|
MRMD 0.4.0
Multi Resolution Molecular Dynamics
|
MRMD is a stand-alone, open-source C++ package implementing the (Hamiltonian) adaptive resolution simulation ((H-)AdResS) method, which concurrently couples regions of different resolution — e.g. atomistic Lennard-Jones and ideal gas — to simulate open molecular systems that exchange particles and energy with a reservoir.
The software exposes all of its algorithms as composable building blocks, facilitating both running AdResS simulations and developing the method itself.
These are fetched and built automatically by CMake:
| Flag | Description | Default |
|---|---|---|
| MRMD_BUILD_DOCS | Build the Doxygen documentation (docs) | OFF |
| MRMD_ENABLE_COVERAGE | Enable code coverage (clang only) | OFF |
| MRMD_ENABLE_HDF5 | Enable HDF5 / H5MD support | OFF |
| MRMD_ENABLE_TESTING | Build tests and add them to ctest | ON |
| MRMD_USE_SHARED_SPACE | Use shared space for Kokkos. | OFF |
| MRMD_VEC_REPORT | Enable reporting of loop vectorization | OFF |
| MRMD_VERBOSE_ASSERTS | Verbose asserts (CPU only) | OFF |
| MRMD_WERROR | Treat warnings as errors | OFF |
| Flag | Description | Options |
|---|---|---|
| Kokkos_ENABLE_* | Enable Kokkos backends | SERIAL, OPENMP, CUDA, ... |
| Kokkos_ARCH_* | Select target architecture | AMPERE80, NATIVE, ... |
MRMD can be installed and consumed as a library from other CMake projects:
Downstream projects locate it with find_package and link against the mrmd::mrmd target:
When configuring the downstream project, point CMake at the install location:
The API documentation is published at https://xzzx.github.io/mrmd/. To build it locally, install Doxygen (and optionally Graphviz for diagrams) and run:
The HTML output is written to mrmd-build/docs/html/index.html.
The [examples](examples) directory contains a series of self-contained simulations that build on each other, from a minimal, non-interacting system up to a full multi-resolution production workflow. Each example is built as its own executable in mrmd-build/examples/<name>. Work through them in order to get familiar with MRMD.
| Example | Description |
|---|---|
00_IdealGas_NVE | Minimal ideal gas (non-interacting particles) simulation in the NVE (microcanonical) ensemble. Introduces the simulation domain, ghost layer, and the velocity-Verlet integrator. |
01_IdealGas_NVT | Same ideal gas setup as above, but run in the NVT (canonical) ensemble using a Langevin thermostat. |
02_LennardJones_NVT | Lennard-Jones fluid in the NVT ensemble with a Langevin thermostat, neighbor lists, and analysis of kinetic energy, pressure, and system momentum. Writes a .gro configuration file used by later examples. |
03_LennardJones_NVE | Lennard-Jones fluid in the NVE ensemble, restoring the initial configuration from the .gro file produced by 02_LennardJones_NVT and writing H5MD output. |
04_LennardJones_IdealGas_LocalCap | Relaxes a randomly placed, ideal-gas-like starting configuration into a Lennard-Jones fluid using a locally capped force during equilibration to avoid instabilities from overlapping atoms. |
05_LennardJones_Equilibration | Two-stage equilibration workflow: first with a Berendsen thermostat, then a follow-up run with a Langevin thermostat, producing H5MD checkpoints for production runs. |
06_LennardJones_ProductionAtomistic | Atomistic production simulation restoring from an equilibrated H5MD checkpoint, with configurable thermostat and force-capping options. |
07_LennardJones_ThermoForce | Computes the thermodynamic force field iteratively for adaptive-resolution coupling; includes a variant that starts from a precomputed initial guess to speed up convergence. |
08_LennardJones_ProductionTracer | Production run with tracer particles using the converged thermodynamic force field from 07_LennardJones_ThermoForce. |
Contributions are welcome! Please open an issue to discuss a bug or feature request before submitting a pull request. When contributing code, follow the existing code style (enforced via .clang-format) and ensure all tests pass.
format.sh formats all tracked C++ sources (*.cpp, *.hpp) in place according to .clang-format. It is also wired up as a pre-commit hook in .pre-commit-config.yaml, so formatting happens automatically on every commit.
Run it manually from the repository root:
Enable the commit hook once per clone:
Hard dependencies of the script:
clang-format-18 — exactly this versioned binary name must be on your PATH; a plain clang-format or a different version will not be picked upThe pre-commit hook additionally requires pre-commit itself.
If you use MRMD in your research, please cite it using the metadata in CITATION.cff or the following:
Sebastian Eibl and Julian Friedrich Hille. Multi Resolution Molecular Dynamics (MRMD). doi:10.5281/zenodo.17698862
MRMD is licensed under the Apache License 2.0. See [LICENSE](LICENSE) for details.