Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

MOOSE Support in ICE

Revision as of 15:05, 2 November 2016 by Crawfordst.ornl.gov (Talk | contribs) (Introduction)

Introduction

The Multi-physics Object Oriented Simulation Environment (MOOSE) is a parallel, finite-element framework developed at Idaho National Laboratory (INL). ICE has always provided strong support for MOOSE input generation, simulation execution, and data visualization as a core part of the ICE platform. To learn more about MOOSE, please check out MOOSE Framework.

Support for MOOSE within ICE was expanded further in the summer of 2015 to incorporate changes based on feedback from MOOSE's internal development team and MOOSE application developers. The latest version of ICE now provides a unified interface for interacting with the MOOSE framework alongside tools for embedded visualizations of problem meshes, simulation output, and post processor XY plotting. Additionally, ICE now has improved MOOSE tooling that facilitates real-time updating—via web sockets—from a running MOOSE simulation back to ICE. Users can now specify a list of post processor values relevant to their job, launch their simulation, and see the specified post processor plots update in real time.

The following tutorial will describe these new updates and provide a walkthrough for using MOOSE in the ICE development environment. The tutorial will also detail ICE installation, MOOSE input generation, existing MOOSE input file loading, simulation launch, and post-simulation data visualization using an existing (user-provided) MOOSE application.

Note that ICE now supports MOOSE application development. Check out Developing MOOSE Applications with ICE for more information.

ICE Installation

The ICE team has developed a new and improved mechanism for users to install ICE and its dependencies from a command line terminal. The ICE install can now be completed using a simple python script, which can be downloaded at ICE Install. To install ICE, simply download the script, open a terminal and navigate to the download directory, and then execute the script as follows:

python Install_ICE.py

Running the above script will pull down the correct versions of ICE, VisIt, and HDFJava for your operating system. The script will then unpack these components and configure the ICE application to use the downloaded VisIt and HDFJava dependencies. For Mac OS users, this script will also configure ICE to use the current user's environment variables and register those environments with ICE through the Apple Application Launch Service. All of this will enable you to simply double click the newly-created ICE application icon (for Mac OS: ~/Applications/ICE.app; for Linux: an ICE application icon will appear in the 'Programming' category of the applications menu).

Furthermore, you can customize the install by adding command line arguments to the python install script. To download and configure ICE in a specified directory, simply execute:

python Install_ICE.py --prefix /path/to/install

To install the latest unstable version of ICE (currently required for the MOOSE support described in this article), simply execute:

python Install_ICE.py --unstable

For Windows users, installation is even simpler as we provide MSI installers, which can be found at the same files download URL. Just download the installer specific to your architecture, run it, and you'll be ready to use ICE.

Prerequisites

To use the MOOSE support in ICE, you'll need to have MOOSE installed on your system along with any MOOSE-based application you would like to use (you can simply use "moose_test" if you don't have any other application).

To install MOOSE on your system, check out the MOOSE Getting Started guide. If you would like to install MOOSE and create a MOOSE-based application of your own (or clone an existing application) from within ICE itself, check out the Developing MOOSE Applications with ICE article.

MOOSE Perspective

ICE comes bundled with a MOOSE Perspective that organizes the various views and windows that a MOOSE user or developer would need to efficiently work with MOOSE in ICE. The updated MOOSE perspective shows the Item Viewer, Resources View, Project Explorer, MOOSE Data Tree View, and Properties tab to enable the user to have an efficient interaction with the framework.

To access the MOOSE Perspective, use the the ICE toolbar at the top and navigate to:

Window > Open Perspective > Other...

Select MOOSE in the window that pops up and click OK.

Alternatively, you can also access the same pop-up menu by clicking the Open Perspective button in the upper right-hand corner of the ICE workbench (as shown in the image below).

ICE OpenPerspective.png

Once the MOOSE Perspective opens, you should notice the workbench now contains fewer UI components, and resembles something like this:

New moose perspective.png

Connecting to VisIt

If you would like to view embedded visualizations within the ICE MOOSE tools, you will need to first specify a connection to VisIt. To do this, simply open the Preferences menu item in the top toolbar.

For Mac OS: Eclipse ICE > Preferences
For Linux: Window > Preferences

In the preferences wizard, navigate to the Visualization Preference node in the left tree view, open it, and select the VisIt node.

Preferences > Visualization > VisIt

In that preferences view, you can add a connection to VisIt by clicking the add button (stylized as a +) and specifying the path to the VisIt executable.

Visit connection.png


The MOOSE Workflow Item

Previously, ICE had two separate interfaces from which the user could choose, depending on the desired task: the MOOSE Model Builder and the MOOSE Launcher. The ICE team has since merged the functionality of these work spaces together and now allows users to construct a MOOSE Workflow Item, which presents a unified interface for MOOSE simulation development.

To create a new MOOSE Workflow Item, simply click the green + button in the Item Viewer, located on the left-hand side of the ICE workbench and MOOSE perspective.

ICE CreateItem.png

This will prompt a window to pop up; from there, select the MOOSE Workflow Item, and click Finish.

Item selector.png

Alternatively, if you would like to import an existing *.i input file to modify, click the yellow item import arrow located at the top of the ICE workbench.

ICE ImportItem.png

