Skip to main content

Module simulation_io

Module simulation_io 

Source
Expand description

Physics simulation I/O formats.

Provides writers and readers for full physics scenes (bodies, joints, materials), multi-body trajectories, contact force logs, energy logs, simulation checkpoints, VTK time-series output, and XDMF wrappers.

Structs§

BodyDesc
A rigid body descriptor for scene serialization.
CheckpointReader
Read a checkpoint and restore simulation state.
CheckpointWriter
A simulation checkpoint: full state including bodies, constraints, and broadphase.
ContactForceLog
Log of contact forces at each timestep.
ContactForceRecord
A single contact force record.
EnergyEntry
Energy log entry for one timestep.
EnergyLog
Log kinetic/potential/total energy, angular momentum, linear momentum.
JointDesc
A joint descriptor.
MaterialDesc
A physics material descriptor.
ParaviewXdmf
XDMF wrapper for HDF5-based trajectory (positions as heavy data).
PhysicsSceneReader
Read a physics scene from JSON, validate it, and reconstruct a body list.
PhysicsSceneWriter
Write a full physics scene (bodies, joints, materials) to JSON or binary.
TrajectoryFrame
A single trajectory frame: positions, velocities, quaternions.
TrajectoryReader
Reader for binary trajectory files produced by TrajectoryWriter.
TrajectoryWriter
Writer for multi-body trajectory files: positions, velocities, quaternions per timestep.
VtkTrajectory
Write a time-series VTK output: per-step VTU files + a PVD collection.

Functions§

encode_quaternion_f32
Encode a quaternion (w, x, y, z) as four f32 values in little-endian bytes.
pack_float3_array
Pack a slice of [f64; 3] vectors into an interleaved f32 little-endian byte buffer.
read_xdmf_timesteps
Parse a simple XDMF file and return a list of (time, data_file) pairs.
write_pvd_collection
Write a ParaView PVD collection XML file pointing to per-step VTU files.