/usr/share/doc/rheolef-doc/examples/stokes_cavity.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 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "cavity.icc"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega (argv[1]);
space Xh = cavity_space (omega, "P2");
space Qh (omega, "P1");
trial u (Xh), p (Qh); test v (Xh), q (Qh);
form a = integrate (2*ddot(D(u),D(v)));
form b = integrate (-div(u)*q);
form mp = integrate (p*q);
field uh = cavity_field (Xh, 1);
field ph (Qh, 0.);
solver_abtb stokes (a.uu(), b.uu(), mp.uu());
stokes.solve (-(a.ub()*uh.b()), -(b.ub()*uh.b()),
uh.set_u(), ph.set_u());
dout << catchmark("u") << uh
<< catchmark("p") << ph;
}
|