Difference between revisions of "ParaView"

From OSUPDOCS
Jump to navigation Jump to search
Line 24: Line 24:


<li>Use <tt>ExtractMPM</tt> on a file from the <tt>Results</tt> folder with the following command line:
<li>Use <tt>ExtractMPM</tt> on a file from the <tt>Results</tt> folder with the following command line:
<pre>ExtractMPM -V -q sxx -q velx -q dispx -n Example -o TwoSpheres spheres.264
<pre>ExtractMPM -V -q sxx -q velx -q dispx -s -o TwoSpheres disksUSAVG.*
</pre>
</pre>
This command will extract particle data (with the listed quantites) to a series of VTK files names "<tt>TwoSpheres_#.vtk</tt>" where "#" is the step number. The <tt>-s</tt> option is needed to get the step number in the file name, which ParaView uses to correctly order the results.


<li>Run ParaView
<li>Run ParaView, open the block of saved VTK files, and click "Apply" in the object inspector to load. The files will be read, but nothing will be plotted yet.
 
<li>To see the particles, click or use menu command to add Glyphs. Then in its object inspector, enter Radius = 1.25 ( which 1/4 of the 5 mm cell size, use a different Glyph size if you have changed the cell size of this example).


</pre>
<li>Download, install, and run <a href="htpp://www.paraview.org">ParaView</a>. Use it to open the <code>TwoSpheres.vtk</code> file created by the above extraction. Then:
<ul>
<li>Click &quot;Apply&quot; in the object inspector.
<li>Click or use menu command to add Glyphs.
<li>Select Glyph Type &quot;Sphere.&quot;
<li>Enter Radius = 1.25 (1/4 of the 5 mm cell size).
<li>Scroll down, click to "Edit Scale" and edit it to be 1.
<li>Scroll down, click to "Edit Scale" and edit it to be 1.
<li>Click &quot;Apply&quot; to get the particle plot
 
</ul>
<li>Scroll down and change "Maximum Number of Points" to be 10000 (or some number larger than the number of material points in the simulation).
 
<li>Click "Apply" to get the particle plot.
 
</ol>
</ol>


<p>You should have gotten a plot of two spheres in contact. You can explore all the <a href="http://www.paraview.org">ParaView</a> options for ways to visualize the results. You can color by any of the properties extracted to the file. If you extract multiple files and load them all into <a href="http://www.paraview.org">ParaView</a>, you can animate the results. When extracting results from multiple files in a single simulation, you should use the <code>-s</code> option to include step number in the file name. This method insures that <a href="http://www.paraview.org">ParaView</a> will read the files in the correct order.
You should have gotten a plot of two spheres in contact. You can explore all the ParaView options for ways to visualize the results. You can color by any of the properties extracted to the file. You can animate the results with the movie controls.
</p>

Revision as of 10:45, 2 January 2014

ParaView is free andadvanced software with many options for visualization, especially when doing 3D calculations.

Getting Started with ParaView

This section gives the basic steps needs to start using ParaView to visualize material point method output for NairnMPM.

  1. Download and install ParaView. It is available for many platforms and can run in parallel (hence the name) if installed on a multiprocessor system or cluster of computers.
  2. Run from NairnMPM calculations that use the VTKArchive Custom Task to save results as VTK legacy files. Save the quantties you might want to plot and one of them should be mass (because it is used in many plot options)
  3. Run ParaView, choose the open command and select the block of VTK legacy files that were just created. The files will be found in the archived results folder with the naming stlye "MPM_#.vtk" where "MPM" is the root name you used for the calculation's archived files and "#" is the step number. ParaView will let you select these as a block to open them all at once, or expand the block and select a single file. You need to open as a block to get movies of results.
  4. ParaView does not actually read files when they are opened. To read them, click the "Apply" button in the object inspector. When it is done reading, a wire frame surroinding the analysis space should appear in the plot area, but still not plot.
  5. These are numerous types of plots you can create. To try one, click the "Contour" icon. In the object inspector, set it to countour by mass. In the isosurfaces section, set the contour value to some number less than the maximum mass. The optimal value will depend on the structure of your model. You need a lowed number to visualize porous objects or a higher number for solid objects. You can also add several numbers to create contours at several values of mass.
  6. Finally, use the "Coloring" menu (in tool bar or in object inspector) to choose archived component to apply color the the mass surface. If you pick a tensor or vector, you can pick which component to use in the second menu.
  7. If you loading the VTK files as a block, you can use the movies controls to animate the results.

These instructions gets just one time of plot. Once you have data in the ParaView, you can explore all its other options for plotting.

Particle Plots in ParaView

Using the VTKArchive Custom Task always gets grid-based plots. By extracting particle data using ExtractMPM, you can also use ParaView to view particle-based plots. Here is an example to get started with particle plots in ParaView:

  1. Run the TwoDisks.fmcmd example in nairn-mpm-fea/NairnMPM/input/Scripted_Input using #analysis$="3D MPM".
  2. Use ExtractMPM on a file from the Results folder with the following command line:
    ExtractMPM -V -q sxx -q velx -q dispx -s -o TwoSpheres disksUSAVG.*
    

    This command will extract particle data (with the listed quantites) to a series of VTK files names "TwoSpheres_#.vtk" where "#" is the step number. The -s option is needed to get the step number in the file name, which ParaView uses to correctly order the results.

  3. Run ParaView, open the block of saved VTK files, and click "Apply" in the object inspector to load. The files will be read, but nothing will be plotted yet.
  4. To see the particles, click or use menu command to add Glyphs. Then in its object inspector, enter Radius = 1.25 ( which 1/4 of the 5 mm cell size, use a different Glyph size if you have changed the cell size of this example).
  5. Scroll down, click to "Edit Scale" and edit it to be 1.
  6. Scroll down and change "Maximum Number of Points" to be 10000 (or some number larger than the number of material points in the simulation).
  7. Click "Apply" to get the particle plot.

You should have gotten a plot of two spheres in contact. You can explore all the ParaView options for ways to visualize the results. You can color by any of the properties extracted to the file. You can animate the results with the movie controls.