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.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.unstructured_mesh.UnstructuredMesh],
Union[
int,
numpy.int32,
numpy.int64,
float,
numpy.float32,
numpy.float64,
],
],
] = None,
) -> None:
...Parameters controlling the use of linear solids in viscous simulations.
There are two mutually exclusive ways to attach the linear solids required for viscous simulations in Salvus_Project_. The first is by specifying them in a background model (https://mondaic.com/docs/tutorials/meshing/1d_models/1D_models/), while the other is through this interface. To avoid ambiguities, these methods cannot be combined.
At a minimum, you must set the reference frequency. This is the
frequency at which any acoustic or elastic parameters you provide are
defined. You can also supply parameters which define a frequency band
over which Q should be considered constant. If these parameters are
no supplied here, sane defaults will be used (see the documentation
for the min_frequency and max_frequency member functions).
For more details, please see https://doi.org/10.1093/gji/ggu314.
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.unstructured_mesh.UnstructuredMesh], Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64]]] — Minimum frequency for which 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.unstructured_mesh.UnstructuredMesh], Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64]]] — Maximum frequency for which 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.unstructured_mesh.UnstructuredMesh] = None,
) -> float:
...Return or compute the maximum frequency for which
If the maximum was set to None, return mesh_frequency * 10.
mesh_frequencyfloat — The maximum frequency resolved by the mesh.meshOptional[salvus.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.unstructured_mesh.UnstructuredMesh] = None,
) -> float:
...Return or compute the minimum frequency for which
If the minimum was set to None, returns mesh_frequency / 100.
mesh_frequencyfloat — The maximum frequency resolved by the mesh.meshOptional[salvus.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
],
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.