ParaView Tutorial

A simple recipe for movie making and adapting state files

You want to make movies similar to those you have seen on our webpage without going through the trouble of learning all the nuts and bolds related to ParaView? Then this tutorial is right for you! In this tutorial, we will shortly summarize how to produce a movie using ParaView and SMASH output. We will look at an Au+Au collision and also give a short guide for the visualisation of density profiles. For this purpose, two different SMASH output files are provided which you can download here. Alternatively, you can run SMASH yourself using the input files AuAu_position_config.yaml and AuAu_density_config.yaml. For an overview regarding SMASH output configuration options please refer to the official SMASH User Guide.

Several SMASH background pictures for animations can be downloaded here.

What this is not: An introduction to ParaView. There will be no further explanations to available features or how they work. If you want to become a pro at the art of ParaView animation making and are looking for a more in-depth introduction, please visit the official Resources on the ParaView homepage which include among other things a user guide and tutorials.

Remarks


To open the State Files (*.pvsm) provided on the movie page with ParaView go to File and then choose the Load State... option (for more information visist the State File Adaption section). By going to FileSave State..., you can also create your own State Files. This may be helpful if you want to take breaks during the following tutorial without losing your progress and is, most importantly, very useful for future usage.

Since ParaView offers a vast variety of tools and filters, we have added pictures to guide you step by step through the movie making process. Important buttons have been marked in green whenever possible to help you find them.

Lastly, please note that the tutorials on particle collision and density visualizations were conceptualized using ParaView version 5.4.1. The tutorial on adapting state files was prepared using ParaView version 5.12.0. The versions used are visible in the top of at least the initial screenshot in every tutorial below. Be aware that there might be some trouble with backward compatibility between versions.

Table of Contents


How to create a particle collisions visualization

How to create a density visualization

How to load and adapt provided state files

Particle Collisions Visualization


1. Open the file

Open ParaView. Open the data file by clicking the File option in the top left corner of the Menu Bar, go to Open and choose the file called pos_ev00000_tstep..vtk in the position_data folder you have downloaded previously. The data set should be of the Type Group.

Click Apply in the Properties Panel. Data points and a color legend appear.

On the left side in the Properties panel, set Background to Solid Color and choose a background color you like. Use the Camera Controls and to get a side view of the collision. Note that with the Show Orientation Axes button you can hide the little coordinate system.

2. Set Mass Dependent Scaling

Later, we want the sizes of the particles to correspond to their weight according to V ∼ m. The mass itself is a variable already contained in the SMASH data, so we only need to rescale it. To do so, we choose the Calculator option in the filter bar above the Pipeline Browser in the left corner (or go to FiltersAlphabeticalCalculator). Type mass_scaling into the Result Array Name line and enter mass^(1/3) into the calculation field.

Then press .

We have now created a new variable that is called mass_scaling and whose magnitude is defined by the third root of the respective particle's mass. Press Toggle Color Legend Visibility to get rid of the color legend.

3. Add Glyphs

Choose the Glyph option in the filter bar or go to FiltersAlphabeticalGlyph. In the properties window, change Glyph Type to Sphere. In the Active Attributes section, make sure Scalars is set to mass_scaling. In the Scaling section, set Scale Mode to scalar and choose a Scale Factor to your liking, for example 1.09. This will define the size of the visualized nucleons. We want to show all nucleons, so we have to change Glyph Mode in the Masking section to All Points.

Press .

Everything else is now completely up to your liking!

4. Legend and Colors

Next, we will try to make the movie look actually visually appealing. This means, for example, adding units and labels to the legend. Also, you may note that the coloring scheme of our particles is currently diverging which is not necessarily appropriate for a linearly scaling unit such as the mass.

So let us start by improving our legend. First, look at the Pipeline Browser and make sure that Glyph1 is selected (recognizable by the blue border around it – this is also called the active view). Now, if not already visible, press the Color Map Editor button (or go to View and check Color Map Editor). Within the now opened window click the Edit Color Legend Properties button. Capitalize the title and add the unit [GeV] to it, and set all font properties to the color black (or white depending on your background color). You may want to play around with the other settings in order to get know them and find out what you like.

Press to see the changes you have made. If you are content with your choices, press .

Pressing the Rescale to custom range button, you can set the range of the color bar, for example from 0 to 2.5.

To change the diverging coloring scheme of our particles, click on the Choose preset button (you might have to enlarge the width of the Color Map Editor sidebar for this button to be visible). Choose any preset you like and press to see the changes. When you are finished, press .

5. Text and Clock

Let's add titles and a clock! To add writing, go to Sources Text. Type whatever you like into the text field and press . Now you can modify the color, size and positioning of your text in the Properties panel.

