salvus.project.configuration.mesh_configuration
Classes
MeshConfiguration
MeshConfigurationclass MeshConfiguration(
salvus.flow.utils.serialization_helpers.SerializationMixin
):
def __init__(
self,
max_frequency_in_hertz: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
elements_per_wavelength: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
tensor_order: Union[int, numpy.int32, numpy.int64] = 1,
max_depth_in_meters: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
absorbing_boundaries: Optional[
salvus.mesh.simple_mesh.basic_mesh.AbsorbingBoundaryParameters
] = None,
mask_generator: Optional[
salvus.mesh.mask_generators.SurfaceMaskGenerator,
salvus.mesh.mask_generators.RayMaskGenerator,
] = None,
) -> None:
...Parameters to turn abstract simulation settings into a concrete mesh.
max_frequency_in_hertzUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max mesh frequency.elements_per_wavelengthUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Elements per wavelength.tensor_orderUnion[int, numpy.int32, numpy.int64] — Tensor order for the mesh.max_depth_in_metersOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Maximum depth in meters of the mesh.absorbing_boundariesOptional[salvus.mesh.simple_mesh.basic_mesh.AbsorbingBoundaryParameters] — Absorbing boundary configuration.mask_generatorOptional[salvus.mesh.mask_generators.SurfaceMaskGenerator, salvus.mesh.mask_generators.RayMaskGenerator] — A mesh masking callback function.
min_period_in_seconds float
min_period_in_seconds floatMinimum mesh period in seconds.
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, 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.
ModelDependentMeshParameters
ModelDependentMeshParametersclass ModelDependentMeshParameters(
salvus.flow.utils.serialization_helpers.SerializationMixin
):
def __init__(
self,
mesh_parameters: salvus.project.configuration.mesh_configuration.MeshConfiguration,
model_configuration: salvus.project.configuration.model.ModelConfiguration,
topography_configuration: Optional[
salvus.project.configuration.topography.TopographyConfiguration
],
bathymetry_configuration: Optional[
salvus.project.configuration.bathymetry.BathymetryConfiguration
] = None,
):
...Model dependent mesh parameters.
mesh_parameterssalvus.project.configuration.mesh_configuration.MeshConfiguration — The mesh parameters.model_configurationsalvus.project.configuration.model.ModelConfiguration — Model configuration.topography_configurationOptional[salvus.project.configuration.topography.TopographyConfiguration] — Configuration for the topography.bathymetry_configurationOptional[salvus.project.configuration.bathymetry.BathymetryConfiguration] — Configuration for the bathymetry.
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, 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.
SphericalSmoothieSemLateralRefinement
SphericalSmoothieSemLateralRefinementclass SphericalSmoothieSemLateralRefinement(builtins.object):
def __init__(
self,
min_theta_in_degrees: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
max_theta_in_degrees: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
min_radius_in_meters: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
max_radius_in_meters: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
min_phi_in_degrees: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
max_phi_in_degrees: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
) -> None:
...Parameters describing a SmoothieSEM lateral refinement.
Multiple refinements can be used in a SmoothieSEM context, with the strict requirement that each refinement must be wholly contained within the others. To add multiple refinements, one can pass a list of these objects to the relevant mesh generation routines.
Note here that theta and phi are to be taken from the source’s
reference frame, and are in general not equivalent to geographical
latitude and longitude.
min_theta_in_degreesUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Min theta refinement boundary.max_theta_in_degreesUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max theta refinement boundary.min_radius_in_metersUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Min radius of the refinement.max_radius_in_metersOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max radius of the refinement. Defaults to None (which represents the surface of the Earth).min_phi_in_degreesOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Min phi refinement boundary. Defaults to None (which results in a refinement in a band around the globe).max_phi_in_degreesOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max phi refinement boundary. Defaults to None (which results in a refinement in a band around the globe).
get_dict()
get_dict()def get_dict(self) -> Dict:
...Get the refinement parameters as a Python dictionary.
This is the form which is accepted by the Salvus_Mesh_ schema.
SphericalSmoothieSemMeshConfiguration
SphericalSmoothieSemMeshConfigurationclass SphericalSmoothieSemMeshConfiguration(
salvus.project.configuration.mesh_configuration._SphericalSmoothieSemMixin,
salvus.project.configuration.mesh_configuration.MeshConfiguration,
):
def __init__(
self,
elements_per_wavelength: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
source_latitude: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
source_longitude: Union[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
],
num_lateral_elements: Union[int, numpy.int32, numpy.int64],
tensor_order: Union[int, numpy.int32, numpy.int64] = 1,
lateral_refinements: Optional[
salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement,
List[
salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement
],
] = None,
max_frequency_in_hertz: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
min_period_in_seconds: Optional[
int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64
] = None,
mask_generator: Optional[
salvus.mesh.mask_generators.SurfaceMaskGenerator,
salvus.mesh.mask_generators.RayMaskGenerator,
] = None,
):
...A mixin add SmoothieSEM parameters to spherical meshes.
elements_per_wavelengthUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Elements per wavelength.source_latitudeUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Latitude of the seismic source.source_longitudeUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Longitude of the seismic source.num_lateral_elementsUnion[int, numpy.int32, numpy.int64] — Number of lateral elements per hemisphere.tensor_orderUnion[int, numpy.int32, numpy.int64] — Tensor order for the mesh.lateral_refinementsOptional[salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement, List[salvus.project.configuration.mesh_configuration.SphericalSmoothieSemLateralRefinement]] — A list of lateral refinements to add.max_frequency_in_hertzOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Max mesh frequency.min_period_in_secondsOptional[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Minimum period in seconds.mask_generatorOptional[salvus.mesh.mask_generators.SurfaceMaskGenerator, salvus.mesh.mask_generators.RayMaskGenerator] — . An optional mesh masking callback.
min_period_in_seconds float
min_period_in_seconds floatMinimum mesh period in seconds.
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.
get_lateral_refinements()
get_lateral_refinements()def get_lateral_refinements(self) -> Optional[List[Dict]]:
...Get a any lateral refinements as a list of dictionaries.
The list can then be passed directly to the SmoothieSem mesh schema.
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.