the paraview tutorial - fd.kuaero.kyoto-u.ac.jp

16
The ParaView Tutorial Version 4.1 Kenneth Moreland Sandia National Laboratories [email protected] Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000. SAND 2013-9578P

Upload: others

Post on 29-Apr-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

The ParaView TutorialVersion 4.1

Kenneth MorelandSandia National Laboratories

[email protected]

Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a whollyowned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security

Administration under contract DE-AC04-94AL85000.SAND 2013-9578P

Page 2: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

ii

Page 3: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

Contents

1 Introduction 1

1.1 Development and Funding . . . . . . . . . . . . . . . . . . . . 4

1.2 Basics of Visualization . . . . . . . . . . . . . . . . . . . . . . 5

1.3 More Information . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Basic Usage 9

2.1 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.2 Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Exercise 2.1: Creating a Source . . . . . . . . . . . . . . . . . 11

Exercise 2.2: Undo and Redo . . . . . . . . . . . . . . . . . . 13

Exercise 2.3: Modifying Rendering Parameters . . . . . . . . . 14

2.3 Loading Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Exercise 2.4: Opening a File . . . . . . . . . . . . . . . . . . . 16

Exercise 2.5: Representation and Field Coloring . . . . . . . . 18

2.4 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Exercise 2.6: Apply a Filter . . . . . . . . . . . . . . . . . . . 21

Exercise 2.7: Creating a Visualization Pipeline . . . . . . . . . 23

2.5 Multiview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Exercise 2.8: Using Multiple Views . . . . . . . . . . . . . . . 26

2.6 Vector Visualization . . . . . . . . . . . . . . . . . . . . . . . 29

Exercise 2.9: Streamlines . . . . . . . . . . . . . . . . . . . . . 30

Exercise 2.10: Making Streamlines Fancy . . . . . . . . . . . . 31

2.7 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Exercise 2.11: Plot Over a Line in Space . . . . . . . . . . . . 33

Exercise 2.12: Plot Series Display Options . . . . . . . . . . . 36

2.8 Volume Rendering . . . . . . . . . . . . . . . . . . . . . . . . 38

Exercise 2.13: Turning On Volume Rendering . . . . . . . . . 38

iii

Page 4: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

iv CONTENTS

Exercise 2.14: Combining Volume Rendering and Surface-Based Visualization . . . . . . . . . . . . . . . . . . . . 39

Exercise 2.15: Modifying Volume Rendering Transfer Functions 422.9 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Exercise 2.16: Loading Temporal Data . . . . . . . . . . . . . 43Exercise 2.17: Temporal Data Pitfall . . . . . . . . . . . . . . 44

2.10 Save Screenshot and Save Animation . . . . . . . . . . . . . . 46Exercise 2.18: Save Screenshot . . . . . . . . . . . . . . . . . . 46Exercise 2.19: Save Animation . . . . . . . . . . . . . . . . . . 48

2.11 Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Exercise 2.20: Performing Query-Based Selections . . . . . . . 50Exercise 2.21: Data Element Selections vs. Spatial Selections . 53Exercise 2.22: The Spreadsheet View and Selection . . . . . . 54Exercise 2.23: Labeling Selections . . . . . . . . . . . . . . . . 56Exercise 2.24: Plot Over Time . . . . . . . . . . . . . . . . . . 57Exercise 2.25: Extracting a Selection . . . . . . . . . . . . . . 58

2.12 Controlling Time . . . . . . . . . . . . . . . . . . . . . . . . . 58Exercise 2.26: Slowing Down an Animation with the Anima-

tion Mode . . . . . . . . . . . . . . . . . . . . . . . . . 59Exercise 2.27: Temporal Interpolation . . . . . . . . . . . . . . 61

2.13 Text Annotation . . . . . . . . . . . . . . . . . . . . . . . . . 61Exercise 2.28: Adding Text Annotation . . . . . . . . . . . . . 62Exercise 2.29: Adding Time Annotation . . . . . . . . . . . . 63

2.14 Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64Exercise 2.30: Animating Properties . . . . . . . . . . . . . . . 64Exercise 2.31: Modifying Animation Track Keyframes . . . . . 66Exercise 2.32: Multiple Animation Tracks . . . . . . . . . . . 67Exercise 2.33: Camera Orbit Animations . . . . . . . . . . . . 68

3 Visualizing Large Models 693.1 ParaView Architecture . . . . . . . . . . . . . . . . . . . . . . 703.2 Setting up a ParaView Server . . . . . . . . . . . . . . . . . . 723.3 Parallel Visualization Algorithms . . . . . . . . . . . . . . . . 743.4 Ghost Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763.5 Data Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . 773.6 D3 Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783.7 Matching Job Size to Data Size . . . . . . . . . . . . . . . . . 793.8 Avoiding Data Explosion . . . . . . . . . . . . . . . . . . . . . 80

