jaxdem.writers.vtkSpheresWriter#
VTK writer that exports spheres data.
Classes
A |
- class jaxdem.writers.vtkSpheresWriter.VTKSpheresWriter[source]#
Bases:
VTKBaseWriter
A
VTKBaseWriter
that writes particle centers as VTK points and attaches per-particleState
fields asPointData
attributes.For each particle, its position is written as a point. Relevant per-particle fields (e.g.,
vel
,rad
,mass
) are exported as arrays. Positions and 2-component vectors are padded to 3D as required by VTK.- classmethod write(state: State, system: System, filename: Path, binary: bool)[source][source]#
Write information from a simulation snapshot to a VTK PolyData file.
This abstract method is the core interface for all concrete VTK writers. Implementations should assume that all jax arrays are converted to numpy arrays before write is called.
- Parameters:
state (State) – The simulation
jaxdem.State
snapshot to be written.system (System) – The simulation
jaxdem.System
configuration.filename (Path) – Target path where the VTK file should be saved. The caller guarantees that it exists.
binary (bool) – If True, the VTK file is written in binary mode; if False, it is written in ASCII (human-readable) mode.