sfepy.fem.integrals module

class sfepy.fem.integrals.Integral(name, kind='v', order=1, coors=None, weights=None)[source]

Wrapper class around quadratures.

get_key()[source]

Get the key string corresponding to the integral kind and order, that can be used to distinguish various cached data evaluated using the integral.

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:

geometry : str

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

Returns:

coors : array

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:

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.fem.quadratures.quadrature_tables.

Returns:

val : float

The value of the integral.

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

Container for instances of Integral.

static from_conf(conf)[source]
get(name, kind='v')[source]

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