I am developing a parallel 2D CFD code in C++ using PETSc and would like to use it as an opportunity to learn about VTK/Paraview. Right now, I have each processor output an ASCII file for the portion of the domain that it owns.

Where is a good place to start to learn how to format the data to make a VTK file and view it in Paraview? I have the VTK guide (https://www.kitware.com/products/books/VTKUsersGuide.pdf) but was curious if anyone else has experience with this and could offer some advice on where to start.

The code is based on the finite volume method with a uniform Cartesian mesh. For each cell center, I have information about the pressure, velocity, density, etc.



I use VisIt to see vtk files but this may work with Paraview also. Each partition saves its own file which is a standard format and you name them with partition number, e.g.,


then VisIt can open them together. Make sure the cells in the partitions overlap by adding some ghost cells, otherwise you may have gaps in the visualization.

| cite | improve this answer | |
  • $\begingroup$ Thanks, I'm curious what resource you used to learn how to format the data? $\endgroup$ – StrugglingStudent42 Nov 24 '17 at 20:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.