Cubica: a toolkit for subspace deformations

What is it?

Cubica is a toolkit for efficient finite element simulations of deformable bodies containing both geometric and material non-linearities. Its main feature is its use of subspace methods, also known as dimensional model reduction or reduced order methods, which can accelerate simulations by several orders of magnitude. In particular, it implements the methods described in the papers

Various versions of this code were used to generate the examples in those papers.

You can download the code here. This code is released under the GNU Public License.


Cubica depends on several freely available software packages:

  • GLVU, for OpenGL navigation.
  • PETSc, to solve sparse linear systems.
  • SLEPc, to solve sparse eigenproblems.
  • ARPACK and ARPACK++, also to solve sparse eigenproblems.
  • UMFPACK to quickly invert sparse matrices for ARPACK.
  • If you are compiling on Linux, you will need Intel MKL. Note that for non-commercial purposes, Intel provides a free download.
It takes some effort to successfully compile Cubica for the first time. It is not as straightforward to build as say, the Wavelet Turbulence code. However, according to SLOCCount, it contains 105,546 lines of C++ code, so the compilation effort is still considerably less than implementing from scratch.

In order to assist you, operating system-specific installation instructions are available:

Windows is not supported at this time, because there does not appear to be a clean way to get both PETSc and a complete LAPACK implementation to build and link to C++ under Cygwin.

Detailed instructions for using the Cubica toolkit are here.


The purpose of the current code release is to provide a working implementation of the techniques from the above papers. While every effort has been made to make the code readable, it is still primarily a research prototype, and time constraints preclude its full documentation. However, a general overview of the structure of the code and its key classes can be found here.


Many pieces of external code are embedded in Cubica that the original authors were generous enough to make available:

Some cosmetic changes may have been made to the code in order to bring them into line with the Cubica coding standards. If you spot any external code in the distribution that I have forgotten to attribute here, please let me know. This code has been under development for several years, so there are likely pieces that I have forgotten that I included.

Cubica was written by Theodore Kim, with contributions from Doug James, Steven An, Jeff Chadwick, and Alan Bandurka.

This work was supported in part by the National Science Foundation (CAREER-0430528, EMTCompBio-0621999), the National Institutes of Health (NIBIB/NIH R01EB006615), NSERC (Many-core Physically Based Simulations), the Alfred P. Sloan Foundation, and donations from Intel, Pixar, and Autodesk.