Sie sind auf Seite 1von 34

Creating Animations with

ParaView
Visualization Technology Workshop
SuperComputing 20014
November 17, 2014

Bill Sherman
shermanw@iu.edu
Advanced Visualization Lab
Indiana University
The Visualization Process
The Visualization Process
Visualization dichotomy

•  Batch vs. Interactive

•  Interactive:
•  Explorative
•  Immediate feedback
•  Performance constraints
•  Batch:
•  Pre-determined
•  Big-data / big-processing vs.  
•  HPC-ready
bigred2%  qsub  render-­‐data.pbs  
Visualization dichotomy
Visualization process
•  Batch vs. Interactive
•  Interactive è Batch

•  Interactive:
•  Explore
•  Reduced data

•  Batch:
•  Guided by exploration then  
•  Full data / high-res
bigred2%  qsub  render-­‐data.pbs  
What is ParaView?

•  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-2 license.
•  Commercial maintenance and support.
Data Types

Uniform Rectilinear Non-Uniform Rectilinear Curvilinear


(vtkImageData) (vtkRectilinearGrid) (vtkStructuredGrid)

Multi-block
Hierarchical Adaptive
Mesh Refinement
(AMR)
Hierarchical Uniform
Polygonal Unstructured Grid AMR
(vtkPolyData) (vtkUnstructuredGrid) Octree
Supported Data Types
•  ParaView  Data  (.pvd)   •  Dyna3D(.dyn)   •  Miranda  (.mir,  .raw)   •  SLAC  netCDF  par>cle  data  
•  VTK  (.vtp,  .vtu,  .v>,  .vts,  .vtr)   •  EnSight  (.case,  .sos)   •  Mul>level  3d  Plasma  (.m3d,  .h5)   •  Silo  (.silo,  .pdb)  
•  VTK  Legacy  (.vtk)   •  Enzo  boundary  and  hierarchy   •  NASTRAN  (.nas,  .f06)   •  Spheral  (.spheral,  .sv)  
•  VTK  Mul>  Block   •  ExodusII  (.g,  .e,  .exe,  .ex2,  .ex2v..,  etc)   •  Nek5000  Files     •  SpyPlot  CTH  
(.vtm,.vtmb,.vtmg,.vthd,.vthb)   •  ExtrudedVol  (.exvol)   •  Nrrd  Raw  Image  (.nrrd,  .nhdr)   •  Spy  Plot  (.case)  
•  Par>>oned  VTK   •  FVCOM  (MTMD,  MTSD,  Par>cle,   •  OpenFOAM  Files  (.foam)   •  Stereo  Lithography  (.stl)  
(.pvtu,  .pv>,  .pvts,  .pvtr)   STSD)     •  PATRAN  (.neu)   •  TFT  Files  
•  ADAPT  (.nc,  .cdf,  .elev,  .ncd)   •  Facet  Polygonal  Data   •  PFLOTRAN  (.h5)   •  TIFF  Image  Files  
•  ANALYZE  (.img,  .hdr)   •  Flash  mul>block  files   •  PLOT2D  (.p2d)   •  TSurf  Files  
•  ANSYS  (.inp)   •  Fluent  Case  Files  (.cas)   •  PLOT3D  (.xyz,  .q,  .x,  .vp3d)   •  Tecplot  ASCII  (.tec,  .tp)  
•  AVS  UCD  (.inp)   •  GGCM  (.3df,  .mer)   •  PLY  Polygonal  File  Format   •  Tecplot  Binary  (.plt)  
•  BOV  (.bov)   •  GTC  (.h5)   •  PNG  Image  Files   •  Tetrad  (.hdf5,  .h5)  
•  BYU  (.g)   •  GULP  (.trg)   •  POP  Ocean  Files   •  UNIC  (.h5)    
•  CCSM  MTSD  (.nc,  .cdf,  .elev,  .ncd)   •  Gadget  (.gadget)   •  ParaDIS  Files   •  VASP  CHGCA  (.CHG)  
•  CCSM  STSD  (.nc,  .cdf,  .elev,  .ncd)   •  Gaussian  Cube  File  (.cube)   •  Phasta  Files  (.pht)   •  VASP  OUT  (.OUT)    
•  CEAucd  (.ucd,  .inp)   •  JPG  Image  (.jpg,  .jpeg)   •  Pixie  Files  (.h5)   •  VASP  POSTCAR  (.POS)    
•  CMAT  (.cmat)   •  LAMPPS  Dump  (.dump)   •  ProSTAR  (.cel,  .vrt)   •  VPIC  (.vpc)  
•  CTRL  (.ctrl)   •  LAMPPS  Structure  Files   •  Protein  Data  Bank  (.pdb,  .ent,  .pdb)   •  VRML  (.wrl)  
•  Chombo  (.hdf5,  .h5)   •  LODI  (.nc,  .cdf,  .elev,  .ncd)   •  Raw  Image  Files   •  Velodyne  (.vld,  .rst)  
•  Claw  (.claw)   •  LODI  Par>cle  (.nc,  .cdf,  .elev,  .ncd)   •  Raw  NRRD  image  files  (.nrrd)   •  VizSchema  (.h5,  .vsh5)  
•  Comma  Separated  Values  (.csv)   •  LS-­‐DYNA  (.k,  .lsdyna,  .d3plot,  d3plot)   •  SAMRAI  (.samrai)     •  Wavefront  Polygonal  Data  (.obj)  
•  Cosmology  Files   •  M3DCl  (.h5)   •  SAR  (.SAR,  .sar)     •  WindBlade  (.wind)  
(.cosmo,  .gadget2)   •  MFIX  Unstructred  Grid  (.RES)   •  SAS  (.sasgeom,  .sas,  .sasdata)     •  XDMF  and  hdf5  (.xmf,  .xdmf)  
•  Curve2D  (.curve,  .ultra,  .ult,  .u)   •  MM5  (.mm5)   •  SESAME  Tables   •  XMol  Molecule  
•  DDCMD  (.ddcmd)   •  MPAS  NetCDF  (.nc)   •  SLAC  netCDF  mesh  and  mode  data  
•  Digital  Eleva>on  Map  (.dem)   •  Meta  Image  (.mhd,  .mha)    
Basic User Interface
Menu Bar
Toolbars

