rheolef  7.0
stokes_cavity.cc
Go to the documentation of this file.
1 #include "rheolef.h"
2 using namespace rheolef;
3 using namespace std;
4 #include "cavity.icc"
5 int main(int argc, char**argv) {
6  environment rheolef (argc, argv);
7  geo omega (argv[1]);
8  space Xh = cavity::velocity_space (omega, "P2");
9  space Qh (omega, "P1");
10  trial u (Xh), p (Qh); test v (Xh), q (Qh);
11  form a = integrate (2*ddot(D(u),D(v)));
12  form b = integrate (-div(u)*q);
13  form mp = integrate (p*q);
14  field uh = cavity::velocity_field (Xh, 1);
15  field ph (Qh, 0.);
16  solver_abtb stokes (a.uu(), b.uu(), mp.uu());
17  stokes.solve (-(a.ub()*uh.b()), -(b.ub()*uh.b()),
18  uh.set_u(), ph.set_u());
19  dout << catchmark("u") << uh
20  << catchmark("p") << ph;
21 }
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
field - piecewise polynomial finite element field
int main(int argc, char **argv)
Definition: stokes_cavity.cc:5
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
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)
const vec< T, M > & b() const
Definition: field.h:292
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