PLMC
A simple Physics of Liquids Monte Carlo simulation code written in Fortran
Install / Use
/learn @fortranguy/PLMCREADME
PLMC
A simple Physics of Liquids Monte Carlo simulation code written in Fortran.
Getting Started
Prerequisites
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.
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.
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
