Glauber Dynamics in C
Simulation for Glauber Dynamics written in C11
|
This library is fully documented using doxygen which can be generated using
doxygen Doxyfile
and then observed by opening documentation/html/index.html
. This README contains the necessary information to get the program running (only tested on Linux).
glib-2.0
, graphviz
and pkg-config
installed and their respective C libraries. A quick check for this is that the command pcg-c
is a subdirectory of lib
(Note: Do not download the minimal version)../configure && make
in the pcg-c
folder../configure && make
in the main directory of this repository. If this fails make sure you have autotools
installed.There should be a runnable glauber_dynamics
in the main directory of this library now. To see how to run it run
As a quick reference the three main commands are If you wish to run the simulation and save the final state of the configuration in a png (final.png
), then run
To have a comparison between the state after 10 iterations and the end of the simulation add the -i
flag
To save the video file of the configuration evolution using ffmpeg
for example use that ./glauber_dynamics
streams png
files to stdout
and hence you can pipe the output to ffmpeg directly and save it for example in the nut format as out.nut
by writing
If you additionally want to concurrently stream the evolution while simulating specify an additional output to ffmpeg
which pipes its rendered video to stdout
and can thus be piped into any regular video player, here mpv
, as
Adapt the fps
(frames per second) to your need. If you increase the frames per second you will have a shorter video but streaming it will be laggy as more frames have to be calculated for a second of output.