-
Notifications
You must be signed in to change notification settings - Fork 2
/
PseudoArclength.h
43 lines (34 loc) · 1009 Bytes
/
PseudoArclength.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
#pragma once
#include "ExtendedStateVector.h"
#include "NewtonKrylov.h"
class PseudoArclengthContinuation : public NewtonKrylov<ExtendedStateVector>
{
public:
PseudoArclengthContinuation(ExtendedStateVector x0, ExtendedStateVector v, stratifloat deltaS)
: x0(x0)
, v(v)
, deltaS(deltaS)
{}
virtual void EnforceConstraints(ExtendedStateVector& at) override
{
at.x.RemovePhaseShift();
RemoveAverage(at.x.u1, flowParams.L3);
RemoveAverage(at.x.b, flowParams.L3);
}
protected:
virtual ExtendedStateVector EvalFunction(const ExtendedStateVector& at) override
{
ExtendedStateVector result;
at.FullEvolve(T, result, false, false);
result -= at;
ExtendedStateVector displacement = at;
displacement -= x0;
flowParams.Ri = at.p;
result.p = deltaS - v.Dot(displacement);
return result;
}
private:
ExtendedStateVector x0;
ExtendedStateVector v;
stratifloat deltaS;
};