Page 5: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

CONTENTS v

3.9 Culling Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833.10 Keeping Track of Memory . . . . . . . . . . . . . . . . . . . . 853.11 Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

3.11.1 Basic Parameter Settings . . . . . . . . . . . . . . . . . 863.11.2 Basic Parallel Rendering . . . . . . . . . . . . . . . . . 893.11.3 Image Level of Detail . . . . . . . . . . . . . . . . . . . 913.11.4 Parallel Render Parameters . . . . . . . . . . . . . . . 923.11.5 Parameters for Large Data . . . . . . . . . . . . . . . . 94

4 Batch Python Scripting 974.1 Starting the Python Interpreter . . . . . . . . . . . . . . . . . 974.2 Tracing ParaView State . . . . . . . . . . . . . . . . . . . . . 99

Exercise 4.1: Creating a Python Script Trace . . . . . . . . . . 994.3 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

Exercise 4.2: Adding a Macro . . . . . . . . . . . . . . . . . . 1004.4 Creating a Pipeline . . . . . . . . . . . . . . . . . . . . . . . . 101

Exercise 4.3: Creating and Showing a Source . . . . . . . . . . 102Exercise 4.4: Creating and Showing a Filter . . . . . . . . . . 102Exercise 4.5: Changing Pipeline Object Properties . . . . . . . 103Exercise 4.6: Branching Pipelines . . . . . . . . . . . . . . . . 104

4.5 Active Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 106Exercise 4.7: Experiment with Active Pipeline Objects . . . . 106

4.6 Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074.7 Reading from Files . . . . . . . . . . . . . . . . . . . . . . . . 108

Exercise 4.8: Creating a Reader . . . . . . . . . . . . . . . . . 1094.8 Querying Field Attributes . . . . . . . . . . . . . . . . . . . . 109

Exercise 4.9: Getting Field Information . . . . . . . . . . . . . 1094.9 Representations . . . . . . . . . . . . . . . . . . . . . . . . . . 110

Exercise 4.10: Coloring Data . . . . . . . . . . . . . . . . . . . 111

5 Further Reading 113

Acknowledgements 117

Index 118

Page 6: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

vi CONTENTS

Page 7: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

List of Exercises

2.1 Creating a Source . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Undo and Redo . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 Modifying Rendering Parameters . . . . . . . . . . . . . . . . . . 142.4 Opening a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.5 Representation and Field Coloring . . . . . . . . . . . . . . . . . 182.6 Apply a Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.7 Creating a Visualization Pipeline . . . . . . . . . . . . . . . . . . 232.8 Using Multiple Views . . . . . . . . . . . . . . . . . . . . . . . . 262.9 Streamlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302.10 Making Streamlines Fancy . . . . . . . . . . . . . . . . . . . . . . 312.11 Plot Over a Line in Space . . . . . . . . . . . . . . . . . . . . . . 332.12 Plot Series Display Options . . . . . . . . . . . . . . . . . . . . . 362.13 Turning On Volume Rendering . . . . . . . . . . . . . . . . . . . 382.14 Combining Volume Rendering and Surface-Based Visualization . 392.15 Modifying Volume Rendering Transfer Functions . . . . . . . . . 422.16 Loading Temporal Data . . . . . . . . . . . . . . . . . . . . . . . 432.17 Temporal Data Pitfall . . . . . . . . . . . . . . . . . . . . . . . . 442.18 Save Screenshot . . . . . . . . . . . . . . . . . . . . . . . . . . . 462.19 Save Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.20 Performing Query-Based Selections . . . . . . . . . . . . . . . . . 502.21 Data Element Selections vs. Spatial Selections . . . . . . . . . . 532.22 The Spreadsheet View and Selection . . . . . . . . . . . . . . . . 542.23 Labeling Selections . . . . . . . . . . . . . . . . . . . . . . . . . . 562.24 Plot Over Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572.25 Extracting a Selection . . . . . . . . . . . . . . . . . . . . . . . . 582.26 Slowing Down an Animation with the Animation Mode . . . . . 592.27 Temporal Interpolation . . . . . . . . . . . . . . . . . . . . . . . 612.28 Adding Text Annotation . . . . . . . . . . . . . . . . . . . . . . . 62

vii

Page 8: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

viii LIST OF EXERCISES

