# sfepy.discrete.integrals module

Classes for accessing quadrature points and weights for various reference element geometries.

class sfepy.discrete.integrals.Integral(name, order=1, coors=None, weights=None, bounds=None, tp_fix=1.0, weight_fix=1.0, symmetric=False, full_order=False)

  Wrapper class around quadratures.

  get_qp(geometry)

    Get quadrature point coordinates and corresponding weights for given geometry. For built-in quadratures, the integration order is given by self.order.

    Parameters:
      geometry str

        The geometry key describing the integration domain, see the keys of sfepy.discrete.quadratures.quadrature_tables.

    Returns:
      coors array

        The coordinates of quadrature points.

      weights: array

        The quadrature weights.

  integrate(function, order=1, geometry='1_2')

    Integrate numerically a given scalar function.

    Parameters:
      function callable(coors)

        The function of space coordinates to integrate.

      order int, optional

        The integration order. For tensor product geometries, this is the 1D (line) order.

      geometry str

        The geometry key describing the integration domain. Default is ‘1_2’, i.e. a line integral in [0, 1]. For other values see the keys of sfepy.discrete.quadratures.quadrature_tables.

    Returns:
      val float

        The value of the integral.

class sfepy.discrete.integrals.Integrals(objs=None, **kwargs)

  Container for instances of `Integral`.

  static from_conf(conf)
  get(name)

    Return existing or new integral.

    Parameters:
      name str

        The name can either be a non-negative integer, a string representation of a non-negative integer (the integral order) or ‘a’ (automatic order) or a string beginning with ‘i’ (existing custom integral name).