rheolef  7.0
streamf_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  field uh;
8  din >> uh;
9  space Ph = cavity::streamf_space (uh.get_geo(), uh.get_approx());
10  space Xh = uh.get_space();
11  size_t d = uh.get_geo().dimension();
12  trial u (Xh), psi (Ph); test phi (Ph);
13  form a = (d == 3) ? integrate (ddot(grad(psi),grad(phi)))
14  : integrate ( dot(grad(psi),grad(phi)));
15  form b = (d==3) ? integrate (dot(curl(u),phi))
16  : integrate (curl(u)*phi);
17  field psi_h = cavity::streamf_field (Ph);
18  field lh = b*uh;
19  solver sa (a.uu());
20  psi_h.set_u() = sa.solve (lh.u() - a.ub()*psi_h.b());
21  dout << catchmark("psi") << psi_h;
22 }
field - piecewise polynomial finite element field
std::enable_if< details::is_field_expr_v2_linear_arg< Expr >::value,details::field_expr_v2_nonlinear_terminal_field_curl< typename Expr::scalar_type,typename Expr::memory_type >>::type curl(const Expr &expr)
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
Definition: vec_expr_v2.h:335
int main(int argc, char **argv)
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
size_t d
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 grad(const Expr &expr)
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
Definition: tensor.cc:211
idiststream din(cin)
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
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)
const vec< T, M > & u() const
Definition: field.h:291
odiststream dout(cout)
Definition: diststream.h:313