Inner Product Mass Matrix#
At the core of any FEM solver is the inner product of the trial solution with the weight functions. The inner product is available for “raw” functions as well as for \(k\)-forms, with both having the option to either compute it by evaluating a callable or instead returning a mass matrix that is the result of factoring the values of degrees of freedom from the definition of these functions.
Functions Related#
- fdg.projection_l2_dual(func: ~fdg.integration.Integrable, function_space: ~fdg._fdg.FunctionSpace, integration: ~fdg._fdg.IntegrationSpace | ~fdg._fdg.SpaceMap, /, mapped_input: bool = True, *, integration_registry: ~fdg._fdg.IntegrationRegistry = <fdg._fdg.IntegrationRegistry>, basis_registry: ~fdg._fdg.BasisRegistry = <fdg._fdg.BasisRegistry object>) → DegreesOfFreedom[source]#
Compute the dual L2 projection of the function on the function space.
- Parameters:
func (Integratable) – Function to project. It has to be possible to integrate it.
function_space (FunctionSpace) – Function space on which to project the function.
integration (IntegrationSpace or SpaceMap) – Specification of the integration domain.
mapped_input (bool, default: True) – Function takes coordinates in the physical domain instead of reference domain. When
False, the reference domain coordinates are used instead.integration_registry (IntegrationRegistry, default: DEFAULT_INTEGRATION_REGISTRY) – The registry to use for obtaining the integrator.
basis_registry (BasisRegistry, default: DEFAULT_BASIS_REGISTRY) – The registry to use for obtaining the basis values.
- Returns:
Dual degrees of freedom of the projection.
- Return type:
- fdg.compute_mass_matrix(space_in: FunctionSpace, space_out: FunctionSpace, integration: IntegrationSpace | SpaceMap, /, *, integration_registry: IntegrationRegistry = DEFAULT_INTEGRATION_REGISTRY, basis_registry: BasisRegistry = DEFAULT_BASIS_REGISTRY) → numpy.typing.NDArray[numpy.double]#
Compute the mass matrix between two function spaces.
- Parameters:
space_in (FunctionSpace) – Function space for the input functions.
space_out (FunctionSpace) – Function space for the output functions.
integration (IntegrationSpace or SpaceMap) – Integration space used to compute the mass matrix or a space mapping. If the integration space is provided, the integration is done on the reference domain. If the mapping is defined instead, the integration space of the mapping is used, along with the integration being done on the mapped domain instead.
integration_registry (IntegrationRegistry, default: DEFAULT_INTEGRATION_REGISTRY) – Registry used to retrieve the integration rules.
basis_registry (BasisRegistry, default: DEFAULT_BASIS_REGISTRY) – Registry used to retrieve the basis specifications.
- Returns:
Mass matrix as a 2D array, which maps the primal degress of freedom of the input function space to dual degrees of freedom of the output function space.
- Return type:
array
\(k\)-forms Related#
- fdg.projection_kform_l2_dual(funcs: ~collections.abc.Sequence[~fdg.integration.Integrable], specs: ~fdg._fdg.KFormSpecs, integration: ~fdg._fdg.IntegrationSpace | ~fdg._fdg.SpaceMap, /, mapped_input: bool = True, *, integration_registry: ~fdg._fdg.IntegrationRegistry = <fdg._fdg.IntegrationRegistry>, basis_registry: ~fdg._fdg.BasisRegistry = <fdg._fdg.BasisRegistry object>) → tuple[ndarray[tuple[Any, ...], dtype[float64]], ...][source]#
Compute the dual L2 projection of the \(k\)-form.
- Parameters:
funcs (Sequence of Integratable) – Functions to project. There must be the same number of them as the number of the \(k\)-form components.
specs (KFormSpecs) – Specifications of the \(k\)-form to project.
integration (IntegrationSpace or SpaceMap) – Specification of the integration domain.
mapped_input (bool, default: True) – Function takes coordinates in the physical domain instead of reference domain. When
False, the reference domain coordinates are used instead.integration_registry (IntegrationRegistry, default: DEFAULT_INTEGRATION_REGISTRY) – The registry to use for obtaining the integrator.
basis_registry (BasisRegistry, default: DEFAULT_BASIS_REGISTRY) – The registry to use for obtaining the basis values.
- Returns:
Dual degrees of freedom of the projection for each of the components.
- Return type:
tuple of array
- fdg.compute_kform_mass_matrix(smap: SpaceMap, order: int, left_bases: FunctionSpace, right_bases: FunctionSpace, *, int_registry: IntegrationRegistry, basis_registry: BasisRegistry) → numpy.typing.NDArray[numpy.double]#
Compute the k-form mass matrix.
- Parameters:
smap (SpaceMap) – Mapping of the space in which this is to be computed.
order (int) – Order of the k-form for which this is to be done.
left_bases (FunctionSpace) – Function space of 0-forms used as test forms.
right_bases (FunctionSpace) – Function space of 0-forms used as trial forms.
basis_registry (BasisRegistry) – Registry to get the basis from.
int_registry (IntegrationRegistry) – Registry to get the integration rules from.
- Returns:
Mass matrix for inner product of two k-forms.
- Return type:
array