Difference between revisions of "ExtractMPM"
(Created page with "A tool to extract data for MPM output files for visualization in other tools.") |
|||
(85 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== ExtractMPM Tool == | |||
The main visualization tools ([[NairnFEAMPM]] and [[NairnFEAMPMViz]]) have many visualization options, but may not have what you need. For 3D visualization, the options are more limited and [[NairnFEAMPMViz]] has very few options for visualizing 3D results. The purpose of the ExtractMPM tool is to read [[NairnMPM]] binary [[Archive File Formats|archive files]], extract selected results, and write them to text, binary or <tt>XML</tt> files. These new files can serve as input to alternative visualization tools or alternative software for interpreting the data. | |||
== Compiling ExtractMPM == | |||
The first step is to compile the ExtractMPM command-line tool. On MacOS X or Windows, you can compile ExtractMPM using its target in the XCode or Visual Studio projects found in the <tt>nairn-mpm-fea/Common/Projects</tt> folder. On any other system (or alternatively in MacOS X), you can compile by changing directory to the <tt>nairn-mpm-fea/NairnMPM/tools</tt> directory and use the command | |||
make ExtractMPM SYSTEM=(system) | |||
where <tt>(system)</tt> defines the system being used. This option mainly picks path to the <tt>c++</tt> compiler on your computer. For unsupported systems, you can manually set the path to that compiler using | |||
make ExtractMPM CC=/usr/local/gcc48/bin/g++ | |||
Other options that can be passed to the <tt>make</tt> command are | |||
* <tt>CFLAGS</tt> - options passed to compiler (default: <tt>-c -O3</tt>) | |||
* <tt>LFLAGS</tt> - options during linking step (default: none) | |||
Other <tt>make</tt> functions are: | |||
make | |||
make clean | |||
make install | |||
A <tt>make</tt> by itself will compile all tools (and not just ExtractMPM). The <tt>clean</tt> option will delete compiled objects and executables for all tools. The <tt>install</tt> option will copy all compiled tool executables to an install folder. The default install location is <tt>~/bin</tt> but that can be changing by adding <tt>ioutput=(new folder)</tt> to the <tt>make</tt> command. | |||
== Using Extract MPM == | |||
ExtractMPM is most conveniently run by using the "Export Particle VTKs" options in [[NairnFEAMPM]] or in [[NairnFEAMPMViz]]. The help information in those applications gives more details. Alternatively, you can run the ExtractMPM directly on a command line with | |||
ExtractMPM [-hdDfFTXVsHPC] [-m num] [-M num] [-q data] [-n text] [-o path] archive0 archive1 ... | |||
ExtractMPM reads the [[NairnMPM]] binary archive files in <tt>archive0</tt>, <tt>archive1</tt>, <i>etc.</i>, extracts the data selected by the options, and outputs it all to standard output or to file(s) specified in the options. The flags and their descriptions, grouped by subject, are: | |||
=== Exported Data === | |||
<dl> | |||
<dt><b>-q</b> <u>data</u> | |||
<dd>When exporting particle data, the output always includes particle position (<tt>x</tt>, <tt>y</tt>, and <tt>z</tt> (for 3D)), but can include additional data for each <b>-q</b> option. The allowed quantities for particle data are: | |||
<ul> | |||
<li><tt>mat</tt> for material number</li> | |||
<li><tt>mass</tt> for particle mass (in g)</li> | |||
<li><tt>velx</tt>, <tt>vely</tt>, and <tt>velz</tt> for component of velocity vector (in mm/sec)</li> | |||
<li><tt>velocity</tt> for all three components of velocity. For VTK files, they will be output as a vector quantity (in mm/sec)</li> | |||
<li><tt>dispx</tt>, <tt>dispy</tt>, and <tt>dispz</tt> for component of displacement vector (in mm)</li> | |||
<li><tt>displacement</tt> for all three components of displacement. For VTK files, they will be output as a vector quantity (in mm)</li> | |||
<li><tt>sxx</tt>, <tt>syy</tt>, <tt>szz</tt>, <tt>sxy</tt>, <tt>sxz</tt>, and <tt>syz</tt> for a component of the stress tensor (in Pa)</li> | |||
<li><tt>stress</tt> for all 6 components of the stress tensor. For VTK files, they will be output as a tensor quantity with 9 elements of the stress tensor (in Pa)</li> | |||
<li><tt>pressure</tt> for pressure (in Pa)</li> | |||
<li><tt>vonmises</tt> for von Mises (or equivalent) stress (= sqrt(3 J2)) (in Pa)</li> | |||
<li><tt>exx</tt>, <tt>eyy</tt>, <tt>ezz</tt>, <tt>exy</tt>, <tt>exz</tt>, and <tt>eyz</tt> for a component of the strain tensor, which is elastic strain for plasticity materials (absolute)</li> | |||
<li><tt>strain</tt> for all 6 components of the strain tensor. For VTK files, they will be output as a tensor quantity with 9 elements of the strain tensor (absolute)</li> | |||
<li><tt>pexx</tt>, <tt>peyy</tt>, <tt>pezz</tt>, <tt>pexy</tt>, <tt>pexz</tt>, and <tt>peyz</tt> for a component of the plastic strain tensor (absolute)</li> | |||
<li><tt>plasticstrain</tt> for all 6 components of the plastic strain tensor. For VTK files, they will be output as a tensor quantity with 9 elements of the plastic strain tensor (absolute). But note that not all materials store plastic strain the archive files. For example, [[Material_Models#Hyperelastic-Plastic_Materials|Hyperelastic-Plastic_Materials]] store the elastic, left-Cauchy green strain. This quantity will extract the values stored in the archive.</li> | |||
<li><tt>angz</tt>, <tt>angy</tt>, <tt>angx</tt> for initial rotation angles (in degrees) between material axes and initial configuration (R<sub>0</sub> = R<sub>z</sub>R<sub>y</sub>R<sub>x</sub>); only <tt>angz</tt> is available for 2D results. These values never change are thereore are mostly used to confirm you set orientation of anisotropic materials correctly. | |||
<li><tt>xmat</tt>, <tt>ymat</tt>, <tt>zmat</tt> for unit vectors in the current material x, y, or z axes, which may rotate during a simulations (material axes start aligned with the grid unless rotated when creating the material points). Plotting glyphs oriented by these vectors can be used to visualization material directions in [[ParaView]] (and sometimes helps other visualizations too). Dot products of these vectors with global axes gives current material angle to that direction. <tt>u.σ.v</tt>, where <tt>u</tt> and <tt>v</tt> is two of these unit vectors gives normal stress (when <tt>u=v</tt> or shear stress when <tt>u≠v</tt>) in material coordinates (since version 2). | |||
<li><tt>meansize</tt> to output mean size of particles. Scaling plot features by this size (such as glyphs in [[ParaView]]) can better represent the size of material points in the graphics (since version 2). | |||
<li><tt>equivstrain</tt> for equivalent strain (= sqrt(2/3)|'''s'''| where '''s''' is deviatoric strain tensor from elastic strain only) (absolute)</li> | |||
<li><tt>strerg</tt> for strain energy (in J)</li> | |||
<li><tt>work</tt> for work energy (in J)</li> | |||
<li><tt>heat</tt> for heat energy (in J)</li> | |||
<li><tt>plerg</tt> for plastic energy (in J)</li> | |||
<li><tt>temp</tt> for temperature (in K)</li> | |||
<li><tt>conc</tt> for concentration (in wt %)</li> | |||
<li><tt>hist#</tt> for history variable where <tt>#</tt> can be from 1 to 19</li> | |||
</ul> | |||
<tt>XML</tt> file output always includes <tt>mat</tt> and can include <tt>mass</tt>; they currently cannot include <tt>stress</tt> or <tt>strain</tt>.<br> | |||
When exporting crack particle data (<tt>-C</tt> option), the output always includes crack position and the crack number, but can include additional data for each <b>-q</b> option. The allowed quantities for crack particle data are: | |||
<ul> | |||
<li><tt>J1</tt> and <tt>J2</tt> for crack tip J integral terms | |||
<li><tt>KI</tt> and <tt>KII</tt> for crack tip stress intensity factors | |||
<li><tt>czm1</tt> and <tt>czm2</tt> for dissipated mode I or mode II energy per unit area of a crack particle with a cohesive zone</li> | |||
<li><tt>tract#</tt> for traction history variable where <tt>#</tt> can be from 1 to 10</li> | |||
</ul> | |||
<tt>XML</tt> file output only includes crack particle positions and the tip material ID (1 based) if available in the archive file; they currently cannot include these extra crack archived properties. | |||
<br> | |||
Any requested particle or crack quantity not in the archive file will be output as zero. Entering an invalid quantity name will cause an error. | |||
<dt><b>-m</b> <u>num</u> | |||
<dd>Omit data for particles with material number <u>num</u>. More than one use can remove multiple material types. | |||
<dt><b>-M</b> <u>num</u> | |||
<dd>Include data for particles with material number <u>num</u>. More than one use can include multiple material types. If no <b>-M</b> options are used, then all materials are included. A material that is both included and excluded, will be excluded. | |||
<dt><b>-P</b> | |||
<dd>Specify to export particle data only. Because particle data export is the default assumption, this option is normally not needed. The selected quantities should be only particle properties. | |||
<dt><b>-C</b> | |||
<dd>Specify to export crack particle data only. The selected quantities should be only crack particle properties. | |||
<dt><b>-h</b> | |||
<dd>Include a header at the beginning of the file. The header has text that describes the content of the file. Each line begins with a key word. The text after the space is the setting for that keyword. The possible keywords are | |||
<ul> | |||
<li>Name - optional text if the <b>-n</b> options is used | |||
<li>Source - name of the input archive file | |||
<li>Data - space delimited list of columns in the output | |||
<li>Included_Materials - space delimited list of included materials | |||
<li>Excluded_Materials - space delimited list of omitted materials | |||
<li>Format - format of the output numbers (<tt>text</tt>, <tt>xml</tt>, <tt>double</tt>, <tt>float</tt>) | |||
<li>Endian - for binary output will be <tt>little</tt> or <tt>big</tt>. | |||
<li>EndHeader - last line of the header | |||
</ul> | |||
The header ends with the line feed character (<tt>0x0A</tt>) after <tt>EndHeader</tt>. For binary files, the header is padded to be a multiple of 8 | |||
bytes long. For VTK Legacy files, the name (if provided) and source will always be output on the second line of the file (<i>i.e</i>, the <b>-h</b> option is not needed). | |||
<dt><b>-n</b> <u>text</u> | |||
<dd>The text defines a title or any brief comment about the extracted file. It is output in the header, but only if the <b>-h</b> option is used. For text with spaces, include it in quotes. For VTK Lagacy files it is output on the second line of the file. | |||
</dl> | |||
=== Exported File Name === | |||
<dl> | |||
<dt><b>-o</b> <u>path</u> | |||
<dd>The output will be to standard output unless an output file path is specified in this option. The output file should not include an extension because one will be generated automatically based on the selected file type. When multiple archive files are extracted in a single command, the output | |||
files will add an index number to this specified output file name for each additional file (unless this default index number is overridden by the <tt>-s</tt> option). | |||
<dt><b>-s</b> | |||
<dd>Include the step number in the output file name. <tt>NairnMPM</tt> archive files should have the step number as an extension. For example, if you are extracting data to a text file with root name <tt>ParticleData</tt> from archive file named <tt>archive.323</tt> while using the <tt>-s</tt> option, the extracted file name will be <tt>ParticleData_323.txt</tt>. When extracting multiple files, inclusion of a step number will override the default index number (see <tt>-o</tt> option). If two of the multiple files have the same step number, the second one will overwrite the first. This problem will never occur when extracting from multiple files resulting from a single simulation. | |||
</dl> | |||
=== Exported File Format === | |||
<dl> | |||
<dt><b>-T</b></dt> | |||
<dd>Output as tab-delimited text file (extension <tt>.data</tt>). This option is the default output mode unless overridden by those below: <b>-V</b>, <b>-U</b>, <b>-X</b>, <b>-d</b>, <b>-D</b>, <b>-f</b>, or <b>-F</b>.</dd> | |||
<dt><b>-V</b> | |||
<dd>These both out as a VTK Legacy file suitable for reading in visualization tools such as [[ParaView]] or [[VisIt]]. The file can have particle data or only crack data (with the <tt>-C</tt> option). Note the separate particle data and crack data files can be opened simultaneously in [[ParaView]] or [[VisIt]] to view them together (or to toggle one off for clarity). Particle data will export as a POLYDATA style VTK file (which limits visualization to point-based methods). Crack data, however, will export as an UNSTRUCTURED_GRID style VTK file (but, if 3D cracks cannot access facet information, they will export instead as a POLYDATA style VTK file) (extension <tt>.vtk</tt>).</dd> | |||
<dt><b>-U</b></dt> | |||
<dd>This option is identical to <tt>-V</tt> except will export particle data as an UNSTRUCTURED_GRID style VTK file. Each material point will be a cell in the VTK data and the cell will be deformed to match the current deformation of that particle. This type of file improves quality of the visualization. The two drawbacks are: | |||
<ol> | |||
<li>You cannot use this option unless the simulation archived both strain and size, which are needed to deform the particle (see [[MPM Archiving Options]])</li> | |||
<li>The files are much larger, but it appears visualization features in [[ParaView]] and [[VisIt]] are somewhat faster.</li> | |||
</ol> | |||
This option can be used for crack data too, but is equivalent to a crack export using <b>-V</b> (extension <tt>.vtk</tt>). (Since version 2).</dd> | |||
<dt><b>-X</b></dt> | |||
<dd>Output an XML file, but see [[#XML File Extractions|below]] for details. These files are intended for input to new calculations (extension <tt>.xml</tt>).</dd> | |||
<dt><b>-d</b></dt> | |||
<dd>Output as little Endian binary file with double precision numbers (extension <tt>.data</tt>)</dd> | |||
<dt><b>-D</b></dt> | |||
<dd>Output as big Endian binary file with double precision numbers (extension <tt>.data</tt>)</dd> | |||
<dt><b>-f</b></dt> | |||
<dd>Output as little Endian binary file with single precision numbers or floats (extension <tt>.data</tt>)</dd> | |||
<dt><b>-F</b></dt> | |||
<dd>Output as big Endian binary file with single precision numbers or floats (extension <tt>.data</tt>)</dd> | |||
<dt><b>-Z</b></dt> | |||
<dd>Output as a custom binary file, which if not of general use and cannot export crack data (extension <tt>.xyz</tt>)</dd> | |||
</dl> | |||
=== Other Commands === | |||
<dl> | |||
<dt><b>-H</b> | |||
<dd>Print synopsis of ExtractMPM (and version number) along with brief descriptiosn of all options and variables. | |||
</dl> | |||
=== Deprecated Commands === | |||
The following commands are only needed for very old archive files. They can be ignored for all result archive files. | |||
<dl> | |||
<dt><b>-b</b> <u>format</u> | |||
<dd>Specify the archive <u>format</u> of the file. Only needed for ver3 archive files. For ver4 archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details. | |||
<dt><b>-c</b> <u>format</u> | |||
<dd>Specify the crack archive <u>format</u> of the file. Only needed for ver3 archive files. For ver4 archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details. | |||
<dt><b>-2</b> | |||
<dd>Specify the archive file as one having 2D results. Because 2D results is the default assumption, this option is normally not needed. | |||
<dt><b>-3</b> | |||
<dd>Specify the archive file as one having 3D results. Only needed | |||
for <tt>ver3</tt> archive files. For <tt>ver4</tt> archive files or newer it is overridden by the file format specified in the [[Archive File Formats#Archive File Header|archive file's header]]. | |||
</dl> | |||
== Examples== | |||
<p>The following examples are shown as given to the shell: | |||
<dl> | |||
<dt><tt>ExtractMPM -h -o positions arch.57</tt> | |||
<dd>Output particle positions from a <tt>ver4</tt> or newer archive file (<tt>arch.57</tt>) to the text file named <tt>positions.txt</tt> with a header at the beginning of the file. | |||
<dt><tt>ExtractMPM -d -b iYYYYNNNNNNNYNNNN -q syy -q szz -o str disks.78</tt> | |||
<dd>Output particle positions and <tt>y</tt>- and <tt>z</tt>-direction normal stress from a <tt>ver4</tt> or newer archive file (disks.78) to a little Endian file of double named <tt>str.data</tt>. | |||
<dt><tt>ExtractMPM -hF -q sxx -M 1 -o strxx disks.*</tt> | |||
<dd>Output particle positions and <tt>x</tt>-direction normal stress from several ver4 archive files (<tt>disks.*</tt>) to a series big Endian files of floats named | |||
<tt>strxx.data</tt>, <tt>strxx_1.data</tt>, <i>etc.</i>, including headers. The output file will include only data from particles for material number 1. | |||
The header will help determine which output file came from which archive file. | |||
<dt><tt>ExtractMPM -hC -o cracks disks.1289</tt> | |||
<dd>Output crack number and crack particle particle positions from a ver4 archive file to a text file <tt>cracks.txt</tt> including a header. The output file will include only crack particle data. | |||
<dt><tt>ExtractMPM -V -q sxx -q velx -q dispx -s -o Output archive.*</tt> | |||
<dd>Extract data for all "archive.#" files in the current folder and write to VTK file with name "Output_#.vtk". These output files can be read by [[ParaView]] for an alternate method of generating [[ParaView#Particle Plots in ParaView|particle based plots]] for any extracted quantity. | |||
</dl> | |||
You only need to specify file formats (in <b>-b</b> and <b>-c</b> options) and dimensionality (in <b>-3</b> option) for <tt>ver3</tt> archive files. These options will be read from the [[Archive File Formats#Archive File Header|header]] of <tt>ver4</tt> or newer files. The version ID of any archive file can be determined by looking at the first 4 bytes of the file. The <tt>ver4</tt> or newer format took effect 25 OCT 2007. See [[Archive File Formats#NairnMPM Output Files|MPM output file format]] information for more details on archive file versions. | |||
Since the archive file format is specified in the command, when extracting from multiple <tt>ver3</tt> archive files in a single command, they must all have the same format. This restriction does not apply when extracting from multiple <tt>ver4</tt> or newer files. | |||
== XML File Extraction To Extend Calculations == | |||
The main use of <tt>XML</tt> file extractions is to restart <tt>NairnMPM</tt> calculations with particle results from a previous calculation. As a result, the <tt>XML</tt> file uses a format intended for defining material points in a <tt>NairnMPM</tt> input commands file. All material points will be in a single <tt><PointList></tt> structure. Each material point in the structure will have the following format: | |||
<PointList> | |||
. . . | |||
<mp matl='1' angle='0' thick='1' wtconc='0' temp='0'> | |||
<pt units='mm' x='1.25' y='-11.25'/> | |||
<vel units='mm/sec' x='0' y='0'/> | |||
<mass m='1e-3'/> | |||
</mp> | |||
. . . | |||
</PointList> | |||
The material number (<tt>matl</tt>), material angle (<tt>angle</tt>, if 2D), thickness (<tt>thick</tt>, if 2D), and position (<tt>pt</tt> element) will always be in the extracted file. To include concentration (<tt>wtconc</tt>) and/or temperature (<tt>temp</tt>), use the <tt>-q conc</tt> and <tt>-q temp</tt> options, respectively. To include the velocity use the <tt>-q velx</tt> option (which will include all components of velocity). To include mass (and you normally should) use a <tt>-q mass</tt> option. Concentration, temperature, and velocity will only appear if they are in the archive file. All other requested quantities (including other components of velocity) will be ignored. | |||
If you only want certain types of material points in the new calculations, use the <tt>-m</tt> or <tt>-M</tt> options to select the desired material types. You can include a header with the <tt>-h</tt> option and it will appear at the beginning of the file in an <tt>XML</tt> comment structure. | |||
Finally, you can use the extracted <tt>XML</tt> file to define all or some of the material points in a new calculation. First, define the path to the new file in an <tt>ENTITY</tt> element in the file's <tt>DOCTYPE</tt> element such as: | |||
<!DOCTYPE JANFEAInput SYSTEM '/full path to/NairnMPM.dtd' | |||
[ | |||
<!ENTITY mpfile "path to/pointlist.xml"> | |||
]> | |||
where <tt>pointlist.xml</tt> is the name of the newly extracted <tt>XML</tt> file. | |||
Then, import that file in the <tt><MaterialPoints></tt> element such as: | |||
<MaterialPoints> | |||
&mpfile; | |||
</MaterialPoints> | |||
In scripted files, the above can be done [[Entity Command|<tt>Entity</tt>]] and [[XMLData Command|<tt>XMLData</tt>]] commands. |
Latest revision as of 13:44, 2 February 2023
ExtractMPM Tool
The main visualization tools (NairnFEAMPM and NairnFEAMPMViz) have many visualization options, but may not have what you need. For 3D visualization, the options are more limited and NairnFEAMPMViz has very few options for visualizing 3D results. The purpose of the ExtractMPM tool is to read NairnMPM binary archive files, extract selected results, and write them to text, binary or XML files. These new files can serve as input to alternative visualization tools or alternative software for interpreting the data.
Compiling ExtractMPM
The first step is to compile the ExtractMPM command-line tool. On MacOS X or Windows, you can compile ExtractMPM using its target in the XCode or Visual Studio projects found in the nairn-mpm-fea/Common/Projects folder. On any other system (or alternatively in MacOS X), you can compile by changing directory to the nairn-mpm-fea/NairnMPM/tools directory and use the command
make ExtractMPM SYSTEM=(system)
where (system) defines the system being used. This option mainly picks path to the c++ compiler on your computer. For unsupported systems, you can manually set the path to that compiler using
make ExtractMPM CC=/usr/local/gcc48/bin/g++
Other options that can be passed to the make command are
- CFLAGS - options passed to compiler (default: -c -O3)
- LFLAGS - options during linking step (default: none)
Other make functions are:
make make clean make install
A make by itself will compile all tools (and not just ExtractMPM). The clean option will delete compiled objects and executables for all tools. The install option will copy all compiled tool executables to an install folder. The default install location is ~/bin but that can be changing by adding ioutput=(new folder) to the make command.
Using Extract MPM
ExtractMPM is most conveniently run by using the "Export Particle VTKs" options in NairnFEAMPM or in NairnFEAMPMViz. The help information in those applications gives more details. Alternatively, you can run the ExtractMPM directly on a command line with
ExtractMPM [-hdDfFTXVsHPC] [-m num] [-M num] [-q data] [-n text] [-o path] archive0 archive1 ...
ExtractMPM reads the NairnMPM binary archive files in archive0, archive1, etc., extracts the data selected by the options, and outputs it all to standard output or to file(s) specified in the options. The flags and their descriptions, grouped by subject, are:
Exported Data
- -q data
- When exporting particle data, the output always includes particle position (x, y, and z (for 3D)), but can include additional data for each -q option. The allowed quantities for particle data are:
- mat for material number
- mass for particle mass (in g)
- velx, vely, and velz for component of velocity vector (in mm/sec)
- velocity for all three components of velocity. For VTK files, they will be output as a vector quantity (in mm/sec)
- dispx, dispy, and dispz for component of displacement vector (in mm)
- displacement for all three components of displacement. For VTK files, they will be output as a vector quantity (in mm)
- sxx, syy, szz, sxy, sxz, and syz for a component of the stress tensor (in Pa)
- stress for all 6 components of the stress tensor. For VTK files, they will be output as a tensor quantity with 9 elements of the stress tensor (in Pa)
- pressure for pressure (in Pa)
- vonmises for von Mises (or equivalent) stress (= sqrt(3 J2)) (in Pa)
- exx, eyy, ezz, exy, exz, and eyz for a component of the strain tensor, which is elastic strain for plasticity materials (absolute)
- strain for all 6 components of the strain tensor. For VTK files, they will be output as a tensor quantity with 9 elements of the strain tensor (absolute)
- pexx, peyy, pezz, pexy, pexz, and peyz for a component of the plastic strain tensor (absolute)
- plasticstrain for all 6 components of the plastic strain tensor. For VTK files, they will be output as a tensor quantity with 9 elements of the plastic strain tensor (absolute). But note that not all materials store plastic strain the archive files. For example, Hyperelastic-Plastic_Materials store the elastic, left-Cauchy green strain. This quantity will extract the values stored in the archive.
- angz, angy, angx for initial rotation angles (in degrees) between material axes and initial configuration (R0 = RzRyRx); only angz is available for 2D results. These values never change are thereore are mostly used to confirm you set orientation of anisotropic materials correctly.
- xmat, ymat, zmat for unit vectors in the current material x, y, or z axes, which may rotate during a simulations (material axes start aligned with the grid unless rotated when creating the material points). Plotting glyphs oriented by these vectors can be used to visualization material directions in ParaView (and sometimes helps other visualizations too). Dot products of these vectors with global axes gives current material angle to that direction. u.σ.v, where u and v is two of these unit vectors gives normal stress (when u=v or shear stress when u≠v) in material coordinates (since version 2).
- meansize to output mean size of particles. Scaling plot features by this size (such as glyphs in ParaView) can better represent the size of material points in the graphics (since version 2).
- equivstrain for equivalent strain (= sqrt(2/3)|s| where s is deviatoric strain tensor from elastic strain only) (absolute)
- strerg for strain energy (in J)
- work for work energy (in J)
- heat for heat energy (in J)
- plerg for plastic energy (in J)
- temp for temperature (in K)
- conc for concentration (in wt %)
- hist# for history variable where # can be from 1 to 19
XML file output always includes mat and can include mass; they currently cannot include stress or strain.
When exporting crack particle data (-C option), the output always includes crack position and the crack number, but can include additional data for each -q option. The allowed quantities for crack particle data are:- J1 and J2 for crack tip J integral terms
- KI and KII for crack tip stress intensity factors
- czm1 and czm2 for dissipated mode I or mode II energy per unit area of a crack particle with a cohesive zone
- tract# for traction history variable where # can be from 1 to 10
XML file output only includes crack particle positions and the tip material ID (1 based) if available in the archive file; they currently cannot include these extra crack archived properties.
Any requested particle or crack quantity not in the archive file will be output as zero. Entering an invalid quantity name will cause an error. - -m num
- Omit data for particles with material number num. More than one use can remove multiple material types.
- -M num
- Include data for particles with material number num. More than one use can include multiple material types. If no -M options are used, then all materials are included. A material that is both included and excluded, will be excluded.
- -P
- Specify to export particle data only. Because particle data export is the default assumption, this option is normally not needed. The selected quantities should be only particle properties.
- -C
- Specify to export crack particle data only. The selected quantities should be only crack particle properties.
- -h
- Include a header at the beginning of the file. The header has text that describes the content of the file. Each line begins with a key word. The text after the space is the setting for that keyword. The possible keywords are
- Name - optional text if the -n options is used
- Source - name of the input archive file
- Data - space delimited list of columns in the output
- Included_Materials - space delimited list of included materials
- Excluded_Materials - space delimited list of omitted materials
- Format - format of the output numbers (text, xml, double, float)
- Endian - for binary output will be little or big.
- EndHeader - last line of the header
The header ends with the line feed character (0x0A) after EndHeader. For binary files, the header is padded to be a multiple of 8 bytes long. For VTK Legacy files, the name (if provided) and source will always be output on the second line of the file (i.e, the -h option is not needed).
- -n text
- The text defines a title or any brief comment about the extracted file. It is output in the header, but only if the -h option is used. For text with spaces, include it in quotes. For VTK Lagacy files it is output on the second line of the file.
Exported File Name
- -o path
- The output will be to standard output unless an output file path is specified in this option. The output file should not include an extension because one will be generated automatically based on the selected file type. When multiple archive files are extracted in a single command, the output files will add an index number to this specified output file name for each additional file (unless this default index number is overridden by the -s option).
- -s
- Include the step number in the output file name. NairnMPM archive files should have the step number as an extension. For example, if you are extracting data to a text file with root name ParticleData from archive file named archive.323 while using the -s option, the extracted file name will be ParticleData_323.txt. When extracting multiple files, inclusion of a step number will override the default index number (see -o option). If two of the multiple files have the same step number, the second one will overwrite the first. This problem will never occur when extracting from multiple files resulting from a single simulation.
Exported File Format
- -T
- Output as tab-delimited text file (extension .data). This option is the default output mode unless overridden by those below: -V, -U, -X, -d, -D, -f, or -F.
- -V
- These both out as a VTK Legacy file suitable for reading in visualization tools such as ParaView or VisIt. The file can have particle data or only crack data (with the -C option). Note the separate particle data and crack data files can be opened simultaneously in ParaView or VisIt to view them together (or to toggle one off for clarity). Particle data will export as a POLYDATA style VTK file (which limits visualization to point-based methods). Crack data, however, will export as an UNSTRUCTURED_GRID style VTK file (but, if 3D cracks cannot access facet information, they will export instead as a POLYDATA style VTK file) (extension .vtk).
- -U
- This option is identical to -V except will export particle data as an UNSTRUCTURED_GRID style VTK file. Each material point will be a cell in the VTK data and the cell will be deformed to match the current deformation of that particle. This type of file improves quality of the visualization. The two drawbacks are:
- You cannot use this option unless the simulation archived both strain and size, which are needed to deform the particle (see MPM Archiving Options)
- The files are much larger, but it appears visualization features in ParaView and VisIt are somewhat faster.
- -X
- Output an XML file, but see below for details. These files are intended for input to new calculations (extension .xml).
- -d
- Output as little Endian binary file with double precision numbers (extension .data)
- -D
- Output as big Endian binary file with double precision numbers (extension .data)
- -f
- Output as little Endian binary file with single precision numbers or floats (extension .data)
- -F
- Output as big Endian binary file with single precision numbers or floats (extension .data)
- -Z
- Output as a custom binary file, which if not of general use and cannot export crack data (extension .xyz)
Other Commands
- -H
- Print synopsis of ExtractMPM (and version number) along with brief descriptiosn of all options and variables.
Deprecated Commands
The following commands are only needed for very old archive files. They can be ignored for all result archive files.
- -b format
- Specify the archive format of the file. Only needed for ver3 archive files. For ver4 archive files or newer it is overridden by the file format specified in the archive file's header. See MPM output file format information for more details.
- -c format
- Specify the crack archive format of the file. Only needed for ver3 archive files. For ver4 archive files or newer it is overridden by the file format specified in the archive file's header. See MPM output file format information for more details.
- -2
- Specify the archive file as one having 2D results. Because 2D results is the default assumption, this option is normally not needed.
- -3
- Specify the archive file as one having 3D results. Only needed for ver3 archive files. For ver4 archive files or newer it is overridden by the file format specified in the archive file's header.
Examples
The following examples are shown as given to the shell:
- ExtractMPM -h -o positions arch.57
- Output particle positions from a ver4 or newer archive file (arch.57) to the text file named positions.txt with a header at the beginning of the file.
- ExtractMPM -d -b iYYYYNNNNNNNYNNNN -q syy -q szz -o str disks.78
- Output particle positions and y- and z-direction normal stress from a ver4 or newer archive file (disks.78) to a little Endian file of double named str.data.
- ExtractMPM -hF -q sxx -M 1 -o strxx disks.*
- Output particle positions and x-direction normal stress from several ver4 archive files (disks.*) to a series big Endian files of floats named strxx.data, strxx_1.data, etc., including headers. The output file will include only data from particles for material number 1. The header will help determine which output file came from which archive file.
- ExtractMPM -hC -o cracks disks.1289
- Output crack number and crack particle particle positions from a ver4 archive file to a text file cracks.txt including a header. The output file will include only crack particle data.
- ExtractMPM -V -q sxx -q velx -q dispx -s -o Output archive.*
- Extract data for all "archive.#" files in the current folder and write to VTK file with name "Output_#.vtk". These output files can be read by ParaView for an alternate method of generating particle based plots for any extracted quantity.
You only need to specify file formats (in -b and -c options) and dimensionality (in -3 option) for ver3 archive files. These options will be read from the header of ver4 or newer files. The version ID of any archive file can be determined by looking at the first 4 bytes of the file. The ver4 or newer format took effect 25 OCT 2007. See MPM output file format information for more details on archive file versions.
Since the archive file format is specified in the command, when extracting from multiple ver3 archive files in a single command, they must all have the same format. This restriction does not apply when extracting from multiple ver4 or newer files.
XML File Extraction To Extend Calculations
The main use of XML file extractions is to restart NairnMPM calculations with particle results from a previous calculation. As a result, the XML file uses a format intended for defining material points in a NairnMPM input commands file. All material points will be in a single <PointList> structure. Each material point in the structure will have the following format:
<PointList> . . . <mp matl='1' angle='0' thick='1' wtconc='0' temp='0'> <pt units='mm' x='1.25' y='-11.25'/> <vel units='mm/sec' x='0' y='0'/> <mass m='1e-3'/> </mp> . . . </PointList>
The material number (matl), material angle (angle, if 2D), thickness (thick, if 2D), and position (pt element) will always be in the extracted file. To include concentration (wtconc) and/or temperature (temp), use the -q conc and -q temp options, respectively. To include the velocity use the -q velx option (which will include all components of velocity). To include mass (and you normally should) use a -q mass option. Concentration, temperature, and velocity will only appear if they are in the archive file. All other requested quantities (including other components of velocity) will be ignored.
If you only want certain types of material points in the new calculations, use the -m or -M options to select the desired material types. You can include a header with the -h option and it will appear at the beginning of the file in an XML comment structure.
Finally, you can use the extracted XML file to define all or some of the material points in a new calculation. First, define the path to the new file in an ENTITY element in the file's DOCTYPE element such as:
<!DOCTYPE JANFEAInput SYSTEM '/full path to/NairnMPM.dtd' [ <!ENTITY mpfile "path to/pointlist.xml"> ]>
where pointlist.xml is the name of the newly extracted XML file. Then, import that file in the <MaterialPoints> element such as:
<MaterialPoints> &mpfile; </MaterialPoints>
In scripted files, the above can be done Entity and XMLData commands.