2.29 Adding Time Annotation . . . . . . . . . . . . . . . . . . . . . . 632.30 Animating Properties . . . . . . . . . . . . . . . . . . . . . . . . 642.31 Modifying Animation Track Keyframes . . . . . . . . . . . . . . . 662.32 Multiple Animation Tracks . . . . . . . . . . . . . . . . . . . . . 672.33 Camera Orbit Animations . . . . . . . . . . . . . . . . . . . . . . 684.1 Creating a Python Script Trace . . . . . . . . . . . . . . . . . . . 994.2 Adding a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . 1004.3 Creating and Showing a Source . . . . . . . . . . . . . . . . . . . 1024.4 Creating and Showing a Filter . . . . . . . . . . . . . . . . . . . 1024.5 Changing Pipeline Object Properties . . . . . . . . . . . . . . . . 1034.6 Branching Pipelines . . . . . . . . . . . . . . . . . . . . . . . . . 1044.7 Experiment with Active Pipeline Objects . . . . . . . . . . . . . 1064.8 Creating a Reader . . . . . . . . . . . . . . . . . . . . . . . . . . 1094.9 Getting Field Information . . . . . . . . . . . . . . . . . . . . . . 1094.10 Coloring Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

Page 9: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

Chapter 1

Introduction

ParaView is an open-source application for visualizing two- and three-dimensional data sets. The size of the data sets ParaView can handlevaries widely depending on the architecture on which the application is run.The platforms supported by ParaView range from single-processor worksta-tions to multiple-processor distributed-memory supercomputers or worksta-tion clusters. Using a parallel machine, ParaView can process very largedata sets in parallel and later collect the results. To date, ParaView hasbeen demonstrated to process billions of unstructured cells and to processover a trillion structured cells. ParaView’s parallel framework has run onover 100,000 processing cores.

ParaView’s design contains many conceptual features that make it standapart from other scientific visualization solutions.

• An open-source, scalable, multi-platform visualization application.

• Support for distributed computation models to process large data sets.

• An open, flexible, and intuitive user interface.

• An extensible, modular architecture based on open standards.

• A flexible BSD 3-clause license.

• Commercial maintenance and support.

1

Page 10: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

2 CHAPTER 1. INTRODUCTION

ParaView is used by many academic, government,and commercial institutions all over the world. Para-View’s open license makes it impossible to track ex-actly how many users ParaView has, but it is thoughtto be many thousands large based on indirect evi-dence. For example, ParaView is downloaded roughly100,000 times every year. ParaView also won theHPCwire Readers’ Choice Award in 2010 and 2012and HPCwire Editors’ Choice Award in 2010 for BestHPC Visualization Product or Technology.

ZSU23-4 Russian Anti-Aircraft vehiclebeing hit by a planar wave. Image cour-tesy of Jerry Clarke, US Army ResearchLaboratory.

A loosely coupled SIERRA-Fuego-Syrinx-Calore simulation with 10million unstructured hexahedra cells ofobjects-in-crosswind fire.

Simulation of a Peltonturbine. Image courtesyof the Swiss National Su-percomputing Centre

Airflow around a Le Mans Race car. Image courtesyof Renato N. Elias, NACAD/COPPE/UFRJ, Rio deJanerio, Brazil

As demonstrated in these visualization, ParaView is a general-purposetool with a wide breadth of applications. In addition to scaling from small tolarge data, ParaView provides many general-purpose visualization algorithms

Page 11: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

3

as well as some specific to particular scientific disciplines. Furthermore, theParaView system can be extended with custom visualization algorithms.

MPI OpenGL IceT Etc.

VTK

ParaView Server

ParaView Client pvpython Custom App

UI (Qt Widgets, Python Wrappings)

ParaWeb Catalyst

The application most people associate with ParaView is really just asmall client application built on top of a tall stack of libraries that provideParaView with its functionality. Because the vast majority of ParaView fea-tures are implemented in libraries, it is possible to completely replace theParaView GUI with your own custom application, as demonstrated in thefollowing figure. Furthermore, ParaView comes with a pvpython applica-tion that allows you to automate the visualization and post-processing withPython scripting.

Available to each ParaView application is a library of user interface com-ponents to maximize code sharing between them. A ParaView Serverlibrary provides the abstraction layer necessary for running parallel, interac-tive visualization. It relieves the client application from most of the issuesconcerning if and how ParaView is running in parallel. The VisualizationToolkit (VTK) provides the basic visualization and rendering algorithms.VTK incorporates several other libraries to provide basic functionalities suchas rendering, parallel processing, file I/O, and parallel rendering. Althoughthis tutorial demonstrates using ParaView through the ParaView client ap-plication, be aware that the modular design of ParaView allows for a greatdeal of flexibility and customization.

Page 12: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

4 CHAPTER 1. INTRODUCTION

1.1 Development and Funding

