Build and Run¶
Usage¶
First, clone the repository from GitHub by typing in a terminal:
git clone https://github.com/maniac-mc/maniac-mc.git
Then, cd into the maniac-mc/ folder:
cd maniac-mc/
And build the code by runing the following command from a terminal:
./build.sh
This will create the executable in ./build/maniac.
The executable build.sh is a helper that performs the following steps:
Read version information The script reads the project version from
version.txtand the current Git commit ID usinggit rev-parse. This ensures that every build is traceable.Generate version module It processes the template file
src/version_module.f90.inand replaces placeholders with the actual version and commit ID, producingsrc/version_module.f90. This Fortran module allows the program to embed its build version.Clean previous build Runs
make distcleanto remove any previous build artifacts, including generated dependencies and include files.Regenerate dependencies Executes
make dependso thatdependencies.dis updated. This ensures proper compilation order when source files change.Compile the project Finally,
makeis executed to compile the source code and generate the executable in./build/maniac.
Run¶
To run the code, you need to provide three files:
The main MANIAC input file (
.maniac) containing the parameters values,A LAMMPS data file (
.data) containing the topology,A LAMMPS parameter file (
.inc), where thepair_coeffare provided.
To do so, in a terminal, define the paths to each three files:
input="input.maniac"
data="topology.data"
inc="parameters.inc"
Then, launch MANIAC with:
path/maniac -i $input -d $data -p $inc
Where path is the path to the executable maniac. Optionally, you can also
specify:
An output folder with the
-oflag,A molecule reservoir with the
-rflag. The reservoir should also be provided as
a LAMMPS .data file.
Example:
res="reservoir.data"
./maniac -i $input -d $data -p $inc -o "outputs/" -r $res
All output files (logs, trajectory, and data) will be written into the specified folder. When a reservoir is provided, MANIAC draws molecules from it and attempts to insert them into the system. If no reservoir is specified, MANIAC instead replicates the first molecule found in the topology.