ParaView Course

90
1 Parallel Visualization Parallel Visualization with ParaView with ParaView Ken Moreland (Sandia National Labs) Ken Moreland (Sandia National Labs) Berk Geveci (Kitware Inc.) Berk Geveci (Kitware Inc.)

Transcript of ParaView Course

Page 1: ParaView Course

11

Parallel Visualization with Parallel Visualization with ParaViewParaView

Ken Moreland (Sandia National Labs)Ken Moreland (Sandia National Labs)Berk Geveci (Kitware Inc.)Berk Geveci (Kitware Inc.)

Page 2: ParaView Course

22

What is ParaView?What is ParaView? Open-source, multi-platform Open-source, multi-platform

visualization application. visualization application. Supports distributed computation Supports distributed computation

models to process large data sets. models to process large data sets. Has an open, flexible, and intuitive Has an open, flexible, and intuitive

user interface. user interface. Extensible architecture based on Extensible architecture based on

open standards. open standards.

Page 3: ParaView Course

33

History of ParaViewHistory of ParaView

Project started in 1999Project started in 1999 Developed by Kitware, Los Developed by Kitware, Los

Alamos and Sandia National LabsAlamos and Sandia National Labs Funded by Trilabs and Army Funded by Trilabs and Army

Research LabsResearch Labs

Page 4: ParaView Course

44

Large data / scalable parallel Large data / scalable parallel processing processing

End user applicationEnd user application Application frameworkApplication framework Visualization and processing featuresVisualization and processing features Data modelsData models Open-sourceOpen-source Commercial supportCommercial support

Why use ParaView?Why use ParaView?

Page 5: ParaView Course

55

More InformationMore Information ParaView information:ParaView information:

– ParaView Guide - ParaView Guide - http://www.kitware.com/products/paraviewguide.hthttp://www.kitware.com/products/paraviewguide.htmlml

– http://http://www.paraview.orgwww.paraview.org– Mailing list - Mailing list -

http://www.paraview.org/HTML/MailingList.htmlhttp://www.paraview.org/HTML/MailingList.html– Wiki - Wiki - http://www.paraview.org/Wiki/ParaViewhttp://www.paraview.org/Wiki/ParaView– FAQ - FAQ - http://www.paraview.org/Wiki/ParaView:FAQhttp://www.paraview.org/Wiki/ParaView:FAQ

Page 6: ParaView Course

66

Basics of VisualizationBasics of Visualization Large amount of dataLarge amount of data Using pictures to understand raw Using pictures to understand raw

datadata Debugging simulationsDebugging simulations Communication/marketingCommunication/marketing Several post-processing Several post-processing

techniquestechniques

Page 7: ParaView Course

77

Basics of VisualizationBasics of Visualization Present data visuallyPresent data visually Use algorithms to process dataUse algorithms to process data Focus on important featuresFocus on important features

Page 8: ParaView Course

88

Basics of VisualizationBasics of Visualization

Page 9: ParaView Course

99

More InformationMore Information VTK information:VTK information:

– Visualization Toolkit BookVisualization Toolkit Book– VTK User’s GuideVTK User’s Guide– http://http://www.vtk.orgwww.vtk.org– Mailing listMailing list– WikiWiki– FAQFAQ

Page 10: ParaView Course

1010

Building ParaViewBuilding ParaView Use CMake Use CMake www.cmake.orgwww.cmake.org Run CMake GUI to configureRun CMake GUI to configure Run native build system to buildRun native build system to build

Page 11: ParaView Course

1111

Introduction To CMakeIntroduction To CMake On Unix (or Mac OSX) On Unix (or Mac OSX) ccmakeccmake

– Example: ccmake /src/ParaViewExample: ccmake /src/ParaView

Page 12: ParaView Course

1212

Introduction To CMakeIntroduction To CMake On Windows On Windows CMakeSetupCMakeSetup

Page 13: ParaView Course

1313

More InformationMore Information CMake information:CMake information:

– CMake BookCMake Book– www.cmake.orgwww.cmake.org– Mailing listMailing list– WikiWiki– FAQFAQ

