rheolef  6.6
stokes_contraction_bubble.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 
6 int main(int argc, char**argv) {
7  environment rheolef (argc, argv);
8  geo omega (argv[1]);
9  space X1h (omega, "P1", "vector");
10  space Bh (omega, "bubble", "vector");
11  space Qh (omega, "P1");
12  space Wh (omega["upstream"], "P1");
13  X1h.block ("wall");
14  X1h.block ("upstream");
15  X1h[1].block ("axis");
16  X1h[1].block ("downstream");
17  trial u1 (X1h), ub (Bh), p (Qh);
18  test v1 (X1h), vb (Bh), q (Qh);
19  form mp = integrate (p*q);
20  form b1 = integrate (-div(u1)*q);
21  form bb = integrate (-div(ub)*q);
22  form a1 = integrate (2*ddot(D(u1),D(v1)));
23  form_option_type fopt;
24  fopt.invert = true;
25  form inv_ab = integrate (2*ddot(D(ub),D(vb)), fopt);
26  form c = bb*inv_ab*trans(bb);
27  field u1h (X1h, 0), ph (Qh, 0);
28  string sys_coord = omega.coordinate_system_name();
29  Float cr = omega.xmax()[1];
30  u1h[0]["upstream"] = interpolate (Wh, u_poiseuille(cr,sys_coord));
31  solver_abtb stokes (a1.uu(), b1.uu(), c.uu(), mp.uu());
32  stokes.solve (-(a1.ub()*u1h.b()), -(b1.ub()*u1h.b()),
33  u1h.set_u(), ph.set_u());
34  dout << catchmark("inv_lambda") << 0 << endl
35  << catchmark("u") << u1h
36  << catchmark("p") << ph;
37 }
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
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
form_option_type - send options to the integrate function
double Float
Definition: compiler.h:177
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
Definition: tensor.cc:200
int main(int argc, char **argv)
field_vf_expr< field_vf_expr_div< test_basic< T, M, VfTag > >> div(const test_basic< T, M, VfTag > &x)
Definition: operators2.h:124
catchmark - iostream manipulator
Definition: catchmark.h:30
form - representation of a finite element bilinear form
Definition: form.h:98
csr< T, sequential > trans(const csr< T, sequential > &a)
Definition: csr.h:383
void solve(const vec< T, M > &f, const vec< T, M > &g, vec< T, M > &u, vec< T, M > &p) const
Definition: solver_abtb.cc:110
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