Difference between revisions of "ParaView"

From OSUPDOCS
Jump to navigation Jump to search
Line 29: Line 29:
## Set "Scale Array" to "meansize" and "Scale Factor" to 2 (because archive mean size is particle radius). If you did not archive particle size and export it to the particle VTK files, the "meansize" will not be available. In this case, set "Scale Array" to "No Scale Array" and set "Scale Factor" to half the grid size. This approach only works when all particle are the same size.
## Set "Scale Array" to "meansize" and "Scale Factor" to 2 (because archive mean size is particle radius). If you did not archive particle size and export it to the particle VTK files, the "meansize" will not be available. In this case, set "Scale Array" to "No Scale Array" and set "Scale Factor" to half the grid size. This approach only works when all particle are the same size.
## Set "Glyph Mode" to "All Points"
## Set "Glyph Mode" to "All Points"
# Use all settings are made, click "Apply" to get the plot (often ParaView does nothing when you change something until you click "Apply")
# Use all settings are made, click "Apply" to get the plot (often ParaView does nothing when you change something until you click "Apply"). Sometimes nothing appears (especially in Windows), but can be fixed by clicking view direction icon (right side of the second-row tool bar). Once you have a plot, you can click and drag with mouse to change the viewing position.


You should have gotten a plot showing all material points. You can explore all the ParaView options for ways to visualize the results. For example, you can color by any of the properties exported to the VTK files, create cropping planes, animate the results with the movie controls, or plot different style Glyphs at each material point.
You can explore all the ParaView options for more ways to visualize the results. For example, you can color by any of the properties exported to the VTK files, create cropping planes, animate the results with the movie controls, or plot different style Glyphs at each material point.


=== Particle Plots using Point Gaussians ===
=== Particle Plots using Point Gaussians ===


To plot using point sprites, do the following:
To plot using point sprites (which might be faster than glyphs but has few options), do the following:


<ol>
# Open the exports particle VTK files in ParView (as described above)
 
# In properties for the opened files
<li>In the opened file, choose "Point Gaussian" from the "Representation" menu.
## Choose "Point Gaussian" from the "Representation" menu
 
## Set the "Gaussian Radius" to about 2/3 the particle size (usually about 1/3 grid size). Note that this plot style only works when all particles have the same size. To handle variable size particles use [[#Particle Plots using Glyphs|glyph plots]] instead.
<li>For best results, set the radius to a constant radius and enter particle size (usually half the background grid element length)..
# When settings are done, you should see a plot. Sometimes nothing appears (especially in Windows), but can be fixed by clicking view direction icon (right side of the second-row tool bar). Once you have a plot, you can click and drag with mouse to change the viewing position.
 
<li>Also set opacity to constant value of one (or to some custom value if desired). By editing the color map, you can enable opacity mapping to threshold various points based on their plotted value.
 
<li>Set coloring to the calculation result you want to visualize.
 
</ol>


== Mesh Plots ==
== Mesh Plots ==

Revision as of 14:54, 28 January 2022

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

Getting Started

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 someNairnMPM calculations. You have two options for visualizing results in ParaView:
    1. After a simulation is done, use the "Export Particle VTKs..." option to extract results of any simulation to particle VTK files. Include the data you want to visualize. it works best if you include "meansize" which means the simulation include "size" in the archived results. These VTK files can be used create particle plots.
    2. Include the VTKArchive Custom Task to save results as VTK legacy files. Save the quantities you might want to plot and one of them should be mass (because it is used in many plot options). These VTK files can be used to create mesh plots.
  3. To open either type of VTK files in ParaView, choose the open command and select a block of VTK legacy files. Those exported as particle VTKs will be in the results folder for you simulations and have the root name you choose when exporting the files. The created by a VTKArchive Custom Task will also be int archived results folder with the naming style "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 such files as a block and will open them all at once. Alternatively, you can 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

Once opened, you have many plotting options available. They available options will depend of if you opened particle VTK files or grid-based VTK files. The following sections gives to steps to get started with plotting.

Particle Plots in ParaView

By extracting particle to VTK files (either using the "Export Particle VTKs..." option in NairnFEAMPM or in NairnFEAMPMViz or by running ExtractMPM on a command line), you can also use ParaView to view particle-based plots. This section gives to examples to get started with particle plots.

Particle Plots using Glyphs

The most advanced particle plots use glyphs. Here is an some steps to get started:

  1. Open the exports particle VTK files in ParView (as described above)
  2. Choose icon to add "Glyph" in the tool bar (it is also in the "Filters" menu along with many more options)
  3. In the "Glyph Properties" window, make the following settings:
    1. Set "Glyph Type" to box or sphere (other options normally do not make sense)
    2. Set "Orientation Array" to "No Orientation Array" (otherwise boxes might rotate)
    3. Set "Scale Array" to "meansize" and "Scale Factor" to 2 (because archive mean size is particle radius). If you did not archive particle size and export it to the particle VTK files, the "meansize" will not be available. In this case, set "Scale Array" to "No Scale Array" and set "Scale Factor" to half the grid size. This approach only works when all particle are the same size.
    4. Set "Glyph Mode" to "All Points"
  4. Use all settings are made, click "Apply" to get the plot (often ParaView does nothing when you change something until you click "Apply"). Sometimes nothing appears (especially in Windows), but can be fixed by clicking view direction icon (right side of the second-row tool bar). Once you have a plot, you can click and drag with mouse to change the viewing position.

You can explore all the ParaView options for more ways to visualize the results. For example, you can color by any of the properties exported to the VTK files, create cropping planes, animate the results with the movie controls, or plot different style Glyphs at each material point.

Particle Plots using Point Gaussians

To plot using point sprites (which might be faster than glyphs but has few options), do the following:

  1. Open the exports particle VTK files in ParView (as described above)
  2. In properties for the opened files
    1. Choose "Point Gaussian" from the "Representation" menu
    2. Set the "Gaussian Radius" to about 2/3 the particle size (usually about 1/3 grid size). Note that this plot style only works when all particles have the same size. To handle variable size particles use glyph plots instead.
  3. When settings are done, you should see a plot. Sometimes nothing appears (especially in Windows), but can be fixed by clicking view direction icon (right side of the second-row tool bar). Once you have a plot, you can click and drag with mouse to change the viewing position.

Mesh Plots

Using the VTKArchive Custom Task allows you create mesh plots.

One type of mesh plot is to create contours based on one output variable and color the surface by another one.

it is done reading, a wire frame surrounding the analysis space should appear in the plot area, but still nothing is plotted.

  1. There are numerous types of mesh plot options. To try one, click the "Contour" icon. In the object inspector, set it to contour 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 lower 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.
  2. 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.
  3. If you loaded the VTK files as a block, you can use the movies controls to animate the results.