OOF: Finite Element Analysis of Microstructures


oof2 logo

[Introduction] [Features]
[System Requirements] [Disclaimer and Copyright] [Download] [Installation] [Platform Specific Installation Notes]
[Getting Started] [Manual] [FAQ]
[Reporting Bugs] [Known Problems]


OOF2 version 2.1.19 is now available. The major differences between 2.1 and 2.0 are that 2.1 can solve time dependent problems, and has much improved nonlinear solvers. A detailed discussion of the differences and a summary of how to use the new features is included in the What's New in 2.1 page.

OOF2 version 2.1.12 can now be run on the nanoHUB. See the announcement for more details.

OOF2 retains (almost) all of the features of OOF1, although it does not read OOF1 data files. The latest versions of OOF1, however, can write OOF2 data files.

OOF2 is based on a new set of C++ classes for finite elements and material properties, tied together in a Python infrastructure. Python is an easy to use, high-level, object-oriented scripting language.

OOF2 is in an Active Development status.

Here is a brief list of OOF2 features, highlighting the differences between OOF2 and OOF1:
  • OOF2 is much more flexible and expandable than OOF1. OOF2 can potentially handle any problem of the form:
    • "Flux = Modulus times gradient of Field"
    • "divergence of Flux = Applied Force".
    Currently OOF2 can solve the heat equation, mechanical force balance, and the Coulomb equation. It includes material properties for linear elasticity, body forces (gravity), thermal conductivity, heat sources, dielectric permittivity, space charge (in an approximation in which charges interact only with the local polarization field, not with other charges at a distance), thermal expansion, and piezoelectricity.
  • New Fields and Fluxes can be added with only a few lines of Python code. New material properties can be added with a few lines of Python code, or, if speed is an issue, in C++. (Defining new Properties is not quite as simple as defining new Fields, but is much simpler than the corresponding task in OOF1.) Instructions for adding features to OOF2 are given in the manual.
  • Materials are built from a collection of Properties. Any combination of Properties is allowed, with reasonable constraints on completeness and unambiguity.
  • OOF2 contains a more powerful set of finite elements than does OOF1. OOF2 has 3 noded triangles, 4 node quadrilaterals, 6 noded subparametric triangles, and 8 noded subparametric quadrilaterals. Adding new element types in C++ is easy.
  • OOF2 generates and refines triangular, quadrilateral, and mixed meshes from image data. Element order is specified independently from element geometry.
  • OOF2 incorporates nonlinear solvers. (But not many non-linear material properties are yet present.)
  • OOF2 can refine meshes adaptively using a-posteriori error estimators.
  • OOF2 is threaded, meaning that it can perform multiple calculations simultaneously, unlike OOF1. OOF2 is not yet fully parallel -- it doesn't yet use multiple processors to perform a single calculation.
  • OOF2 is completely scriptable in Python, and can also be run interactively from a graphical user interface.
  • OOF2 has more flexible graphical output than OOF1.
  • OOF2 can export mesh geometry directly into abaqus input files.
  • OOF2 (version 2.0.4 or later) can read EBSD orientation map data files. See the OOF2 Orientation Mapping page for more information.
  • OOF2 (version 2.1.0 or later) can solve time dependent problems.
  • OOF2 (version 2.1.0 or later) can solve problems in which the flux cannot be written as modulus times field gradients.

We're working on including the following features in OOF2:
  • Expanding the scope of the problems solved.
  • Non-linear physics, including plasticity and possibly fracture.
  • Line elements, as well as elements with higher order continuity (for phase-field or strain-gradient models).
  • Parallel execution.
  • OOF2 will eventually become OOF3, which will solve 3 dimensional problems. The primary difficulties here will involve image based mesh generation and user interfaces. The finite element and material definition machinery will carry over from OOF2.


OOF2 will run on any computer running a variant of the Unix operating system, including Linux and Macintosh OS X, as long as the prerequisites listed below are available.

