forked from JamesdeLisle/2D-Chern-Number
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phasespace.cpp
68 lines (55 loc) · 1.63 KB
/
phasespace.cpp
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
62
63
64
65
66
67
68
#include "twodwind.h"
#include <iostream>
#include <fstream>
void phasespace::mulinspace(double mumin_, double mumax_, int muint_)
{
double step = (mumax_-mumin_) / (muint_-1);
while(mumin_ <= mumax_)
{
muVec.push_back(mumin_);
mumin_ += step;
}
}
void phasespace::deltalinspace(double deltamin_, double deltamax_, int deltaint_)
{
double step = (deltamax_-deltamin_) / (deltaint_-1);
while(deltamin_ <= deltamax_)
{
deltaVec.push_back(deltamin_);
deltamin_ += step;
}
}
phasespace::phasespace(double mumin_, double mumax_, int muint_, double deltamin_, double deltamax_, int deltaint_, int pint_)
{
mulinspace( mumin_, mumax_, muint_);
deltalinspace( deltamin_, deltamax_, deltaint_ );
space.resize(muint_);
for ( auto& row : space ) {
row.reserve(deltaint_);
}
std::ofstream myfile;
myfile.open ("wind.dat");
int i,j;
double mu_, delta_;
for( i = 0; i < muint_; i++)
{
for( j = 0; j < deltaint_; j++)
{
mu_ = muVec[i];
delta_ = deltaVec[j];
//std::cout << mu_ << delta_;
space[i][j] = chern(mu_, delta_, pint_);
myfile << getdelta(j) << " " << getmu(i) << " " << space[i][j].getChern() << " " << space[i][j].getGapC() << std::endl;
//std::cout << space[i][j].getGapC() << std::endl;
}
std::cout << "\r" << muint_-i << " " << std::flush;
}
myfile.close();
}
double phasespace::getWinding( int munum_, int deltanum_ )
{
double out;
out = space[munum_][deltanum_].getChern();
//std::cout << out;
return out;
}