Page 14: ParaView Course

1414

Different Running Different Running ModesModes Local Local

– paraviewparaview Client server Client server

– pvclientpvclient– pvserverpvserver

Render serverRender server– pvclient pvclient – pvdataserverpvdataserver– pvrenderserverpvrenderserver

BatchBatch– pvbatchpvbatch

Page 15: ParaView Course

1515

LocalLocal Executable: paraviewExecutable: paraview Can run on multiple processesCan run on multiple processes

– mpirun –np 2 paraviewmpirun –np 2 paraview

Page 16: ParaView Course

1616

Client/ServerClient/Server Executables: pvclient, pvserverExecutables: pvclient, pvserver pvserver processes data and pvserver processes data and

rendersrenders Data remains on serverData remains on server --reverse-connection (-rc) argument--reverse-connection (-rc) argument pvserver can run with multiple pvserver can run with multiple

processesprocesses

Page 17: ParaView Course

1717

Render ServerRender Server ExecutablesExecutables

– pvclientpvclient– pvdataserverpvdataserver– pvrenderserverpvrenderserver

Specify host on command lineSpecify host on command line Connection ID to further specify Connection ID to further specify

connectionconnection Used when large data resides on server Used when large data resides on server

with no rendering resourceswith no rendering resources

Page 18: ParaView Course

1818

Render ServerRender Server

Multiple socket connections with Multiple socket connections with data serverdata server

M->N redistribution executes on M->N redistribution executes on data server then data is data server then data is transferred to render servertransferred to render server

Geometry can optionally be sent to Geometry can optionally be sent to the client for local renderingthe client for local rendering

Page 19: ParaView Course

1919

Basic UsageBasic Usage GUIGUI Readers / writersReaders / writers Camera manipulationCamera manipulation FiltersFilters Accept / resetAccept / reset 3D widgets3D widgets

Page 20: ParaView Course

2020

GUIGUI

ToolbarSources and

filters

Parameters forcurrent filter

View Filters Center of rotation

Message box Progress bar

Error message

Page 21: ParaView Course

2121

File MenuFile Menu

Page 22: ParaView Course

2222

Loading DataLoading Data

Page 23: ParaView Course

2323

Loading Data: File Loading Data: File TypesTypes

ChomboChombo SpyPlot / CTH (.sptch)SpyPlot / CTH (.sptch) ExodusExodus Partitioned ExodusPartitioned Exodus HDF5 Raw(.h5)HDF5 Raw(.h5) Extensible Data Format (.xdmf)Extensible Data Format (.xdmf) EnSight (.case .sos)EnSight (.case .sos) Plot3D (.xyz)Plot3D (.xyz) VRML (.wrl)VRML (.wrl) Protein Data Bank (.pdb)Protein Data Bank (.pdb) XMol Molecule (.xyz)XMol Molecule (.xyz) Stereo Lithography (.stl)Stereo Lithography (.stl) BYU (.g)BYU (.g) Gaussian Cube File (.cube)Gaussian Cube File (.cube) Digital elevation map (.dem)Digital elevation map (.dem)

ParaView Data (.pvd) ParaView Data (.pvd) VTK PolyData (.vtp)VTK PolyData (.vtp) VTK Unstructured Grid (.vtu)VTK Unstructured Grid (.vtu) VTK Image (.vti)VTK Image (.vti) VTK Structured Grid (.vts)VTK Structured Grid (.vts) VTK Rectilinear (.vtr)VTK Rectilinear (.vtr) VTK Legacy (.vtk)VTK Legacy (.vtk) VTK Partitioned PolyData (.pvtp)VTK Partitioned PolyData (.pvtp) VTK Partitioned Unstructured grid VTK Partitioned Unstructured grid

(.pvtu)(.pvtu) VTK Partitioned Image (.pvti)VTK Partitioned Image (.pvti) VTK Partitioned Structured Grid VTK Partitioned Structured Grid

(.pvts) …(.pvts) …

Page 24: ParaView Course