In addition, OOF2 requires

  • An X11 server. This is standard on most Unix systems. On OS X, X11 is an optional installation on the system DVD. Note that users of OS X 10.5 should install the latest version from Mac OS Forge instead.
  • The Python scripting language, version 2.7. OOF2 might work with versions as early as 2.4, but it hasn't been tested there. OOF2 does not work with Python 3.
  • The Image Magick++ image processing library. See the installation notes for information about ImageMagick, OOF2, and OS X.
  • The gtk+2 graphics toolkit. OOF2 requires version 2.6 or later, but not as late as version 3.0.
  • The Gnome canvas library, libgnomecanvas2, version 2.6 or later. (Earlier versions may work too.)
  • The pygtk Python bindings for the gtk+ library. OOF2 requires version 2.6 or later.
  • The BLAS basic linear algebra subroutines and the lapack linear algebra library. These are provided with many computer systems. Check to see if you have a native version before downloading and installing the generic code from netlib. On Macintosh OS X, the blas routines are built in to the Accelerate framework and do not have to be installed separately.

In addition, if you are going to be compiling OOF2 (which is the only way to get it at the moment), you should have

Detailed instructions for installing the prerequisites on various operating systems may be found here.

Disclaimer and Copyright

The research software provided on this web site (“software”) is provided by NIST as a public service. You may use, copy and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software. To facilitate maintenance we ask that before distributing modified versions of this software, you first contact the authors at oof_manager@nist.gov.


You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software was developed by NIST employees. NIST employee contributions are not subject to copyright protection within the United States.


Please read the Disclaimer and Copyright notice before downloading this software.

Useful links:


Please read the Disclaimer and Copyright notice before installing this software.

  1. Install the OOF2 prerequisites. We strongly recommend that you use a package management system to do so.
  2. The downloaded file is a compressed tar archive. If your browser didn't unpack it for you, unpack it like this:
    % tar -xzf oof2-2.1.12.tar.gz
    This will create a directory called "oof2-2.1.12".
  3. cd to that directory.
  4. Read the README.md file and follow the directions in it. Additional system-specific installation notes are available here, and some frequently asked questions are answered in the FAQ.
  5. If you like, run the test suites located in the TEST and TEST/GUI subdirectories of the OOF2 distribution. Read the README files in those directories for instructions.


After installing OOF2, you should have an executable file named oof2 in a bin directory in your execution path. You can now simply type oof2 at your shell prompt, and OOF2 will start up.

OOF also has many options, and you can get a summary of them by typing oof2 --help.

By default, OOF runs in graphics mode, opening a couple of windows to get you started. If you don't want this, you can use the --text option to run it in command-line mode.

Most importantly, explore the Tutorials in the Help menu. (The tutorials are only available in graphics mode.)

Getting Started with OOF2 2.1 explains the differences between 2.0.5 and 2.1.

If you run into trouble, please check the FAQ.


The OOF2 Manual is available at http://www.ctcms.nist.gov/~langer/oof2man/index.html. You can also download the html files as a gzipped tar file (8926465 bytes). Use tar -xzf oof2man.tgz to unpack it.

If you're familiar with OOF2 2.0, the Getting Started with OOF2 2.1 page summarizes the differences between versions 2.0 and 2.1.


Please check the FAQ and the Known Problems list below before submitting bug reports. Send bug reports via e-mail to oof_bugs@nist.gov. Include the following information with your report:

  1. The type of computer and operating system that you're using.

  2. The version of OOF2 that you're using. Starting OOF2 with the --version flag will print the version number.

  3. A complete description of the problem: what happened, and what did you do to make it happen? Be as specific and detailed as possible.

  4. If possible, an OOF2 script that reproduces the problem. A script can be saved from the "File/Save/Python Log" menu item in the main OOF2 window, or the "Save" button in the "Quit" dialog box.

    If OOF2 crashes before you get a chance to save a script, a script will be saved automatically in the directory that your operating system uses for temporary files, which is probably /tmp. Look for a file with oof2 in its name in a subdirectory of /tmp.

    Be sure to include any files that the script requires.

