Modified kinetic Monte Carlo (kMC) code for running simulation of elastically interacting excitations.
To compile the program, you need a C compiler, such as gcc, clang, etc. Use the following command:
gcc kmcres.c gsd.c -o kmcres.exe -lmThe executable requires 5 command-line arguments:
kmcres.exe (L) (kappa) (betaJ) (filename) (gsd_mode)L: System sizekappa: Interaction strength parameterbetaJ: Inverse temperature parameterfilename: Base name for output filesgsd_mode: Set toonoroff. Ifon, the program generates a GSD file for trajectory data.
Note that this program will generates 4 files.
filename.log:
Contains:
- Number of timesteps
- Simulation time
- Bond-order correlation
- Self-intermediate scattering function
- Mean-squared displacement
- Persistence function
- Number of excitation
- Boolean flag indicating whether the threshold has been reached.
-
filename.binCheckpoint file used for restarting simulations. -
filename.finAn empty file created when the simulation ends normally. Useful as a completion flag. -
filename.gsd(only ifgsd_modeison) Stores trajectory data in GSD format, which contains:
particles/N: Total number of lattice sitesparticles/position: Positions of the lattice sitesparticles/diameter: Persistence variable of each site (0 or 1).particles/typid: Site type identifier -- 0 for type A and 1 for type B, where type B indicates an excited site.configuration/box: System size information.configuration/step: Current kinetic Monte Carlo step.
- Ensure the
gsd.handgsd.cfiles are included and properly linked. - The program assumes a lattice-based system in 2 dimension with kinetic constraints.
- GSD files can be visualized using Ovito or analyzed with Python libraries such as
gsdandhoomd.