2424

Source MenuSource Menu

Page 25: ParaView Course

2525

ParametersParameters AcceptAccept Reset Reset DeleteDelete Time step Time step

(File series)(File series) Array Array

selectionselection

Page 26: ParaView Course

2626

Auto AcceptAuto Accept

Page 27: ParaView Course

2727

InformationInformation

Data typeData type Number of Number of

cellscells Number of Number of

pointspoints BoundsBounds ExtentExtent

Page 28: ParaView Course

2828

Display OptionsDisplay Options

Representation

Shading

Wireframe Surface Points

Gouraud

Flat

Page 29: ParaView Course

2929

Color By AttributeColor By Attribute

Page 30: ParaView Course

3030

Volume RenderingVolume Rendering Only unstructured gridOnly unstructured grid Future plansFuture plans

– Structured Structured – AMRAMR– Faster algorithmsFaster algorithms

Page 31: ParaView Course

3131

Volume RenderingVolume Rendering

Page 32: ParaView Course

3232

Transfer Function Transfer Function EditorEditor

Page 33: ParaView Course

3333

Level of DetailsLevel of Details

DecimationDistributed / local rendering

Image reduction

Page 34: ParaView Course

3434

View PropertiesView Properties

Select

Page 35: ParaView Course

3535

View Properties: View Properties: Camera Camera

Axis aligned views

User defined views

User customization of

view manipulators

Reset camera

View manipulators Center of rotation

Page 36: ParaView Course

3636

View Properties: View Properties: GeneralGeneral

Background color

Parallel / Perspective

Performance

Page 37: ParaView Course

3737

Filter MenuFilter Menu

Page 38: ParaView Course

3838

FiltersFiltersFilter toolbar

Filter menu

NavigationSelection

Page 39: ParaView Course

3939

Toolbar Filters/SourcesToolbar Filters/SourcesContourCutClipThresholdExtract gridWarp vectorStream linesIntegrate flowSurface vectorsGlyph

CalculatorPick cellProbeGroupUngroupAMR outlineAMR extract partAMR surface

WaveletMeasureFractalSphereSuperquadric

Page 40: ParaView Course

4040

Contour (Iso Surface)Contour (Iso Surface)

Page 41: ParaView Course

4141

CutCut

Page 42: ParaView Course

4242

3D Widgets3D Widgets

Point WidgetPoint Widget Box Widget Box Widget Line WidgetLine Widget Plane WidgetPlane Widget Sphere WidgetSphere Widget

Page 43: ParaView Course

4343

Clip (Scalars)Clip (Scalars)

Page 44: ParaView Course

4444

Clip (Plane)Clip (Plane)

Page 45: ParaView Course

4545

Extract GridExtract Grid

Page 46: ParaView Course

4646

StreamlinesStreamlines

Page 47: ParaView Course

4747

Pick FilterPick Filter

Page 48: ParaView Course

4848

GroupGroup

Dr. Jean M. Favre, Dr. Jean M. Favre,

CSCS, Swiss Center for Scientific ComputingCSCS, Swiss Center for Scientific Computing

Page 49: ParaView Course

4949

Attribute CalculatorAttribute Calculator

Scalar menu

Page 50: ParaView Course

5050

ProbeProbe

Page 51: ParaView Course

5151

Intermediate Intermediate UsageUsage AnimationAnimation AnnotationsAnnotations Parallel operationsParallel operations

Page 52: ParaView Course

5252

AnimationAnimation Change parameters over time.Change parameters over time. Cannot animate creation/deletion Cannot animate creation/deletion

of sources/filters.of sources/filters.

Page 53: ParaView Course

5353

Animation InterfaceAnimation InterfaceAnimation Play

Control

Key Frame properties

Active Track Selector

Track Editor

Page 54: ParaView Course

5454

Creating AnimationCreating Animation Select Active Track for the Source Select Active Track for the Source

and property to animate.and property to animate. Add/Edit key frames.Add/Edit key frames.

Page 55: ParaView Course

5555

