Version:

salvus.project.configuration.model

salvus.project.configuration.model salvus project configuration model
Model configurations.

Classes

LinearSolids

Keeps track of the initial arguments passed to an objects and can later on serialize them to JSON document.
It will only consider whatever is passed in the init.
Parameters controlling the use of linear solids in viscous simulations.
The frequency band for fitting the linear solid approximation can either be provided through this interface, in which case a constant Q factor model will be constructed internally.
This reference frequency is the frequency at which any acoustic or elastic parameters provided in the model are defined. The minimum and maximum frequency are optional. If provided, they define the frequency band over which Q should be considered constant. If these parameters are not supplied here, they will be derived from the mesh frequency.
For more details, please see https://doi.org/10.1093/gji/ggu314.
Alternatively, the viscous parameters can be provided externally by attaching them to the mesh directly or using the linear solid models directly from the built-in 1-D models. Both options are mutually exclusive to avoid ambiguities.
SIGNATURE
class LinearSolids(salvus.flow.utils.serialization_helpers.SerializationMixin):
    def __init__(
        self,
        reference_frequency: salvus._core.types.float_,
        min_frequency: (
            salvus._core.types.float_
            | typing.Callable[[UnstructuredMesh], salvus._core.types.float_]
            | None
        ) = None,
        max_frequency: (
            salvus._core.types.float_
            | typing.Callable[[UnstructuredMesh], salvus._core.types.float_]
            | None
        ) = None,
    ): ...
ARGUMENTS
Required
reference_frequency
Type:salvus._core.types.float_
Description:
Frequency at which material parameters are defined.
Optional
min_frequency
Type:salvus._core.types.float_ | typing.Callable[[UnstructuredMesh], salvus._core.types.float_] | None
Default value:None
Description:
Minimum frequency used when fitting the linear solid approximation is valid. If None, defer the computation of this value until later (for instance, until a mesh is built for a specific frequency).
Optional
max_frequency
Type:salvus._core.types.float_ | typing.Callable[[UnstructuredMesh], salvus._core.types.float_] | None
Default value:None
Description:
Maximum frequency used when fitting the linear solid approximation is valid. If None, defer the computation of this value until later (for instance, until a mesh is built for a specific frequency).

Properties

  • reference_frequency(float)-Get the reference frequency.

Class Methods

LinearSolids.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

LinearSolids.max_frequency()
Return or compute the maximum frequency for fitting a constant Q in a linear solid.
If the frequency has not been provided, a default based on the mesh frequency will be computed based on van Driel & Nissen-Meyer (2014).
SIGNATURE
def max_frequency(
    self, mesh_frequency: float, mesh: UnstructuredMesh | None = None
) -> float: ...
ARGUMENTS
Required
mesh_frequency
Type:float
Description:
The maximum frequency resolved by the mesh.
Optional
mesh
Type:UnstructuredMesh | None
Default value:None
Description:
An optional mesh object for deferred frequency computation.
LinearSolids.min_frequency()
Return or compute the minimum frequency for fitting a constant Q in a linear solid.
If the frequency has not been provided, a default based on the mesh frequency will be computed based on van Driel & Nissen-Meyer (2014).
SIGNATURE
def min_frequency(
    self, mesh_frequency: float, mesh: UnstructuredMesh | None = None
) -> float: ...
ARGUMENTS
Required
mesh_frequency
Type:float
Description:
The maximum frequency resolved by the mesh.
Optional
mesh
Type:UnstructuredMesh | None
Default value:None
Description:
An optional mesh object for deferred frequency computation.
LinearSolids.to_json()
Serialize the object to a dictionary that can be written to JSON.
SIGNATURE
def to_json(
    self,
    external_file_hash: types = None,
    timer: types = None,
    log_to_logger: bool = False,
    comm: types = None,
) -> builtins.dict: ...
ARGUMENTS
Optional
external_file_hash
Type:types
Default value:None
Description:
Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file.
Optional
timer
Type:types
Default value:None
Description:
Execution timer.
Optional
log_to_logger
Type:bool
Default value:False
Description:
Log timings to the logger.
Optional
comm
Type:types
Default value:None
Description:
MPI communicator, if any.

ModelConfiguration

Model configuration.
This is a collection of up to one background model with any number of volumetric material models. At mesh building time all models added to a configuration part will be combined and interpolated onto the mesh.
SIGNATURE
class ModelConfiguration(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        background_model: str | _BackgroundBase | None = None,
        volume_models: list[str] | str | None = None,
        linear_solids: LinearSolids | None = None,
    ) -> None: ...
ARGUMENTS
Optional
background_model
Type:str | _BackgroundBase | None
Default value:None
Description:
The background model definition.
Optional
volume_models
Type:list[str] | str | None
Default value:None
Description:
A list of volumetric models.
Optional
linear_solids
Type:LinearSolids | None
Default value:None
Description:
A set of parameters which describe the linear solids to be used in viscous simulations.

Properties

  • background_model(str | _BackgroundBase | None)-The background model.
  • linear_solids(LinearSolids | None)-The parameters governing any linear solids to be attached.
  • volume_models(list[str] | None)-The volume models.

Class Methods

ModelConfiguration.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(d: builtins.dict) -> Any: ...
ARGUMENTS
Required
d
Type:builtins.dict
Description:
Dictionary containing its init parameters and a few other things.

Methods

ModelConfiguration.to_json()
Serialize the object to dictionary that can be written to JSON.
SIGNATURE
def to_json(self) -> dict: ...

Submodules

Used in tutorials

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