scalarfield_builder
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. |