Version:

salvus.mesh.algorithms.unstructured_mesh.spatial_gradients

salvus.mesh.algorithms.unstructured_mesh.spatial_gradients salvus mesh algorithms unstructured_mesh spatial_gradients
Functions related to the extraction of spatial gradients of fields defined on an unstructured mesh.

Functions

compute_spatial_gradients()

Extract spatial model gradients.
This function takes a mesh object and computes the spatial model gradient of each field contained in the mesh. The function returns the same mesh with additional fields for each component of the gradient.
Model gradients are always computed in Cartesian coordinates. By construction of the Lagrange basis, the gradients are not continuous across elemental boundaries. Hence, the values of the gradient on points shared between elements, depend on which element they are computed in.
SIGNATURE
def compute_spatial_gradients(
    mesh: UnstructuredMesh, fields: str | list[str] | None = None
) -> None: ...
ARGUMENTS
Required
mesh
Type:UnstructuredMesh
Description:
Mesh object for which model gradients are to be computed.
Optional
fields
Type:str | list[str] | None
Default value:None
Description:
Optional list of fields for which model gradients should be computed. Defaults to all fields contained in the mesh.

compute_volume_integrals()

Compute volume integrals of fields over the mesh.
This function computes the volume integrals of the passed fields defined as elemental fields or elemental nodal fields.
SIGNATURE
def compute_volume_integrals(
    mesh: UnstructuredMesh, fields: str | list[str]
) -> dict[str, float]: ...
ARGUMENTS
Required
mesh
Type:UnstructuredMesh
Description:
Mesh object for which volume integrals are to be computed.
Required
fields
Type:str | list[str]
Description:
The fields for which volume integrals should be computed.
RETURNS
Return type: dict[str, float]
Dictionary containing the volume integrals of the fields. Each integral is a float.
PAGE CONTENTS