Difference between revisions of "NairnFEAMPMViz"
Line 55: | Line 55: | ||
The <tt>-Xmx</tt> option allocates the desired memory (where "m" means in megabytes). The script file runs with 512 MB of memory. You can edit the script file to change this amount if needed. If double clicking does not run the script in the Terminal app, you can control-click on the script and choose to run in Terminal (and/or use the "Get Info" command to configure the file to open in Terminal app). | The <tt>-Xmx</tt> option allocates the desired memory (where "m" means in megabytes). The script file runs with 512 MB of memory. You can edit the script file to change this amount if needed. If double clicking does not run the script in the Terminal app, you can control-click on the script and choose to run in Terminal (and/or use the "Get Info" command to configure the file to open in Terminal app). | ||
Running the script will open a Terminal window that will stay open while <tt>NairnFEAMPMViz</tt> is running. That window is also a console for the Java app and will display some | Running the script will open a Terminal window that will stay open while <tt>NairnFEAMPMViz</tt> is running. That window is also a console for the Java app and will display some messages that might provide useful information. | ||
=== Running in Linux === | === Running in Linux === |
Revision as of 09:00, 3 September 2019
NairnFEAMPMViz is a Java application to create simulations, run them, and visualize them. This page has brief instruction on its use and on compiling it if you want to enhance the source code to create new visualization options.
Introduction
The nairn-mpm-fea project includes a Java application called NairnFEAMPMViz that lets you create input files, run calculations, and visualize results for both NairnMPM and NairnFEA. On this page, you can download a complete package that includes the Java application and all code engines and libraries from the nairn-mpm-fea project. These are stand-alone packages that can run simulations immediately. Once a package is downloaded, launch the application by described platform-dependent methods. Instruction for using NairnFEAMPMViz are included in the its' help window. This page also has some quick-start suggestions.
If you want to make changes to the NairnFEAMPMViz Java application, its' entire source is included in the nairn-mpm-fea project. See the instructions on compiling NairnFEAMPMViz to learn how to create a new jar file from altered source code.
NairnFEAMPMViz Packages
The following downloads provide packages that contain the NairnFEAMPMViz application. Pick the version for your computer. Both are full-featured versions of NairnFEAMPMViz and the download folder contains compiled binaries for finite element analysis and for material point method analysis along libraries needed to run the application.
NairnFEAMPM Download | Size (MB) | Updated |
---|---|---|
NairnFEAMPMViz 7.4 for Windows - For use on Windows computers. The packages should contain all the needed dlls to run code engines. | 2.8 | 20 AUG 2019 |
NairnFEAMPM 7.4 for Mac - For MacOS computer. The package contains the xerces library and hopefully your computer will have the needed standard c++ library to run the code engines. | 6.0 | 20 AUG 2019 |
Note that NairnFEAMPMViz requires your computer to have Java 1.7.0 (a.k.a Java 7) or newer installed. If neither of these packages work, you can build your own binaries and libraries by checking out the nairn-mpm-fea project.
Once the packages are downloaded, you can start NairnFEAMPMViz by double clicking the NairnFEAMPMViz.jar file contained within the package folders. Although this method works, the application will start with the default amount of memory for the Java Virtual Machine. The default memory is enough to open small calculations, but not enough for larger calculations. To start NairnFEAMPMViz with more memory, you should launch the Java application using provided scripts as explained in the following sections.
Running in Windows
Start NairnFEAMPMViz by double clicking the NairnFEAMPMLaunch.bat file. This Windows batch file will launch the jar file with a command line argument using:
java -Xmx512m -jar NairnFEAMPMViz.jar
The -Xmx option allocates the desired memory (where "m" means in megabytes). The batch file runs with 512 MB of memory. You can edit the batch file to change this amount if needed.
The above approach will open a Windows prompt window and it will stay open while NairnFEAMPMViz is running. That window is also a console for the Java app and will display some message that might provide useful information. If you prefer to run without that prompt window, you can use a short cut. First, create a short cut to the NairnFEAMPMLaunch.bat file (and give it any desired name). Second, right click on the new shortcut and select "Properties". In the properties window:
- Make sure "Target" and "Start in" refer to the batch file, it's folder, and the NairnFEAMPMViz.jar file is in that folder too.
- Choose "Minimized" from the "Run:" menu.
- Click "Change Icon..." and "Browse..." for the NairnFEAMPMViz.ico file (in the packages bundle folder).
- If desired, the short cut can be moved to any location (such as your desktop), but the folder with the target batch file and the jar file cannot move (because Windows short cut targets are not relocatable).
Note that the batch files command launches NairnFEAMPMViz using a java command. For this basic command to work, you will need to include the path to your installed java command in your PATH environment variable. The path to Java executables in Windows will be something like:
C:\Program Files\Java\jdk1.7.0_80\bin
Installation of java may add this path to your Windows environment for you; if not, you will have to edit the system environment variables and add it.
Running in MacOS
The preferred approach in MacOS is to download and use the NairnFEAMPM application. If you need to use a NairnFEAMPMViz package, start the Java application by double clicking the NairnFEAMPMLaunch file. This will launch the jar file with a command line argument using:
java -Xmx512m -jar Resources/NairnFEAMPMViz.jar
The -Xmx option allocates the desired memory (where "m" means in megabytes). The script file runs with 512 MB of memory. You can edit the script file to change this amount if needed. If double clicking does not run the script in the Terminal app, you can control-click on the script and choose to run in Terminal (and/or use the "Get Info" command to configure the file to open in Terminal app).
Running the script will open a Terminal window that will stay open while NairnFEAMPMViz is running. That window is also a console for the Java app and will display some messages that might provide useful information.
Running in Linux
Although the NairnFEAMPMViz works in Linux, no stand-alone package is provided. When using Linux, you will have to check out the nairn-mpm-fea project and build all needed code engines and libraries. Once they are created, launch NairnFEAMPMViz with the command line:
java -Xmx512m -jar (path/to/NairnFEAMPMViz.jar)
and follow it's help instructions for setting it up to run calculations using the binaries you created. The -Xmx512m argument runs the jar file with 512 MB of memory. You can run with more or less if desired.
Running on a Remote Computer
To run NairnFEAMPMViz remotely (such as running from a terminal connected to a Linux cluster that has your code and calculation results), you have to log onto the remote computer using X11 terminal software and enable "trusted X11 forwarding." The command line is
ssh -Y -l username servername
Once connected, start NairnFEAMPMViz using the java command line:
java -Xmx512m -jar (path/to/NairnFEAMPMViz.jar)
Running on a Linux machine using an X11 terminal is significantly slower, especially when any window with graphics is open. You will want to avoid this option, unless it is the only option available (i.e., when your only access to the data is through a remote login). The differences are caused by the system dependent Java virtual machines and between X11 and non-X11 uses by Java.
Using NairnFEAMPMViz
For instructions on using NairnFEAMPMViz, use the "Help" menu command in the application. The first time it is run, you may need to do some setup (as explained in the help). Once set up, a quick-start explanation about typical use is as follows:
- You can create "New" input commands files (or open saved ones with "Open" command or by clicking the "Folder" icon) and edit them in a text editing window.
- 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. The text results will appear in the top two sections of a new window. A control panel for visualizing results will appear in the bottom section.
- To plot results, select a plot type in the control panel area and then follow the blue line to select all available options for that type of plot.
- Finally, click the "Plot" button to get the plot in a new window. To plot different results, select new options and click the "Plot" button again (which may have changed to "Replot" or "Add Plot").
- To open saved results for visualization use the "Open..." menu command or click the "Folder" icon. Note that "calculation results" are in the file of output text sent by NairnMPM or NairnFEA to standard output, and not one of the associated files written by those calculations. Once opened, the text results will appear as described above after running calculations.
One limitation of the NairnFEAMPMViz pacakages is that the embedded binaries may not be the latest versions from the nairn-mpm-fea project. Furthermore, the packaged MacOS code engines can only run in serial (due to Apple limitations for distributing software with OpenMP support). To use the latest versions of the code and enable parallel calculation on Mac while using the packages, you should:
- Download Source Code (i.e., check out the nairn-mpm-fea project.
- Compile the Code Engines for NairnMPM and NairnFEA.
- Either copy the compiled binaries into the package folders (replacing the original versions) or configure NairnFEAMPMViz to run the code engines created by the project tools. See NairnFEAMPMViz's help window for information on configuring it to run new code engines.
Compiling the NairnFEAMPMViz Java Application
The nairn-mpm-fea project contains the complete source code for NairnFEAMPMViz. One option for creating new visualization tools, therefore, is to edit the NairnFEAMPMViz source code and create them. After editing, you will need to recompile the code as explained in this section.
Compiling Using Eclipse
Eclipse is an open-source and free development system (IDE) for Java (and for other languages). This section explains how to import the NairnFEAMPMViz code into an Eclipse project. This method was done using Eclipse Mars (4.5), which is available free for Windows, Mac, and other platforms. These steps will probably work for other versions too, possibly with minor modifications.
Assuming you have the Eclipse IDE for Java development installed, you can import a project for editing NairnFEAMPMViz as follows:
- Start Eclipse
- Choose Import... menu command and select "Existing Projects into Workspace" in the "General" section.
- On next screen, choose Visualization/src folder in the cloned nairn-mpm-fea project. A "NairnFEAMPMViz" project should show up.
- You can select "Copy projects into workspace" or leave it unchecked. When checked, all files are copied to your Eclipse workspace and the files in the code check out remain in place. If not checked, the Eclipse project will directly use (and edit) the files in your check out.
- Click "Finish" to import the project.
The imported project should compile fine. To create a running option with sufficient memory, choose the "Run Configurations..." menu command
- Select "Java Application" and click the "New" icon to create a new runnable
- Enter any name such as "NairnFEAMPMViz with Memory".
- Enter "NairnFEAMPMViz" (or browse for it) into the Project field
- Enter "NairnFEAMPMViz" (or browse for it) into the Main class field
- Click on "Arguments" tab
- Enter "-Xmx512m" into the VM Arguments field (this command tells the Java machine to allocate 512 MB for running NairnFEAMPMViz. You can increase or decrease the memory as needed).
- Click "Apply"
- Click "Run" to run NairnFEAMPMViz
- In the future, you can run using the "NairnFEAMPMViz with Memory" item in the Run History menu
The above process will let you compile and run NairnFEAMPMViz within Eclipse. You can also use Eclipse to create a jar file, which can be run outside of Eclipse. The process is:
- Choose menu command "Export..." and then select "Runable Jar File" in the "Java" section. Click "Next".
- Choose the NairnFEAMPMViz launch configuration (such as the "NairnFEAMPMViz with Memory" one created above), choose export destination (which by default is (project)/lib/NairnFEAMPMViz.jar, where (project) is the name you gave this project in your workspace), and select to "Extract required libraries into generated JAR".
- Click "Finish" to generate the jar file.
- If desired, you can save the jar file to a downloaded package to update that package to use your recompiled jar file.
Compiling a Checked Out Copy - OSParticulas Only
When using OSPartculas, you can alternatively check out the NairnFEAMPMViz code directly from the repository using SVN. These steps need tools for subversion installed in Eclipse as described here. Be sure to do the optional step for Java development (or just download Eclipse for Java development). You are now ready to manage Eclipse projects using SVN. To get started with a NairnFEAMPMViz project, do the following:
- Choose menu command "New → Project...", expand the "SVN" section, choose "Project from SVN" and click "Next".
- You will be asked to select an SVN repository. Enter the following settings followed by clicking "Next":
- URL: (http_OSParticulas_Server)/svn/OSParticulas/trunk/Visualization/src
- User: enter your username and password for the OSParticulas svn repository.
- Choose "Head Revision" for latest version or use date or revision options for older versions and then click "Next" (or "Finish" is "Next" is not available).
- Select "Check out as project with the name specified" and specify NairnFEAMPMViz. Click "Finish" and the project will be created. It should automatically build and be ready to run.
- See above for how create a running option with sufficient memory.
The above process will create a project in your Eclipse workspace that will have a copy of the files needed for the NairnFEAMPMViz project. You can update to the latest version by right clicking (or control clicking on Mac) the project name and selecting "Update" from the "Team" submenu. If you are certified as a project committer, you can save your changes by right clicking (or control clicking on Mac) on the project name and choosing "Team → Commit..." (be sure to enter message described the changes being committed).
Command Line Compile
You can alternatively compile the code and create the jar file on a Unix/Linux command line by running the script called makejar that is located at:
nairn-mpm-fea/Visualization/build/makejar
When you run this script, it will compile the Java source code and create a self-contained jar file in that same directory. By default this script assumes compilation on Windows. To compile on Mac uses makejar -m. To compile on Linux, use makejar -l.
To run this script, you need the javac compiler and jar utility installed on your computer. Compilation requires Java 1.7.0 or newer. It is available free on various platforms as part of the standard Java Development Kit (JDK) installation.
If the required javac and jar tools are not in the default path, you can edit the makejar file and enter the full path to each command (or add their paths to your $PATH environment variable).