ogstools.variables.vector module#

ogstools.variables.vector.vector_norm(values)[source]#
Return type:

PlainQuantity | ndarray

Returns:

The norm of the vector.

class ogstools.variables.vector.Vector[source]#

Bases: Variable

Represent a vector variable.

Vector variables should contain either 2 (2D) or 3 (3D) components. Vector components can be accesses with brackets e.g. displacement[0]

__getitem__(index)[source]#

Get a scalar variable as a specific component of the vector variable.

Parameters:

index (Union[int, Literal['x', 'y', 'z']]) – The index of the component.

Return type:

Scalar

Returns:

A scalar variable as a vector component.

property magnitude: Scalar#
Returns:

A scalar variable as the magnitude of the vector.

class ogstools.variables.vector.BHE_Vector[source]#

Bases: Variable

BHE type

available Vector components

1U

in, out, grout1, grout2

2U

in1, in2, out1, out2, grout1, grout2, grout3, grout4

1P

in, grout

CXC

in, out, grout

CXA

in, out, grout

BHE_COMPONENTS: ClassVar[dict[str, list[str]]] = {'1P': ['in', 'grout'], '1U': ['in', 'out', 'grout1', 'grout2'], '2U': ['in1', 'in2', 'out1', 'out2', 'grout1', 'grout2', 'grout3', 'grout4'], 'CXA': ['in', 'out', 'grout'], 'CXC': ['in', 'out', 'grout']}#
__getitem__(index)[source]#

Get a scalar variable as a specific component of the vector variable.

Parameters:

index (int | str | tuple) – The index of the component.

Return type:

Scalar

Returns:

A scalar variable as a vector component.

property magnitude: Scalar#
Returns:

A scalar variable as the magnitude of the vector.

__init__(data_name, data_unit='', output_unit='', output_name='', symbol='', mask='', func=<function identity>, mesh_dependent=False, process_with_units=False, cmap='coolwarm', bilinear_cmap=False, categoric=False, color=None)#
class ogstools.variables.vector.VectorList[source]#

Bases: Variable

Represent a list of vector variables.

__getitem__(index)[source]#
Return type:

Vector

Returns:

A vector variable as a component of the vectorlist variable.

__init__(data_name, data_unit='', output_unit='', output_name='', symbol='', mask='', func=<function identity>, mesh_dependent=False, process_with_units=False, cmap='coolwarm', bilinear_cmap=False, categoric=False, color=None)#