fem.vector#

Classes#

Inheritance diagram of psydac.fem.vector

MultipatchFemSpace(*spaces[, connectivity])

Product of single-patch FEM spaces.

VectorFemSpace(*spaces)

FEM space with a vector basis defined on a single patch.

Details#

class VectorFemSpace(*spaces)[source]#

Bases: FemSpace

FEM space with a vector basis defined on a single patch. This class is used to represent either spaces of vector-valued FEM fields, or product spaces involved in systems of equations.

Parameters:
*spacesFemSpace

Single-patch FEM spaces, either scalar or vector-valued.

property ldim#

Parametric dimension.

property periodic#

Tuple of booleans: along each logical dimension, say if domain is periodic. :rtype: tuple[bool]

property mapping#

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

property coeff_space#

Vector space of the coefficients (mapping invariant). :rtype: psydac.linalg.block.BlockVectorSpace

property symbolic_space#

Symbolic space.

property patch_spaces#

Return the patch spaces (self if single-patch) as a tuple.

property component_spaces#

Return the component spaces (self if scalar-valued) as a tuple.

property axis_spaces#

Return the axis spaces (self if univariate) as a tuple.

property is_multipatch#

Boolean flag that describes whether the space is a multi-patch space. :rtype: bool

property is_vector_valued#

Boolean flag that describes whether the space is vector-valued. :rtype: bool

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.

eval_fields(grid, *fields, weights=None, npts_per_cell=None, overlap=0)[source]#

Evaluates one or several fields on the given location(s) grid.

Parameters:
gridList of ndarray

Grid on which to evaluate the fields. Each array in this list corresponds to one logical coordinate.

*fieldstuple of psydac.fem.basic.FemField

Fields to evaluate.

weightspsydac.fem.basic.FemField or None, optional

Weights field used to weight the basis functions thus turning them into NURBS. The same weights field is used for all of fields and they thus have to use the same basis functions.

npts_per_cell: int, tuple of int or None, optional

Number of evaluation points in each cell. If an integer is given, then assume that it is the same in every direction.

overlapint

How much to overlap. Only used in the distributed context.

Returns:
List of list of ndarray

List of the same length as fields, containing for each field a list of self.ldim arrays, i.e. one array for each logical coordinate.

See also

psydac.fem.tensor.TensorFemSpace.eval_fields

More information about the grid parameter.

eval_fields_regular_tensor_grid(grid, *fields, weights=None, overlap=0)[source]#

Evaluates one or several fields on a regular tensor grid.

Parameters:
gridList of ndarray

List of 2D arrays representing each direction of the grid. Each of these arrays should have shape (ne_xi, nv_xi) where ne_xi is the number of cells in the domain in the direction xi and nv_xi is the number of evaluation points in the same direction.

*fieldstuple of psydac.fem.basic.FemField

Fields to evaluate.

weightspsydac.fem.basic.FemField or None, optional

Weights field used to weight the basis functions thus turning them into NURBS. The same weights field is used for all of fields and they thus have to use the same basis functions.

overlapint

How much to overlap. Only used in the distributed context.

Returns:
List of list of ndarray

List of the same length as fields, containing for each field a list of self.ldim arrays, i.e. one array for each logical coordinate.

See also

psydac.fem.tensor.TensorFemSpace.eval_fields

More information about the grid parameter.

eval_fields_irregular_tensor_grid(grid, *fields, weights=None, overlap=0)[source]#

Evaluates one or several fields on an irregular tensor grid i.e. a tensor grid where the number of points per cell depends on the cell.

Parameters:
gridList of ndarray

List of 1D arrays representing each direction of the grid.

*fieldstuple of psydac.fem.basic.FemField

Fields to evaluate.

weightspsydac.fem.basic.FemField or None, optional

Weights field used to weight the basis functions thus turning them into NURBS. The same weights field is used for all of fields and they thus have to use the same basis functions.

overlapint

How much to overlap. Only used in the distributed context.

Returns:
List of list of ndarray

List of the same length as fields, containing for each field a list of self.ldim arrays, i.e. one array for each logical coordinate.

See also

psydac.fem.tensor.TensorFemSpace.eval_fields

More information about the grid parameter.

