This guide explains how to visualize peclet.dem simulation results using Ovito (for particles) and ParaView (for fields).
Part 1: Particle Visualization (Ovito)
This section explains how to visualize peclet.dem simulation results using Ovito.
1. Prerequisites
- Ovito Pro or Ovito Basic (free).
- Generated particle_shape.stl (run python examples/generate_particles.py).
- LAMMPS Dump files generated by the simulation (e.g., dump.custom.*).
2. Loading Data
- Open Ovito.
- File -> Load File.
- Select the dump files: dump.custom.* (select the first one, it will load the sequence).
- Ovito should automatically detect the columns. Ensure the mapping is correct:
- id, type: Standard
- x, y, z: Position
- radius: Radius
- vx, vy, vz: Velocity (optional)
- qw, qx, qy, qz: User-defined (do not map to Orientation yet).
- Correcting Orientation: Ovito expects the Orientation property to be a quaternion $(X, Y, Z, W)$. Our exporter provides components $(W, X, Y, Z)$ as separate columns. To map this correctly:
- Click Add modification -> Compute property.
- Output property: Select Orientation.
- Expression: Enter (qx, qy, qz, qw). (This constructs the quaternion using the loaded scalar columns qx, qy, qz, and qw).
- Setting Particle Shape:
- Click Add modifier -> Particle Types.
- Select Type 1.
- Change "Shape" to Mesh/User-defined.
- Load particle_shape.stl.
- Note: The STL is a base shape ($r=1$). Ovito will automatically scale it by the Radius property.
- Periodic Boundaries:
- If enabled, particles wrapping around checks should appear correctly if "PBC" is detected in the file source settings.
Part 2: Field Visualization (ParaView)
We use ParaView to visualize volumetric data, such as Signed Distance Fields (SDF) or occupancy grids exported as VTI files.
1. Prerequisites
- ParaView (Open Source).
- Generated VTI files (e.g., sdf_output.vti).
2. Workflow
- Load Data:
- Open ParaView.
- File -> Open -> Select your .vti file.
- Click Apply in the Properties panel.
- Visualize Volume:
- Change the representation dropdown (top toolbar) from "Outline" to Volume.
- Note: This renders the SDF scalar field as a density cloud. Since SDF values are signed (negative inside), you may need to adjust the "Color Map" or "Opacity Transfer Function" to clearly see the shapes.
- Alternative: Volume rendering can be tricky for SDFs. The Iso-Surface (Contour) method below is often clearer for seeing the exact shape boundaries.
- Visualize Iso-Surfaces (Zero-Level Set):
- With the VTI file selected, click Contour (active filter).
- In "Contour By", select SDF.
- In "Isosurfaces", add a value of 0.0.
- Click Apply.
- This will extract the exact surface where the SDF is zero (the collision boundary).
- Visualize Slices:
- Click Slice.
- Choose "Z Normal" (or X/Y) to see a cross-section of the field.
- Click Apply.
- Change "Coloring" to SDF.