Version:

salvus.mesh.layered_meshing.utils.compute_ellipticity

salvus.mesh.layered_meshing.utils.compute_ellipticity salvus mesh layered_meshing utils compute_ellipticity
A utility for computing the ellipticity of a layered model.

Functions

apply_ellipticity()

Deform a spherical mesh according to its ellipticity.
SIGNATURE
def apply_ellipticity(
    mesh: UnstructuredMesh,
    ellipticity: typing.Callable[[npt.NDArray], npt.NDArray],
    radius: float,
    execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
) -> UnstructuredMesh: ...
ARGUMENTS
Required
mesh
Type:UnstructuredMesh
Description:
The mesh to deform. NOTE: Will be updated in place.
Required
ellipticity
Type:typing.Callable[[npt.NDArray], npt.NDArray]
Description:
A callable that provides the ellipticity at an array of radii. Can be computed from a layered model using the compute_ellipticity function in this module.
Required
radius
Type:float
Description:
The radius of the sphere to apply ellipticity to.
Optional
execution_policy
Type:bindings.ExecutionPolicy
Default value:<salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy object at 0x7c032d7dd930>
Description:
Execution policy governing the maximum allowable parallelism of child routines.
EXCEPTIONS
ValueError
If the mesh's reference frame is not spherical.
RETURNS
Return type: UnstructuredMesh
A mesh with ellipticity applied.

compute_ellipticity()

Computes the ellipticity of a layered model as a function of radius.
All realized parameter types are acceptable. For discrete parameters the mean ellipticity will be computed at each radial sample, and for analytic parameters only 1-D radially-varying models are accepted.
Each layer is discretized using 100 equally-spaced points in the radial direction, and the density is evaluated at those points. These discrete values are then used to integrate Clairaut's equation. The discrete interval is then interpolated using a 3rd order spline, and returned as a callable that can be evaluated at any absolute radius in meters.
SIGNATURE
def compute_ellipticity(
    layered_model: LayeredModel, ellipsoid: str | float
) -> typing.Callable[[npt.NDArray], npt.NDArray]: ...
ARGUMENTS
Required
layered_model
Type:LayeredModel
Description:
The layered model to compute the ellipticity of.
Required
ellipsoid
Type:str | float
Description:
The ellipticity (or flattening -- the terms are used interchangeably here) of the sphere at the surface. If a string is passed, it can be one of WGS84, GRS80, or MARS, which will be converted to the corresponding ellipticity.
EXCEPTIONS
ValueError
If an unknown ellipsoid is passed.
ValueError
If the materials are not realized.
RETURNS
Return type: typing.Callable[[npt.NDArray], npt.NDArray]
A function that can be called to compute the ellipticity at a given absolute radius in meters.
PAGE CONTENTS