Skip to content

A simple Physics of Liquids Monte Carlo simulation code written in Fortran

License

Notifications You must be signed in to change notification settings

fortranguy/PLMC

Repository files navigation

PLMC

A simple Physics of Liquids Monte Carlo simulation code written in Fortran.

Getting Started

Prerequisites

You need:

You may need:

Installation

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

Run a simulation

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"

Analyse the results

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

Legacy

I hope to defend my thesis soon. Feel free to fork this project, make it your own and share it.

Licence

This code is under GPL3 licence.

About

A simple Physics of Liquids Monte Carlo simulation code written in Fortran

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published