daniel-pedersen / LKMC

Framework for developing lattice kinetic monte carlo (LKMC or KMC) simulations
GNU General Public License v3.0
4 stars 1 forks source link

how to run or use this code #1

Open SUN123RAY opened 7 years ago

SUN123RAY commented 7 years ago

hi Daniel, You wrote the code really in a nice way. Just one thing I want to know, can you please help how to use this code. What command needs for that.

daniel-pedersen commented 7 years ago

I will make a guide and rewrite the API when I've got some more free time. Likely during summer.

Meanwhile, to run the code you need to have a C++ compiler and compile it with your own main.cpp. If you want to run any simulation, other than the graphene-boron nitride one, you need to write your own lattice code. A simple example, using the mentioned lattice can be with the following main.cpp:

#include "src/LKMC/LKMC.h"

auto sim = new LKMC();
sim.newAdatom(100,100); // create new adatom at (100,100)
sim.newAdatom(-140,50); // create new adatom at (-140,50)

// run simulation for 100 steps
for (int i = 0; i < 100; ++i) {
  sim.step();
}

// output status to stdout
sim.outputStatus();

Inside LKMC.cpp you can set simulation constants, such as size of the lattice and temperature.

To run the code using an arbitrary lattice, you need to write your own LKMC.h and LKMC.cpp files as well. You can use these files as examples.

The API for writing your own simulations/lattices is currently close to non-existent, so the code is very difficult to use. That's why I'm rewriting those parts as soon as I have some more time on my hands.

SUN123RAY commented 7 years ago

hi Daniel thanks for your reply. I want try the same thing only one tap of sheet, either graphene or BN.

so for that what I need to change in lattice? I have looked in the Lattice directory, that containing : adatom.h, basis.h, Latticenode.h, latticespecilization.h, LKMCNode.h, SNArray.h, Space.h

On Fri, Jun 2, 2017 at 2:00 PM, Daniel Pedersen notifications@github.com wrote:

I will make a guide and rewrite the API when I've got some more free time. Likely during summer.

Meanwhile, to run the code you need to have a C++ compiler and compile it with your own main.cpp. If you want to run any simulation, other than the graphene-boron nitride one, you need to write your own lattice code. A simple example, using the mentioned lattice can be with the following main.cpp:

include "src/LKMC/LKMC.h"

auto sim = new LKMC(); sim.newAdatom(100,100); // create new adatom at (100,100) sim.newAdatom(-140,50); // create new adatom at (-140,50) // run simulation for 100 stepsfor (int i = 0; i < 100; ++i) { sim.step(); } // output status to stdout sim.outputStatus();

Inside LKMC.cpp you can set simulation constants, such as size of the lattice and temperature.

To run the code using an arbitrary lattice, you need to write your own LKMC.h and LKMC.cpp files as well. You can use these files as examples.

The API for writing your own simulations/lattices is currently close to non-existent, so the code is very difficult to use. That's why I'm rewriting those parts as soon as I have some more time on my hands.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/daniel-pedersen/LKMC/issues/1#issuecomment-305766935, or mute the thread https://github.com/notifications/unsubscribe-auth/ATOQFMpTBydObnEf3fY4MPY4umGms97Fks5r__ljgaJpZM4Nrpie .