Rheolef  7.1
an efficient C++ finite element environment
streamf_cavity.icc
Go to the documentation of this file.
1 void streamf_cavity_solver (const space& Xh, problem& pa, form& a, form& b) {
26  string valued = (Xh.size() == 3) ? "vector" : "scalar";
27  space Ph (Xh.get_geo(), "P2", valued);
28  Ph.block("top"); Ph.block("bottom");
29  size_t d = Xh.get_geo().dimension();
30  if (d == 3) {
31  Ph.block("back"); Ph.block("front");
32  } else {
33  Ph.block("left"); Ph.block("right");
34  }
35  trial u (Xh), psi (Ph); test phi (Ph);
36  a = (d == 3) ? integrate (ddot(grad(psi),grad(phi)))
37  : integrate ( dot(grad(psi),grad(phi)));
38  b = (d == 3) ? integrate (dot(curl(u),phi))
39  : integrate (curl(u)*phi);
40  pa = problem (a);
41 }
42 field streamf (const field& uh, const problem& pa, const form& a, const form& b) {
43  field lh = b*uh;
44  field psi_h (b.get_second_space(), 0);
45  pa.solve (lh, psi_h);
46  return psi_h;
47 }
form
see the form page for the full documentation
streamf
field streamf(const field &uh, const problem &pa, const form &a, const form &b)
Definition: streamf_cavity.icc:42
field
see the field page for the full documentation
phi
Definition: phi.h:25
rheolef::integrate
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 integrate_option &iopt, Result dummy=Result())
see the integrate page for the full documentation
Definition: integrate.h:202
phi
Float phi(const point &nu, Float a, Float b)
Definition: burgers_flux_godunov.icc:25
space
see the space page for the full documentation
rheolef::grad
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad(const Expr &expr)
grad(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:911
rheolef::ddot
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
ddot(x,y): see the expression page for the full documentation
Definition: tensor.cc:278
a
Definition: diffusion_isotropic.h:25
psi
Definition: interpolate_RTk_polynom.icc:34
rheolef::details::dot
rheolef::details::is_vec dot
lh
field lh(Float epsilon, Float t, const test &v)
Definition: burgers_diffusion_operators.icc:25
test
see the test page for the full documentation
problem
see the problem page for the full documentation
u
Definition: leveque.h:25
rheolef::curl
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::curl >>::type curl(const Expr &expr)
curl(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:1089
mkgeo_ball.d
d
Definition: mkgeo_ball.sh:154
u
Float u(const point &x)
Definition: transmission_error.cc:26
mkgeo_ball.b
b
Definition: mkgeo_ball.sh:152
trial
see the test page for the full documentation
streamf_cavity_solver
void streamf_cavity_solver(const space &Xh, problem &pa, form &a, form &b)
Definition: streamf_cavity.icc:25