fem.basic#

In order to avoid multiple inheritence, we define the base objects for Finite Elements as abstract classes that contain a topological member. This member can be used to specify the used data structure for example.

Classes#

Inheritance diagram of psydac.fem.basic

FemField(space[, coeffs])

Element of a finite element space V.

FemSpace()

Generic Finite Element space V.

Details#

In order to avoid multiple inheritence, we define the base objects for Finite Elements as abstract classes that contain a topological member. This member can be used to specify the used data structure for example.

class FemSpace[source]#

Bases: object

Generic Finite Element space V.

A unique basis is associated to a FemSpace, i.e. FemSpace = Span( basis )

abstract property ldim#

Number of dimensions in logical space, i.e. number of scalar logical coordinates.

abstract property periodic#

Tuple of booleans: along each logical dimension, say if domain is periodic.

abstract property mapping#

Mapping from logical coordinates ‘eta’ to physical coordinates ‘x’. If None, we assume identity mapping (hence x=eta).

abstract property vector_space#

Topologically associated vector space.

abstract property is_product#

Boolean flag that describes whether the space is a product space. If True, an element of this space can be decomposed into separate fields.

abstract property symbolic_space#

Symbolic space.

abstract eval_field(field, *eta, weights=None)[source]#

Evaluate field at location(s) eta.

Parameters:
fieldFemField

Field object (element of FemSpace) to be evaluated.

etalist of float or numpy.ndarray

Evaluation point(s) in logical domain.

weightsStencilVector, optional

Weights of the basis functions, such that weights.space == field.coeffs.space.

Returns:
valuefloat or numpy.ndarray

Field value(s) at location(s) eta.

abstract eval_field_gradient(field, *eta, weights=None)[source]#

Evaluate field gradient at location(s) eta.

Parameters:
fieldFemField

Field object (element of FemSpace) to be evaluated.

etalist of float or numpy.ndarray

Evaluation point(s) in logical domain.

weightsStencilVector, optional

Weights of the basis functions, such that weights.space == field.coeffs.space.

Returns:
valuefloat or numpy.ndarray

Value(s) of field gradient at location(s) eta.

class FemField(space, coeffs=None)[source]#

Bases: object

Element of a finite element space V.

Parameters:
spacepsydac.fem.basic.FemSpace

Finite element space to which this field belongs.

coeffspsydac.linalg.basic.Vector (optional)

Vector of coefficients in finite element basis (by default assume zero vector).

property space#

Finite element space to which this field belongs.

property coeffs#

Coefficients that uniquely identify this field as a linear combination of the elements of the basis of a Finite element space.

Coefficients are stored into one element of the vector space in ‘self.space.vector_space’, which is topologically associated to the finite element space.

property fields#
gradient(*eta, weights=None)[source]#

Evaluate gradient of weighted field at location identified by logical coordinates eta.

divergence(*eta, weights=None)[source]#

Evaluate divergence of weighted vector field at location identified by logical coordinates eta.

copy()[source]#