-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathStability3D.cpp
More file actions
67 lines (52 loc) · 1.53 KB
/
Stability3D.cpp
File metadata and controls
67 lines (52 loc) · 1.53 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "Arnoldi.h"
#include "ExtendedStateVector.h"
int main(int argc, char* argv[])
{
ExtendedStateVector testState;
testState.LoadFromFile(argv[1], true);
flowParams.Ri = testState.p;
PrintParameters();
BasicArnoldi solver;
StateVector eigenMode;
stratifloat growth = solver.Run(testState.x, eigenMode);
if (growth > 1)
{
std::cout << "STATE IS UNSTABLE" << std::endl;
}
else
{
std::cout << "STATE IS STABLE" << std::endl;
}
}
// stratifloat growth(stratifloat p)
// {
// flowParams.Ri = p;
// StateVector background;
// StateVector result;
// BasicArnoldi solver;
// return solver.Run(background, result);
// }
// int main(int argc, char *argv[])
// {
// stratifloat RiLower = 0.245;
// stratifloat RiHigher = 0.245625;
// stratifloat GrowthLower = growth(RiLower);
// stratifloat GrowthHigher = growth(RiHigher);
// while (true)
// {
// stratifloat RiMiddle = 0.5*(RiLower+RiHigher);
// stratifloat GrowthMiddle = growth(RiMiddle);
// std::cout << "flowParams.Ri: " << RiLower << " " << RiMiddle << " " << RiHigher << std::endl;
// std::cout << "Growth: " << GrowthLower << " " << GrowthMiddle << " " << GrowthHigher << std::endl;
// if (GrowthMiddle > 1)
// {
// RiLower = RiMiddle;
// GrowthLower = GrowthMiddle;
// }
// else
// {
// RiHigher = RiMiddle;
// GrowthHigher = GrowthMiddle;
// }
// }
// }