rheolef  6.5
stokes_contraction.cc
Go to the documentation of this file.
1 #include "rheolef.h"
2 using namespace rheolef;
3 using namespace std;
4 #include "poiseuille.h"
5 int main(int argc, char**argv) {
6  environment rheolef (argc, argv);
7  geo omega (argv[1]);
8  string sys_coord = omega.coordinate_system_name();
9  Float cr = omega.xmax()[1];
10  space Xh (omega, "P2", "vector");
11  Xh.block ("upstream");
12  Xh.block ("wall");
13  Xh[1].block ("axis");
14  Xh[1].block ("downstream");
15  space Qh (omega, "P1");
16  space Wh (omega["upstream"], "P2");
17  trial u (Xh), p (Qh);
18  test v (Xh), q (Qh);
19  form a = integrate (2*ddot(D(u),D(v)));
20  form b = integrate (-div(u)*q);
21  form mp = integrate (p*q);
22  solver_abtb stokes (a.uu(), b.uu(), mp.uu());
23  field uh (Xh, 0);
24  field ph (Qh, 0);
25  uh[0]["upstream"] = interpolate (Wh, u_poiseuille(cr,sys_coord));
26  stokes.solve (-(a.ub()*uh.b()), -(b.ub()*uh.b()), uh.set_u(), ph.set_u());
27  dout << catchmark("inv_lambda") << 0 << endl
28  << catchmark("u") << uh
29  << catchmark("p") << ph;
30 }
31