rheolef  6.6
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 }
field - piecewise polynomial finite element field
Definition: field.h:225
solver_abtb – direct or iterative solver iterface for mixed linear systems
Definition: solver_abtb.h:58
STL namespace.
field_vf_expr< field_vf_expr_grad< test_basic< T, M, VfTag > >> D(const test_basic< T, M, VfTag > &x)
Definition: operators2.h:97
vec< T, M > & set_u()
Definition: field.h:281
int main(int argc, char **argv)
irheostream, orheostream - large data streams
Definition: compiler.h:7
const csr< T, M > & uu() const
Definition: form.h:140
static field_basic< T, sequential > interpolate(const space_basic< T, sequential > &Vh, const field_basic< T, sequential > &uh)
const csr< T, M > & ub() const
Definition: form.h:141
space – piecewise polynomial finite element space
Definition: space.h:229
double Float
Definition: compiler.h:177
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
Definition: tensor.cc:200
field_vf_expr< field_vf_expr_div< test_basic< T, M, VfTag > >> div(const test_basic< T, M, VfTag > &x)
Definition: operators2.h:124
Definition: rotating-hill.h:1
catchmark - iostream manipulator
Definition: catchmark.h:30
form - representation of a finite element bilinear form
Definition: form.h:98
Float u(const point &x)
odiststream dout(cout)
Definition: diststream.h:317
field_basic< T, M > integrate(const geo_basic< T, M > &domain, const test_basic< T, M, details::vf_tag_01 > &expr, const quadrature_option_type &qopt=quadrature_option_type())
integrate - integrate a function or an expression
Definition: integrate.h:90