ParaView
ParaView is free and advanced software with many options for visualization, especially when doing 3D calculations.
Getting Started
This section gives the basic steps needed to start using ParaView to visualize material point method output from NairnMPM.
- 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.
- Run someNairnMPM calculations. You have two options for visualizing results in ParaView:
- 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 included "size" in the archived results. These VTK files can be used create particle plots.
- 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 grid plots.
- 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 the archived results folder for your simulation and will have the root name you choose when exporting the files. Those created by a VTKArchive Custom Task will also be in the 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. If you used VTKArchive Custom Task to archive results for a single material type, the fille name will change to "MPM_mat_#_#.vtk" where the first number is a material 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.
- 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. The 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. Once have one of these plots visible, you can explore all the ParaView options for more ways to visualize the results.
Particle Plots in ParaView
By extracting particle data 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:
- Open the exports particle VTK files in ParView (as described above)
- Choose icon to add "Glyph" in the tool bar (it is also in the "Filters" menu along with many more options)
- In the "Glyph Properties" window, make the following settings:
- Set "Glyph Type" to box or sphere (other options normally do not make sense)
- Set "Orientation Array" to "No Orientation Array" (otherwise boxes might rotate)
- 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"
- Once 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.
- Choose simulation result to plot from menu in second row of tool bars. (for [#Vector and Tensor Plotting|tensor or vector quantities]], choose the component to plot from the second menu).
Particle Plots using Point Gaussians
To plot using point sprites (which might be faster than glyphs but has few options), do the following:
- Open the exports particle VTK files in ParView (as described above)
- In properties for the opened files
- Choose "Point Gaussian" from the "Representation" menu
- Choose simulations result to plot from the "Coloring" menu (for [#Vector and Tensor Plotting|tensor or vector quantities]], choose the component to plot from the second 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 glyph plots instead.
- 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
By saving simulations results using VTKArchive Custom Task, you can get grid plot in ParaView. One type of mesh plot is to create contours based on one output variable and color the surface by another one.
- Open the VTK files save by a VTKArchive Custom Task. If you did not include this custom task when running the simulation, you will have to add it and run again. If cannot be exported from prior simulations. Once opened, you should get a wire frame showing extent of the grid.
- Choose icon to add a "Contour" in the tool bar (it is also in the "Filters" menu along with many more options)
- In the "Contour Properties" window make the following settings
- Set "Contour By" to 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.
- Once all settings are made, click "Apply" to get the plot (often ParaView does nothing when you change something until you click "Apply"). Once you have a plot, you can click and drag with mouse to change the viewing position.
- Choose simulation result to plot from menu in second row of tool bars. (for tensor or vector quantities, choose the component to plot from the second menu).
Vector and Tensor Plotting
Archived vectors will include all components of the vector and ParaView can view the magnitude or any single component for constructing graphics. Archived tensors will include all components of the tensor. In ParaView, the magnitude and components 0 through 8 of tensors will be listed. The numbers correspond to the following tensor components:
( xx xy xz ) ( 0 1 2 ) | yx yy yz | = | 3 4 5 | ( zx zy zz ) = ( 6 7 8 )
The magnitude appears to square all terms, add, and take the square root. In is generalize of vector length to a second-rank tensor.