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)[source]

Wrapper class around quadratures.

get_qp(geometry)[source]

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

Parameters:
geometrystr

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

Returns:
coorsarray

The coordinates of quadrature points.

weights: array

The quadrature weights.

integrate(function, order=1, geometry='1_2')[source]

Integrate numerically a given scalar function.

Parameters:
functioncallable(coors)

The function of space coordinates to integrate.

orderint, optional

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

geometrystr

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:
valfloat

The value of the integral.

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

Container for instances of Integral.

static from_conf(conf)[source]
get(name)[source]

Return existing or new integral.

Parameters:
namestr

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).