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 bolts related to ParaView? Then this tutorial is right for you! We briefly explain how to produce movies using ParaView and VTK output from SMASH and vHLLE. The latter is only relevant if you want to create hybrid animations.

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 visit 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 for each of the listed tutorials in the following table of contents the ParaView version used for the section is stated in parentheses, e.g., (PV 5.4.1). Additionally, the versions used are stated as well in the headline of each tutorial section. Be aware that there might be some trouble with backward compatibility between versions.

Table of Contents


How to create a Particle Collisions Visualization (PV 5.4.1)

How to create a Density Visualization (PV 5.4.1)

How to create a Hybrid Visualization (PV 5.12.1)

How to Load and Adapt provided State Files (PV 5.12.0)

Particle Collisions Visualization (PV 5.4.1)


This section covers animating particles in an Au+Au collision. For this purpose, the needed SMASH output files can be downloaded here. Alternatively, you can run SMASH yourself using the config file AuAu_position_config.yaml. For an overview regarding SMASH output configuration options please refer to the official SMASH User Guide.

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 (PV 5.4.1)


This section covers animating density profiles in an Au+Au collision. For this purpose, the needed SMASH output files can be downloaded here. Alternatively, you can run SMASH yourself using the config file AuAu_density_config.yaml. For an overview regarding SMASH output configuration options please refer to the official SMASH User Guide.

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 FiltersAlphabeticalContour. 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.

Hybrid Visualization (PV 5.12.1)


A full hybrid visualization is a combination of two particle collisions, for the initial condition and afterburner stage, and a density visualization, for the hydrodynamical stage. This section focuses mainly on how to properly connect the different stages with regards to timing. For further details on visualizing each individual part, please consult the corresponding tutorial on particle collisions and density visualizations. The needed SMASH and vHLLE output files for the different stages are provided here. Alternatively, you can run the hybrid stages yourself, e.g., using the Hybrid-handler.

1. Open the Files

Open ParaView. Open the data files for the three stages IC, Hydro, and Afterburner one by one, as explained in the tutorial sections on particle collisions and density visualizations. For the IC and Afterburner stages, the necessary files are called pos_ev00000_tstep..vtk, while for the Hydro stage the files eps_taustep..vtk are relevant in our case. Depending on which quantity you want to visualize for the Hydro stage, the data might have a different prefix. To avoid confusion between the data sets of each stage, they are renamed in the ParaView Pipeline Browser for this tutorial adding the stage name as a prefix, e.g., IC_pos_ev00000_tstep..vtk. All the added filters are also named using the stage name as a prefix.

2. Show only formed Particles during the Afterburner Stage

Go to ViewFind Data and select as Data Producer Afterburner_pos_ev00000_tstep00000.vtk*. Below Element Type, change ID to cross_section_scaling_factor and set the value to 1. Click on and change ID again this time to is_formed with a value of 1. Click on and then on . This step leads to a new item in the Pipeline Browser (screenshot two on the right) and ensures that only already formed particles of the SMASH output are visible.

3. Shift the Start Time of the Hydro and Afterburner Stage

Right now, all three stages will start simultaneously. To adapt this, select the extracted Afterburner selection from the previous step. Go to FiltersTemporalTemporal Shift Scale and set the Post Shift to 54. The same filter and shift has to be applied to the Hydro data set. Be aware that for each individual data set the needed shift might be different, depending on the output time interval and the collision energy.

4. Use Glyphs and Contours to visualize the Stages

To visualize the particles and density, please consult the tutorials on particle collisions and density visualizations.

5. Change Visibility of Stages using the Time Manager

The stages are now properly visualized and timely shifted, but ParaView will still show all the stages as freeze frames during times when they are not propagated. This can be resolved by using ViewTime Manager. In the dropdown menus next to Animations select the Afterburner Glyphs, in our case called Afterburner_glyph_mass^(1/3), and Visibility. Click on right next to it. Down below is now a new entry called Afterburner_glyph_mass^(1/3) - Visibility. Double click it to see the settings. Click on twice and set once Time to 53 and the corresponding Value to 0, and once Time to 54 and the corresponding Value to 1. The last time step has to be set to a Value to 1 as well. For the complete settings, see the second screenshot on the right. Similar visibility changes have to be applied to IC_glyph_mass^(1/3) and Hydro_Contour1. The settings needed for the sample data set are: the IC stage should be visible from 0 to 53, Hydro and Afterburner stages visible from 54 on. Since the Hydro stage will not propagate as long as the Afterburner stage, this needs an additional Time entry of 121 and a corresponding Value of 1.
Be aware that if you adapt the shift of the Temporal Shift Scale filter, load new data using a state file, or adapt the end time (number of time steps in the Time Manager), the set times in the Time Manager might change for each stage and have to be set again.

6. State File

If you want to look up a certain step in more detail, the state file for this tutorial section is provided here. Be aware that you need to provide the appropriate locations of the VTK data sets as described in the section State File Adaptation.

State File Adaptation (PV 5.12.0)


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 input'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.