Date: 2026-08-14 Purpose: From a fresh checkout to a running simulation — build, first run, and where to go next. This is the user entry point; the contributor entry point is the Coding Philosophy.
BELFEM requires CMake (≥ 3.11), a C++17 compiler, a Fortran compiler, and — for parallel runs — Open MPI. Open MPI is the only supported MPI: MPICH and Intel MPI are untested and the configure step refuses them (see MPI support). The generator is pinned to Unix Makefiles.
The defaults build the Maxwell modules with STRUMPACK, MUMPS, SuperLU and PETSc, HDF5 and Exodus I/O, and the test suite (USE_TEST=ON). On an ordinary checkout this is an optimized build: USE_DEBUG defaults to OFF (-O2 with NDEBUG), so BELFEM_ASSERT is compiled out. Configure with -DUSE_DEBUG=ON for -Og -g and the full assertion set when you need it. The full option list sits at the top of CMakeLists.txt.
The one exception is a toolchain-driven default: if $SCLS is set and names the debug flavor, USE_DEBUG presets to ON instead. An explicit -DUSE_DEBUG=… always wins, and when a flavor is in play the configure summary prints it.
The examples/ directory ships working decks. Most decks carry the geometry (.geo) — generate the mesh with gmsh first; two (corc_twolayer, pancake) build theirs with python/main.py instead, as their READMEs say. Starting from the repository root:
The bin/ path follows your build directory — build/bin/ after the §1 quick start, cmake-build-debug/bin/ in a stock IDE setup.
belfem is the solver, and the deck decides what it solves: an unlabeled linear thermal or nonlinear thermal solver section requests the coupled h-ɸ/T problem, otherwise the run is magnetic-only. It announces the choice at startup, so there is nothing to pass on the command line. It reads input.conf from the working directory and writes the field solution to an Exodus file, the current/voltage history to iv_results.csv, and a restart dump to memdump.hdf5. The Exodus file is named after the mesh — helix.msh gives helix.e-s, viewable in ParaView — except on the segregated coupled path (coupling : segregated), which still writes a fixed hphi_results.e-s.
Three things first-time users trip over:
The per-deck prerequisites and cleanup scripts are described in Examples, which lists what each deck needs before it will run; the helper scripts shared between decks are covered in Shared example scripts.
Copy the nearest example and edit it. Every section and key of input.conf is documented in the Input File Reference — syntax, units, defaults, aliases, and the pitfalls each key carries. The machine-readable twin (doc/input_schema.yaml) drives python/belfem-conf, which validates a deck without running the solver:
belfem-conf needs PyYAML.
| If you want to | Read |
|---|---|
| Understand every input.conf key | Input File Reference |
| Understand a module's internals | Module Documentation |
| Contribute code | Coding Philosophy — BELFEM's conventions differ deliberately from mainstream C++ |
| Trace a formulation to the literature | Literature References |