Dimensionality#

class ansys.dpf.core.dimensionality.Dimensionality(dim_vec=None, nature: ansys.dpf.core.common.natures = natures.vector)#

Represents the dimensionality of a field.

This class reads a list of dimension vectors and creates a dimensionality message.

Parameters:
  • dim_vec (list) –

    List of integers for the dimension vectors. There is a 1D vector for a scalar or 3D vector. There is a 2D vector for a matrix. For example:

    • [1]: scalar

    • [3]: 3d vector

    • [3, 3]: 3 x 3 matrix

  • nature (ansys.dpf.core.common.natures)

Overview#

is_1d_dim

Check if dimensionality is 1.

is_2d_dim

Check if dimensionality is 2.

component_count

Retrieve the number of components based on the dimensionality.

scalar_dim

Retrieve the dimensionality of a scalar field.

vector_dim

Retrieve the dimensionality of a vector field of a given size.

vector_3d_dim

Retrieve the dimensionality of a three-dimension vector field.

tensor_dim

Retrieve the dimensionality of a symmetrical 3 x 3 tensor field.

__str__

Customize the string representation of the dimensionality.

__eq__

Check if this Dimensionality object is equal to another.

__ne__

Check if this Dimensionality object is not equal to another.

Import detail#

from ansys.dpf.core.dimensionality import Dimensionality

Property detail#

property Dimensionality.component_count#

Retrieve the number of components based on the dimensionality.

Returns:

Number of components.

Return type:

float

Attribute detail#

Dimensionality.dim#
Dimensionality.nature#

Method detail#

Dimensionality.is_1d_dim()#

Check if dimensionality is 1.

Dimensionality.is_2d_dim()#

Check if dimensionality is 2.

Dimensionality.__str__()#

Customize the string representation of the dimensionality.

static Dimensionality.scalar_dim()#

Retrieve the dimensionality of a scalar field.

Returns:

Dimensionality of the scalar field.

Return type:

ansys.dpf.core.dimensionnality.Dimensionality

static Dimensionality.vector_dim(size)#

Retrieve the dimensionality of a vector field of a given size.

Parameters:

size (int) – Number of components by entity.

Returns:

Dimensionality of the vector field.

Return type:

ansys.dpf.core.dimensionnality.Dimensionality

static Dimensionality.vector_3d_dim()#

Retrieve the dimensionality of a three-dimension vector field.

Returns:

Dimensionality of the three-dimension vector field.

Return type:

ansys.dpf.core.dimensionnality.Dimensionality

static Dimensionality.tensor_dim()#

Retrieve the dimensionality of a symmetrical 3 x 3 tensor field.

Returns:

Dimensionality of the symmetrical 3 x 3 tensor field.

Return type:

ansys.dpf.core.dimensionnality.Dimensionality

Dimensionality.__eq__(other)#

Check if this Dimensionality object is equal to another.

Two Dimensionality objects are considered equal if their dimensionality vectors (dim) and natures (nature) are the same.

Parameters:

other (Dimensionality) – The other Dimensionality object to compare with.

Returns:

True if the two objects are equal, False otherwise.

Return type:

bool

Dimensionality.__ne__(other)#

Check if this Dimensionality object is not equal to another.

Two Dimensionality objects are considered not equal if their dimensionality vectors (dim) or natures (nature) differ.

Parameters:

other (Dimensionality) – The other Dimensionality object to compare with.

Returns:

True if the two objects are not equal, False otherwise.

Return type:

bool