-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulation.h
45 lines (35 loc) · 1.07 KB
/
simulation.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
#ifndef SIMULATION_H
#define SIMULATION_H
#include <gsl/gsl_rng.h>
#include <stdio.h>
#include "parameters.h"
typedef struct { unsigned int up;
unsigned int down;
} NodeIndex;
typedef struct { double I;
double Wsquared;
unsigned long int iteration;
} Sample;
class Simulation
{
public:
Simulation(int length, double Tmin, double Tmax, int seed=0);
~Simulation();
void evolve(int numberOfIterations);
void sample(); // Writes sample to OUTFILE
void truncate(); // Truncates OUTFILE
unsigned char lattice1[DIMENSION*DIMENSION];
unsigned char lattice2[DIMENSION*DIMENSION];
unsigned char difference[DIMENSION*DIMENSION];
NodeIndex indices[DIMENSION*DIMENSION];
double temperature[DIMENSION];
unsigned long int interface[DIMENSION];
private:
void heatBath(unsigned char *lattice, unsigned long row, unsigned long column, double r);
gsl_rng *rng;
int systemLength;
FILE *filedescriptor;
char filename[100];
unsigned long long int iteration;
};
#endif // SIMULATION_H