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

salvus.mesh.layered_meshing.detail.detail

Utils for layered meshing.

Functions

compute_hmax()

def compute_hmax(
    n_dim: int,
    min_wavelengths: List[
        salvus.mesh.layered_meshing.material.parameter._RealizedParameter
    ],
    elements_per_wavelength: Tuple[float, ...],
) -> List[Tuple[float, ...]]:
    ...

Compute the maximum allowable edge length for each dimension in each layer.

Parameters
  • n_dim int — The dimension of the mesh.
  • min_wavelengths List[salvus.mesh.layered_meshing.material.parameter._RealizedParameter] — A list of minimum wavelengths in each layer, each expressed as a _RealizedParameter. These values can be obtained by reducing each layer’s material to its wavelength oracle.
  • elements_per_wavelength Tuple[float, ...] — The desired number of elements per wavelength in each dimension.
Returns List[Tuple[float, ...]] — A list of tuples containing the maximum edge lengths for each dimension in each layer.

compute_minimum_wavelengths()

def compute_minimum_wavelengths(
    n_dim: int,
    layered_model: salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel,
    mesh_resolution: salvus.project.components.types.MeshResolution,
    oracle_filter: Optional[
        List[
            salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.OracleFilter
        ]
    ] = None,
) -> List[salvus.mesh.layered_meshing.material.parameter._RealizedParameter]:
    ...

Compute the maximum element sizes.

Parameters
  • n_dim int — The number of dimensions.
  • layered_model salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel — The layered model.
  • mesh_resolution salvus.project.components.types.MeshResolution — The mesh resolution.
  • oracle_filter Optional[List[salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.OracleFilter]] — A function which can filter the wavelength oracle to restrict the minimum wavelength computation.
Returns List[salvus.mesh.layered_meshing.material.parameter._RealizedParameter] — A list of the minimum wavelengths in each layer wrapped in the appropriate parameter type.

deform_mesh_block()

def deform_mesh_block(
    d: salvus.project.domain.DomainBounds,
    mb: salvus.mesh.mesh_block.mesh_block.MeshBlock,
    bot: salvus.mesh.layered_meshing.interface.Interface,
    top: salvus.mesh.layered_meshing.interface.Interface,
    cs: salvus.project.components.types.CoordinateSystem,
) -> salvus.mesh.mesh_block.mesh_block.MeshBlock:
    ...

Deform a mesh block to respect two interfaces.

Parameters
  • d salvus.project.domain.DomainBounds — The bounds of the domain.
  • mb salvus.mesh.mesh_block.mesh_block.MeshBlock — The mesh block to deform.
  • bot salvus.mesh.layered_meshing.interface.Interface — The bottom interface.
  • top salvus.mesh.layered_meshing.interface.Interface — The top interface.
  • cs salvus.project.components.types.CoordinateSystem — The coordinate system of the mesh block.
Returns salvus.mesh.mesh_block.mesh_block.MeshBlock — A (potentially) deformed mesh block.

expand_elements_per_wavelength()

def expand_elements_per_wavelength(
    elements_per_wavelength: Tuple[float, ...], n_dim: int
) -> Tuple[float, ...]:
    ...

Expand the elements per wavelength so there is one value per dimension.

Parameters
  • elements_per_wavelength Tuple[float, ...] — The elements per wavelength.
  • n_dim int — The number of dimensions.
Returns Tuple[float, ...] — A tuple with a value of elements per wavelength per dimension.