forked from CEED/Laghos
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlaghost_function.cpp
94 lines (80 loc) · 1.57 KB
/
laghost_function.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include <fstream>
#include <sys/time.h>
#include <sys/resource.h>
#include <cmath>
#include "laghost_function.hpp"
namespace mfem
{
double rho0(const Vector &x)
{
return 2800.0; // This case in initialized in main().
}
double gamma_func(const Vector &x)
{
return 1.0; // This case in initialized in main().
}
void v0(const Vector &x, Vector &v)
{
// const double atn = dim!=1 ? pow((x(0)*(1.0-x(0))*4*x(1)*(1.0-x(1))*4.0),W
// 0.4) : 0.0;
// const double s = 0.1/64.;
// v(0) = 0.0;
// v(1) = 1.0e-16;
v =0.0;
// if(x(0) <= 1)
// {
// v(0) = -1*0.003/86400/365.25;
// }
// if(x(1) >= 35e3)
// {
// v(1) = -1e-20;
// }
}
double e0(const Vector &x)
{
return 0.0; // This case in initialized in main().
}
double p0(const Vector &x)
{
double r = sqrt(pow((x(0)-50e3), 2) + pow((x(1)-2e3), 2));
if(r <= 1.0e3)
{
return 0.5;
}
else
{
return 0.0;
}
}
double depth0(const Vector &x)
{
int dim = x.Size();
return x(dim-1);
}
double x_l2(const Vector &x)
{
return x(0);
}
double y_l2(const Vector &x)
{
return x(1);
}
double z_l2(const Vector &x)
{
return x(2);
}
void xyz0(const Vector &x, Vector &v)
{
if(x.Size() == 2)
{
v(0) = x(0);
v(1) = x(1);
}
else
{
v(0) = x(0);
v(1) = x(1);
v(2) = x(2);
}
}
}