Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

how to run or use this code #1

Open
SUN123RAY opened this issue May 31, 2017 · 2 comments
Open

how to run or use this code #1

SUN123RAY opened this issue May 31, 2017 · 2 comments

Comments

@SUN123RAY
Copy link

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
Copy link
Owner

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
Copy link
Author

SUN123RAY commented Jun 2, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants