Getting Started

This section walks you through a brief introduction to using IAMR.

Downloading the code

IAMR is built on top of the AMReX framework. In order to run IAMR, you must download separate git modules for IAMR, AMReX and AMReX-Hydro.

First, make sure that git is installed on your machine.

  1. Download the AMReX repository by typing:

    git clone

    This will create a folder called amrex/ on your machine.

  2. Download the AMReX-Hydro repository by typing:

    git clone

    This will create a folder called AMReX-Hydro/ on your machine.

  3. Download the IAMR repository by typing:

    git clone

    This will create a folder called IAMR/ on your machine.

You will want to periodically update each of these repositories by typing git pull within each repository.

Building the code

Here, we walk you through compiling an IAMR executable. We’ll build the source code in one of the IAMR/Tutorials directories. A description of the included problems is given in Tutorials/ or in the Tutorials Section.

To build the code:

  1. cd to the desired build directory.

  2. Edit the GNUmakefile:

    Set AMREX_HOME to be the path to the directory where you have put amrex. NOTE: when setting AMREX_HOME in the GNUmakefile, be aware that ~ does not expand, so AMREX_HOME=~/amrex/ will yield an error.

    Alternatively, the path to AMReX can be set up as an environment variable, AMREX_HOME, on your machine to point to the path name where you have put AMReX. For example, if you are using the bash shell, you can add this to your .bashrc as:

    export AMREX_HOME=/path/to/amrex

    alternatively, in tcsh one can set

    setenv AMREX_HOME /path/to/amrex

    Other options that you can set in the GNUMakefile include

    Option name


    Possible values

    Default value


    Compiler (gnu or intel)

    gnu / intel



    Whether to enable MPI




    Whether to enable OpenMP




    Whether to enable CUDA




    Whether to use DEBUG mode




    Include profiling info




    Include tiny profiling info




    Include comm profiling info




    Include trace profiling info




    Do not set both USE_OMP and USE_CUDA to true.

    Information on using other compilers can be found in the AMReX documentation at .

  3. Make the executable:

    Now type


    The name of the resulting executable (generated by the make system) encodes several of the build characteristics, including dimensionality of the problem, compiler name, and whether MPI and/or OpenMP were linked with the executable. Thus, several different build configurations may coexist simultaneously in a problem folder. For example, the default build in IAMR/Tutorials/FlowPastCylinder will look like amr3d.gnu.MPI.ex, indicating that this is a 3-d version of the code, made with COMP=gnu, and USE_MPI=TRUE.

Running the code

IAMR takes an input file as its first command-line argument. The file may contain a set of parameter definitions that will overrides defaults set in the code. For example, to run an example in IAMR/Tutorials/Bubble, type:

./amr2d.gnu.ex inputs.2d.bubble

IAMR typically generates subfolders in the current folder that are named plt00000, plt00010, etc, and chk00000, chk00010, etc. These are called plotfiles and checkpoint files. The plotfiles are used for visualization of derived fields; the checkpoint files are used for restarting the code. The output folders contain a set of ASCII and binary files. The field data is generally written in a self-describing binary format; the ASCII header files provide additional metadata to give AMR context to the field data.

Visualizing the Results

There are several options for visualizing the data. VisIt supports the AMReX file format natively, as does the yt python package and ParaView. Amrvis is a package developed by CCSE that is designed specifically for highly efficient visualization of block-structured hierarchical AMR data. We have also created a number of routines to convert AMReX plotfile data to other formats (such as MATLAB), but in order to properly interpret the hierarchical AMR data, each tends to have its own idiosyncrasies. If you would like to display the data in another format, please let us know and we will point you to whatever we have that can help.

Here we provide instructions on downloading and using Amrvis. For more infomation on visualization, including using other software for visualization, please see the Visualization Section.

  1. Get Amrvis:

    git clone

    Then cd into Amrvis/, edit the GNUmakefile there to set DIM = 2, and again set COMP to the compiler suite you have. Leave DEBUG = FALSE.

    Type make to build, resulting in an executable that looks like amrvis2d…ex.

    If you want to build amrvis with DIM = 3, you must first download and build volpack:

    git clone

    Then cd into volpack/ and type make.

    Note: Amrvis requires the OSF/Motif libraries and headers. If you don’t have these you will need to install the development version of motif through your package manager. lesstif gives some functionality and will allow you to build the amrvis executable, but Amrvis may exhibit subtle anomalies.

    On most Linux distributions, the motif library is provided by the openmotif package, and its header files (like Xm.h) are provided by openmotif-devel. If those packages are not installed, then use the OS-specific package management tool to install them.

    You may then want to create an alias to amrvis2d, for example

    alias amrvis2d /tmp/Amrvis/amrvis2d.gnu.ex
  2. Return to the IAMR/Tutorials/Bubble folder. You should have a number of output files, including some in the form pltXXXXX, where XXXXX is a number corresponding to the timestep the file was output. To see a single plotfile, type

    amrvis2d <filename>
    Amrvis visualization tool

    Fig. 1 Amrvis visualization tool

    Or to animate the sequence of plotfiles, use

    amrvis2d -a plt\*

    Within Amrvis you can change which variable you are looking at and/or select a region and click “Dataset” (under View) in order to look at the actual numbers. You can also export the pictures in several different formats under “File/Export”.