Skip to content

tensors

FabricTensor

Fabric tensor of directional density function.

density classmethod

density(
    *coords: ndarray,
    deg: int,
    kind: Literal["second", "third"] = "third",
    theta_den: ndarray | None = None,
    phi_den: ndarray | None = None,
    csys: Literal["cartesian", "polar"] = "polar"
) -> Tuple[ndarray, ndarray, ndarray]

Directional density function, defined as for the second kind:

\[ f(\mathbf{n}) = \frac{1}{4\pi}F_{i_1i_2...i_n} \mathbf{n}_{i_1}\mathbf{n}_{i_2}...\mathbf{n}_{i_n} \]

and for the third kind:

\[ f(\mathbf{n}) = \frac{1}{4\pi}\sum_{k=0}^{\infty}D_{i_1i_2...i_k} \mathbf{n}_{i_1}\mathbf{n}_{i_2}...\mathbf{n}_{i_k} \]
PARAMETER DESCRIPTION
coords

Tuple of (theta, phi, radius) in polar coordinates, or tuple of (x, y, z) in cartesian coordinates.

TYPE: Tuple[ndarray, ndarray, ndarray] DEFAULT: ()

deg

Degree of the fabric tensor, must be even and greater or equal to 0, by default 2.

TYPE: int

kind

Kind of the fabric tensor to use, by default "third".

TYPE: Literal['second', 'third'] DEFAULT: 'third'

theta_den

Meshgrid of theta for the directional density function, by default theta is derived from coords.

TYPE: ndarray DEFAULT: None

phi_den

Meshgrid of phi for the directional density function, by default phi is derived from coords.

TYPE: ndarray DEFAULT: None

csys

Coordinate system of the directional data, by default "polar".

TYPE: Literal['cartesian', 'polar'] DEFAULT: 'polar'

RETURNS DESCRIPTION
Tuple[ndarray, ndarray, ndarray]

Tuple of meshgrid of theta, meshgrid of phi, and directional density function.

first_kind classmethod

first_kind(
    *coords: ndarray, deg: int, csys: Literal["cartesian", "polar"] = "polar"
) -> ndarray

Fabric tensor of the first kind, defined as the average of the product of directional coordinates:

\[ N_{i_1i_2...i_n} = \frac{1}{n} \sum_{j=1}^n x_{i_1}^jx_{i_2}^j...x_{i_n}^j \]
PARAMETER DESCRIPTION
coords

Tuple of (theta, phi, radius) in polar coordinates, or tuple of (x, y, z) in cartesian coordinates.

TYPE: Tuple[ndarray, ndarray, ndarray] DEFAULT: ()

deg

Degree of the fabric tensor, must be greater or equal to 0.

TYPE: int

csys

Coordinate system of the directional data, by default "polar".

TYPE: Literal['cartesian', 'polar'] DEFAULT: 'polar'

RETURNS DESCRIPTION
ndarray

Fabric tensor of the first kind of shape 3^order.

second_kind classmethod

second_kind(
    *coords: ndarray, deg: int, csys: Literal["cartesian", "polar"] = "polar"
) -> ndarray

Fabric tensor of the second kind.

PARAMETER DESCRIPTION
coords

Tuple of (theta, phi, radius) in polar coordinates, or tuple of (x, y, z) in cartesian coordinates.

TYPE: Tuple[ndarray, ndarray, ndarray] DEFAULT: ()

deg

Degree of the fabric tensor, must be even and greater or equal to 0.

TYPE: int

csys

Coordinate system of the directional data, by default "polar".

TYPE: Literal['cartesian', 'polar'] DEFAULT: 'polar'

RETURNS DESCRIPTION
ndarray

Fabric tensor of the first kind of shape 3^order.

tensor classmethod

tensor(
    *coords: ndarray,
    deg: int,
    kind: Literal["first", "second", "third"],
    csys: Literal["cartesian", "polar"] = "polar"
) -> ndarray

Calculate the fabric tensor of the directional density function.

PARAMETER DESCRIPTION
coords

Tuple of (theta, phi, radius) in polar coordinates, or tuple of (x, y, z) in cartesian coordinates.

TYPE: Tuple[ndarray, ndarray, ndarray] DEFAULT: ()

deg

Degree of the fabric tensor, must be even and greater or equal to 0.

TYPE: int

kind

Kind of the fabric tensor to use.

TYPE: Literal['first', 'second', 'third']

csys

Coordinate system of the directional data, by default "polar".

TYPE: Literal['cartesian', 'polar'] DEFAULT: 'polar'

RETURNS DESCRIPTION
ndarray

Fabric tensor of the directional density function of shape 3^order.

third_kind classmethod

third_kind(
    *coords: ndarray, deg: int, csys: Literal["cartesian", "polar"] = "polar"
) -> ndarray

Fabric tensor of the third kind.

PARAMETER DESCRIPTION
coords

Tuple of (theta, phi, radius) in polar coordinates, or tuple of (x, y, z) in cartesian coordinates.

TYPE: Tuple[ndarray, ndarray, ndarray] DEFAULT: ()

deg

Degree of the fabric tensor, must be even and greater or equal to 0.

TYPE: int

csys

Coordinate system of the directional data, by default "polar".

TYPE: Literal['cartesian', 'polar'] DEFAULT: 'polar'

RETURNS DESCRIPTION
ndarray

Fabric tensor of the first kind of shape 3^order.