Version:

salvus.mesh.layered_meshing.utils.flood

salvus.mesh.layered_meshing.utils.flood salvus mesh layered_meshing utils flood
Functions relating to flooding layers.

Functions

flood()

Flood a layer.
Flooding in this context refers to first splitting the representation of a material's parameters at a user-defined vertical coordinate. On either side of this coordinate value the parameter is then populated by:
1. The parameter's values as evaluated at the vertical coordinate, or
2. The parameter's original values, unchanged.
For instance, given parameter values of [1.0, 1.5, 2.0] which correspond to vertical locations of [0.0, 0.5, 1.0] respectively, flooding "upwards" from a vertical coordinate of 0.5 would result in the model [1.0, 1.5, 1.5], while flooding "downwards" would result in the model [1.5, 1.5, 2.0].
All parameter types can be flooding. More specifically:

Constant Parameters

The flooding of constant parameters is trivial, as they have no vertical coordinate to slice. As such, they are simply returned as-is.
The input parameter can contain absolute or relative coordinates. If a vertical coordinate is present in the parameter's representation, the parameter will be returned with all values on one side of flood_from coming from the input model, with all parameters on the other side set to the value of the parameter evaluated along the flooding plane. If no vertical coordinate is present, the parameter will be returned as it was passed in.
Important to note is that this function does not (currently) add the flooding plane coordinate / value to the returned parameter. This additional functionality is planned when considering parameters using absolute vertical coordinates, or those using relative coordinates between two flat interfaces. Considering the case involving deformed bounding interfaces and relative coordinates requires the presence of two separate relative coordinate systems, and as such requires a full split of the relevant layer.
The input parameter must contain absolute coordinates. If a vertical coordinate is present in the parameter's representation, a new analytic parameter which is flooded via the use of a sympy.Piecewise(...) representation will be returned. If no vertical coordinate is present, the analytic parameter will be returned as it was passed in.
SIGNATURE
def flood(
    layer: lm.layered_model.Layer,
    flood_from: float | lm.interface.Depth | lm.interface.Height,
    flood_direction: typing.Literal["up", "down"],
    new_layer_bounds: lm.layered_model.LayerBounds | None = None,
) -> lm.layered_model.Layer: ...
ARGUMENTS
Required
layer
Type:lm.layered_model.Layer
Description:
The layer to flood.
Required
flood_from
Type:float | lm.interface.Depth | lm.interface.Height
Description:
The vertical coordinate from which to flood the layer's parameters.
Required
flood_direction
Type:typing.Literal['up', 'down']
Description:
The direction with which to flood, can be "up" or "down".
Optional
new_layer_bounds
Type:lm.layered_model.LayerBounds | None
Default value:None
Description:
The bounds of the layer post-flooding. Can be different than the layer's current bounds. If None, will default to the layer's current bounds.
RETURNS
Return type: lm.layered_model.Layer
A new layer with flooded parameters with bounds adjusted to new_layer_bounds.
PAGE CONTENTS