-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.cpp
executable file
·59 lines (51 loc) · 1.01 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
59
#include "src/includes.hpp"
#include <cmath>
#include <string>
using namespace std;
double U(double x, double y)
{
return 0.0;
}
double V(double x, double y)
{
return 0.0;
}
double eta(double x, double y)
{
if(x<0.0)
return 1.0;
else
return 0.0;
}
double Depth(double x, double y)
{
return 2.0;
}
int main()
{
string name;
unsigned Nex = 20;
unsigned Ney = 5;
unsigned N = 16 ;
double L_start = -2;
double L_end = 2;
double H_start = 0;
double H_end = 1;
unsigned NTimeSteps =50;
double dt = 1e-4;
unsigned i;
ShallowWater q(Nex,Ney,N);
q.setDomain(L_start,L_end,H_start,H_end);
q.setDepth(Depth);
q.setInitialConditions(eta,U,V);
q.setSolver(dt,NTimeSteps);
for(i=0;i<2000;i++)
{
name = "DamBreakN=16/DamBreak"+to_string(i)+".vtk";
q.writeVTK(name);
q.solve();
}
name = "DamBreakN=16/DamBreak"+to_string(i)+".vtk";
q.writeVTK(name);
return 0;
}