salvus.mesh.layered_meshing.detail.detail
Utils for layered meshing.
Functions
compute_hmax()
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_dimint — The dimension of the mesh.min_wavelengthsList[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_wavelengthTuple[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()
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_dimint — The number of dimensions.layered_modelsalvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel — The layered model.mesh_resolutionsalvus.project.components.types.MeshResolution — The mesh resolution.oracle_filterOptional[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()
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
dsalvus.project.domain.DomainBounds — The bounds of the domain.mbsalvus.mesh.mesh_block.mesh_block.MeshBlock — The mesh block to deform.botsalvus.mesh.layered_meshing.interface.Interface — The bottom interface.topsalvus.mesh.layered_meshing.interface.Interface — The top interface.cssalvus.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()
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_wavelengthTuple[float, ...] — The elements per wavelength.n_dimint — The number of dimensions.
Returns Tuple[float, ...] — A tuple with a value of elements per wavelength per dimension.