builders
CycleBuilder
Builds pyvista PolyData from cycle DataFrame and updates data based on timestep.
Attributes:
| Name | Type | Description |
|---|---|---|
coords |
ndarray
|
Coordinates of the scalar field. |
cycles |
DataFrame
|
DataFrame containing cycle data. |
scalar_column |
str
|
Name of the column containing scalar data. |
pv_object |
PolyData
|
Built pyvista object. |
coords = coords
instance-attribute
cycles = cycles
instance-attribute
pv_object = pv.PolyData()
instance-attribute
scalar_column = scalar_column
instance-attribute
__init__(coords, cycles, scalar_column=None)
Initialize a CycleBuilder with coordinates and cycle data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords |
ndarray
|
Array of vertex coordinates with shape (N, 3). |
required |
cycles |
DataFrame
|
DataFrame containing cycle data for each vertex. |
required |
scalar_column |
str | None
|
Name of the column in |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
coords |
ndarray
|
Stored vertex coordinates. |
cycles |
DataFrame
|
Stored cycle data. |
scalar_column |
str | None
|
Column used for scalar values, if provided. |
pv_object |
PolyData | None
|
PyVista PolyData object, initially None. |
build()
Build pyvista object from cycle data.
Returns:
| Type | Description |
|---|---|
PolyData
|
pv.PolyData: Built pyvista object. |
update(timestep, prev_time=-1.0)
Update pyvista object based on timestep.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestep |
int
|
Timestep to update the object for. |
required |
prev_time |
float
|
Previous timestep value for updates. |
-1.0
|
Returns:
| Type | Description |
|---|---|
PolyData
|
pv.PolyData: Updated pyvista object. |
ScalarFieldBuilder
Builds pyvista PolyData from scalar field data and updates based on timestep.
Attributes:
| Name | Type | Description |
|---|---|---|
points |
ndarray
|
Coordinates of the scalar field. |
faces |
array
|
Cells of the scalar field. |
scalars |
ndarray
|
Scalar field data. |
pv_object |
PolyData
|
Built pyvista object. |
faces = faces
instance-attribute
points = points
instance-attribute
pv_object: pv.PolyData | None = None
instance-attribute
scalars = scalars
instance-attribute
scalars_name = scalars_name
instance-attribute
time_axis = time_axis
instance-attribute
__init__(points, faces, scalars, scalars_name='scalars', time_axis=None)
Initialize a mesh with coordinates, cells, and scalar values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points |
ndarray
|
Array of vertex coordinates with shape (N, 3). |
required |
faces |
ndarray
|
Array defining the mesh connectivity. |
required |
scalars |
ndarray
|
Array of scalar values associated with vertices. |
required |
scalars_name |
str
|
Name of scalars. |
'scalars'
|
time_axis |
ndarray
|
Array indicating the timesteps of the scalars. |
None
|
build()
Build pyvista object from scalar field data.
Returns:
| Type | Description |
|---|---|
PolyData
|
pv.PolyData: Built pyvista object. |
update(timestep, prev_time=-1.0)
Update pyvista object based on timestep.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestep |
int
|
Timestep to update the object for. |
required |
prev_time |
float
|
Previous timestep value for updates. Defaults to -1.0. |
-1.0
|
Returns:
| Type | Description |
|---|---|
PolyData
|
pv.PolyData: Updated pyvista object. |