salvus.project.configuration.model
Classes
LinearSolids
LinearSolidsclass 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.
reference_frequencyUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Frequency at which material parameters are defined.min_frequencyOptional[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. IfNone, defer the computation of this value until later (for instance, until a mesh is built for a specific frequency).max_frequencyOptional[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. IfNone, defer the computation of this value until later (for instance, until a mesh is built for a specific frequency).
reference_frequency float
reference_frequency floatGet the reference frequency.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
max_frequency()
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).
mesh_frequencyfloat — The maximum frequency resolved by the mesh.meshOptional[salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh] — An optional mesh object for deferred frequency computation.
min_frequency()
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).
mesh_frequencyfloat — The maximum frequency resolved by the mesh.meshOptional[salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh] — An optional mesh object for deferred frequency computation.
to_json()
to_json()def to_json(self, external_file_hash: Optional[str] = None) -> Dict: ...Serialize the object to dictionary that can be written to JSON.
external_file_hashOptional[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.
ModelConfiguration
ModelConfigurationclass 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.
background_modelOptional[str, salvus.project.configuration.model.background._BackgroundBase] — The background model definition.volume_modelsOptional[List[str], str] — A list of volumetric models.linear_solidsOptional[LinearSolids] — A set of parameters which describe the linear solids to be used in viscous simulations.
background_model Optional[str, salvus.project.configuration.model.background._BackgroundBase]
background_model Optional[str, salvus.project.configuration.model.background._BackgroundBase]The background model.
linear_solids Optional[LinearSolids]
linear_solids Optional[LinearSolids]The parameters governing any linear solids to be attached.
volume_models Optional[List[str]]
volume_models Optional[List[str]]The volume models.
from_json()
from_json()def from_json(d: Dict) -> Any: ...Recreate the object from a dictionary serialization of its initialization parameters.
dDict — Dictionary containing its init parameters and a few other things.
to_json()
to_json()def to_json(self) -> Dict: ...Serialize the object to dictionary that can be written to JSON.