Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.layered_meshing.layered_model.layer

A single layer.

Classes

Layer

class 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
  • bot salvus.mesh.layered_meshing.interface.Interface — The bottom layer (smaller vertical coordinate).
  • mod salvus.mesh.layered_meshing.material._material.Material — The bounded model.
  • top salvus.mesh.layered_meshing.interface.Interface — The top layer (larger vertical coordinate).
  • linear_solids Optional[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]

Return the bottom interface as a curve or a surface.

bounds LayerBounds

Get this layer’s bounding interfaces.

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

Get the model.

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]

Return the top interface as a curve or a surface.

v_ref Tuple[float, float]

Get the reference elevations of the (bottom, top) layers.

LayerBounds

class 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
  • top salvus.mesh.layered_meshing.interface.Interface — The top interface.
  • bot salvus.mesh.layered_meshing.interface.Interface — The bottom interface.
Methods
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
  • top Union[float, salvus.mesh.layered_meshing.interface.Height, salvus.mesh.layered_meshing.interface.Depth] — The top interface.
  • bot Union[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()
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
  • like xarray.core.dataarray.DataArray — The DataArray on which to interpolate this interface.
Returns typing_extensions.Self — A new interpolated interface.
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
  • top Optional[salvus.mesh.layered_meshing.interface.Interface] — The new top bound, or None if the current bound is to be kept.
  • bot Optional[salvus.mesh.layered_meshing.interface.Interface] — The new bottom bound, or None if the current bound is to be kept.
Returns typing_extensions.Self — An instance of LayerBounds with the specified bounds replaced.