Mondaic
This API reference is not for the latest stable Salvus version.

salvus.flow.collections.source_mechanism

The source mechanism data structures to be used with block sources.

Classes

MomentTensor

class MomentTensor(salvus.flow.collections.source_mechanism._SourceMechanism):
    def __init__(self, weights: npt.ArrayLike): ...

A moment tensor source mechanism.

Parameters
  • weights npt.ArrayLike — The weights of the vector gradient source. Must be of shape (NUM_SOURCES, 4|9) or (4|9,).
Attributes
ndim int | tuple[int, int]

The dimensionality of the source mechanism.

Methods
copy()
def copy(self) -> typing.Self: ...

Return a copy of the source mechanism.

Returns typing.Self
to_2d()
def to_2d(self) -> typing.Self: ...

Return a 2-D version of the mechanism.

In cartesian systems, component along the z dimension are discarded. In spherical systems, components along the theta dimension are discarded.

If its already 2-D it will return itself.

Returns typing.Self
to_3d()
def to_3d(self) -> typing.Self: ...

Return a 3-D version of the mechanism.

If its already 3-D it will return itself.

Please pass missing parameters as keyword arguments by name.

Returns typing.Self

Scalar

class Scalar(salvus.flow.collections.source_mechanism._SourceMechanism):
    def __init__(self, weights: npt.ArrayLike): ...

A scalar source mechanism.

Parameters
  • weights npt.ArrayLike — The weights of the scalar source. Must be of shape (NUM_SOURCES, 1) or (1,).
Attributes
ndim tuple[int, int]

Return the dimensionality of the the source mechanism.

Methods
copy()
def copy(self) -> typing.Self: ...

Return a copy of the source mechanism.

Returns typing.Self
to_2d()
def to_2d(self) -> typing.Self: ...

Return a 2-D version of the mechanism.

If its already 2-D it will return itself.

Returns typing.Self
to_3d()
def to_3d(self) -> typing.Self: ...

Return a 3-D version of the mechanism.

If its already 3-D it will return itself.

Returns typing.Self

ScalarGradient

class ScalarGradient(
    salvus.flow.collections.source_mechanism._SourceMechanism
):
    def __init__(self, weights: npt.ArrayLike): ...

A scalar gradient source mechanism.

Parameters
  • weights npt.ArrayLike — The weights of the scalar gradient source. Must be of shape (NUM_SOURCES, 2|3) or (2|3,).
Attributes
ndim int | tuple[int, int]

The dimensionality of the source mechanism.

Methods
copy()
def copy(self) -> typing.Self: ...

Return a copy of the source mechanism.

Returns typing.Self
to_2d()
def to_2d(self) -> typing.Self: ...

Return a 2-D version of the mechanism.

In cartesian systems, component along the z dimension are discarded. In spherical systems, components along the theta dimension are discarded.

If its already 2-D it will return itself.

Returns typing.Self
to_3d()
def to_3d(self) -> typing.Self: ...

Return a 3-D version of the mechanism.

If its already 3-D it will return itself.

Please pass missing parameters as keyword arguments by name.

Returns typing.Self

Vector

class Vector(salvus.flow.collections.source_mechanism._SourceMechanism):
    def __init__(self, weights: npt.ArrayLike): ...

A vector source mechanism.

Parameters
  • weights npt.ArrayLike — The weights of the scalar gradient source. Must be of shape (NUM_SOURCES, 2|3) or (2|3,).
Attributes
ndim int | tuple[int, int]

The dimensionality of the source mechanism.

Methods
copy()
def copy(self) -> typing.Self: ...

Return a copy of the source mechanism.

Returns typing.Self
to_2d()
def to_2d(self) -> typing.Self: ...

Return a 2-D version of the mechanism.

In cartesian systems, component along the z dimension are discarded. In spherical systems, components along the theta dimension are discarded.

If its already 2-D it will return itself.

Returns typing.Self
to_3d()
def to_3d(self) -> typing.Self: ...

Return a 3-D version of the mechanism.

If its already 3-D it will return itself.

Please pass missing parameters as keyword arguments by name.

Returns typing.Self

VectorGradient

class VectorGradient(
    salvus.flow.collections.source_mechanism._SourceMechanism
):
    def __init__(self, weights: npt.ArrayLike): ...

A vector gradient source mechanism.

Parameters
  • weights npt.ArrayLike — The weights of the vector gradient source. Must be of (NUM_SOURCES, 4|9) or (4|9,).
Attributes
ndim int | tuple[int, int]

The dimensionality of the source mechanism.

Methods
copy()
def copy(self) -> typing.Self: ...

Return a copy of the source mechanism.

Returns typing.Self
to_2d()
def to_2d(self) -> typing.Self: ...

Return a 2-D version of the mechanism.

In cartesian systems, component along the z dimension are discarded. In spherical systems, components along the theta dimension are discarded.

If its already 2-D it will return itself.

Returns typing.Self
to_3d()
def to_3d(self) -> typing.Self: ...

Return a 3-D version of the mechanism.

If its already 3-D it will return itself.

Please pass missing parameters as keyword arguments by name.

Returns typing.Self