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
|
#include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "poiseuille.h"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega (argv[1]);
string sys_coord = omega.coordinate_system_name();
Float c = omega.xmax()[1];
space Xh (omega, "P2", "vector");
Xh.block ("upstream");
Xh.block ("wall");
Xh[1].block ("axis");
Xh[1].block ("downstream");
space Qh (omega, "P1");
space Wh (omega["upstream"], "P2");
field uh (Xh, 0);
field ph (Qh, 0);
uh[0]["upstream"] = interpolate (Wh, u(c,sys_coord));
form a (Xh, Xh, "2D_D");
form b = - form(Xh, Qh, "div");
form mp (Qh, Qh, "mass");
solver_abtb stokes (a.uu(), b.uu(), mp.uu());
stokes.solve (-(a.ub()*uh.b()), -(b.ub()*uh.b()), uh.set_u(), ph.set_u());
dout << catchmark("inv_lambda") << 0 << endl
<< catchmark("u") << uh
<< catchmark("p") << ph;
}
|