Pre-Built MOOSE
If you are not interested in developing your own MOOSE based application, and wish to use MOOSE's many available physics solvers, you can install the pre-built fully-featured MOOSE binary.
If you are operating on a Windows machine, please first follow Windows Subsystem for Linux, and then come back to these instructions.
Install Conda
Our preferred method for delivering pre-built MOOSE binaries is via Conda.
Follow the steps below depending on your platform to install Miniforge. If you run into issues during these steps, please visit our Conda Troubleshooting guide.
Linux Users:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh bash Miniforge3-Linux-x86_64.sh -b -p ~/miniforge
Macintosh Users with Intel processors:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh bash Miniforge3-MacOSX-x86_64.sh -b -p ~/miniforge
Macintosh Users with Apple Silicon processors:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh bash Miniforge3-MacOSX-arm64.sh -b -p ~/miniforge
With Miniforge installed in your home directory, export PATH so that it may be used:
export PATH=$HOME/miniforge/bin:$PATH
Now that we can execute conda
, initialize it and then exit the terminal:
conda init --all
exit
Upon restarting your terminal, you should see your prompt prefixed with (base). This indicates you are in the base environment, and Conda is ready for operation:
$ (base) ~>
The next thing you should do after a fresh install, is perform an update to the base Conda environment:
conda update --all --yes
Add INL's public channel to gain access to INL's Conda package library:
conda config --add channels https://conda.software.inl.gov/public
If you find yourself using sudo
commands while engaging Conda commands... something is not right. The most common reason for needing sudo is due to an improper Conda installation. Conda should be installed to your home directory, without any use of sudo
.
Install MOOSE
With Conda initialized, create the moose
environment and install moose
:
conda create -n moose moose
After the installation completes, activate the new environment:
conda activate moose
Know that you will need to conda activate moose
for each terminal window you open, and each time you wish to perform MOOSE related work. If you wish to make this automatic, you can add that command to the end of your shell profile.
Verify moose
is available:
moose --help
Should produce the help page. This simple command demonstrates that you have successfully installed the MOOSE Conda package.
Run an Example
A MOOSE installation binary comes with several examples you can run to make sure everything is sound, as well as moving some of the example inputs into a safe location you can play with.
You may query the executable for the available inputs with the following:
moose-opt --show-copyable-inputs
which will show something like this:
The following directories are installable into a user-writeable directory:
chemical_reactions combined contact electromagnetics external_petsc_solver fluid_properties framework fsi functional_expansion_tools geochemistry heat_transfer level_set misc navier_stokes optimization peridynamics phase_field porous_flow ray_tracing rdg reactor reactor_tutorial richards scalar_transport solid_mechanics solid_properties stochastic_tools tensor_mechanics thermal_hydraulics xfem
To install one or more directories of inputs, execute the binary with the "--copy-inputs" flag. e.g.:
$ moose-opt --copy-inputs chemical_reactions
For now, lets copy heat_transfer
into a safe location for editing:
mkdir -p ~/projects/examples
cd ~/projects/examples
moose-opt --copy-inputs heat_transfer
<output trimmed>
Directory successfully copied into ./moose/heat_transfer/
With heat_transfer's examples and inputs copied, move into the heat_transfer directory and instruct moose
to run the tests:
cd ./moose/heat_transfer
moose-opt --run -j 6
Testing will commence and take a few moments to finish. There may be several skipped tests for one reason or another. This is normal. However none of the tests should fail.
Next, we will run a single input file manually, to demonstrate how you will ultimately use moose-opt
. Peruse the subdirectories and find an input file you wish to run:
You can list all available input files by running:
# be sure to be in the heat_transfer's directory
find . -name '*.i'
# cd into the directory containing the input file you wish to run
moose-opt -i <the input file you chose>.i --mesh-only
You will see some information scroll by, and ultimately end back at your prompt. If you perform a directory listing (ls
) you should see an exodus file was generated in the process (a file with the same input filename but with _in.e
suffix).
Viewing Results
<the input file you chose>_in.e
can be opened with Paraview. A free tool available for all major operating systems for viewing mesh files of many sorts (including Exodus). Paraview is also available from Conda!
If you are interested in installing this package using Conda, you will need to do so in a new environment. As the moose
environment you are using now is incompatible with some of the dependencies required. This means while you are running moose
problems, you will need to be in the moose
Conda environment. When you want to view results, you will need to be in paraview
's environment. Conda makes this easy, but it will be up to you to watch your prompt and understand when to activate one or the other.
The easiest solution is to open two terminal windows. While in one, you have moose
activated. While in the other, you have paraview
activated. Open a new terminal window now, and create the new paraview
environment:
conda activate base # just in case you have `moose` auto-activating
conda create -n paraview paraview
conda activate paraview
With paraview installed, you can now open <the input file you chose>_in.e
with the following command:
paraview <the input file you chose>_in.e
The very first time you attempt to run paraview
it can take minutes before it launches. Consecutive launches are quick.
More Examples
Continue on to see more examples and tutorials using MOOSE! However, most of the next section is geared towards developing your own application.