-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
58 lines (48 loc) · 1.7 KB
/
main.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
// A program to solve the 1D linear advection equation with different methods and slope/flux limiters
#include "simulation.h"
#include "fluxes.h"
#include "loadData.h"
int main()
{
vector<double> dist;
dist = loadFromTxt("../../customDist.txt");
simulation custom(0.8, 0.0, 2.0, dist);
custom.save_data("../../data/custom_analytical.txt");
custom.iterate("upwind", 4.0);
custom.save_data("../../data/custom_upwind.txt");
simulation Ana(0.8, 400);
cout << "Generation analytical solution!" << endl;
Ana.save_data("../../data/analytical.txt");
simulation Up(0.8, 400);
cout << "----Upwind----" << endl;
Up.iterate("upwind", 4.0);
Up.save_data("../../data/upwind.txt");
simulation Lax(0.8, 400);
cout << "----Lax-Wendroff----" << endl;
Lax.iterate("lax_wendroff", 4.0);
Lax.save_data("../../data/lax.txt");
simulation beam(0.8, 400);
cout << "----Beam-Warming----" << endl;
beam.iterate("beam_warming", 4.0);
beam.save_data("../../data/beam.txt");
simulation fro(0.8, 400);
cout << "----Fromm----" << endl;
fro.iterate("fromm", 4.0);
fro.save_data("../../data/fromm.txt");
simulation mimo(0.8, 400);
cout << "----MinMod----" << endl;
mimo.iterate("minmod", 4.0);
mimo.save_data("../../data/minmod.txt");
simulation sb(0.8, 400);
cout << "----SuperBee----" << endl;
sb.iterate("superbee", 4.0);
sb.save_data("../../data/sb.txt");
simulation mc(0.8, 400);
cout << "----MC----" << endl;
mc.iterate("mc", 4.0);
mc.save_data("../../data/mc.txt");
simulation vl(0.8, 400);
cout << "----van-Leer----" << endl;
vl.iterate("van_leer", 4.0);
vl.save_data("../../data/vL.txt");
}