salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.detail
Implementation details for coarsening policies.
Functions
construct_interlayer_policies()
construct_interlayer_policies()def construct_interlayer_policies(
layered_model: salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel,
thickness_threshold: float,
n_dim: int,
mesh_resolution: salvus.project.components.types.MeshResolution,
coarsening_policy: salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy = InterlayerDoubling(
n_layers="auto"
),
) -> List[
salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy
]: ...Construct a set of interlayer policies given a layered model.
This function is primarily useful for preventing the introduction of mesh coarsenings where the host layer is too thin.
layered_modelsalvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel — The layered model.thickness_thresholdfloat — The minimum thickness above which coarsening is allowed. Should be expressed as a ratio of the minimum thickness to the maximum edge length.n_dimint — The dimension of the layered model.mesh_resolutionsalvus.project.components.types.MeshResolution — The resolution of the mesh.coarsening_policysalvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy — Which coarsening policy to introduce within layers that are thick enough.
crossing_layer_allowed()
crossing_layer_allowed()def crossing_layer_allowed(
p: salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.IntralayerCoarseningPolicy,
) -> bool: ...Collection of conditions that allow layers to cross.
psalvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.IntralayerCoarseningPolicy — A layer’s coarsening policy.
n_elm_dict()
n_elm_dict()def n_elm_dict(
n_elm: List[int],
cs: salvus.geometry.coordinates.coordinates.CoordinateSystem,
bounds: Dict[str, Tuple[float, float]],
) -> Dict[str, int]: ...A dictionary of element_count_x[y,z] to be passed to a MeshBlock constructor.
Correct argument names will be returned depending on the coordinate system.
n_elmList[int] — List of elements in the x, [y] direction.cssalvus.geometry.coordinates.coordinates.CoordinateSystem — The coordinate system.boundsDict[str, Tuple[float, float]] — The coordinate bounds of the layer.
rotate_cubed_sphere_chunk()
rotate_cubed_sphere_chunk()def rotate_cubed_sphere_chunk(
domain_or_euler_angles: Union[
salvus.project.domain.Domain, Tuple[float, float, float]
],
mb: salvus.mesh.data_structures.mesh_block.mesh_block.MeshBlock,
) -> salvus.mesh.data_structures.mesh_block.mesh_block.MeshBlock: ...Rotate the cubed sphere to center it within a SphericalChunkDomain.
If the domain is not a SphericalChunkDomain, simply return the mesh
blocks as they were passed in.
domain_or_euler_anglesUnion[salvus.project.domain.Domain, Tuple[float, float, float]] — The domain of the cubed sphere, or a set of explicit euler angles to rotate by. If euler angles, they should be in degrees and describe an extrinsic rotation around the z->y->z axes, respectively.mbsalvus.mesh.data_structures.mesh_block.mesh_block.MeshBlock — The mesh block.
solve_interlayer_coarsening()
solve_interlayer_coarsening()def solve_interlayer_coarsening(
nh: List[Tuple[int, ...]],
policies: Optional[
List[
salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy
]
] = None,
layer_modulo_constraint: int = 1,
bottom_layer_modulo_constraint: int = 1,
) -> List[List[int]]: ...Compute the number of horizontal elements across successive layers.
Will return a solution that respects the interlayer coarsening policies while minimizing the total number of elements in the mesh.
nhList[Tuple[int, ...]] — The minimum number of elements in each horizontal dimension, for each layer.policiesOptional[List[salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy]] — A list of interlayer coarsening policies. Should either be equal to the number of interfaces, orNone, in which a constant policy will be applied to each interface.layer_modulo_constraintint — Ensure that all layers include elements along each dimension that are multiples of this number.bottom_layer_modulo_constraintint — Ensure that the bottom layer (i.e. the last entry innh) is a multiple of this number.