jaxdem.writers.vtk_deformable_particle_writer#

VTK writers for deformable particles.

Classes

VTKDeformableEdgeAdjacenciesWriter()

A VTKBaseWriter that writes the shared hinges between adjacent elements.

VTKDeformableEdgesWriter()

A VTKBaseWriter that writes deformable particle edges as VTK lines.

VTKDeformableElementsWriter()

A VTKBaseWriter that writes deformable particle elements.

class jaxdem.writers.vtk_deformable_particle_writer.VTKDeformableEdgeAdjacenciesWriter#

Bases: VTKBaseWriter

A VTKBaseWriter that writes the shared hinges between adjacent elements.

In 3D the writer draws each shared edge as a VTK line. In 2D it draws each shared vertex as a VTK point. It attaches the rest and current bending angles and the bending stiffness eb as CellData arrays.

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_deformable_particle_writer.VTKDeformableEdgesWriter#

Bases: VTKBaseWriter

A VTKBaseWriter that writes deformable particle edges as VTK lines.

It attaches the rest and current edge lengths and the edge stiffness el as CellData arrays.

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_deformable_particle_writer.VTKDeformableElementsWriter#

Bases: VTKBaseWriter

A VTKBaseWriter that writes deformable particle elements.

The writer draws 3-vertex elements as VTK triangles and 2-vertex elements as VTK lines. It attaches per-element properties (elements_id, ec, gamma, rest and current element measures, partial_content, and element_normals) as CellData arrays.

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.