Skip to content

About

Lightweight Fortran Monte Carlo code for adsorption, compatible with LAMMPS input files.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

MANIAC

Last Commit License: MIT GitHub release Build Docs Lint DOI

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

Why the name MANIAC?

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.

Compile

To build MANIAC from source, you will need the following tools installed:

sudo apt update
sudo apt install gfortran make makedepf90

Then compile the project by running:

./build.sh

This 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/maniac

Quickstart

Clone 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.

Output files

All results are written to the output directory (outputs/ by default):

  • log.maniac: run log
  • topology.data: final configuration, in LAMMPS data format
  • trajectory.lammpstrj (and reservoir.lammpstrj): trajectories in LAMMPS dump format
  • energy.dat: energy as a function of the Monte Carlo step
  • moves.dat: attempted/accepted move counters
  • number_<residue>.dat, histogram_<residue>.dat, widom_<residue>.dat: per-residue observables

LAMMPS compatibility

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.

Build the documentation

The documentation is built with Sphinx. Install the requirements:

pip install sphinx furo

Then, navigate to the docs directory and run:

cd docs
./build.sh

This 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.html

The documentation is also visible online at maniac-mc.github.io.

Examples and tests

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.sh

See tests/README.md for details.

How to cite

If you use MANIAC in your research, please cite it via its Zenodo DOI: 10.5281/zenodo.24052849.

Credit

This code was written by Simon Gravelle, who currently maintains the code, documentation, and the associated GitHub organization.

About

Lightweight Fortran Monte Carlo code for adsorption, compatible with LAMMPS input files.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages