-
Notifications
You must be signed in to change notification settings - Fork 0
/
lattice.h
59 lines (47 loc) · 1.19 KB
/
lattice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <eigen3/Eigen/Sparse>
#include <eigen3/unsupported/Eigen/SparseExtra>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <math.h>
#include <omp.h>
#include "utility.h"
#include "ising.h"
#ifndef LATTICE
#define LATTICE
typedef Eigen::SparseMatrix<int> SpMat;
typedef Eigen::Triplet<int> T;
typedef std::vector<int> intVector;
class Lattice
{
private:
int size;
int n_sites;
float external_field;
float coupling;
float temperature;
float k_boltzman = 1;
int M = 0;
float E = 0;
intVector latticeMat;
bool storeMat = true;
public:
Lattice();
Lattice(int _size);
Lattice(int _size, float external_h, float J, float temp);
int getSize();
int getNSites();
intVector getLatticeMatrix();
int getValueFromCoordinates(int i, int j);
int getMag();
float getEnergy();
void setStorageOption(bool option);
void printLatticeMatrix();
void calcEnergy();
void calcMag();
void analyseSite(int row, int col);
void timeStep();
void simulate(int cycles);
};
#endif