Difference between revisions of "ParaView"
Line 9: | Line 9: | ||
## After a simulation is done, use the "Extract 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. | ## After a simulation is done, use the "Extract 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. | ||
## 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. | ## 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. | ||
# To open either type of VTK files in ParaView, choose the open command and select the block of VTK legacy files that were just created by a [[VTKArchive Custom Task]]. The files will be found 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. 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. | |||
# ParaView does not actually read files when they are opened. To read them, click the "Apply" button in the object inspector. When | |||
These instructions gets simple examples for plotting in ParaView. Once you have data in the ParaView, you can explore all its other options for plotting. | |||
== Particle Plots in ParaView == | |||
By extracting particle data using [[ExtractMPM]], you can also use ParaView to view particle-based plots. The best way to extract particle VTK files is to use the "Extract Particle VTKs..." option in [[NairnFEAMPM]] or in [[NairnFEAMPMViz]]. Alternativelym you can manually rung [[ExtractMPM]] on a command line. Once to have particle VTK files, you have two options for particle plots: plot glyphs or plot point sprites at each material point.Glyphs are better and have more options. Point sprites are simple and might be faster. | |||
== Particle Plots | === Particle Plots using Glyphs === | ||
To plot particles with glyphs, do the following: | |||
<ol> | <ol> | ||
<li> | <li>To see the particles, click or use menu command to add Glyphs.</li> | ||
<li> | <li>Then in the glyph object inspector: | ||
< | <ul> | ||
</ | <li>Set "Glyph Type" to box or sphere (whichever you prefer)</li> | ||
<li>Set "Orientation Array" to "No Orientation Array" (otherwise boxes might rotate)</li> | |||
This | <li>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 extract it to the VTK file, 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.</li> | ||
<li>Set "Glyph Mode" to "All Points"</li> | |||
<li> | </ul> | ||
<li>Click "Apply" to get the particle plot. | |||
</ol> | </ol> | ||
You | You should have gotten a plot of two spheres which each particle plotted as a small sphere. You can explore all the ParaView options for ways to visualize the results. For example, you can color by any of the properties extracted to the file, 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 === | ||
Line 57: | Line 54: | ||
</ol> | </ol> | ||
== 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. | |||
# 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. | |||
# 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. | |||
# If you loaded the VTK files as a block, you can use the movies controls to animate the results. | |||
Revision as of 12:55, 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.
- 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 "Extract 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.
- 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.
- To open either type of VTK files in ParaView, choose the open command and select the block of VTK legacy files that were just created by a VTKArchive Custom Task. The files will be found 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. 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.
- ParaView does not actually read files when they are opened. To read them, click the "Apply" button in the object inspector. When
These instructions gets simple examples for plotting in ParaView. Once you have data in the ParaView, you can explore all its other options for plotting.
Particle Plots in ParaView
By extracting particle data using ExtractMPM, you can also use ParaView to view particle-based plots. The best way to extract particle VTK files is to use the "Extract Particle VTKs..." option in NairnFEAMPM or in NairnFEAMPMViz. Alternativelym you can manually rung ExtractMPM on a command line. Once to have particle VTK files, you have two options for particle plots: plot glyphs or plot point sprites at each material point.Glyphs are better and have more options. Point sprites are simple and might be faster.
Particle Plots using Glyphs
To plot particles with glyphs, do the following:
- To see the particles, click or use menu command to add Glyphs.
- Then in the glyph object inspector:
- Set "Glyph Type" to box or sphere (whichever you prefer)
- 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 extract it to the VTK file, 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"
- Click "Apply" to get the particle plot.
You should have gotten a plot of two spheres which each particle plotted as a small sphere. You can explore all the ParaView options for ways to visualize the results. For example, you can color by any of the properties extracted to the file, 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, do the following:
- In the opened file, choose "Point Gaussian" from the "Representation" menu.
- For best results, set the radius to a constant radius and enter particle size (usually half the background grid element length)..
- 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.
- Set coloring to the calculation result you want to visualize.
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.
- 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.
- 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.
- If you loaded the VTK files as a block, you can use the movies controls to animate the results.