visualization of simulation data
play

Visualization of Simulation Data Jonah M. Miller Los Alamos - PowerPoint PPT Presentation

Visualization of Simulation Data Jonah M. Miller Los Alamos National Lab European Einstein Toolkit Workshop September, 2018 Why Visualize in 3D? Eye catchinggreat for journals, posters, talks, etc. 3D structures not visible in slice


  1. Visualization of Simulation Data Jonah M. Miller Los Alamos National Lab European Einstein Toolkit Workshop September, 2018

  2. Why Visualize in 3D? Eye catching—great for journals, posters, talks, etc. 3D structures not visible in slice plots can be visible in 3D volume renders Useful for exploring and understanding your own data J. Miller (LANL) Visualization ET Workshop 2 / 34

  3. What You Will Learn 1 (Very roughly) how does volume rendering work? 2 How to put your simulation data into these tools Your code has one representation of the physics, the data file has another, the visualization tool yet another. Mapping these representations into each other can be hard. We’ll do it for: Einstein Toolkit data Arbitrary simulation data 3 Some tips and tricks Visualization best practices Idiosyncracies of each tool J. Miller (LANL) Visualization ET Workshop 3 / 34

  4. Volume Rendering and Ray Tracing Source Screen/Eyes Data/Transfer Function J. Miller (LANL) Visualization ET Workshop 4 / 34

  5. Mapping Your Simulation Data Into a Visualization Tool

  6. What do we care about in a simulation? J. Miller (LANL) Visualization ET Workshop 6 / 34

  7. What do we care about in a simulation? J. Miller (LANL) Visualization ET Workshop 7 / 34

  8. What do we care about in a simulation? Schnetter et al 2006 Class. Quantum Grav. 23 S553 Pollney et al 2011 Phys. Rev. D 83 044045 J. Miller (LANL) Visualization ET Workshop 8 / 34

  9. Important Finite Volume Concepts cells faces J. Miller (LANL) Visualization ET Workshop 9 / 34

  10. Important Carpet AMR Concepts refined grid/patch Components domain J. Miller (LANL) Visualization ET Workshop 10 / 34

  11. Visualization Tools Pros: Simple. Easy to explore/inspect data. Cons: Limited. 3D visualization hard. Pros: Incorporates meaningful physics and analysis. Hackable. Parallel. Cons: Less flexible. No interactive UI. Pros: Very flexible. Contain graphical UI. Cons: Opaque. Hard to use in parallel. J. Miller (LANL) Visualization ET Workshop 11 / 34

  12. Pure Python

  13. Exercise: Inspecting Arbitrary Data in Python import h5py import numpy as np data = {} with h5py.File(’harmdisk2d/data.h5’,’r’) as f: for k,v in f.items(): data[k] = v.value 3 3.5 10 28 × Pressure (cgs) 3.0 2.5 2 2.0 1.5 1 1.0 0.5 0.0 0 20 40 r / r g J. Miller (LANL) Visualization ET Workshop 13 / 34

  14. Exercise: Inspecting Carpet AMR Data in Python lapse filenames = sorted (glob(’admbase − lapse. ∗ .h5’)) lapse = {} for filename in lapse filenames: with h5py.File(filename ,’r’) as f: for k,v in f.items(): try : lapse[k] = v.value except : pass 0.84 1.0 0.82 0.5 0.80 0.78 0.0 y 0.76 0.5 0.74 0.72 1.0 0.70 1.5 2.0 2.5 x J. Miller (LANL) Visualization ET Workshop 14 / 34

  15. yt

  16. (Optional) Exercise: Installing yt 0.4 0.2 � cm 2 � g 6 × 10 -1 Projected Density y (cm) 0.0 pip install yt –user 0.2 4 × 10 -1 0.4 0.4 0.2 0.0 0.2 0.4 x (cm) J. Miller (LANL) Visualization ET Workshop 16 / 34

  17. Exercise: Loading Curvilinear Data into yt × 10 3 10 28 4 10 26 Advantages 10 24 2 Easy plotting and data analysis 10 22 More advanced than pure � python � dyn cm 2 z (km) 0 Pressure 10 20 Limitations No volume rendering or 10 18 projection plots available 2 Ad hoc—parallelism unlikely 10 16 to work 10 14 4 0 1 2 3 4 × 10 3 R (km) J. Miller (LANL) Visualization ET Workshop 17 / 34

  18. yt’s Best Feature: The Community Website: yt-project.org IRC: yt-project.org/irc.html Slack Mailing list: yt-users@python.org J. Miller (LANL) Visualization ET Workshop 18 / 34

  19. Help Wanted Carpet AMR and yt are not easy to integrate Ideally a frontend for yt can be written to integrate it with Carpet J. Miller (LANL) Visualization ET Workshop 19 / 34

  20. Visit

  21. Visualizing ET Data in Visit: Opening Visit J. Miller (LANL) Visualization ET Workshop 21 / 34

  22. Visualizing ET Data in Visit: Loading Data J. Miller (LANL) Visualization ET Workshop 22 / 34

  23. Visualizing ET Data in Visit: The Contour Plot J. Miller (LANL) Visualization ET Workshop 23 / 34

  24. Visualizing ET in Visit: Accounting for Symmetry J. Miller (LANL) Visualization ET Workshop 24 / 34

  25. Visualizing ET in Visit: Changing the Colormap J. Miller (LANL) Visualization ET Workshop 25 / 34

  26. Aside: The Rainbow Colormap is Bad! Plots should convert to grayscale easily Plots should be colorblind friendly The human mind/eye doesn’t perceive differences in color uniformly The canonical “rainbow” colormap is bad about all of this A good choice are “perceptually uniform” colormaps, which solve many of these problems For more info, see https://matplotlib.org/ users/colormaps.html J. Miller (LANL) Visualization ET Workshop 26 / 34

  27. Visualizing ET in Visit: The Two Stars J. Miller (LANL) Visualization ET Workshop 27 / 34

  28. Visualizing ET in Visit: The Volume Render J. Miller (LANL) Visualization ET Workshop 28 / 34

  29. Visualizing ET in Visit: Ray Tracing J. Miller (LANL) Visualization ET Workshop 29 / 34

  30. Visualizing ET in Visit: Ray Tracing J. Miller (LANL) Visualization ET Workshop 30 / 34

  31. Using Arbitrary Data With Visit: XDMF Suppose you generated data with a code and you want to read it in to visit You can create a XDMF file to tell Visit how to read your data XDMF is XML, which is human readable/writable. Resources: http://www.xdmf.org/index.php/XDMF_Model_and_Format https://www.visitusers.org/index.php?title=Using_XDMF_ to_read_HDF5 J. Miller (LANL) Visualization ET Workshop 31 / 34

  32. Using Arbitrary Data With Visit: XDMF < Domain > < Grid Name="mesh1" GridType="Uniform" > < Topology TopologyType="2DSMesh" NumberOfElements="21 31"/ > < Geometry GeometryType="X Y" > < DataItem Dimensions="21 31" NumberType="Float" Format="HDF" > xdmf2d.h5:/X < /DataItem > < DataItem Dimensions="21 31" NumberType="Float" Format="HDF" > xdmf2d.h5:/Y < /DataItem > < /Geometry > < Attribute Name="Pressure" AttributeType="Scalar" Center="Cell" > < DataItem Dimensions="20 30" Format="HDF" > xdmf2d.h5:/Pressure < /DataItem > < /Attribute > < /Grid > < /Domain > J. Miller (LANL) Visualization ET Workshop 32 / 34

  33. Exercise: Read in Simulation Data With XDMF Write an XDMF file to read the data in exercises/harmdisk3d and visualize it in Visit. Resources: http://www.xdmf.org/ index.php/XDMF_Model_ and_Format https://www.visitusers. org/index.php?title= Using_XDMF_to_read_HDF5 J. Miller (LANL) Visualization ET Workshop 33 / 34

  34. You Have (Hopefully) Learned 1 (Very roughly) how does volume rendering work? 2 How to put your simulation data into these tools Your code has one representation of the physics, the data file has another, the visualization tool yet another. Mapping these representations into each other can be hard. We’ll do it for: Einstein Toolkit data Arbitrary simulation data 3 Some tips and tricks Visualization best practices Idiosyncracies of each tool J. Miller (LANL) Visualization ET Workshop 34 / 34

Recommend


More recommend