Version:

salvus.project.configuration.model.utils

salvus.project.configuration.model.utils salvus project configuration model utils
Utility functions supporting models and their configuration.

Functions

derive_bm_file()

Create a depth-dependent .bm model from a Cartesian volume model.
It is sometimes useful to extract an appropriate 1-D model, varying in depth, from a general 2- or 3-D volume model, that can then be used as a "size function" for a future mesh generation stage. This function returns such a model as a string in the BM format, which can then be written to disk and used as a background_model in, for instance, a concrete ModelConfiguration. Since the mesh size with depth is determined by the background model, using an appropriate one such as that returned from this function can have the advantage of ensuring that the element sizes properly coarsen with depth, which can lead to more efficient simulations without a loss of accuracy.
This function is conservative in the sense that it find the minimum parameter value in a given vertical layer, and uses this as the 1-D value across the line (2-D) or plane (3-D) of the returned BM model.
More information about 1-D models and the BM format can be found here: https://mondaic.com/docs/tutorials/meshing/1d_models/1D_models/
SIGNATURE
def derive_bm_file(
    vm: _CartesianBase, detect_discontinuities_with: str = "vs"
) -> str: ...
ARGUMENTS
Required
vm
Type:_CartesianBase
Description:
Cartesian volume model -- can be 2- or 3-D.
Optional
detect_discontinuities_with
Type:str
Default value:'vs'
Description:
A parameter which is used to determine where an artificial "discontinuity" should be placed, to allow for a doubling layer to be inserted during mesh generation. Note that this discontinuity does not necessarily imply that there is a physical discontinuity present at a depth (although it might): it is primarily a tool used by the size function.
EXCEPTIONS
ValueError
If discontinuities are to be detected with a non-existant parameter.
ValueError
If the model is of a type from which a 1-D model cannot be auto-derived.
RETURNS
Return type: str
A BM model as a string, ready to be written to a file and used as a background model.
PAGE CONTENTS