Lemma is an Electromagnetics Modelling API


  • Lemma has an expressive API
  • Lemma employs a modern test-driven development
  • Lemma is 100% C++, currently we require a C++-14 compliant compiler
  • Lemma has bindings and integration with VTK
  • Lemma provides excellent multi-core performance
  • Lemma objects employ class serialization using YAML.

Getting the code

Lemma uses git. The project is hosted here on our own website:

git clone

If you prefer to use GitHub, Lemma is mirrored there as well, pull requests can be managed though GitHub too

git clone

Read only anonymous access is permitted at either site. If you would like to contribute and obtain write access please email info for a username and password.


Lemma is modular, compile and bundle only what you need. There are several modules provided with the main project.

  1. LemmaCore (required) - Provides base classes which all Lemma objects inherit from
  2. FDEM1D (optional) - Frequency domain 1D forward modelling of Maxwell's equations
  3. TEM1D (optional) - Time domain 1D forward modelling of Maxwell's equations
  4. Several other modules are being ported over from prior versions of Lemma.

Lemma is extensible, in addition to the main modules, you can easily plugin additional modules.

  1. EMSchur3D - 3D solution of Maxwell's equations.
  2. Merlin - Merlin provides surface NMR functionality to Lemma including 1D inversion
  3. FEM4EllipticPDE - This is a finite element solver of general elliptic PDE problems.


  • Doxygen generated man pages are index.


Lemma compares well with existing FORTRAN 77 codes and also scales well on multi-processor machines. Benchmarks will be uploaded shortly.


Lemma uses CxxTest?, results are posted using CDash


The only hard dependencies prior to installation are a C++ compiler, git, and CMake

  • C++ Compiler - we actively test against gcc (gcc-7, gcc-8), Microsoft Visual C++, and clang.
  • The Intel compiler (icpc) is tested less often
  • git - a distributed version control software needed for the build process
  • CMake - v3 or higher, CMake is a cross-platform platform for building software

Bundled dependencies

Several additional dependencies are bundled with Lemma, all have liberal licenses and should place minimal restrictions on any use of Lemma.

  • Eigen 3 C++ linear algebra (header) library
  • matio
  • tinyxml2
  • matplot_vtk
  • yaml-cpp

As an optional dependency VTK is needed for visualisation. VTK is released under a BSD license.

Compiler support

We actively test against GCC versions 5.2 to 5.3 and Intel 13.0.1. Clang++ is also tested and supported (clang does not yet support OpenMP). Microsoft compilers are less frequently tested, but are officially supported. Stable releases will support all of these compilers. If you are using a different C++ compiler, please let us know your experience.

Platform support

Lemma has been successfully compiled on Linux (our primary platform) Windows ( XP, Vista, 7, and 8), as well as Max OS X.


Most Linux package managers handle all the dependencies for Lemma, and the Lemma install process should proceed smoothly in a UNIX/Un*x environment.


Compilation on Mac OSX using clang++ is relatively straightforward.


The preferred compilation approach is shown in AnacondaWindowsNotes which relies on the Anaconda Python Distribution as a means to install third-party software including git, CMake, and VTK. This approach uses the Microsoft Visual C++ compiler.


Lemma is available under the Mozilla Public License, v. 2.0. MPL Much of the code is covered by

  • Copyright (C) 2009--2018 Trevor Irons
  • Copyright (C) 2010, 2011, 2012 Colorado School of Mines.
  • Copyright (C) 2010--2013 M. Andy Kass.


Email questions to support.

Bug reports

File a ticket using this website.


Lemma has been built in collaboration with the department of Geophysics at the Colorado School of Mines, specifically CGEM the United States Geological Survey and the University of Utah

Our primary authors are Trevor Irons and M. Andy Kass.

Lemma has extended public domain code from Walt Anderson, Alan Chave, and Ki Ha Lee. In all cases original FORTRAN 77 codes were ported and reworked into our modern framework. We are grateful for their fine contributions to the public domain. Please keep in mind use of their code does not imply endorsement.


Interested in contributing? Great. Whether you are interested in extending Lemma, improving some aspect, or just making the documentation better, we welcome contributions. Some links that might be useful

Citing Lemma

An example BibTeX entry is provided below. If you are using a module with different primary authors, it may be appropriate to modify this entry.

  author = {Trevor Irons and M. Andrew Kass and others},
  title = {Lemma v1},
  howpublished = {},
  year = {2012}
Last modified 9 days ago Last modified on Dec 5, 2018 5:10:45 PM