Selecting Active TrackSelecting Active Track

OR

Page 56: ParaView Course

5656

Add/Delete Key Add/Delete Key FramesFrames

OR

Add/Delete Buttons Click to add

Drag-out to remove

Page 57: ParaView Course

5757

Key Frame PropertiesKey Frame Properties Time – key frame Time – key frame

activation time.activation time. Value – property value Value – property value

on key frame on key frame activation.activation.

Interpolation – controls Interpolation – controls value interpolation value interpolation until the subsequent until the subsequent key frame.key frame.

Page 58: ParaView Course

5858

Animation ControlAnimation Control VCR-like control.VCR-like control. Controls playing of Controls playing of

animation.animation. Play ModePlay Mode

– SequenceSequence played as a sequence of frames.played as a sequence of frames. ((DurationDuration + 1) frames are rendered. + 1) frames are rendered.

– Real TimeReal Time Uses wall-clock time for playing animation.Uses wall-clock time for playing animation. Animation is played for Animation is played for DurationDuration seconds. seconds.

Page 59: ParaView Course

5959

Animate XFreqAnimate XFreq

Time: 5

Time: 10

Time: 0

Page 60: ParaView Course

6060

Recording AnimationRecording Animation Create animation on-the-fly.Create animation on-the-fly. Create all the sources/filters needed.Create all the sources/filters needed. Start recording by clicking Start recording by clicking Change Source/Filter parameter.Change Source/Filter parameter. Accept changes.Accept changes. Record changes to parameters as key Record changes to parameters as key

frames by clicking frames by clicking Stop recording by clicking Stop recording by clicking

Page 61: ParaView Course

6161

Record changes

Animate Contour Animate Contour ValuesValues

Start Recording

Record changes

Stop Recording

Page 62: ParaView Course

6262

Animate Contour Animate Contour ValuesValues

Time: 5 Time: 9Time: 2

Page 63: ParaView Course

6363

Default AnimationDefault Animation Automatically adds animation for Automatically adds animation for

datasets with timesteps.datasets with timesteps. Duration set to number of Duration set to number of

timesteps.timesteps. eg. Load data eg. Load data series_0.vtuseries_0.vtu

Page 64: ParaView Course

6464

Animation SettingsAnimation Settings Cache GeometryCache Geometry

– Use cache while playingUse cache while playing Record All PropertiesRecord All Properties

– While recording, create key frames for all While recording, create key frames for all property changes, otherwise only active track property changes, otherwise only active track property is observed.property is observed.

Show all animatable propertiesShow all animatable properties– Show all available tracks in Track Editor, Show all available tracks in Track Editor,

otherwise only a selected few are shown.otherwise only a selected few are shown.

Page 65: ParaView Course

6565

Extending ParaViewExtending ParaView New VTK filters/readers/writers…New VTK filters/readers/writers… New GUI elementsNew GUI elements New rendering techniquesNew rendering techniques Custom ClientsCustom Clients

Page 66: ParaView Course

6666

ServerManager XMLServerManager XML ParaView/Servers/ServerManager/ParaView/Servers/ServerManager/

ResourcesResources <SourceProxy name=“<SourceProxy name=“ProxyNameProxyName" class=“" class=“vtkClassvtkClass">"> <InputProperty name="Input" <InputProperty name="Input"

command="SetInput">command="SetInput"> <ProxyGroupDomain name="groups"><ProxyGroupDomain name="groups"> <Group name="sources"/><Group name="sources"/> <Group name="filters"/><Group name="filters"/> </ProxyGroupDomain></ProxyGroupDomain> <DataTypeDomain name="input_type"><DataTypeDomain name="input_type"> <DataType value=“<DataType value=“InputDataTypeInputDataType"/>"/> </DataTypeDomain></DataTypeDomain> </InputProperty></InputProperty> <IntVectorProperty name=“<IntVectorProperty name=“PropertyNamePropertyName" " command="command="SetCommandSetCommand" " number_of_elements=“number_of_elements=“numbernumber"" default_values=“default_values=“val1 val2 …val1 val2 …" > " > </IntVectorProperty> </IntVectorProperty> </SourceProxy></SourceProxy>

