-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowderAverage.cpp
More file actions
48 lines (37 loc) · 1.29 KB
/
PowderAverage.cpp
File metadata and controls
48 lines (37 loc) · 1.29 KB
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
#include <cmath>
#include <string>
#include "SpinWaveGenie/SpinWaveGenie.h"
using namespace std;
using namespace SpinWaveGenie;
int main()
{
Cell cell;
cell.setBasisVectors(1.0,10.0,10.0,90.0,90.0,90.0);
Sublattice spin0;
string name0 = "Spin0";
spin0.setName(name0);
spin0.setType("NONE");
spin0.setMoment(1.0,0.0,0.0);
cell.addSublattice(spin0);
cell.addAtom(name0,0.0,0.0,0.0);
SpinWaveBuilder builder(cell);
InteractionFactory interactions;
builder.addInteraction(interactions.getExchange("J",1.0,name0,name0,0.9,1.1));
SpinWave SW = builder.createElement();
PointsAlongLine Line;
Line.setFirstPoint(0.0,0.0,0.0);
Line.setFinalPoint(0.0,0.0,3.0*2.0*M_PI);
Line.setNumberPoints(201);
ThreeVectors<double> kPoints = Line.getPoints();
Energies energies(0.0, 5.0, 201);
OneDimensionalFactory factory;
auto gauss = factory.getGaussian(0.25,1.0e-2);
unique_ptr<SpinWavePlot> res(new EnergyResolutionFunction(move(gauss), SW,energies));
unique_ptr<SpinWavePlot> cut(new IntegrateThetaPhi(move(res),2.0e-2));
TwoDimensionalCut twodimcut;
twodimcut.setFilename("FMPowderAverage");
twodimcut.setPlotObject(move(cut));
twodimcut.setPoints(kPoints);
twodimcut.save();
return 0;
}