Pipeline Browser

Object Inspector

3D View
Geometry Representations

Points Wireframe Surface Surface Volume


with Edges
Common Filters

Calculator   Glyph  

Contour   Stream  Tracer  

Clip   Warp  (vector)  

Slice   Group  Datasets  

Threshold   Extract  Level  

Extract  Subset  
Filters Menu
Multiple simultaneous data views:
ParaView usage at Indiana University

•  Large complement of features addressing time-varying


computational data
•  Can be learned and used directly by researchers
•  Runs on desktop and HPC
•  the same HPC systems researchers already using
•  Collaborations with:
•  Astronomy
•  Geology
•  Nuclear Physics
Animation with ParaView

•  capable of reading time-varying data


•  sequence of VTK files
•  ParaView format (XML pointing to a sequence of files)
•  “temporal interpolator” filter to in-between the data
•  Control pane for basic animation operations
•  choice of animation mode:
•  sequence
•  real time
•  snap to timesteps
Animation Toolbar control pane

First Previous Next Last Loop Current Current


Play
Frame Frame Frame Frame Animation Time Time Step
What can be animated?

•  Time (of course)


•  Camera
•  Annotation
•  special “time”
annotation source
•  Object properties
•  sphere resolution
•  visibility
•  …
•  Python script!
Animated Python script “Cue”

•  Three methods:
•  start_cue(self)
•  tick(self)
•  end_cue(self)
Animated Python script “Cue”

def start_cue(self):
print 'Animation starting'
print 'NumberOfFrames = ' + str(scene.NumberOfFrames)

def tick(self):
i = int(scene.TimeKeeper.Time)
print "time is " + str(i)

view.ViewTime = i
scene.AnimationTime = i
Render()

def end_cue(self):
print 'Animation ending'
Batch Animations with Python script

•  ParaView State can be saved in a “StateFile” (.pvsm)


