|
Peano
|
ExaParty relies on Peano's standard output routines to write file dumps. As the files can be rather large, the simulation configuration allows you to specify exactly how often you want to see file dumps, and you can also add spatial filters. The latter help you to visualise only subdomains. As we rely on Peano's infrastructure, you can use the render.py script in src/tarch/plotter/api to convert the output files into vtu files. Consult also Peano's generic discussion of various visualisation pathways.
Besides the infrastructure that Peano provides, in ExaParty we very often require to visualise the different simulation quantities in detail, e.g. to compare the output of the simulation against a reference such as typically a known analytical solution. For this purpose, a rudimentary reader for particles (points) stored in .vtu files is provided. To use it, the VTUInterface python library is required. The library can be installed using pip, i.e. invoking
The reader provides two default options: Either read in a single vtu file, or provide it with the .pvd file and specify the time of the snapshot you want to extract.
To read in a single vtu file, provide the filename as the keyword argument, e.g.
Particle data for a given snapshot may be stored in several .vtu files. Metadata about the storage is contained in the corresponding .pvd file. To read in all particle data of a given snapshot, you need to provide both the path to the .pvd file, as well as the time of the snapshot you want to extract, e.g. like so:
The reader will return an object (partData) with attributes representing particle fields with the same name as they were set in the .vtu files, save for necessary changes to prevent illegal characters in attribute names. To display what the actual attribute names are, you can run partData.show_attribute_list():
Below is a minimal full example that reads in data and creates three subplots of the particle densities, pressures, and internal energies:
A few scripts are included among the tests in /tests/exaparty/hydro-simple-sph-physics/, which can be used as reference.
If you decide to dump particles into a csv database via the particles toolbox, you might want to use the peano4/toolbox/particles/postprocessing/convert.py to transform this database into a proper vtu file sequence or to inspect the actual particle trajectory files, which do not dump all data but only data that exceeds certain thresholds.
There is a script
which allows you to visualise the mesh rearrangement statistics once you dump the information output into a file.