Page 67: ParaView Course

6767

GUI XMLGUI XML ParaView/GUI/Client/ResourcesParaView/GUI/Client/Resources

<Module name=“ProxyName" root_name=“ProxyName" module_type="Filter“ menu_name=“MenuName" long_help=“Long Help“ short_help=“Short Help"> <Filter class=“vtkClass"> <Input name="Input" class=“InputDataType"/> </Filter> <InputMenu trace_name="Input" label="Input"

property="Input" help=“Help for the input.“ input_name="Input"/> <VectorEntry label=“Label" trace_name=“TraceName" property=“PropertyName" type=“PropertyType"/> <Documentation> Documentation for the module </Documentation> </Module>

Page 68: ParaView Course

6868

Importing ModulesImporting Modules At compile timeAt compile time

– Create Create ModuleParaViewImport.cmakeModuleParaViewImport.cmake

SET (Sample_SRCS ${Sample_SOURCE_DIR}/vtkFilter1.cxx)

INCLUDE_DIRECTORIES(${Sample_SOURCE_DIR})

PARAVIEW_INCLUDE_WRAPPED_SOURCES( "${Sample_WRAPPED_SRCS}")

PARAVIEW_INCLUDE_SERVERMANAGER_RESOURCES( "${Sample_SOURCE_DIR}/ServerManagerXML.xml") PARAVIEW_INCLUDE_GUI_RESOURCES( "${Sample_SOURCE_DIR}/GUIXML.xml")

Page 69: ParaView Course

6969

Importing ModulesImporting Modules At compile timeAt compile time

– Create Create ModuleParaViewImport.cmakeModuleParaViewImport.cmake

– Create ServerManager and GUI XML Create ServerManager and GUI XML filesfiles<ModuleInterface>

<ServerManagerFile name=“ServerManagerFile.pvsm" />…</ModuleInterface>

Page 70: ParaView Course

7070

Importing ModulesImporting Modules At compile timeAt compile time

– Create ModuleParaViewImport.cmakeCreate ModuleParaViewImport.cmake– Create ServerManager and GUI XML Create ServerManager and GUI XML

filesfiles– Import into ParaViewImport into ParaView– CMake variable:CMake variable:

PARAVIEW_EXTRA_EXTERNAL_MODULEPARAVIEW_EXTRA_EXTERNAL_MODULE PARAVIEW_USE_PARAVIEW_USE_<ModuleName><ModuleName> <ModuleName><ModuleName>_SOURCE_DIR_SOURCE_DIR

Page 71: ParaView Course

7171

Importing ModulesImporting Modules At run timeAt run time

– Create CMakeLists.txtCreate CMakeLists.txtPROJECT(Sample)

FIND_PACKAGE(ParaView REQUIRED)INCLUDE(${PARAVIEW_USE_FILE})