eval_field_gradient(field, *eta)[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.

integral(f)[source]#
property nbasis#
property degree#
property multiplicity#
property pads#
property ncells#
property spaces#
get_refined_space(ncells)[source]#
set_refined_space(ncells, new_space)[source]#
class MultipatchFemSpace(*spaces, connectivity=None)[source]#

Bases: FemSpace

Product of single-patch FEM spaces.

Parameters:
*spacesFemSpace

Single-patch FEM spaces, either scalar or vector-valued.

connectivitydict, optional

Dictionary representing the connectivity between the patches.

property ldim#

Parametric dimension.

property periodic#

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

property mapping#

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

property coeff_space#

Vector space of the coefficients (mapping invariant). :rtype: psydac.linalg.basic.BlockVectorSpace

property symbolic_space#

Symbolic space.

property patch_spaces#

Return the patch spaces (self if single-patch) as a tuple.

property component_spaces#

Return the component spaces (self if scalar-valued) as a tuple.

property axis_spaces#

Return the axis spaces (self if univariate) as a tuple.

property is_multipatch#

Boolean flag that describes whether the space is a multi-patch space. :rtype: bool

property is_vector_valued#

Boolean flag that describes whether the space is vector-valued. :rtype: bool

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.

eval_fields(grid, *fields, weights=None, npts_per_cell=None, overlap=0)[source]#

Evaluates one or several fields on the given location(s) grid.

Parameters:
gridList of ndarray

Grid on which to evaluate the fields. Each array in this list corresponds to one logical coordinate.

*fieldstuple of psydac.fem.basic.FemField

Fields to evaluate.

weightspsydac.fem.basic.FemField or None, optional

Weights field used to weight the basis functions thus turning them into NURBS. The same weights field is used for all of fields and they thus have to use the same basis functions.

npts_per_cell: int, tuple of int or None, optional

Number of evaluation points in each cell. If an integer is given, then assume that it is the same in every direction.

overlapint

How much to overlap. Only used in the distributed context.

Returns:
List of list of ndarray

List of the same length as fields, containing for each field a list of self.ldim arrays, i.e. one array for each logical coordinate.

See also

psydac.fem.tensor.TensorFemSpace.eval_fields

More information about the grid parameter.

eval_fields_regular_tensor_grid(grid, *fields, weights=None, overlap=0)[source]#

Evaluates one or several fields on a regular tensor grid.

Parameters:
gridList of ndarray

List of 2D arrays representing each direction of the grid. Each of these arrays should have shape (ne_xi, nv_xi) where ne_xi is the number of cells in the domain in the direction xi and nv_xi is the number of evaluation points in the same direction.

*fieldstuple of psydac.fem.basic.FemField

Fields to evaluate.

weightspsydac.fem.basic.FemField or None, optional

Weights field used to weight the basis functions thus turning them into NURBS. The same weights field is used for all of fields and they thus have to use the same basis functions.

overlapint

How much to overlap. Only used in the distributed context.

Returns:
List of list of ndarray

List of the same length as fields, containing for each field a list of self.ldim arrays, i.e. one array for each logical coordinate.

See also

psydac.fem.tensor.TensorFemSpace.eval_fields

More information about the grid parameter.

eval_fields_irregular_tensor_grid(grid, *fields, weights=None, overlap=0)[source]#

Evaluates one or several fields on an irregular tensor grid i.e. a tensor grid where the number of points per cell depends on the cell.

Parameters:
gridList of ndarray

List of 1D arrays representing each direction of the grid.

*fieldstuple of psydac.fem.basic.FemField

Fields to evaluate.

weightspsydac.fem.basic.FemField or None, optional

Weights field used to weight the basis functions thus turning them into NURBS. The same weights field is used for all of fields and they thus have to use the same basis functions.

overlapint

How much to overlap. Only used in the distributed context.

Returns:
List of list of ndarray

List of the same length as fields, containing for each field a list of self.ldim arrays, i.e. one array for each logical coordinate.

See also

psydac.fem.tensor.TensorFemSpace.eval_fields

More information about the grid parameter.

eval_field_gradient(field, *eta)[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.

integral(f)[source]#
property nbasis#
property degree#
property multiplicity#
property pads#
property ncells#
property spaces#
property n_components#
property comm#