salvus.mesh.layered_meshing.layered_model.layer
A single layer.
Classes
Layer
Layerclass Layer(salvus.utils.dataclass_utils.MappableDataclass):
def __init__(
self,
bot: salvus.mesh.layered_meshing.interface.Interface,
mod: salvus.material.base_materials.Material,
top: salvus.mesh.layered_meshing.interface.Interface,
linear_solids: Optional[
salvus.project.configuration.model.LinearSolids,
Literal["skip_validation_linear_solids"],
] = None,
) -> None: ...A layer consists of a model bounded by two interface.
Parameters
botsalvus.mesh.layered_meshing.interface.Interface — The bottom layer (smaller vertical coordinate).modsalvus.material.base_materials.Material — The bounded model.topsalvus.mesh.layered_meshing.interface.Interface — The top layer (larger vertical coordinate).linear_solidsOptional[salvus.project.configuration.model.LinearSolids, Literal['skip_validation_linear_solids']] — Any linear solids associated with the layer.
Attributes
bot_realized Union[salvus.mesh.layered_meshing.interface.curve.Curve, salvus.mesh.layered_meshing.interface.surface.Surface]
bot_realized Union[salvus.mesh.layered_meshing.interface.curve.Curve, salvus.mesh.layered_meshing.interface.surface.Surface]Return the bottom interface as a curve or a surface.
bounds LayerBounds
bounds LayerBoundsGet this layer’s bounding interfaces.
interfaces Tuple[salvus.mesh.layered_meshing.interface.Interface, salvus.mesh.layered_meshing.interface.Interface]
interfaces Tuple[salvus.mesh.layered_meshing.interface.Interface, salvus.mesh.layered_meshing.interface.Interface]Get a tuple of the (bottom, top) interface.
model salvus.material.base_materials.Material
model salvus.material.base_materials.MaterialGet the model.
strata List[Union[salvus.mesh.layered_meshing.interface.Interface, salvus.material.base_materials.Material]]
strata List[Union[salvus.mesh.layered_meshing.interface.Interface, salvus.material.base_materials.Material]]Get this layer’s ordered strata.
top_realized Union[salvus.mesh.layered_meshing.interface.curve.Curve, salvus.mesh.layered_meshing.interface.surface.Surface]
top_realized Union[salvus.mesh.layered_meshing.interface.curve.Curve, salvus.mesh.layered_meshing.interface.surface.Surface]Return the top interface as a curve or a surface.
v_ref Tuple[float, float]
v_ref Tuple[float, float]Get the reference elevations of the (bottom, top) layers.
LayerBounds
LayerBoundsclass LayerBounds(builtins.object):
def __init__(
self,
top: salvus.mesh.layered_meshing.interface.Interface,
bot: salvus.mesh.layered_meshing.interface.Interface,
) -> None: ...The bounding interfaces of a layer.
Parameters
topsalvus.mesh.layered_meshing.interface.Interface — The top interface.botsalvus.mesh.layered_meshing.interface.Interface — The bottom interface.
Methods
from_coords()
from_coords()def from_coords(
top: Union[
float,
salvus.mesh.layered_meshing.interface.Height,
salvus.mesh.layered_meshing.interface.Depth,
],
bot: Union[
float,
salvus.mesh.layered_meshing.interface.Height,
salvus.mesh.layered_meshing.interface.Depth,
],
) -> LayerBounds: ...Construct the layer bounds from coordinate values.
Removes the burden of wrapping the input coordinates with
Hyperplanes.
Parameters
topUnion[float, salvus.mesh.layered_meshing.interface.Height, salvus.mesh.layered_meshing.interface.Depth] — The top interface.botUnion[float, salvus.mesh.layered_meshing.interface.Height, salvus.mesh.layered_meshing.interface.Depth] — The bottom interface.
Returns LayerBounds — A set of layer bounds consisting of two hyperplanes.
interp_like()
interp_like()def interp_like(self, like: xarray.core.dataarray.DataArray) -> Self: ...Interpolate bounding interfaces onto another DataArray’s coordinates.
Will call the interface’s extend method to ensure that it spans the
coordinates spanned by other with the desired expansion behavior.
Parameters
likexarray.core.dataarray.DataArray — TheDataArrayon which to interpolate this interface.
Returns Self — A new interpolated interface.
replace_bounds()
replace_bounds()def replace_bounds(
self,
top: Optional[salvus.mesh.layered_meshing.interface.Interface] = None,
bot: Optional[salvus.mesh.layered_meshing.interface.Interface] = None,
) -> Self: ...Replace one or both bounds.
Parameters
topOptional[salvus.mesh.layered_meshing.interface.Interface] — The new top bound, orNoneif the current bound is to be kept.botOptional[salvus.mesh.layered_meshing.interface.Interface] — The new bottom bound, orNoneif the current bound is to be kept.
Returns Self — An instance of
LayerBounds with the specified bounds replaced.