SET(mySrcs “vtkSample.cxx")

VTK_WRAP_ClientServer(“Sample" wrappedSrcs "${mySrcs}")

ADD_LIBRARY(“Sample" MODULE ${wrappedSrcs} ${mySrcs})TARGET_LINK_LIBRARIES(“Sample" vtkClientServer vtkPVServerManager)

Page 72: ParaView Course

7272

Importing ModulesImporting Modules At run timeAt run time

– Create CMakeLists.txtCreate CMakeLists.txt– Create ServerManager and GUI XML Create ServerManager and GUI XML

filesfiles<ModuleInterface> <Library name=“SomeLibrary.so” directory=“/location/of/library” /> <ServerManagerFile name=“ServerManagerFile.pvsm" />…</ModuleInterface>

Page 73: ParaView Course

7373

Importing ModulesImporting Modules At run timeAt run time

– Create CMakeLists.txtCreate CMakeLists.txt– Create ServerManager and GUI XML filesCreate ServerManager and GUI XML files– Run CMakeRun CMake– BuildBuild– Load into ParaViewLoad into ParaView

Menu: File->Import PackageMenu: File->Import Package PV_INTERFACE_PATHPV_INTERFACE_PATH

Page 74: ParaView Course

7474

Parallel Visualization with Parallel Visualization with ParaView – Case StudyParaView – Case Study

Ken Moreland (Sandia National Labs)Ken Moreland (Sandia National Labs)Berk Geveci (Kitware Inc.)Berk Geveci (Kitware Inc.)

Page 75: ParaView Course

7575

Open a PLOT3D FileOpen a PLOT3D File Load combxyz.binLoad combxyz.bin

– Choose “All Files”Choose “All Files”– Manually select reader: PLOT3DManually select reader: PLOT3D

Select Q File: combq.binSelect Q File: combq.bin Rotate the outline using the left Rotate the outline using the left

mouse button and dragging in 3D mouse button and dragging in 3D windowwindow

Page 76: ParaView Course

7676

Open a PLOT3D FileOpen a PLOT3D File

Page 77: ParaView Course

7777

Create a Cut PlaneCreate a Cut Plane Create a cut filter with Filter -> Create a cut filter with Filter ->

CutCut Move the cut plane by interacting Move the cut plane by interacting

with the 3D widgetwith the 3D widget Choose the display tab and:Choose the display tab and:

– Color by densityColor by density– Turn on the scalar barTurn on the scalar bar

Page 78: ParaView Course

7878

Create a Cut PlaneCreate a Cut Plane

Page 79: ParaView Course

7979

Apply a Contour FilterApply a Contour Filter Select combq.bin from the selection Select combq.bin from the selection

windowwindow Turn off the visibility of the cut filter (the Turn off the visibility of the cut filter (the

eye icon on the left, in the selection eye icon on the left, in the selection window)window)

Apply contour: Filter -> ContourApply contour: Filter -> Contour Select “Compute Scalars”Select “Compute Scalars” Create 5 contoursCreate 5 contours AcceptAccept Display -> Color by densityDisplay -> Color by density

Page 80: ParaView Course

8080

Apply Contour FilterApply Contour Filter

Page 81: ParaView Course

8181

Clip the IsosurfacesClip the Isosurfaces

Try switching from selection to Try switching from selection to navigation windownavigation window

Make sure Contour0 is selectedMake sure Contour0 is selected Clip: Filter -> ClipClip: Filter -> Clip

Page 82: ParaView Course

8282

Clip the IsosurfacesClip the Isosurfaces

Page 83: ParaView Course

8383

Pick a CellPick a Cell Switch to selection windowSwitch to selection window Select combq.binSelect combq.bin Filter -> pickFilter -> pick Move the pick point by either 3D Move the pick point by either 3D

interaction or ‘p’ in 3D windowinteraction or ‘p’ in 3D window

Page 84: ParaView Course

8484

Pick a CellPick a Cell

Page 85: ParaView Course

8585

Probe With a LineProbe With a Line Delete the pick filterDelete the pick filter Filter -> ProbeFilter -> Probe Select lineSelect line AcceptAccept Move the xy plotMove the xy plot File -> Save StateFile -> Save State

Page 86: ParaView Course

8686

Probe With a LineProbe With a Line

Page 87: ParaView Course

8787

Generate StreamlinesGenerate Streamlines Delete probeDelete probe Filter -> Stream TracerFilter -> Stream Tracer Change number of streamlines to Change number of streamlines to

1010 Filter -> TubeFilter -> Tube Adjust radiusAdjust radius

Page 88: ParaView Course

8888

Generate StreamlinesGenerate Streamlines

Page 89: ParaView Course

8989

Animate the Cut PlaneAnimate the Cut Plane Turn off clipTurn off clip Turn on cutTurn on cut View -> Keyframe AnimationView -> Keyframe Animation Select Source: Cut1Select Source: Cut1 Select Property: Plane : OffsetSelect Property: Plane : Offset Add key frameAdd key frame PlayPlay

Page 90: ParaView Course

9090

Animate the Cut PlaneAnimate the Cut Plane