Current Problems:
  • Images drawn in the graphics window sometimes are drawn one screen pixel to the left and/or above where they should be. This appears to be due to round-off error within the gtk+ library. A work-around is to turn on antialiasing (in the graphics window's Settings menu), but this causes other problems.
  • A number of operations need to be sped up.
  • Some parts of the GUI test suite fail intermittently. We believe that this is due to timing and threading problems related to the test suite itself, and does not reflect errors in the OOF2 code. If a test fails, repeat it and see what happens. If it fails consistently, we'd like to know about it, but otherwise you can probably ignore it. Partially fixed in version 2.0.2. Even more fixed in version 2.1.
  • Adaptive Mesh Refinement is unreliable. Our algorithm is unstable, and results may be unreproducible.
  • The regression test suite fails intermittently on OS X. We have no evidence that the problem exists outside of the test suite.
  • The list of Past Problems on the website is not sorted in any meaningful way.
Past Problems:
  • OOF2 would crash when solving meshes with orientation maps. Fixed in version 2.1.3.
  • Files opened in "append" mode as destinations in the Scheduled Output page are overwritten instead. Fixed in version 2.1.1.
  • Piezoelectric calculations are almost all incorrect. Fixed in version 2.0.5a11.
  • The value of the Destination widget on the Boundary Analysis page is not used. Results are sent to the Message Window instead. Fixed in version 2.0.5a10.
  • The xz and yz components of the geometric strain are computed incorrectly when the displacement field has out-of-plane derivatives. Other quantities, such as the elastic energy, that depend on the strain are also incorrect. Fixed in version 2.0.5a10.
  • On Ubuntu 9.04 and 9.10, operating in text mode can lead to a garbled screen. This is most likely to occur when running the text-mode test suite, which fails as a result of this behavior. This is a manifestation of Ubuntu bug 492140. Worked around in version 2.1, which only needs to assess the width of the screen once.
  • Meshes that have been modified with Adaptive Mesh Refinement, or whose Skeletons have been modified after the the Mesh was created, are not saved properly and cannot be reloaded from data files. Fixed in version 2.1.
  • Intersecting floating boundary conditions with continuum profiles don't work. Fixed in version 2.0.3.
  • Switching Skeleton modifiers can sometimes cause an RWLock error. Fixed in version 2.0.2.
  • The "File/Save/Python Log" dialog box's "Save" button is sometimes incorrectly disabled. A workaround is to switch directories within the dialog, and then switch back, if necessary. Fixed in version 2.0.2.
  • The Nodes on the top and/or right edges of a Skeleton sometimes move off of the edge when the Skeleton is modified. Fixed in version 2.0.2.
  • The stress-free strain property and the thermal expansion property with non-zero T0 do not work correctly in plane-stress. Fixed in 2.0.2.
  • Material dependent output quantities (e.g, stress) are not computed correctly in some cases if a mesh is loaded from a data file. A workaround is to solve the mesh, even if the saved state has already been equilibrated. Fixed in 2.0.2.
  • In versions 2.0.2 and 2.0.3, OOF lets you use the CG solver even for non-symmetric problems. The workaround is to choose another solver when using thermal expansion with an active temperature field. Fixed in version 2.0.4.
  • OOF dumps core when quitting on some systems, including NetBSD. This is harmless (you were quitting anyway, right?), but annoying. Fixed in version 2.0.4b2.
  • Since the introduction of subproblems in 2.0.2, and possibly prior to that, the Adaptive Mesh Refinement tool on the FEMesh page has caused segfaults. Partially fixed in version 2.0.4, fixed more in version 2.0.5a1.
  • The "Save Image" menu item in the Graphics Window's "File" menu doesn't work if the window is displaying a Microstructure's Material colors. Fixed in version 2.0.5a1.
  • If a Field is defined and initialized on a Subproblem and then defined on a different Subproblem that shares Nodes with the first one, the Field will be reinitialized on those shared Nodes, destroying any calculated values. Fixed in version 2.0.5a1.
  • Modifying a Skeleton, creating a Mesh, unmodifying the Skeleton, and then modifying one of its boundaries causes an error. Fixed in version 2.0.5a1.
  • Mesh data files containing initialized out-of-plane fields cannot be loaded. Fixed in version 2.0.5a2.
  • If the pixel size isn't 1x1 in physical units, round-off error can cause crashes in various operations (for example, creating contour plots of orientation-map dependent quantities). Fixed in version 2.0.5a2.
  • OOF.Skeleton.Auto can create illegal elements because of a poor choice of parameters in SnapRefine, which can lead to a divide-by-zero error in Rationalize. Fixed in version 2.0.5a2.