Loading...
Searching...
No Matches
streamf_cavity.icc

The stream function for the 3D driven cavity benchmark.

The stream function for the 3D driven cavity benchmark

void streamf_cavity_solver (const space& Xh, problem& pa, form& a, form& b) {
string valued = (Xh.size() == 3) ? "vector" : "scalar";
space Ph (Xh.get_geo(), "P2", valued);
Ph.block("top"); Ph.block("bottom");
size_t d = Xh.get_geo().dimension();
if (d == 3) {
Ph.block("back"); Ph.block("front");
} else {
Ph.block("left"); Ph.block("right");
}
trial u (Xh), psi (Ph); test phi (Ph);
a = (d == 3) ? integrate (ddot(grad(psi),grad(phi)))
: integrate ( dot(grad(psi),grad(phi)));
b = (d == 3) ? integrate (dot(curl(u),phi))
: integrate (curl(u)*phi);
pa = problem (a);
}
field streamf (const field& uh, const problem& pa, const form& a, const form& b) {
field lh = b*uh;
field psi_h (b.get_second_space(), 0);
pa.solve (lh, psi_h);
return psi_h;
}
lh
field lh(Float epsilon, Float t, const test &v)
Definition burgers_diffusion_operators.icc:25
field
see the field page for the full documentation
form
see the form page for the full documentation
problem
see the problem page for the full documentation
space
see the space page for the full documentation
test
see the test page for the full documentation
trial
see the test page for the full documentation
d
size_t d
Definition neumann-laplace-lambda.cc:28
streamf
field streamf(const field &uh, const problem &pa, const form &a, const form &b)
Definition streamf_cavity.icc:42
streamf_cavity_solver
void streamf_cavity_solver(const space &Xh, problem &pa, form &a, form &b)
Definition streamf_cavity.icc:25
phi
Definition phi.h:25
psi
Definition interpolate_RTk_polynom.icc:34
u
Definition leveque.h:25