Mondaic

salvus.mesh.data_structures.salvus_mesh.algorithms.interpolation

salvus.mesh.data_structures.salvus_mesh.algorithms.interpolation 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,
    interior_deformation_order: int | None = None,
) -> 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.
  • interior_deformation_order int | None — Polynomial order used for interpolating boundary deformations into the element interior during interface reinterpolation. If None, the backend default is used (the mesh’s own shape order). This function performs a single reinterpolation at the given order; the automatic order-sweep on Jacobian failure is implemented one level up by the distributed mesh construction, not here. See salvus.mesh.utils._aperture_workflow.reinterpolate_interfaces.
Returns Mesh — The mesh with the model interpolated onto it.