From Documentation
Revision as of 15:09, 25 July 2017 by Preney (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Note: Some of the information on this page is for our legacy systems only. The page is scheduled for an update to make it applicable to Graham.

Scientific visualization with ParaView

For visualization of 2D and 3D data we highly recommend ParaView, an open-source, multi-platform, general-purpose visualization and analysis application. It can visualize data both interactively and via Python scripting, supports a large variety of input formats, can deal with structured and unstructured meshes in 2D and 3D, and can scale to handle very large datasets (gigabytes to terabytes).

We have ParaView installed on Visualization Workstations, however, to learn ParaView, we suggest that you first install it on your dekstop/notebook and start playing there, and then you can move to our larger machines. ParaView is available as a free binary download for all major platforms (Linux, Windows, Mac).

Importing data into ParaView

There are many ways to import data into ParaView. Some of them -- raw data, VTK formats (both legacy and XML), XMDF -- are covered in the slides from the 2010 summer school below. However, the easiest solution is probably to store your dataset using NetCDF which ParaView can read natively.

This sample f90 program (and the same program in C) writes a 30^3 volume with a doughnut shape at the centre in NetCDF. You can compile and run it on a cluster where NetCDF is installed:

### f90 example ###
module load netcdf/intel/4.1.2
ifort writeNetCDF.f90 -o writeNetCDF $CPPFLAGS $LDFLAGS -lnetcdff -lnetcdf
./writeNetCDF
### C example ###
module load netcdf/intel/4.1.2
icc writeNetCDF.c -o writeNetCDF $CPPFLAGS $LDFLAGS -lnetcdf
./writeNetCDF

This will create a ~100kB file volume.nc. Copy it to your local machine, where you have ParaView installed. From Paraview, navigate to the file (File - Open) and then press Apply in the Object Inspector to load the file. Highlight volume.nc in the Pipeline Browser to make it visible, select Volume in the drop-down menu, click on Edit Color Map icon, then on Choose Preset and select the desired colour map. In the main visualization window on the right you should be able to see volume rendering similar to the one shown below. The 3D object is fully interactive: you can rotate and move it, as well as zoom in/out, dragging it with one of the three mouse buttons. Play with the colour map; you will discover that the brightness in the colour map is tied to the data value, so that you can highlight the central object or the surroundings.

Volume1.png

ParaView slides

Dataset limitations

The major constraint on the size of the dataset that you can explore with ParaView is the amount of physical memory on a machine. On a typical desktop with 2 GB memory you can work interactively with datasets up to ~500^3. Some of our visualization workstations have 48GB memory and will let you visualize datasets up to ~2000^3 (single variable in single precision), or smaller datasets with multiple variables, or process these datasets with more CPU- and memory-intensive filters.