jaxdem.writers.vtk_domain_writer#

VTK writer for domain geometry.

Classes

VTKDomainWriter()

A VTKBaseWriter that writes the simulation domain as a VTK geometric primitive.

class jaxdem.writers.vtk_domain_writer.VTKDomainWriter#

Bases: VTKBaseWriter

A VTKBaseWriter that writes the simulation domain as a VTK geometric primitive.

Orthogonal domains are axis-aligned cuboids (3D) or rectangles (2D). A LeesEdwardsDomain uses its current shear strain and flow/gradient axes to draw the sheared periodic cell, with its anchor fixed. Two-dimensional input is padded to 3D as VTK requires.

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.