Mondaic

salvus.fem.integrals

salvus.fem.integrals salvus fem integrals

Functions to compute volume integrals of mesh fields.

Functions

compute_integral()

def compute_integral(
    nodes: _ElementNodes | npt.NDArray, fields: dict[str, npt.NDArray]
) -> dict[str, float]: ...

Compute the integral of a field over the mesh.

This function computes the volume integrals of the passed fields defined as elemental fields or elemental nodal fields.

Parameters
  • nodes _ElementNodes | npt.NDArray — Element nodes or numpy array of which the field is defined. If a Numpy array is passed, it should be of shape (nelem, n_nodes_per_element, ndim).
  • fields dict[str, npt.NDArray] — The fields which the gradient should be computed, shaped either as (nelem, n_nodes_per_element) or (nelem,).
Returns dict[str, float] — Dictionary containing the volume integrals of the fields with respect to each dimension. Each intergral is a float.