/usr/share/doc/rheolef-doc/examples/streamf_contraction.cc is in rheolef-doc 6.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "poiseuille.h"
int main (int argc, char** argv) {
environment rheolef (argc, argv);
field uh;
din >> uh;
const geo& omega = uh.get_geo();
size_t d = omega.dimension();
string sys_coord = omega.coordinate_system_name();
Float c = omega.xmax()[1];
string approx = "P" + itos(uh.get_space().degree());
space Ph (omega, approx);
Ph.block("upstream");
Ph.block("wall");
Ph.block("axis");
space Wh (omega["upstream"], approx);
const space& Xh = uh.get_space();
field psi_h (Ph, 0);
psi_h["upstream"] = interpolate (Wh, psi_poiseuille(c,sys_coord));
psi_h["wall"] = 0;
psi_h["axis"] = -1;
form_option_type fopt;
fopt.ignore_sys_coord = true;
trial psi (Ph), u (Xh);
test xi (Ph), v (Xh);
form a = (d == 3) ? integrate (ddot(grad(psi), grad(xi)))
: integrate ( dot(grad(psi), grad(xi)), fopt);
field lh = integrate (dot(uh,bcurl(xi)));
solver sa (a.uu());
psi_h.set_u() = sa.solve (lh.u() - a.ub()*psi_h.b());
dout << catchmark("psi") << psi_h;
}
|