Some simulations codes do not operate with grid-based data, but rather with simple particles in 3D space. For example, the Smoothed- Particle Hydrodynamics (SPH) method is a well known method used in fluid dynamics. Besides a very large and better known set of algorithms to visualize the more common grid-based data, ParaView also offers a number of options to deal with particle-based data output. This article presents a review of the techniques we find the most useful, along with the ParaView Python code that would support such visualizations.
Data format issues
ParaView offers native support for some well-known data formats specific to particles. For example, the H5part, AMReX, ENZO, openPMD. Other file formats used in astrophysics for example, Tipsy, Gadget-HDF5, are provided as plugins, developed and maintained on CSCS machines. In some cases, ParaView can also read time-series of such files.
Particle queries and selections
As the number of particles grow beyond millions, scientists often want to threshold data based on numerical values, or select sub-sets of particles based on geometric features. We offer here a few examples, extracting particle from a full model: |
---|
Extract all particles with rho > 1e-9
Given a ParaView input proxy object called "reader", the following selection is created, and extracted:
|
---|
Extract all particles with rho > 1e-9 AND a negative X coordinate
|
---|
Extract all particles within a sphere of a given Radius and Center
|
---|
Extract all particles within a sphere of a given Radius and Center, using Python Programmable filters
a first example using a geometric object (a sphere)
| a second example using an implicit function (a sphere)
|
---|
Extract all particles lying within a tolerance off a slicing plane
|
---|
Create a hierarchical binning and extract one level of particles
|
---|
Create a gridded slicing plane through a particle cloud
ParaView offers two Plane Interpolators. One is generic, using sampling kernels such as Voronoi, Gaussian, or Shepard. The other is SPH-specific, and will use the VTK smoothed-particle hydrodynamics interpolation kernels as described by D.J. Price. Note that the SPH interpolators cannot be used in a mixed mode (MPI + multi-threaded)
# create a new 'SPH Plane Interpolator' |
---|
Reduce the number of particles by Quadric Clustering
ParaView offers two different clustering options. The first one is the standard VTK-based 'Quadric Clustering' and is the same filter used to generate level of detail for ParaView. It uses a structured grid of bins and merges all points contained in each bin. The second one is VTKm-based 'vtkm Level Of Detail', so it will be fully accelerated (TBB or CUDA) depending on the compilation of ParaView. Because it uses VTKm, it requires a conversion from a VTK dataset, to a VTKm dataset (done internally), at the cost of memory. Further, it does not currently support PolyVertex cells. It will require a vtkPolyData object made of individual vertex cells. If necessary, the ParaView filter "Convert to PointCloud" can be used. Note also that the 'vtkm Level Of Detail' filter will attempt to draw triangles, which does not make sense in the case of particle data. Using a 'Points' representation will turn off this un-desired effect.
# standard VT Quadric Clustering
|
|
---|