Version:

salvus.mesh.layered_meshing.layered_model.detail

salvus.mesh.layered_meshing.layered_model.detail salvus mesh layered_meshing layered_model detail
Implementation details for layered models.

Functions

b_partition()

Convenience function binding partition to a given domain.
Convenient when you want to apply different partitioning predicates to a model on the same domain.
SIGNATURE
def b_partition(d: domain.Domain) -> functools.partial: ...
ARGUMENTS
Required
d
Type:domain.Domain
Description:
The domain to bind to.
RETURNS
Return type: functools.partial
partition with the first argument domain filled in.

da_max()

Return the max of a DataArray added to its "reference_elevation" attr.
SIGNATURE
def da_max(da: xr.DataArray) -> float: ...
ARGUMENTS
Required
da
Type:xr.DataArray
Description:
The DataArray.
RETURNS
Return type: float
float: The maximum value.

da_min()

Return the min of a DataArray added to its "reference_elevation" attr.
SIGNATURE
def da_min(da: xr.DataArray) -> float: ...
ARGUMENTS
Required
da
Type:xr.DataArray
Description:
The DataArray.
RETURNS
Return type: float
float: The minimum value.

delete_duplicate_interfaces()

Delete neighboring duplicate interfaces.
Useful when concatenating models without fussing too much about how to slice layers.
SIGNATURE
def delete_duplicate_interfaces(strata: list) -> list: ...
ARGUMENTS
Required
strata
Type:list
Description:
The strata to inspect.
RETURNS
Return type: list
The strata with any duplicate interfaces removed.

partition()

Partition a LayeredModel into more layers.
TODO: More documentation incoming.
SIGNATURE
def partition(
    d: domain.Domain,
    lm: LayeredModel | Layer,
    model_predicate: (
        ModelPredicate | tuple[ModelPredicate, interface.Interface]
    ),
    mode: str = "continuous",
    interface_modifier: InterfaceFunctor = salvus.utils.utils.identity,
) -> LayeredModel: ...
ARGUMENTS
Required
d
Type:domain.Domain
Description:
The domain.
Required
lm
Type:LayeredModel | Layer
Description:
The layered model to partition.
Required
model_predicate
Type:ModelPredicate | tuple[ModelPredicate, interface.Interface]
Description:
Function which transforms a layered model into a set of discrete integers. Each "region" identified by a unique integer will be considered a new layer as long as it is contiguous across the model. Can also be a tuple, with (predicate, interface) as the two tuple entries. In this case, instead of a model-dependent interface being added, the passed interface itself will be used.
Optional
mode
Type:str
Default value:'continuous'
Description:
"continuous" for logical partitions (such as those used to find doubling regions) or "discontinuous" for true partitions meant to respect model discontinuities. If the former case, partitions will be located at the input grid point with the largest predicate value, while in the latter partitions will be placed halfway between two grid points.
Optional
interface_modifier
Type:InterfaceFunctor
Default value:salvus.utils.utils.identity
Description:
A function that can re-discretize a derived partition interface. Useful, for instance, to avoid stair-stepping artifacts when partitioning models with nonuniform discontinuities on a regular grid.
RETURNS
Return type: LayeredModel
LayeredModel: A partitioned layered model.

Used in tutorials

Functionality from this module is used in the following tutorials.
PAGE CONTENTS