Paraview

Posted on  by 



The Climate Data Analysis Tools (CDAT) project leverages ParaView with other open-source tools to enable analysts to track, monitor, and predict. Tutorial practice files here: VTK file format information for those. Install ParaView from Ubuntu repositories. Installing ParaView with the command. Sudo apt-get install paraview. Results in an earlier version (5.01.) of ParaView.

Paraview Download

Overview

This article is intended to serve as an overview for creating slices from 3Ddata in ParaView.

For the purposes of this article, we will be using Paraview 5.4.1.

For installation instructions, please see the guide forCPU-based rendering orGPU-based rendering.

Paraview

For help running ParaView scripts, please see thebatch-execution instructions.

Manual Instructions

Before beginning, load your 3D data with whatever loader is appropriate foryour use case. In this example, we’ve loaded the motorbike tutorial fromOpenFOAM. To load an OpenFOAM case to ParaView, create a file called run.foamin the case directory.

1) With your data proxy selected in the pipeline browser on the left, clickthe “Slice” button on the “Common” toolbar at the top, or go toFilters >> Common >> Slice in the top menu.

2) Next, in the “Properties” tab for the Slice object, define your Originpoint and Normal vector. Then hit “Apply”.

3) Finally, set your camera view and slice representation.

Scripted Instructions

To create a slice in ParaView, first import the necessary module.

Loading the Data

In this guide, we’ll use the motorbike tutorial from OpenFOAM, as we did in themanual tutorial above. Your use-case may require a different procedure.

To create the slice, you’ll need to first begin with a 3D dataset in yourPipeline Browser.

Loading this case can be done with:

Where case.MeshRegions corresponds to the “Mesh Regions” selection you madein the “Properties” tab when loading the case manually, and case.CellArrayscorresponds to the manual selection for “Cell Arrays”.

In this case, “internalMesh” is the 3D fluid data, and we are only interestedin loading our velocity and pressure fields.

Paraview

We’ll also create a RenderView window to display our slice, and set itsresolution.

Creating the Slice

Paraview Dxf

To create the slice, first create the data object.

Additionally, set the origin point and normal vector for the slice.

Finally, show the data in your view and update the view.

At this point, you can adjust the properties of your slice_display objectto set its representation, adjust the legend, etc.

Paraview 4

Note that you may need to hide the 3D data that the slice was created from, incase it was already displayed. This can be done with:

User

Similarly, if you have an active source that’s highlighted in the view, andwish to turn it off for screenshot capture, you can use:

Paraview dxf

Paraview.com

Goals

This tutorial is intended to be a hands-on resource for users interested in learning the basic concepts of ParaView. The examples can easily be run on a laptop, using the example data set provided.

  • Tour of ParaView
  • Show range of visualization methods
    • Walk through various visualization techniques, hopefully illustrate how these can apply to your own data.
  • Feel for ParaView 'way'
    • Terminology and step-by-step process peculiar to ParaView, which may differ from other packages, e.g. VisIt.

Data

The data used for this tutorial is:

  • Blood flow simulation data
  • Multiple data types
    • Continuum data field (unstructured mesh, tetrahedral): fluid field, plasma
    • Particle data (unstructured points): individual particles moving in the flow
    • Red Blood Cells (RBC, unstructured mesh, triangle): mesh of the surface of an RBC
      • Healthy
      • Diseased
  • Generated using an integrated Nektar/LAMMPS simulation code
  • Courtesy of George Karniadakis and Leopold Grinberg of Brown University

The data is available for download here (~27MB compressed, ~39MB uncompressed):

Load Multi-component Dataset

  • From the File menu, (you can also click the file folder icon, shown above) open each of the following data sets (select then click 'OK').
  • The files will then appear in the Pipeline Browser
  • Click Apply in the Object Inspector
  • You will need to do this one at a time:
    • continuum...vtu
    • particles...vtu
    • rbc_...vtu
    • bad_rbc...vtu
  • The '...' in the name, and the arrow in the file browser, indicates that there are multiple time steps for each of these files.

With all of the default settings, you should see something like this:

Select which data to view

