ParaView¶
Default outputs¶
All the default ParaView outputs (particles, drivers and contact network) are defined in config_paraview.msp. They
are written every simulation_paraview_frequency steps by the dump_data_paraview batch, which calls:
particle_write_paraview_generic: the particles, i.e.write_paraviewwith spheres, andwrite_paraview_polyhedrawrite_paraview_obb_particleswith polyhedra;paraview_driver: the drivers;contact_network_paraview: the contact network, only ifenable_contact_networkis true.
To change the particle outputs, redefine particle_write_paraview_generic in your deck (see the examples below). To
add an operator to the ParaView outputs, append it to dump_data_paraview:
Spheres¶
With spheres, the particles are written as points with their fields:
To display them in ParaView, use the "Point Gaussian" representation and adjust the radius (one size), or select "Use
Scale Array" with radius as "Gaussian Scale Array", unselect "Use Scale Transfer Function" and set "Gaussian Radius"
to 1.
Polyhedra¶
There are two ways to display polyhedra in ParaView:
- write the actual geometry of every polyhedron (vertices and faces) in parallel VTK unstructured grid files
(
.pvtu/.vtu), with per-particle fields such as the velocity, the mass or the stress. This is the default withconfig_polyhedra.msp(operatorwrite_paraview_polyhedra); - use the generic output (one point per particle) with the orientation and (optionally) the homothety fields, and
associate a mesh with each point in ParaView, such as the
octahedron.vtkwritten byread_shape_file.
Note
ParaView does not include the Minkowski layer of the shapes: faces are displayed from the vertex centers.
write_paraview_polyhedra¶
Writes, for each MPI process, one .vtu file with the polyhedra it owns (ghost particles are not written), and a
.pvtu file gathering the pieces. With filename: "ParaviewOutputFiles/exadem_0000010000":
ParaviewOutputFiles/exadem_0000010000.pvtu # file to open with ParaView
ParaviewOutputFiles/exadem_0000010000/000000.vtu # data of MPI process 0
ParaviewOutputFiles/exadem_0000010000/000001.vtu # data of MPI process 1
...
Each polyhedron is a cell of the unstructured grid, so fields are cell data (one value per polyhedron).
| Parameter | Type | Default | Description |
|---|---|---|---|
filename |
string |
output |
basename of the files; set by the default graph to ParaviewOutputFiles/exadem_%010d |
fields |
list of string |
[".*"] |
regular expressions selecting the fields: id, type, velocity, vrot, arot, mass, radius, inertia, stress, group, cluster (if the particles have a cluster field) and mpi_rank (if mpi_rank is enabled) |
mpi_rank |
bool |
false |
adds a field with the MPI rank |
binary_mode |
bool |
true |
binary (zlib-compressed, base64-encoded) or ascii data arrays |
compression |
string |
default |
zlib level in binary mode: default (level 6), min (0, no compression), max (9), or a digit in [0-9] |
Note
Binary files are much smaller and faster to read than ascii files, which are mostly useful for debugging. A higher compression level reduces the size of the files but increases the writing time.
850,000 octahedra:
Generic output with glyphs¶
| Parameter | Description |
|---|---|
binary_mode |
binary format, default true |
compression |
compression level, default default (vtkZLibDataCompressor) |
filename |
basename of the parallel files, default output |
write_ghost |
writes the ghost particles, default false |
write_box |
writes the box in a box.vtp file, default true |
write_external_box |
writes the external box (ghost area), default false |
In ParaView:
- load the reference mesh (
Octahedron.vtkhere); - load the particle files;
-
choose the "3D Glyphs" representation and the coloring;
-
in the Glyph Parameters, choose "Orient" with the orientation mode "Quaternion" and
orientas orientation vectors. To change the size, check Scaling and select a Scale Array. In the Glyph Type menu, select "Pipeline Connection" and chooseOctahedron.vtkas Input.
1000 octahedra falling in a cylinder, colored by their id:
OBBs¶
write_paraview_obb_particles writes the OBBs of the polyhedra, in separate files: by default
<dir_name>/ParaviewOutputFiles/obb_%010d.pvtp, with the id and type of each polyhedron.
| Parameter | Description |
|---|---|
basedir |
output directory |
basename |
basename of the files, default obb |
timestep |
current step |
Note
It is called after write_paraview_polyhedra (see config_polyhedra.msp), every simulation_paraview_frequency
steps.
Warning
This operator does not work with spheres.


Drivers¶
paraview_driver writes the drivers. RShape drivers are written as shape_name_iteration.vtk files; cylinders are
also written. For analytical drivers, you can also use the ParaView sources ("Sources" → "Geometric Shapes" →
"Cylinder" / "Plane" / "Sphere").