Skip to content

Commit 46b765d

Browse files
Added micro sim cpp file
1 parent 5677941 commit 46b765d

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

native/include/c_micro_sim.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ class MicroSim {
4040
void add_interaction(void * interaction);
4141

4242
};
43+
44+
enum EnergyTermIDs {
45+
NONE = 0,
46+
EXCHANGE,
47+
DMI,
48+
ZEEMAN,
49+
UNIAXIAL_ANISOTROPY
50+
};

native/src/c_micro_sim.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include "c_micro_sim.h"
2+
#include "c_constants.h"
3+
4+
5+
void MicroSim::setup(int nx, int ny, int nz, double dx, double dy, double dz,
6+
double unit_length, double *coordinates, int *ngbs,
7+
double *spin, double *Ms, double *Ms_inv,
8+
double *energy, double *field, double *pins
9+
) {
10+
11+
this->nx = nx;
12+
this->ny = ny;
13+
this->nz = nz;
14+
this->n = nx * ny * nz;
15+
this->dx = dx;
16+
this->dy = dy;
17+
this->dz = dz;
18+
this->unit_length = unit_length;
19+
this->coordinates = coordinates;
20+
this->ngbs = ngbs;
21+
22+
this->spin = spin;
23+
this->Ms = Ms;
24+
this->Ms_inv = Ms_inv;
25+
this->energy = energy;
26+
this->field = field;
27+
this->pins = pins;
28+
29+
set_up = true;
30+
}
31+
32+
void MicroSim::add_interaction(void * interaction_ptr, int int_id) {
33+
34+
interactions.push_back(interaction_ptr);
35+
interactions_id.push_back(int_id);
36+
37+
}

0 commit comments

Comments
 (0)