ibfoamrig.io.FoamField#

class ibfoamrig.io.FoamField(header, dimensions, values, is_uniform)[source]#

Bases: object

The internal field of an OpenFOAM volume field.

The values array is read-only.

Variables:
property name: str#

The field name from the header.

property components: int#

The number of components per cell value.

property length: int#

The number of cell values.

expand(size)[source]#

Returns the values for size cells.

A uniform field is broadcast to size cells without copying. A nonuniform field is returned unchanged.

Parameters:

size (int) – Number of cells in the mesh.

Returns:

A read-only array with size rows.

Raises:

ValueError – If the field is nonuniform and does not have size values.

Return type:

ndarray[tuple[Any, …], dtype[float64]]