To add a clock go to FiltersTemporal Annotate Time Filter. In the Properties panel set Format to Time: %.1f fm (in newer ParaView versions the formatting has changed to: Time: {time:.1f} fm). In our provided data set, we have chosen an output interval of 0.1, so we have to change Scale to 0.1. Since in SMASH the time starts counting when the first particle collision happens, we have to set Shift to -4.5. Press . Change the position, size and color of the clock to your liking.

6. Save your Animation

Lastly, you will probably want to save your animation. Go to FileSave Animation. Set the Image Resolution to 1920×1080 – this is the standard movie format, you can choose any format you like. The overall look and positioning of the text may look different when changing this.

Now look at the Animation Options down below. Increase the Frame Rate to 60, or at least 30. This will determine how many frames per second will be played in your animation and, ultimately, sets the speed and duraion of your movie. A typical frame rate in movies is 24 frames per second, but since our original timesteps are so small, a higher frame rate is needed. Once your are finished, you may still change the frame rate in post-production using any movie editor program available to you.

Set Frame Window from 0 to 600. Press . Give your animation a name. Change the format to Ogg/Theora files(*.ogv). Alternatively, you can also save all individual frames as image files and make them into movies using another movie making software. The specified frame rate has no consequence in that case, of course.

Congratulations, you have now made your first movie with ParaView!

Density Visualization


1. Open the file

Open ParaView. Go to FileOpen and navigate to the folder you saved the previously downloaded density_data data set in and open the one called hadron_rho_eckart_00000_tstep..vtk. Press . The outline of a rectangle should appear. If you cannot see the rectangle, change Coloring in the Properties panel to Single Color and choose a color different from your backround color. You may also change the background color by setting Background on the left side in the Properties panel to Solid Color and choosing any color you like.

2. Add Contours

Press the Contour button in the filter bar or go to FiltersAlphabetical Contour. Make sure the Compute Scalars is enabled in the Properties panel. We will now visualize the hadron density using Isosurfaces. The Value Range tells you the range of magnitude and may change with each timestep. Click on the first value and change it to 0.05. Then press on the blue plus sign to add more isosurfaces. Choose, for example, 0.1, 0.15 and 0.2. Finally, press .

You see two egg-shaped, single-colored nuclei. Only the isosurface with the lowest threshold is visible, all others lie within. We fix this by changing the opacity of the surfaces. Go to Styling in the Properties panel and lower the opacity to 0.4. Also, make sure hadron_rho_eckart is selected in the Coloring section.

3. Legend and Colors

You may note that our legend currently looks like a bit of a mess. Let us fix that. Look at the Pipeline Browser and make sure that Contour1 is selected. If not already visible, press the Color Map Editor button (or go to View and check Color Map Editor). Within the now opened window click the Edit Color Legend Properties button. Change the title to Hadron Density and add the unit [1/fm³] to it. Modify the Font Properties so your title and labels are actually visible and of an accurate size. In the Label section, disable Automatic Label Format and type %-#6.2f into both the Label Format field and the Range Label Format field. Press to see the changes. Once you are finished press .

To change the coloring scheme of the isosurfaces, click on the Choose preset button. Choose any preset you like and press to see the changes. When you are finished, press .

If you wish to add a clock or text and to save your animation please follow the steps 5. and 6. from the previous section.

State File Adaptation


0. Download state file (optional)

Go back to the Movies Page and download the state file by clicking Download State File below the desired animation. Please be aware of the ParaView version used to create this state file since there might be trouble with backward compatibility between versions.

If you want to use a SMASH background picture for your animation, you can download a small selection here.

1. Load state file

Open ParaView. Click the File option in the top left corner of the Menu Bar, go to Load State, and choose the desired state file (*.pvsm).

ParaView will prompt you with a Load State Options window. To load your preferred underlying VTK data, the option has to be set to Choose File Names. For every data input (e.g., data set, background picture, etc.) saved in the loaded state file, there will be an option to change the file's location. Adjust these destinations by clicking on . ParaView must be able to find all of these files or will prompt you with error messages after clicking .

If the ParaView version you're using and the one used to create the state file differ, you might encounter error messages (due to some used but deprecated ParaView features).

2. Adapt state file

After successfully importing your data set with the chosen state file, check which filters and sources must be adapted to fit your data (e.g., if an annotate time filter was used, you probably have to adjust it to your data set).

If you want to change the colors or labels and create a new animation from these files, revisit steps 4.-6. of the Particle Collisions Visualization section of this tutorial page. To save your current progress, click on FileSave State... or use the shortcut in the toolbar to create your own state file.