Let's start by looking at the continuum.000** data. This is an unstructured mesh that has velocity and count (density) values.

  • Hide other data sets using the Eyeball icon next their names in the Pipeline Browser.
    • Black = visible, Grey = hidden
  • Select continuum.000** (name is highlighted) in the Pipeline Browser
    • Click on the name to highlight it
  • When manipulating appearance or applying filters, these always affect the selected data set
  • Switch to the Display tab in the Object Inspector.
  • Under Color by, select Velocity from the dropdown.
    • There is also a shortcut to Color by in the menu bar near the top of the GUI.

Manipulating the Color Map

To change the colors used to represent the Velocity:

  • Under Color by click the Edit Color Map... button
  • On the Color Scale Editor window click the Choose Preset button
  • On the Preset Color Scales window, select: Blue to Red Rainbow, and click OK. Then click Close on the Color Scale Editor window
  • You can also create and save your own color maps

Data Representation

In order to be able to see the particles and red blood cells inside the cylinder, we need to be able to see through it. If we scroll down a bit in the Object Inspector view:

  • Group of controls labeled Style
  • In the Representation dropdown, select Wireframe

Generate Streamlines

  • ParaView enables the generation of different types of data from existing data sets in the Pipeline
  • Streamlines: Generated from vectors of the flow field. These curves show the direction a fluid element will travel in at any point in time
  • Make sure that the continuum.000* data is selected in the Pipeline Browser
  • From the main menu select: Filters->Alphabetical->Stream Tracer, or click on the Stream Tracer icon from the menu bar
  • In the Object Inspector make sure the Properties tab is selected.
  • Scroll down to seeds, and change Seed Type to Line Source
  • Click the Y Axis button to set the seed line to run along the Y axis.
  • The default Resolution is set to 100. This will make things a bit cluttered, especially when we start adding in the other data, so let's reduce this to 25
  • Click the Apply button.

Streamlines as Tubes

The streamlines are just that, lines. We can use the Tubes filter to represent them as 3D objects, rather than just lines.

  • With StreamTracer1 selected in the Pipeline Browser, from the main menu select: Filters->Alphabetical->Tube
  • In the Object Inspector make sure the Properties tab is selected.
  • The default value for the Radius is a bit too large for this data, let's set that value to 0.1
  • Click the Apply button.
  • Notice that the StreamLine1 object has automatically been hidden.
  • There are many different ways to color these tubes.
  • With Tubes1 selected, switch to the Display tab in the Object Inspector.
  • The Color by dropdown lets you choose from a handful of different variables.

Cutting Planes (Slices)

Now let's add some cutting plans, or slices, to see what the cross-section of the continuum data looks like.

  • Again, be sure that the continuum.000* data is selected in the Pipeline Browser.
  • Filters->Alphabetical->Slice or Click on the Slice icon from the menu bar
  • In the Object Inspector make sure the Properties tab is selected.
  • At the bottom on the Object Inspector is a section titled Slice Offset Values. Here we can generate values for multiple slices to be made.
  • First click the Delete All button to remove initial values
  • Next, click the New Range button. This will bring up an Add Range dialog box.
  • Set the number of Steps to 7. Click OK
  • Click the Apply button.
  • With Slice1 selected in the Object Inspector, switch to the Display tab
  • Set Color by value to Velocity.

Data Representation: Opacity

Even with the continuum data represented as wireframe, there is still considerable occlusion of the interior structures. In order to further reduce this occlusion by the wireframe, we can make it more transparent.

  • Again, be sure that the continuum.000* data is selected in the Pipeline Browser.
  • In the Object Inspector make sure the Display tab is selected.
  • In the Object Inspector there is a section titled Style.
  • Set Opacity to 0.2

Animating Simulation Data

Since our data has multiple time steps, we can easily animate through them to see how the data changes over time.

  • Simply click the Play button on the animation bar at the top of the GUI
  • Pause to make it stop
  • Loop: With this button toggled on, animation will repeat until stopped

Animations

Animations can be saved to disk as a movie file, to be played back later.

  • From the main menu: File->Save Animation
  • Animation Settings Dialog: Save Animation
  • Files of type: AVI files (*.avi)
  • Enter a name in File name:
  • Click OK
  • Movie can be played back with standard media players (Windows Media Player, QuickTime, VLC, etc.)

