-
Notifications
You must be signed in to change notification settings - Fork 3
/
simparam.h
61 lines (48 loc) · 1.34 KB
/
simparam.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
60
61
#ifndef PARAMSIM_H
#define PARAMSIM_H
#include <fstream>
#include <iostream>
using namespace std;
//Simple class to read in the simulation parameters from a file
class PARAMS
{
public:
int nX_; //linear size of lattice
int Dim_; //dimension of lattice
double H_; //Zeeman field
double Temp_; //Temperature limit 1
double Tlow_; //Temperature limit 2
double Tstep_; //Temperature step
int EQL_; //the number of equilibration steps
int MCS_; //the number of Monte Carlo steps
int nBin_; //number of production bins
long SEED_; //the random number seed
PARAMS();
void print();
}; //PARAMS
PARAMS::PARAMS(){
//initializes commonly used parameters from a file
ifstream pfin;
pfin.open("param.dat");
pfin >> nX_;
pfin >> Dim_;
pfin >> H_;
pfin >> Temp_;
pfin >> Tlow_;
pfin >> Tstep_;
pfin >> EQL_;
pfin >> MCS_;
pfin >> nBin_;
pfin >> SEED_;
pfin.close();
}//constructor
void PARAMS::print(){
cout<<"Linear size "<<nX_<<endl;
cout<<"Dimension "<<Dim_<<endl;
cout<<"Magnetic Field"<<H_<<endl;
cout<<"# Equil steps "<<EQL_<<endl;
cout<<"# MC steps "<<MCS_<<endl;
cout<<"# data bins "<<nBin_<<endl;
cout<<"RNG seed "<<SEED_<<endl;
}
#endif