VTKArchive Custom Task
A custom task to archive grid results to a series of "VTK Legacy" files.
A VTKArchive custom task allows exporting of data extrapolated to the grid during the calculation. The standard archiving is based on particle data. This task's alternative to get grid data is most useful for visualization of results from 3D calculations. The files can be read by third-party visualization applications. A good option is the free, multi-platform ParaView application. The exported files have been written to work well with ParaView. If you export multiple archives in a single run, ParaView can load them as a block and animate the results. There are books and [web sites] on the use of ParaView and few examples of using with NairnMPM.
In scripted files, a VTKArchive custom task is scheduled using
CustomTask VTKArchive Parameter archiveTime,(timeInterval) Parameter firstArchiveTime,(firstTime) Parameter (quantity) . . .
In XML files, this tasks is scheduled using a Schedule element, which must be within the single <CustomTasks> block:
<Schedule name='VTKArchive'> <Parameter name='archiveTime'>(timeInterval)</Parameter> <Parameter name='firstArchiveTime'>(firstTime)</Parameter> <Parameter name='(quantity)'/> . . . </Schedule>
where the first two parameters, both of which are optional, are
- (timeInterval) - Enter the time interval (in alt time units) between saving of VTK archives. If this parameter is omitted, the VTK archive files are written on the same steps as the particle archives. The one difference is that the first particle archive file is written before the calculations start while the first VTK archive file is written after the first time step is completed.
- (firstTime) - Enter the time to save the first results (in alt time units). After this time is reached, subsequent archives will be spaced by the entered (timeInterval) This parameter is ignored unless the (timeInterval) parameter is set as well.
When first setting up calculations, it is useful to create the grid and particles and check them before running a long calculation. When checking the mesh using particle archives, the process is to run the calculations with the -a flag, which aborts the calculations after setup but before the start. If you want to check the setup using VTK archives, however, this abort will happen before the first VTK archive is written. The solution is run with a very small maximum time (less than the time step). The calculations will then stop after the first time step and the first VTK archive file will be available for visualization.
All remaining parameters define a calculation value (by name in (quantity)) to be archived. You can specify any number of quantities to include as manuy results as you want in the output VTK files. The (quantity) options are:
- mass - Archive nodal mass (in mass units). This option is useful for creating contours that visualize the boundaries of the object. The surface can then be colored in any other archived result.
- material - The material number to visualize different materials in a composite (it is extrapolated to the grid, which will blur material edges compared to particle plots).
- displacement - Archive displacement vector (in length units).
- velocity - Archive velocity vector (in velocity units). For problems with cracks, it is the center of mass velocity.
- stress - Archive stress tensor (in pressure units).
- pressure - Archive pressure (in pressure units).
- equivstress - Archive equivalent stress (also know as von Mises stress) (in pressure units).
- defgrad - the deformation gradient (absolute)
- totalstrain - Archive total Biot strain tensor (absolute).
- elasticstrain - Archive elastic Biot strain tensor (absolute, can be "strain" as well).
- plasticstrain - Archive plastic Biot strain tensor, which is total strain minus elastic strain for plasticity materials (absolute)
- deltav - Archive relative volume change (V-V0)/V0 (absolute).
- equivstrain - Archive equivalent strain from above strain (absolute).
- temperature - Archive temperature (in K). Mostly useful when conduction calculations are activated.
- concentration - Archive concentration (in wt %). Only useful when diffusion calculations are activated.
- strainenergy - Archive strain energy in energy units.
- heatenergy - Archive heat energy in energy units.
- plasticenergy - Archive plastic energy (in energy units).
- contactforce - Nodal force on the grid for MultiMaterialMode simulations when they include rigid contact materials. It is force of the rigid material on the object in force units.
- volumegradient (mat) - The volume gradient for material (mat) on the nodes. This gradient is used in contact calculations. The gradient vectors can be visualized in software (e.g., in ParaView). The (mat) is required and specified by material ID in scripted input files, but must be by material number in XML input files.
- numpoints - The number of material points that extrapolate to a node.
When archiving of strain tensors, they are calculated as a Biot strain in the current configuration. The Biot strain is defined is V-I where V is the left-stretch tensor. This strain is also the Seth-Hill strain with m=1/2 in current configuration. For small strain problems it is equivalent to the small strain tensor.
Visualizing Volume Gradient Vectors
If you save volume gradient for some materials, you can visualize them as vectors in ParaView by using arrow glyphs. The basic process is:
- Open the stack of vtk files saved by this custom tasks in ParaView and click apply.
- To see the grid, "Solid Color" and "Wireframe" (being sure to click apply when needed).
- Click "Glyph" icon to add Glyph option to the pipe line, set its properties (clicking apply after each property change). The key properties are:
- Vectors: select the volume gradient to plot (by material number)
- Scaling: set scale mode to "vector" and adjust "scale factor" for good size arrows (1 appears good).
- Coloring: decide how to color the arrows
- Masking: select "All Points" (otherwise only selected arrows will get plotted)
For volume gradients to work well with contact calculations, they should be vectors normal to the surface of any materials an pointing out of the material.
Archived vectors will include all components of the vector and applications like 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 )