salvus.mesh.layered_meshing.detail.detail
Utils for layered meshing.
Functions
compute_hmax()
compute_hmax()def compute_hmax(
min_wavelengths: list[_pd.RealizedParameter],
elements_per_wavelength: list[tuple[float_, ...]],
) -> list[tuple[float, ...]]: ...Compute the maximum allowable edge length for each dimension in each layer.
Parameters
min_wavelengthslist[_pd.RealizedParameter] — A list of minimum wavelengths in each layer, each expressed as aRealizedParameter. These values can be obtained by reducing each layer’s material to its wavelength oracle.elements_per_wavelengthlist[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()
compute_minimum_wavelengths()def compute_minimum_wavelengths(
layered_model: _layered_model.LayeredModel,
reference_frequency: float_,
oracle_filter: typing.Sequence[filters.OracleFilter] | None = None,
) -> list[_pd.RealizedParameter]: ...Compute the maximum element sizes.
Parameters
layered_model_layered_model.LayeredModel — The layered model.reference_frequencyfloat_ — The reference frequency.oracle_filtertyping.Sequence[filters.OracleFilter] | None — A function which can filter the wavelength oracle to restrict the minimum wavelength computation.
Returns list[_pd.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: domain.DomainBounds,
mb: mesh_block.MeshBlock,
bot: interface.Interface,
top: interface.Interface,
cs: CoordinateSystem,
) -> mesh_block.MeshBlock: ...Deform a mesh block to respect two interfaces.
Parameters
ddomain.DomainBounds — The bounds of the domain.mbmesh_block.MeshBlock — The mesh block to deform.botinterface.Interface — The bottom interface.topinterface.Interface — The top interface.csCoordinateSystem — The coordinate system of the mesh block.
Returns 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.