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()
compute_spatial_gradients()def compute_spatial_gradients(
mesh: UnstructuredMesh,
fields: typing.Optional[typing.Union[str, typing.List[str]]] = None,
) -> None: ...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.
Parameters
meshUnstructuredMesh — Mesh object for which model gradients are to be computed.fieldstyping.Optional[typing.Union[str, typing.List[str]]] — Optional list of fields for which model gradients should be computed. Defaults to all fields contained in the mesh.
Returns None