•  Statefiles can be loaded into interactive shell or batch python:
•  pvpython
•  pvbatch
•  Once a statefile is loaded, animation parameters can be set and run
from paraview.simple import *
servermanager.LoadState(”myvis.pvsm")
SetActiveView(GetRenderView())
view = GetActiveView()
scene = GetAnimationScene()
Batch Animations with Python script (cont)
Python Cue
PythonAnimationCue1 = PythonAnimationCue()
PythonAnimationCue1.Script= """
def start_cue(self):
print 'Animation starting'
print 'NumberOfFrames = ' + str(scene.NumberOfFrames)

def tick(self):
i = int(scene.TimeKeeper.Time)
print "time is " + str(i)

view.ViewTime = i
scene.AnimationTime = i
Render()

def end_cue(self):
print 'Animation ending'
""”
scene.Cues.append(PythonAnimationCue1)
Batch Animations with Python script (cont)
Tweak and Render
# Make some tweaks to the visualization
sphere=FindSource('Glyph5').GlyphType
sphere.PhiResolution=9
sphere.ThetaResolution=9

# Setup the rendering parameters


scene.NumberOfFrames=1000
view.ViewSize = [1920,1080]
view.StereoRender = 1
view.StereoType = "Left"
view.UseOffscreenRendering = 1
WriteAnimation("animationC_L.png")
view.StereoType = "Right"
view.UseOffscreenRendering = 1
WriteAnimation("animationC_R.png")
ParaView & VTK
Example (batch animation):
•  Write a Python animation script:
•  aprun% cat 3Drender.py
from paraview.simple import *
servermanager.LoadState("v2D_4-1cam-br.pvsm")
SetActiveView(GetRenderView())
view = GetActiveView()
scene = GetAnimationScene()
[…]
# Setup the rendering parameters
view.ViewSize = [1920,1080]
view.StereoRender = 1
view.StereoType = "Left"
view.UseOffscreenRendering = 1
WriteAnimation("initialV2D_L.png")
view.StereoType = "Right"
view.UseOffscreenRendering = 1
WriteAnimation("initialV2D_R.png")
What else can I add to my Python batch rendering script?

•  Time consumed rendering previous frame


•  Running frame-render-time average
•  Memory consumption (absolute and percentage)
•  System page swaps in previous frame
•  How many polygons created in last frame
Some of the problems

•  2D vs. 3D
•  Camera control
•  Normalized time
•  Start at the beginning
•  Rendering speed
2D vs. 3D

•  2D & 3D shouldn’t be opponents


•  Textual annotations generally work
•  No clean mechanism to cleanly blend 2D information over the 3D view
•  “narrative information”
•  renderings of histograms, plots, etc.
•  non-static text
•  shapes representing a scalar value (e.g. time as “progress bar”)
Camera Control

•  ParaView offers 3 types of camera movement:


•  “Orbit”
•  “Follow Path”
•  “Interpolate Camera Locations”
•  ParaView GUI client has no way to turn off computation
to allow for quick rendering to evaluate path
•  Camera visualization only available when editing the move

•  Crude solution …
Camera Control: rendering camera data

•  Python source allows one to add “data” to scene


•  (including polygonal data)
•  “Showcams.py”
Normalized Time

•  GUI interface shows time in seconds


•  Internally this is stored as a fraction of the length
•  Good when just want to extend the length of the animation and
have all the times expand
•  Bad (very bad) when trying to add new narrative moves at the
end of an animation

•  Bill’s workaround
•  vim & vimscript
Start at the beginning

•  ONLY!

•  Multi-hour batch rendering job on a queued HPC system may be


terminated in the middle – no recovery!
•  Justification
•  some filters (path generators) build up geometry over multiple
time steps
•  practitioner could alleviate this by starting N-steps earlier
Rendering Speed

•  ParaView is not a rendering speed deamon


•  Not clear how to best take advantage of “para” when rendering batch
jobs
•  Breaking into small jobs would be an easy method
•  If jobs could be started in the middle !!!

•  Perhaps made worse when using “rich-man’s anti-aliasing”


•  (render big and scale down)
Other minor things

•  Several other little fiddly issues


•  programmable source isn’t rendered each frame
•  (can use a programmable filter with “time” as input)
•  Unclear how to adjust stereoscopic rendering via python script
•  GUI numeric output issues
•  Animation timesteps shown in scientific notation – how many
frames do they expect me to render?
•  Numbers with lots of “precision” show the least-important digits
•  GUI bugs that don’t show all the cue names
Overall impressions

•  Good to be able to batch render from a GUI exploration


•  Good that the rendering can be easily moved from desktop to HPC
•  Most of the difficulties can be worked around / suffered through
•  Python tools can ease the suffering

•  Really, really, really need to be able to start rendering in the middle


Ques>ons?  

(or  perhaps  a  video)  

Das könnte Ihnen auch gefallen