jaxdem.writers.vtk_spheres_writer#
VTK writers that export particle centers as VTK points.
Classes
A |
|
A |
- class jaxdem.writers.vtk_spheres_writer.VTKSpheresWriter#
Bases:
VTKBaseWriterA
VTKBaseWriterthat writes particle centers as VTK points.The writer skips facet vertices (
facet_id != -1). It attaches per-particleStatefields (e.g.,vel,rad,mass) and quaternion components asPointDataarrays. It pads positions and 2-component vectors to 3D as VTK requires.- classmethod is_active(state: State, system: System) bool[source]#
Check whether this writer has data to write for the given state and system.
- classmethod write(state: State, system: System, filename: Path, binary: bool) None[source]#
Write information from a simulation snapshot to a VTK PolyData file.
Concrete writers implement this method. The caller converts all JAX arrays to NumPy arrays before it calls write.
- Parameters:
state (State) – The simulation
jaxdem.Statesnapshot to write.system (System) – The simulation
jaxdem.Systemconfiguration.filename (Path) – Target path of the VTK file. The caller guarantees that the parent directory exists.
binary (bool) – If True, write the VTK file in binary mode. If False, write it in ASCII (human-readable) mode.
- class jaxdem.writers.vtk_spheres_writer.VTKFacetSpheresWriter#
Bases:
VTKBaseWriterA
VTKBaseWriterthat writes facet vertices (facet_id != -1) as VTK points.- classmethod is_active(state: State, system: System) bool[source]#
Check whether this writer has data to write for the given state and system.
- classmethod write(state: State, system: System, filename: Path, binary: bool) None[source]#
Write information from a simulation snapshot to a VTK PolyData file.
Concrete writers implement this method. The caller converts all JAX arrays to NumPy arrays before it calls write.
- Parameters:
state (State) – The simulation
jaxdem.Statesnapshot to write.system (System) – The simulation
jaxdem.Systemconfiguration.filename (Path) – Target path of the VTK file. The caller guarantees that the parent directory exists.
binary (bool) – If True, write the VTK file in binary mode. If False, write it in ASCII (human-readable) mode.