Mondaic

salvus.material.utils

salvus.material.utils salvus material utils

Utils for SalvusMaterial.

Functions

extract_tensor()

def extract_tensor(
    material: PhysicalMaterial, ndim: typing.Literal[2, 3] = 3
) -> npt.NDArray: ...

Extract the stiffness or acoustic tensor from a material.

Creates a full tensor from the material’s parameters in Voigt notation as a NumPy array, even if some entries are not defined in the symmetry of the material. These are the elliptic coefficients of the wave equation solved by SalvusCompute.

The return of this function is not enough to reconstruct the material fully, as it does not include the density or M0 parameters.

Parameters
  • material PhysicalMaterial — The material to extract the tensor from.
  • ndim typing.Literal[2, 3] — The number of dimensions.
Returns npt.NDArray — The material’s tensor (elliptic coefficients) in Voigt notation.

is_acoustic()

def is_acoustic(
    material: Material | type[Material] | list[Material | type[Material]],
) -> bool | list[bool]: ...

Determine if a (list of) material(s) is acoustic.

Parameters
  • material Material | type[Material] | list[Material | type[Material]] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

is_anisotropic()

def is_anisotropic(
    material: Material | list[Material],
) -> bool | list[bool]: ...

Determine if a (list of) material(s) is anisotropic.

Parameters
  • material Material | list[Material] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

is_attenuating()

def is_attenuating(
    material: Material | list[Material],
) -> bool | list[bool]: ...

Determine if a (list of) material(s) is attenuating.

Parameters
  • material Material | list[Material] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

is_elastic()

def is_elastic(
    material: Material | type[Material] | list[Material | type[Material]],
) -> bool | list[bool]: ...

Determine if a (list of) material(s) is elastic.

Parameters
  • material Material | type[Material] | list[Material | type[Material]] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

is_homogeneous()

def is_homogeneous(
    material: Material | list[Material],
) -> bool | list[bool]: ...

Determine if a (list of) material(s) is homogeneous.

Parameters
  • material Material | list[Material] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

is_isotropic()

def is_isotropic(material: Material | list[Material]) -> bool | list[bool]: ...

Determine if a (list of) material(s) is isotropic.

Parameters
  • material Material | list[Material] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

is_oriented()

def is_oriented(material: Material | list[Material]) -> bool | list[bool]: ...

Determine if a (list of) material(s) is oriented.

Parameters
  • material Material | list[Material] — The material or list of materials to check.
Returns bool | list[bool] — A boolean or list of booleans.

Submodules

Used in tutorials