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.mesh.layered_meshing.material._material.Material,
top: salvus.mesh.layered_meshing.interface.Interface,
linear_solids: Optional[
salvus.project.configuration.model.LinearSolids
] = 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.mesh.layered_meshing.material._material.Material — The bounded model.topsalvus.mesh.layered_meshing.interface.Interface — The top layer (larger vertical coordinate).linear_solidsOptional[salvus.project.configuration.model.LinearSolids] — 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.mesh.layered_meshing.material._material.Material
model salvus.mesh.layered_meshing.material._material.MaterialGet the model.
strata List[Union[salvus.mesh.layered_meshing.interface.Interface, salvus.mesh.layered_meshing.material._material.Material]]
strata List[Union[salvus.mesh.layered_meshing.interface.Interface, salvus.mesh.layered_meshing.material._material.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
) -> typing_extensions.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 typing_extensions.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,
) -> typing_extensions.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 typing_extensions.Self — An instance of
LayerBounds with the specified bounds replaced.