MANIAC is a lightweight Monte Carlo simulation code written in Fortran, designed for GCMC and adsorption studies. It reads basic LAMMPS-style topology files and supports the following Monte Carlo moves:
- Translation
- Rotation
- Insertion
- Deletion
- Swap
The original MANIAC computer (for Mathematical Analyzer, Numerical Integrator, and Computer) was built in the early 1950s at Los Alamos National Laboratory. It was one of the first machines used to perform Monte Carlo simulations in statistical physics and nuclear research.
To build MANIAC from source, you will need the following tools installed:
sudo apt update
sudo apt install gfortran make makedepf90Then compile the project by running:
./build.shThis will:
- Generate the Fortran version module from the template.
- Clean previous build artifacts.
- Rebuild the dependency file using makedepf90.
- Compile all Fortran source files with gfortran.
The resulting executable is located at:
build/maniacClone the repository together with the mc-topology submodule that contains
the example systems, build, and run the ZIF8-CH4O grand canonical example:
git clone --recurse-submodules https://github.com/maniac-mc/maniac-mc.github.io.git
cd maniac-mc.github.io
./build.sh
./run.sh./run.sh executes the ZIF8-CH4O case and writes the results to outputs/.
To run another system, call the executable directly:
build/maniac -i input.maniac -d topology.data -p parameters.inc -o outputs/ -r reservoir.data| Option | Meaning | Required |
|---|---|---|
-i |
input file (.maniac) |
yes |
-d |
topology data file (LAMMPS .data) |
yes |
-p |
parameter include file (parameters.inc) |
yes |
-r |
reservoir topology (for insertion/swap moves) | no |
-o |
output directory (default: outputs/) |
no |
The full list of input-file keywords is described in the input file documentation.
All results are written to the output directory (outputs/ by default):
log.maniac: run logtopology.data: final configuration, in LAMMPS data formattrajectory.lammpstrj(andreservoir.lammpstrj): trajectories in LAMMPS dump formatenergy.dat: energy as a function of the Monte Carlo stepmoves.dat: attempted/accepted move countersnumber_<residue>.dat,histogram_<residue>.dat,widom_<residue>.dat: per-residue observables
MANIAC uses the same .data file format as LAMMPS for molecular
topology. MANIAC assumes that the real units system is used, and that
a pair style of the family lj/cut/coul/long is used.
The documentation is built with Sphinx. Install the requirements:
pip install sphinx furoThen, navigate to the docs directory and run:
cd docs
./build.shThis reads the version from version.txt and creates the complete
documentation in the docs/build/html folder, which can be opened with:
firefox build/html/index.htmlThe documentation is also visible online at maniac-mc.github.io.
Several example systems are provided in a separate repository: mc-topology. The code has been validated against LAMMPS and RASPA for the example cases located in mc-topology.
The automated test suite (unit, reader, writer, and integration tests) can be run with a single command:
bash tests/run-all.shSee tests/README.md for details.
If you use MANIAC in your research, please cite it via its Zenodo DOI: 10.5281/zenodo.24052849.
This code was written by Simon Gravelle, who currently maintains the code, documentation, and the associated GitHub organization.
