A simple Physics of Liquids Monte Carlo simulation code written in Fortran.
You need:
- a Fortran compiler such as gfortran 6.1+ or ifort 16.0+
- CMake 3.0+ to build the project
- json-fortran 5.0+ to input simulation parameters.
You may need:
- FORD 5.0+ to generate the documentation
- LuaLaTex 0.95+ to draw the class diagrams
- Julia 0.5+ to create an initial configuration or check energy consistency
- Python 3+ to analyse dipoles clusters.
Make a folder and execute cmake from it:
mkdir build
cd build
FC=gfortran cmake /path/to/PLMC
The default build is debug. You can change it using make edit_cache
.
From now on PLMC
will be a shorthand for /path/to/PLMC
.
Now you can build the project:
make -j <num_jobs>
Binaries should be in bin/Debug/
.
Copy a parameters file to generate a Markov chain:
cp PLMC/data/hard_spheres.json .
Create an initial configuration:
julia PLMC/scripts/randomCoordinates.jl hard_spheres.json
If you want to use randomCoordinates.jl
, you may need to add this line in your .juliarc.jl
:
push!(LOAD_PATH, "PLMC/scripts/")
Finally, you can run your simulation:
plmc_generate hard_spheres.json
You can plot translations acceptance ratio to check the progress:
gnuplot
plot "generating_box_1/changes_success_1.out"
Copy another parameters file to explore the generated configurations:
cp PLMC/data/exploring.json .
If you want the radial distribution function, enter:
radial hard_spheres.json exploring.json generating_box_1/coordinates/coordinates_*.xyz
And you can plot it:
gnuplot
plot "radial_1-1.out" w l
I hope to defend my thesis soon. Feel free to fork this project, make it your own and share it.
This code is under GPL3 licence.