Skip to content

Running Proteus Simulations

alistairbntl edited this page Dec 7, 2016 · 1 revision

Setting the Proteus Environment

Once Proteus has been installed, the next step is to make sure that the Proteus library paths are set. If you are running in Linux OS, add the following command to the bottom of your .bashrc file.

alias proteusenv="export LD_LIBRARY_PATH=${HOME}/proteus/linux2/lib:${LD_LIBRARY_PATH};export PATH=${HOME}/proteus/linux2/bin:${PATH}"

Next you will need to reload you terminal. One option is to type

source ~/.bashrc

in you terminal. Alternatively you can close your terminal instance and reopen it. Once this command has been set, you should type

proteusenv

in your command window. This will make Proteus visible from you command prompt.

Running a Proteus Simulation

Proteus programs typically consist of two files, one that describes the simulation's physics and another that describes the simulation's numerics. A convention has been adopted in which the physics file is distinguished with a _p, while the numerics is distinguished with a _n. For the purposes of this tutorial, let's say the physics file is called stokes_2d_p.py and the numerics file is called stokes_2d_n.py.

If the numerics and physics files are defined properly, a Proteus simulation can be run with the following command

parun stokes_2d_p.py stokes_2d_n.py

Parun Options

In many cases, it will be helpful to run the program with some additional options tailored to the exact simulation you are running. Simply append these options to the end of the command shown above.

  • -v : This will produce verbose output
  • -l # : This sets the output log detail level. # should be replaced with a number >= 1. Larger numbers will display more output
  • -D str : This option send the program output into a subdirectory with the name of str
  • -C "Options" : This option turns on the program's context. See below for a more detailed discussion of this.
  • -O dir_name : This option allows you to specify the PETSc solver options used in the simulation. dir_name should be replaced with the directory and name of the petsc options file

Context Options

For many simulations, it will be helpful to change the problem parameters directly from the command line.