-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
50 lines (37 loc) · 1.31 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
//-------------------------------------------------------------------------------------------------
// Main program of single compressible flows Xiangyu Hu 2010
//-------------------------------------------------------------------------------------------------
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string.h>
#include <cmath>
#include "glbcls.h"
#include "glbfunc.h"
using namespace std;
int main() {
double Time; //computation time
int N_D_time; //number of output_period
BaseSolver *CurrentSolver;
Initialization Ini; //Geometry and initialization parameters
//start to compute
Time = Ini.start_time;
N_D_time = 0;
SingleFluidSolver single_fluid_solver(Ini);
CurrentSolver = &single_fluid_solver;
single_fluid_solver.InitializeGlobalValues(Time, Ini);
Output output(Time, Ini);
output.OutStates(CurrentSolver, Time, Ini);
while(Time < Ini.end_time) {
// adjust the last output_period
if(Time + Ini.output_period >= Ini.end_time) Ini.output_period = Ini.end_time - Time;
//call the time slover
CurrentSolver->Time_integeral(Ini, Time, Ini.output_period);
N_D_time = N_D_time + 1;
output.OutStates(CurrentSolver, Time, Ini);
if(Ini.case_number == 21 && Ini.problem_number == 8)
output.OutError218(CurrentSolver, Time, Ini);
}
return 0;
}