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

salvus.mesh.layered_meshing.meshing_protocol.meshing_protocol

Parameters governing mesh creation.

Classes

MeshingProtocol

class MeshingProtocol(builtins.object):
    def __init__(
        self,
        lm: LayeredModel | Material,
        ab: AbsorbingBoundaryParameters | None = None,
        interlayer_coarsening_policy: (
            InterlayerCoarseningPolicy
            | list[InterlayerCoarseningPolicy]
            | None
        ) = None,
        intralayer_coarsening_policy: (
            IntralayerCoarseningPolicy
            | list[IntralayerCoarseningPolicy]
            | None
        ) = None,
        local_refinement_policy: (
            LocalRefinementPolicy
            | typing.Sequence[LocalRefinementPolicy]
            | None
        ) = None,
        oracle_filter: (
            filters.OracleFilter | list[filters.OracleFilter]
        ) = salvus.mesh.layered_meshing.layered_model.filters.no_filter,
        _force_linear_shapes: bool = False,
        _interior_deformation_order: int | None = None,
        _is_smoothiesem: bool = False,
    ) -> None: ...

A collection of a Layered Model and one or more inter- / intra-layer coarsening policies.

Create a new MeshingProtocol.

Parameters
  • lm LayeredModel | Material — The layered model to mesh. If a material is passed independently of a LayeredModel, it will be automatically converted into a LayeredModel with one layer.
  • ab AbsorbingBoundaryParameters | None — Absorbing boundary parameters that may be used to extend the mesh to accommodate damping layers.
  • interlayer_coarsening_policy InterlayerCoarseningPolicy | list[InterlayerCoarseningPolicy] | None — A single Interlayer Coarsening Policy, a list of Interlayer Coarsening Policies, or None. If single: the policy will be duplicated between each layer. If a list, the policies will be applied in top-down order between each layer. If the number of policies is less than the number of internal interfaces, the last policy will be extended to the bottom of the mesh.
  • intralayer_coarsening_policy IntralayerCoarseningPolicy | list[IntralayerCoarseningPolicy] | None — A single Intralayer Coarsening Policy, a list of Intralayer Coarsening Policies, or None. If single: the policy will be duplicated for each layer. If a list, the policies will be applied in a top-down order to each layer. If the number of policies is less than the number of layers, the last policy will be extended to the bottom of the mesh.
  • local_refinement_policy LocalRefinementPolicy | typing.Sequence[LocalRefinementPolicy] | None — A single Local Refinement Policy, a list of Local Refinement Policies, a list of tuples of Local Refinement Policies, or the default of no_refinements. Each policy is simply a wrapper around any callable which takes an unstructured mesh and returns a list of element ids around which refinement should take place. The availability of different options for passing this parameter encompasses the following use cases: single policy: Simply a convenient way to specify one policy for the entire mesh, without needing to proactively wrap the policy in a list. list of policies: Multiple policies which will be applied one after the other, with a refinement stage happing between. If the elements found by subsequent policies overlap with those in previous policies, the overlapping area will therefore be refined multiple times. list of tuples of policies: The element ids found by each policy will be reduced over before the refinement stage is applied. This is useful if you are marking several potentially overlapping features for refinement, but only want one stage of refinement to occur. Subsequent refinement policies in the outer list will be applied as described in “list of policies”.
  • oracle_filter filters.OracleFilter | list[filters.OracleFilter] — A single Oracle Filter, or a list of Oracle filters. If single: the filter will be duplicated for each layer. If a list: the list must of of length n_layers. Defaults to no_filter.
  • _force_linear_shapes bool — If True, the mesh will be forced to use linear shapes, even for higher model orders. This is only useful for optimization purposes. This is not a stable feature and it might be removed at any point in the future.
  • _interior_deformation_order int | None — The polynomial order used to interpolate boundary deformations from a mesh’s side sets to its interior nodes. If the default (None) is passed the shape order of the mesh will be chosen for 2-D meshes, while 1 will be chosen for 3-D meshes. This is sufficient for most cases. If the resulting mesh has geometric issues (like invalid Jacobians), increasing this value to match the mesh’s model order may help create a valid mesh with smoother internal deformations.
  • _is_smoothiesem bool — Advanced configuration flag signalling that the mesh should be created using the “smoothiesem” strategy for spherical meshes.
Methods
from_value()
def from_value(
    value: Material | LayeredModel | MeshingProtocol,
) -> MeshingProtocol: ...

Create a MeshingProtocol from a value which may be a Material, a LayeredModel, or a MeshingProtocol.

Parameters
  • value Material | LayeredModel | MeshingProtocol — The value to create the MeshingProtocol from.
Returns MeshingProtocol — A meshing protocol created from value. If value is already a MeshingProtocol, it is returned unchanged. If value is a LayeredModel, a MeshingProtocol with default settings is returned with value as its layered model. If value is a Material, a MeshingProtocol with default settings is returned with a layered model containing a single layer made of value.
replace_layered_model()
def replace_layered_model(self, new_lm: LayeredModel) -> MeshingProtocol: ...

Create a new MeshingProtocol with the same configuration as this one but with a different layered model.

Parameters
  • new_lm LayeredModel — The layered model to use in the new MeshingProtocol.
Returns MeshingProtocol — A new MeshingProtocol with the same configuration as this one but with new_lm as its layered model.