jaxdem.writers.vtk_spheres_writer#

VTK writers that export particle centers as VTK points.

Classes

VTKFacetSpheresWriter()

A VTKBaseWriter that writes facet vertices (facet_id != -1) as VTK points.

VTKSpheresWriter()

A VTKBaseWriter that writes particle centers as VTK points.

class jaxdem.writers.vtk_spheres_writer.VTKSpheresWriter#

Bases: VTKBaseWriter

A VTKBaseWriter that writes particle centers as VTK points.

The writer skips facet vertices (facet_id != -1). It attaches per-particle State fields (e.g., vel, rad, mass) and quaternion components as PointData arrays. 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.State snapshot to write.

  • system (System) – The simulation jaxdem.System configuration.

  • 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: VTKBaseWriter

A VTKBaseWriter that 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.State snapshot to write.

  • system (System) – The simulation jaxdem.System configuration.

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