A wizard will then prompt the user to specify two things: (1) the *.i file to be imported and (2) the type of Item the file should be imported into.

Browse the file system to locate the file to be imported and then select MOOSE Workflow from the list.

Import moose item stc.png

Now let's take a look at the use of the MOOSE Item in each of these two cases.

Creating a new MOOSE Workflow Item

When you select the MOOSE Workflow Item for the first time, you'll be presented with the following form:

New moose item.png

To begin using the MOOSE Workflow Item, you'll need to specify a MOOSE-based application. As you can see in the above picture, this is the first time we've used the MOOSE Workflow Item, so there are no available applications to select and ICE is indicating that we must import one.

Moose-based-app.png

This MOOSE-Based Application Entry allows the user to navigate to either a local or remote MOOSE-based application. Once selecting the application, this Entry saves the value for the future (i.e., it persists between ICE executions so that the user can reuse the same application over and over again). To specify an application, click the Browse button. Upon doing so, you'll be presented with a dialog to specify whether this application is hosted locally or remotely. Select local, for now, and you'll be presented with a File Dialog, search for your application and click finish.

Local or remote.png

Local file browser.png

With your application imported, the next step is to save the current MOOSE Workflow Item to trigger the generation of the MOOSE input tree for that application.

App imported.png

Input tree.png

From this tree, you can start constructing your MOOSE input file. You can add children to the tree nodes, delete children, and set properties for each block in the Properties View.

Updates to the MOOSE Tree

The MOOSE tree has been improved and made smarter. Blocks that require a variable to be specified, such as the Kernels block, now only let users specify a variable that has been created in the Variables block. Adding or removing variables from the Variables block will update those blocks with variable entries to display only a list of the currently available variables. Additionally, all file entries in the MOOSE tree will dynamically show up in the Output File Parameters Data component on the MOOSE Workflow form.

Combined vars.png

Combined dynamic files.png

Importing an Existing MOOSE Workflow Item

As mentioned above, you can import an existing MOOSE input file as a new MOOSE Workflow Item. Clicking the yellow import arrow icon in the toolbar and selecting the input file and MOOSE Workflow Item will import a new MOOSE Workflow Item into the main form editor area in the MOOSE perspective. Its tree view will already be populated with the contents of the file. Next, select the application this MOOSE Workflow Item corresponds to and click save. This will merge the current tree corresponding to the input file with the applications YAML tree, resulting in a view like this:

Merged tree.png

Using a Remote MOOSE-based Application

ICE let's MOOSE users point to remotely hosted MOOSE-based applications just as easily as locally hosted ones. To use a remote application, simply select Remote on the Local/Remote dialog after clicking the Browse button on the MOOSE-Based Application entry. You will be presented with a remote connection dialog, shown below.

Remote connection.png

Fill out the New Connection wizard with the information needed to connect to the remote host. After filling this out, the remote file browser will load up and you can navigate to the remotely hosted application.

Remote app.png

Viewing the Mesh

ICE now has support for embedded visualizations, and the MOOSE support in ICE provides this embedded view to allow users to view the mesh for a given application run. To view the mesh for a given MOOSE Workflow Item and input tree, simply look in the Resources View for the mesh file and double click it (with a valid VisIt connection present). The mesh will open in an embedded view in the MOOSE Workflow Item's Mesh and Output Files tab. It is completely interactive, you can rotate the view and zoom in and out to get a good look at the mesh you are using for the current MOOSE application launch.

Mesh resource.png

Mesh view.png

Launching the Application

Launching your MOOSE-based application is simple. If you selected a remotely hosted application, then ICE handles the appropriate remote launch semantics (file uploads/downloads, remote invocation, etc). If you selected a local application, ICE handles the local execution of your application in your workspaces default/jobs folder. MOOSE users can also specify the number of MPI processes and Intel TBB threads to use in the simulation execution, shown below.

Parallel exec.png

To launch the application, simply click the Go button for the Launch the Job action in the top right of the MOOSE Workflow Item. This will execute the simulation and pipe the output to the Console view.

Moose console view.png

When the simulation finishes, you'll notice the Resources view has been populated with a list of files generated by the simulation. These files include all Postprocessor CSV files and the simulation output Exodus file. To view them in the embedded visualization view in the Mesh and Outputs tab, simply double click the file. For the output Exodus file, you can right click on the Plot to navigate a context menu of all possible plots to view. Simply select the solution field you're interested in viewing on the mesh, as shown below.

Solution mesh.png

Real-time Updating for Postprocessor Values

ICE and MOOSE can now communicate in real-time during a simulation execution over web sockets. Now, as a simulation is running, MOOSE can communicate things such as Postprocessor values in real-time so that ICE can display a dynamically updating plot of the Postprocessor during simulation execution. When the user selects the Launch the Job process, ICE adds an ICEUpdater block to the Outputs block in the MOOSE tree that directs MOOSE to communicate with ICE over a web connection during simulation execution. So, as the simulation is running, you can double-click a Postprocessor CSV file in the Resources view and view it populate in real-time. Or, if you'd like your plots to open immediately, you can select them in the Show Postprocessors component on the MOOSE form. If these Postprocessors are enabled, ICE will immediately open up the Postprocessor plot when the simulation is executed.

Pp view.png

Dynamic update.png

Back to the top