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

salvus.project.configuration.model

Classes

LinearSolids

class LinearSolids(salvus.flow.utils.serialization_helpers.SerializationMixin):
    def __init__(
        self,
        reference_frequency: Union[
            int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
        ],
        min_frequency: Optional[
            int,
            numpy.int32,
            numpy.int64,
            float,
            numpy.float32,
            numpy.float64,
            Callable[
                [
                    salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
                ],
                Union[
                    int,
                    numpy.int32,
                    numpy.int64,
                    float,
                    numpy.float32,
                    numpy.float64,
                ],
            ],
        ] = None,
        max_frequency: Optional[
            int,
            numpy.int32,
            numpy.int64,
            float,
            numpy.float32,
            numpy.float64,
            Callable[
                [
                    salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
                ],
                Union[
                    int,
                    numpy.int32,
                    numpy.int64,
                    float,
                    numpy.float32,
                    numpy.float64,
                ],
            ],
        ] = None,
    ): ...

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.

Parameters
  • reference_frequency Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Frequency at which material parameters are defined.
  • min_frequency Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64, Callable[[salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh], Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64]]] — 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).
  • max_frequency Optional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64, Callable[[salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh], Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64]]] — 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).
Attributes
reference_frequency float

Get the reference frequency.

Methods
from_json()
def from_json(d: Dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
max_frequency()
def max_frequency(
    self,
    mesh_frequency: float,
    mesh: Optional[
        salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
    ] = None,
) -> float: ...

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).

Parameters
  • mesh_frequency float — The maximum frequency resolved by the mesh.
  • mesh Optional[salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh] — An optional mesh object for deferred frequency computation.
Returns float — The value according to the above rules.
min_frequency()
def min_frequency(
    self,
    mesh_frequency: float,
    mesh: Optional[
        salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
    ] = None,
) -> float: ...

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).

Parameters
  • mesh_frequency float — The maximum frequency resolved by the mesh.
  • mesh Optional[salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh] — An optional mesh object for deferred frequency computation.
Returns float — The value according to the above rules.
to_json()
def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...

Serialize the object to dictionary that can be written to JSON.

Parameters
  • external_file_hash Optional[str] — 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.
Returns Dict

ModelConfiguration

class ModelConfiguration(
    salvus.flow.utils.serialization_helpers.SerializationMixin
):
    def __init__(
        self,
        background_model: Optional[
            str, salvus.project.configuration.model.background._BackgroundBase
        ] = None,
        volume_models: Optional[List[str], str] = None,
        linear_solids: Optional[LinearSolids] = None,
    ) -> None: ...

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.

Parameters
  • background_model Optional[str, salvus.project.configuration.model.background._BackgroundBase] — The background model definition.
  • volume_models Optional[List[str], str] — A list of volumetric models.
  • linear_solids Optional[LinearSolids] — A set of parameters which describe the linear solids to be used in viscous simulations.
Attributes
background_model Optional[str, salvus.project.configuration.model.background._BackgroundBase]

The background model.

linear_solids Optional[LinearSolids]

The parameters governing any linear solids to be attached.

volume_models Optional[List[str]]

The volume models.

Methods
from_json()
def from_json(d: Dict) -> Any: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • d Dict — Dictionary containing its init parameters and a few other things.
Returns Any
to_json()
def to_json(self) -> Dict: ...

Serialize the object to dictionary that can be written to JSON.

Returns Dict

Submodules