Difference between revisions of "Options for Running Calculations"

From OSUPDOCS
Jump to navigation Jump to search
Line 3: Line 3:
== Running Using [[NairnFEAMPM]] (Macintosh OS X only) ==
== Running Using [[NairnFEAMPM]] (Macintosh OS X only) ==


If you are using a Mac, you can go to the [http://oregonstate.edu/~nairnj/NairnFEAMPM/index.html <b>NairnFEAMPM</b> web site] and download a complete package that lets you create input files using a command language or raw <tt>XML</tt> commands, run calculations, and visualize the results. This package only works in MacOS X and does not include the code engines' source code. If you are working directly with the source code, you can still run calculations using [[NairnFEAMPM]], but first you have to configure it to use to new compiled code engines in place of the embedded code engines. To make that change consult to "Code Engine Development" topic in the help window.
If you are using a Mac, you can go to the [http://oregonstate.edu/~nairnj/NairnFEAMPM/index.html <b>NairnFEAMPM</b> web site] and download a complete package that lets you create input files using a scripting language or raw <tt>XML</tt> commands, run calculations, and visualize the results. This package only works in MacOS X and does not include the code engines' source code. If you are working directly with the source code, you can still run calculations using [[NairnFEAMPM]], but first you have to configure it to use to new compiled code engines in place of the embedded code engines. To make that change consult to "Code Engine Development" topic in the help window.


To do a test calculation, choose the "New &rarr; FEA Example" or "New &rarr; MPM Example" command, and then choose the "Analyze &rarr; Run FEA/MPM Analysis" command. The text output will stream to a window. When it is done you can use built-in tools to visualize the results. For all the details on running calculations and on visualizing results, you can consult the help window within [[NairnFEAMPM]].
To do a test calculation, choose the "New &rarr; FEA Example" or "New &rarr; MPM Example" command, and then choose the "Analyze &rarr; Run FEA/MPM Analysis" command. The text output will stream to a window. When it is done you can use built-in tools to visualize the results. For all the details on running calculations and on visualizing results, you can consult the help window within [[NairnFEAMPM]].
Line 9: Line 9:
== Running Using [[NairnFEAMPMViz]] Java Application (any platform) ==
== Running Using [[NairnFEAMPMViz]] Java Application (any platform) ==


You can run and visualize [[NairnFEA]],  [[OSParticulas]], and [[NairnMPM]] calculations on any platform using the [[NairnFEAMPMViz]] Java application. [[NairnFEAMPMViz]] started out only as a visualization tool, but now it lets you create and edit input <tt>XML</tt> files, run calculation, and visualize the results. ('''Note''': if you are using a Mac [[NairnFEAMPMViz]] will work, but the recommendation is to use [[NairnFEAMPM]] because it faster and has more features).  
You can run and visualize [[NairnFEA]],  [[OSParticulas]], and [[NairnMPM]] calculations on any platform using the [[NairnFEAMPMViz]] Java application. [[NairnFEAMPMViz]] started out only as a visualization tool, but now it lets you create input files using a scripting language or raw <tt>XML</tt> commands, run calculations, and visualize the results. ('''Note''': if you are using a Mac [[NairnFEAMPMViz]] will work, but the recommendation is to use [[NairnFEAMPM]] because it faster and has more features).  


<p><b>NairnFEAMPMViz</b> is a Java application and therefore to run it, you need it's jar file. This file is not included in the <code>Nairn-MPM-FEA</code> package. You have two options:</p>
[[NairnFEAMPMViz]] is a Java application and therefore to run it, you need it's jar file. The latest jar file can be found in the downloaded <tt>nairn-mpm-fea</tt> project at the relative path:
 
nairn-mpm-fea/Visualization/src/lib/NairnFEAMPM.jar
 
If you want to add features to [[NairnFEAMPMViz]], you can modify the source code and recompile to a new jar file. The complete source code, in the form of an Eclipse project it provided in the project folder
 
nairn-mpm-fea/Visualization/src/lib/NairnFEAMPM.jar
 
 
This file is not included in the <code>Nairn-MPM-FEA</code> package. You have two options:</p>


<ol>
<ol>

Revision as of 12:36, 29 August 2013

This page has information on running NairnFEA finite element calculations and OSParticulas or NairnMPM material point method calculations. If you just compiled the code, it includes information on doing test calculations.

Running Using NairnFEAMPM (Macintosh OS X only)

If you are using a Mac, you can go to the NairnFEAMPM web site and download a complete package that lets you create input files using a scripting language or raw XML commands, run calculations, and visualize the results. This package only works in MacOS X and does not include the code engines' source code. If you are working directly with the source code, you can still run calculations using NairnFEAMPM, but first you have to configure it to use to new compiled code engines in place of the embedded code engines. To make that change consult to "Code Engine Development" topic in the help window.

To do a test calculation, choose the "New → FEA Example" or "New → MPM Example" command, and then choose the "Analyze → Run FEA/MPM Analysis" command. The text output will stream to a window. When it is done you can use built-in tools to visualize the results. For all the details on running calculations and on visualizing results, you can consult the help window within NairnFEAMPM.

Running Using NairnFEAMPMViz Java Application (any platform)

You can run and visualize NairnFEA, OSParticulas, and NairnMPM calculations on any platform using the NairnFEAMPMViz Java application. NairnFEAMPMViz started out only as a visualization tool, but now it lets you create input files using a scripting language or raw XML commands, run calculations, and visualize the results. (Note: if you are using a Mac NairnFEAMPMViz will work, but the recommendation is to use NairnFEAMPM because it faster and has more features).

NairnFEAMPMViz is a Java application and therefore to run it, you need it's jar file. The latest jar file can be found in the downloaded nairn-mpm-fea project at the relative path:

nairn-mpm-fea/Visualization/src/lib/NairnFEAMPM.jar

If you want to add features to NairnFEAMPMViz, you can modify the source code and recompile to a new jar file. The complete source code, in the form of an Eclipse project it provided in the project folder

nairn-mpm-fea/Visualization/src/lib/NairnFEAMPM.jar


This file is not included in the Nairn-MPM-FEA package. You have two options:

  1. Compile the NairnFEAMPMViz source code. Click <a href="../startup/nairnviz.html#compiling">here</a> for details on this approach.
  2. Download the jar from the the <a href="http://code.google.com/p/nairn-mpm-fea/downloads/list">nairn-mpm-fea project downloads</a> page. Compiling the source code will always get you the latest version, but the download might be good enough (and is easier if you just want to verify with a test run).

Once the NairnFEAMPMViz jar file is ready, you need to launch it using a method to make sure it gets enough memory. The method is described <a href="../startup/nairnviz.html#runningViz">here</a>. Once the application is started, do a test run as follows:

  • The first time you run NairnFEAMPMViz, you have to tell the application the location of the NairnFEA and OSParticulas (or NairnMPM) code engines and of a Unix shell. The steps are
    1. Choose "Preferences..." menu command or click the "Prefs" icon
    2. Click the "Code" tab
    3. Click the first five "Change..." buttons and locate the OSParticulas (or NairnMPM) executable, the NairnMPM.dtd file, the NairnFEA executable, the NairnFEA.dtd file, and the bash shell command, respectively. In Windows, the bash command will be in the bin folder of the root cygwin folder; in other systems, it will be in the /bin folder.
    4. Optionally click the last "Change..." button and select a work space directory. When a directory is selected, NairnFEAMPMViz will default to this directory when opening and saving files.
  • To do a test calculation, choose the "File → New FEA Commands" or "File → New MPM Commands" menu commands (or click their icons). These will open a file with sample XML commands. Save the new commands to a new file with extension .fmcmd.
  • To run an analysis, choose the "Analyze → Run FEA/MPM Analysis" command (or click the run arrow icon). You will asked to decide where to save the results (as an .fea or .mpm file). Once you select a name, the calculations will run. When the calculations are done, the results file will open for visualization.
  • See the NairnFEAMPMViz application help information for more details on running calculations and on visualizing results.

Command-Line Execution

Running NairnFEA

You can run NairnFEA from a Unix or Linux command line using:

NairnFEA [options] input > output

where

[options]
The options may be one or more of the following:
-v
Validate the input XML using the DTD file specified in the !DOCTYPE line in the preamble of the input file. If the specified DTD can not be found, the code will exit with an error message. If the input file has no !DOCTYPE, the validation will be skipped. The required DTD file can be found in the input directory of the <a href="../startup/organize.html">source files</a>.
-a
Read the input file, set up the mesh and all boundary conditions and then abort before any calculations. This option is useful to check that all commands have created the mesh and boundary conditions correctly before actually doing the analysis in a subsequent run.
-w
When this option is not used, relative file names for output files and for input of bmp files are resolved as being relatve to the input file. When this option is used, the file names are resolved instead to the current working directory.
-H
Display brief help message and then exit.

Multiple options can use separate options, such as -v -r , or combine them in one option, such as -vr.

input
The path name of the input XML file. The preferred extension for the input files is ".fmcmd".
output
The name of the output text file. The output of NairnFEA is to standard output and redirection should be used to save the output to a file. The preferred extension for the output file is ".fea".


<a name="trialFEA"></a>

Trial FEA Run

After <a href="../startup/index.html">compiling</a> the code, you can do a trial run with the following commands:

cd nairn-mpm-fea/NairnFEA/input
./NairnFEA Cantilever.fmcmd > output.fea

The sample FEA calculation of an end-loaded cantilever beam will finish quickly. The file output.fea will have the text output results.

To verify the results requires visualization tools. See the <a href="../startup/nairnviz.html">visualization options</a> section for the possible tools. The image below shows plot of stress in the x-direction for this sample problem.

<img src = "beam.jpg" alt = "beam example" align="center"/>

Running OSParticulas NairnMPM

You can run OSParticulas (or NairnMPM) from a Unix or Linux command line using:

OSParticulas [options] input > output
NairnMPM [options] input > output

where

[options]
The options may be one or more of the following:
-v
Validate the input XML using the DTD file specified in the !DOCTYPE line in the preamble of the file. If the specified DTD can not be found, the code will exit with an error message. If the input file has no !DOCTYPE, the validation will be skipped. The required DTD file can be found in the input directory of the <a href="../startup/organize.html">source files</a>.
-r
Reverse the bytes when writing results to archive files. This option can be useful when you are running calculations on one computer, but visualizing them on a different computer which uses a different byte order. For example. Macintosh computers and computers with Intel chips use opposite byte orders. This option can be omitted if you analyze on the same computer where you run the calculations or if you have analysis software that works with any byte order (such as all provided <a href="../startup/nairnviz.html">visualization options</a>).
-a
Start the analysis, archive the initial conditions, and then abort the calculations. This option is useful to check that all commands have created the mesh, assigned material points, and created boundary conditions correctly before actually doing the analysis in a subsequent run.
-w
When this option is not used, relative file names for output files and for input of bmp files are resolved as being relatve to the input file. When this option is used, the file names are resolved instead to the current working directory.
-H
display brief help message and then exit.

Multiple options can use separate options, such as -v -r , or combine them in one option, such as -vr.

input
The path name of the input XML file. The preferred extension for the input files is ".fmcmd".
output
The name of the output text file. The output of OSParticulas (or NairnMPM) is to standard output and redirection should be used to save the output to a file. The output file should be saved in the current working directory to insure correct relative paths between the output file and the archive files. The preferred extension for the output file is ".mpm".

<a name="trialMPM"></a>

Trial MPM Run

After <a href="../startup/index.html">compiling</a> the code, you can do a trial run with the following commands:

cd nairn-mpm-fea/NairnMPM/input
./OSParticulas TwoDisks.fmcmd > output.mpm

or

cd nairn-mpm-fea/NairnMPM/input
./NairnMPM TwoDisks.fmcmd > output.mpm

The sample MPM calculation of two disks colliding should finish in a few seconds. The file output.mpm will have the text output results. The archive files should be in a folder created in that directory called TwoDisks.

To verify the results requires visualization tools. See the <a href="../startup/nairnviz.html">visualization options</a> section for the possible tools. The image below shows plot of stress in the x-direction at three different times. Click <a href="disks.mov">here</a> to see a short movie of the same stress.

<img src = "diskframes.jpg" alt = "two disks example" align="center"/>