Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.data_structures.salvus_mesh.algorithms.interpolation

Interpolate a layered model onto a mesh.

Functions

interpolate_model()

def interpolate_model(
    mesh: Mesh,
    layered_model: LayeredModel,
    mesh_resolution: MeshResolution,
    interpolate_materials: bool = True,
    interpolate_interfaces: bool = False,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> Mesh: ...

Interpolate a layered model onto a mesh.

This layered model passed here must have the same number of layers as blocks defined in the mesh (via the “block” elemental variable) and it is assumed that the order of the layers is the same as the order of the blocks. Additionally, the mesh must have the proper side sets defined for interpolate_interfaces to function correctly: that is it must contain the top and bottom side set (e.g. “y0”, “y1” in Cartesian 2-D domains) as well as any internal side sets (“i0”, “i1”, … ,“in-1”) where n is the number of layers. Not satisfying these preconditions may currently result in undefined behavior.

Parameters
  • mesh Mesh — The mesh to interpolate onto.
  • layered_model LayeredModel — The layered model to interpolate from.
  • mesh_resolution MeshResolution — The mesh resolution.
  • interpolate_materials bool — Interpolate material properties.
  • interpolate_interfaces bool — Interpolate interfaces. Only relevant for meshes with a model order > 1.
  • execution_policy bindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
Returns Mesh — The mesh with the model interpolated onto it.