-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspintracking.cpp
More file actions
43 lines (35 loc) · 919 Bytes
/
Copy pathspintracking.cpp
File metadata and controls
43 lines (35 loc) · 919 Bytes
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
#include "spintracking.h"
using namespace std;
Spintracking::Spintracking(double* PolVec, double initialT, double error, double firsthtry, Derivatives *DERI, bool dens)
: P(PolVec), dPdt(NULL), eps(error), stepper(NULL), derivatives(DERI), dense(dens)
{
dPdt = new double[3];
stepper = new Dopr(firsthtry, 3, P, dPdt, initialT, derivatives, eps, eps, dense);
}
Spintracking::~Spintracking()
{
delete stepper;
delete[] dPdt;
}
double Spintracking::getStepperTime()
{
return stepper->getT();
}
double Spintracking::getHdid()
{
return stepper->getHdid();
}
void Spintracking::reset(double* PolVec, double initialT, double firsthtry)
{
P = PolVec;
derivatives->evalInitial(initialT, P, dPdt);
stepper->reset(firsthtry, P, dPdt, initialT);
}
void Spintracking::precess()
{
stepper->step();
}
double Spintracking::dense_out(const int i,const double t,const double h)
{
return stepper->dense_out(i,t,h);
}