Particles as Glyphs

Glyphs are another way of visually representing data where the attributes of a graphical element are dictated by attributes of the data.

All of the particles are displayed as red points in the graphics window. There are ~39K particles in this particular data set, which makes the display a bit cluttered. In order to both filter some of these out, and create 3D representations for them, let's apply a glyph filter to this data.

Now let's add some of our other data back into the scene. Let's start with the particle data.

All of the particles are displayed as red points in the graphics window. There are ~39K particles in this particular data set, which makes the display rather cluttered. In order to both filter some of these out, and create 3D representations for them, we will apply the glyph filter to this data.

Notice that the particles.000* is still visible.

  • Unhide the particles.000* data: click Eye icon
  • Select particles.000* data: click on name
  • Filters->Alphabetical->Glyph or click on the Glyph icon from the menu bar
  • Glyph Type: Sphere
  • Radius:. 0.15
  • Orient: Unchecked
  • Scale Mode: off
  • Set Scale Factor: 1 - Edit: Checked
  • Maximum Number of Points: 3000
  • Mask Points: Checked
  • Random Mode: Unchecked
  • Click the Apply button.
  • Since our goal was to unclutter the display, let's hide the particles.000* by toggling them off, by clicking on the Eye icon next to it in the Pipeline Browser
  • Let's also switch to the Display tab in the Object Inspector, with Glyph1 selected, and change the Color by value to GlyphVector. Since the GlyphVector value is based on the velocity. We can Edit Color Map... and choose the same Blue to Red Rainbow preset that we previously chose for velocity

Enter: Red Blood Cells

Now let's add in both of the other data sets, which are polygonal meshes which make up Red Blood Cells (RBCs).

These two data sets are essentially the same kind of data, so we can apply the same filters and make the same types of representation changes to each of them. However, some of the RBCs are marked by the simulation that generated them as healthy (rbc.000*) and some of them are marked as diseased (bad_rbc.000*).

  • Unhide the rbc.000* and bad_rbc.000* data sets by clicking the Eye icon next to each of them to make them visible

Using Color to Differentiate Data

To enable us to distinguish these two types of data from one other, we can vary their representations.

One way to do this is by setting the color of the two data sets to different colors. Repeat this process for each of rbc.000* and bad_rbc.000*, picking different colors.

  • Select one of the rbc data sets in the Pipeline Browser
  • Go to the Display tab in the Object Inspector
  • In the Color by: dropdown select Solid Color
  • Click on the Set Solid Color... button
  • Select a color from the Select Color dialog that appears.
  • Repeat for the other RBC data set, choosing a different color.

Further Exploration: Highlight the Mesh

Change the representation of one of the RBC data sets.

In this example, the continuum.000* data is also hidden to reduce confusion with showing multiple overlapping meshes.

  • Select on of the RBC data sets
  • Go to the Display tab in the Object Inspector
  • For the Representation select Surface With Edges
  • In the Edge Style section click on the Set Edge Color... button to select a different color from the Select Color dialog.

Further Exploration: Highlight the Vertices

Add glyphs to illustrate the position of the vertices of one of the RBC data sets.

  • Select one of the RBC data sets
  • Select the Glyph filter
    • Since this filter was used recently, can also be found under: Filters->Recent->Glyph
  • As in the earlier example, set the various configuration options for the glyph attributes. Note that this time, we want to show all of the vertices of the RBC, so we should uncheck the Mask Points option.

Further Exploration: Color by Variable

Try playing around with the viewing options and representations of the other data objects.

Change the:

  • Color by values
  • Opacity
  • Representation
  • etc.

Background Color

  • Background color is an important part of final visualization
  • From the main menu choose: Edit->View Settings...
  • Under General in the View Settings dialog box, select Choose Color
  • Select Color: OK
  • Apply, then OK.

This tutorial was developed with support from National Science Foundation Grant OCI-0904190, and from the Argonne Leadership Computing Facility at Argonne National Laboratory, which is supported by the Office of Science of the U.S. Department of Energy under contract DE-AC02-06CH11357.





Coments are closed