rheolef  7.0
stokes_contraction.cc
Go to the documentation of this file.
1 #include "rheolef.h"
2 using namespace rheolef;
3 using namespace std;
4 #include "contraction.icc"
5 int main(int argc, char**argv) {
6  environment rheolef (argc, argv);
7  geo omega (argv[1]);
8  space Xh = contraction::velocity_space (omega, "P2");
9  space Qh (omega, "P1");
10  trial u (Xh), p (Qh);
11  test v (Xh), q (Qh);
12  form a = integrate (2*ddot(D(u),D(v)));
13  form b = integrate (-div(u)*q);
14  form mp = integrate (p*q);
15  solver_abtb stokes (a.uu(), b.uu(), mp.uu());
16  field uh = contraction::velocity_field (Xh);
17  field ph (Qh, 0);
18  stokes.solve (-(a.ub()*uh.b()), -(b.ub()*uh.b()), uh.set_u(), ph.set_u());
19  dout << catchmark("inv_lambda") << 0 << endl
20  << catchmark("u") << uh
21  << catchmark("p") << ph;
22 }
field - piecewise polynomial finite element field
solver_abtb – direct or iterative solver interface for mixed linear systems
Definition: solver_abtb.h:58
STL namespace.
vec< T, M > & set_u()
Definition: field.h:293
int main(int argc, char **argv)
irheostream, orheostream - large data streams
Definition: compiler.h:7
std::enable_if< details::is_field_expr_v2_nonlinear_arg< Expr >::value &&! is_undeterminated< Result >::value, Result >::type integrate(const geo_basic< T, M > &omega, const Expr &expr, const quadrature_option &qopt, Result dummy=Result())
integrate - integrate a function or an expression
Definition: integrate.h:107
space – piecewise polynomial finite element space
Definition: space.h:229
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
Definition: tensor.cc:211
std::enable_if< details::is_field_expr_v2_linear_arg< Expr >::value,details::field_expr_v2_nonlinear_terminal_field_grad< typename Expr::scalar_type,typename Expr::memory_type >>::type D(const Expr &expr)
Definition: rotating-hill.h:1
const csr< T, M > & ub() const
Definition: form.h:141
std::enable_if< details::is_field_expr_v2_linear_arg< Expr >::value,details::field_expr_v2_nonlinear_terminal_field_div< typename Expr::scalar_type,typename Expr::memory_type >>::type div(const Expr &expr)
catchmark - iostream manipulator
Definition: catchmark.h:30
const csr< T, M > & uu() const
Definition: form.h:140
form - representation of a finite element bilinear form
Definition: form.h:98
Float u(const point &x)
odiststream dout(cout)
Definition: diststream.h:313