salvus.project.components.types
Types to be used throughout project.
Classes
Dim
Dimclass Dim(enum.Enum):
def __init__(self): ...The spatial dimension.
MeshResolution
MeshResolutionclass MeshResolution(builtins.object):
def __init__(
self,
reference_frequency: 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,
Tuple[
Union[
int,
numpy.int32,
numpy.int64,
float,
numpy.float32,
numpy.float64,
],
...,
],
] = 1.5,
model_order: Union[int, numpy.int32, numpy.int64] = 1,
): ...The canonical measure of the resolution of a Salvus waveform simulation is the number of elements that span a given reference wavelength in the mesh. For instance, a phrase like “we design our mesh so that there are 1.5 elements per minimum wavelength at 1 MHz” would communicate that signals up to 1 MHz can be interpreted with confidence. Often, however, one does not know the minimum wavelength a-priori, and only in fact knows the cutoff frequency of their transducer, or the minimum period of their earthquake source model, for instance. This class enables the user to express their intent to resolve waves up to a given maximum frequency, and it will be used in conjunction with the meshing algorithms and model interpolators to produce a mesh that attempts to honor that intent.
Specify resolution in terms of frequency and elements per wavelength.
reference_frequencyUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Reference frequency at which to compute the local wavelengths.elements_per_wavelengthUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64, Tuple[Union[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64], ...]] — Number of elements that should span the local wavelength. Can either path a scalar value or a tuple of values. If a tuple is passed, the mesh will be built with a potentially anisotropic elements per wavelength along each principal direction. The last value in the tuple will always be used for the number of elements per wavelength in the vertical direction, while the other [one, two] elements in the tuple specify the number of elements in the horizontal dimensions. If there are more horizontal dimensions than elements in the tuple, the first value will be broadcast along the second. For instance, the following should hold: - 2D: (1.5,): 1.5 elements per wavelength in all dimensions. - 2D: (1.5, 2.0): 1.5 elements per wavelength in the x-dimension, 2.0 elements per wavelength in the y-dimension. - 3D: (1.5,): 1.5 elements per wavelength in all dimensions. - 3D: (1.5, 2.0): 1.5 elements per wavelength in the x- and y-dimensions, 2.0 elements per wavelength in the z-dimension. - 3D: (1.5, 1.75, 2.0): 1.5 elements per wavelength in the x-dimension, 1.75 elements-per-wavelength in the y-dimension, 2.0 elements per wavelength in the z-dimension.model_orderUnion[int, numpy.int32, numpy.int64] — The polynomial order of the model representation on each element.
elements_per_wavelength Tuple[float, ...]
elements_per_wavelength Tuple[float, ...]Return the elements per wavelength as a tuple of at least length 1.
The elements per wavelength parameter can be specified differently in
different dimensions. Since the MeshResolution object has no concept
of dimension itself, for a scalar _epw parameter is upcast to a
1-element tuple so it can easily be repeated where necessary in an
iterable context.
Returns: A tuple of the number of elements per length in each dimension. A 1-element tuple return implies that the elements_per_wavelength parameter is constant in all dimensions.
model_order int
model_order intThe polynomial order of the model representation on each element.
reference_frequency float
reference_frequency floatReference frequency at which to compute the local wavelengths.
from_period()
from_period()def from_period(
reference_period: 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
] = 1.5,
) -> MeshResolution: ...Specify resolution in terms of period and elements per wavelength.
reference_periodUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Reference period at which to compute the local wavelengths.elements_per_wavelengthUnion[int, numpy.int32, numpy.int64, float, numpy.float32, numpy.float64] — Number of elements that should span the local wavelength.