The ParaView project started in 2000 as a collaborative effort between Kit-ware Inc. and Los Alamos National Laboratory. The initial funding wasprovided by a three year contract with the US Department of Energy ASCIViews program. The first public release, ParaView 0.6, was announced inOctober 2002. Development of ParaView continued through collaboration ofKitware Inc. with Sandia National Laboratories, Los Alamos National Lab-oratories, the Army Research Laboratory, and various other academic andgovernment institutions.

In September 2005, Kitware, Sandia National Labs and CSimSoft startedthe development of ParaView 3.0. This was a major effort focused on rewrit-ing the user interface to be more user friendly and on developing a quantita-tive analysis framework. ParaView 3.0 was released in May 2007.

Since this time, ParaView development continues. ParaView 4.0 wasrelease in June 2013 and introduced more cohesive GUI controls and bettermultiblock interaction. Recent releases of ParaView also include the Catalystlibrary for in situ integration into simulation and other applications.

Development of ParaView continues today. Sandia National Laboratoriescontinues to fund ParaView development through the ASC project. Para-View is part of the SciDAC Scalable Data Management, Analysis, and Visu-alization (SDAV) Institute Toolkit (sdav-scidac.org). The US Department ofEnergy also funds ParaView through Los Alamos National Laboratories andvarious SBIR projects and other contracts. The US National Science Foun-dation also often funds ParaView through SBIR projects. Other institutionsalso have ParaView support contracts: Electricity de France, Mirarco, andoil industry customers. Also, because ParaView is an open source project,other institutions such as the Swiss National Supercomputing Centre con-tribute back their own development.

Page 13: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

1.2. BASICS OF VISUALIZATION 5

1.2 Basics of Visualization

Put simply, the process of visualization is taking raw data and convertingit to a form that is viewable and understandable to humans. This allows usto get a better cognitive understanding of our data. Scientific visualizationis specifically concerned with the type of data that has a well defined repre-sentation in 2D or 3D space. Data that comes from simulation meshes andscanner data is well suited for this type of analysis.

There are three basic steps to visualizing your data: reading, filtering,and rendering. First, your data must be read into ParaView. Next, you mayapply any number of filters that process the data to generate, extract, orderive features from the data. Finally, a viewable image is rendered from thedata.

ParaView was designed primarily to handle data with spatial representa-tion. Thus the primary data types used in ParaView are meshes.

Uniform Rectilinear (Image Data)A uniform rectilinear grid is a one- two-or three- dimensional array of data. Thepoints are orthonormal to each other andare spaced regularly along each direction.

Page 14: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

6 CHAPTER 1. INTRODUCTION

Non-uniform Rectilinear (RectilinearGrid)Similar to the uniform rectilinear grid ex-cept that the spacing between points mayvary along each axis.

Curvilinear (Structured Grid)Curvilinear grids have the same topology asrectilinear grids. However, each point in acurvilinear grid can be placed at an arbi-trary coordinate (provided that it does notresult in cells that overlap or self intersect).Curvilinear grids provide the more compactmemory footprint and implicit topology ofthe rectilinear grids, but also allow for muchmore variation in the shape of the mesh.

Polygonal (Poly Data)Polygonal data sets are composed of points,lines, and 2D polygons. Connections be-tween cells can be arbitrary or non-existent.Polygonal data represents the basic render-ing primitives. Any data must be convertedto polygonal data before being rendered(unless volume rendering is employed), al-though ParaView will automatically makethis conversion.

Page 15: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

1.3. MORE INFORMATION 7

Unstructured GridUnstructured data sets are composed ofpoints, lines, 2D polygons, 3D tetrahedra,and nonlinear cells. They are similar topolygonal data except that they can alsorepresent 3D tetrahedra and nonlinear cells,which cannot be directly rendered.

In addition to these basic data types, ParaView also supports multi-block data. A basic multi-block data set is created whenever data setsare grouped together or whenever a file containing multiple blocks is read.ParaView also has some special data types for representing HierarchicalAdaptive Mesh Refinement (AMR), Hierarchical Uniform AMR,Octree, Tablular, and Graph type data sets.

1.3 More Information

There are many places to find more information about ParaView. The Para-View Users Manual is available as an eBook and is also available onlineat at http://paraview.org/Wiki/ParaView/Users Guide/Table Of Contents.ParaView also has an online help that can be accessed by simply clicking the

button in the application.The ParaView web page, www.paraview.org, is also an excellent place

to find more information about ParaView. From there you can find helpfullinks to mailing lists, Wiki pages, and frequently asked questions as well asinformation about professional support services.

Page 16: The ParaView Tutorial - fd.kuaero.kyoto-u.ac.jp

8 CHAPTER 1. INTRODUCTION