/usr/share/doc/rheolef-doc/examples/dirichlet_dg.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 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "cosinusprod_laplace.icc"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega (argv[1]);
space Xh (omega, argv[2]);
size_t d = omega.dimension();
size_t k = Xh.degree();
Float beta = (k+1)*(k+d)/d;
trial u (Xh); test v (Xh);
form a = integrate (dot(grad_h(u),grad_h(v)))
+ integrate ("sides", beta*penalty()*jump(u)*jump(v)
- jump(u)*average(dot(grad_h(v),normal()))
- jump(v)*average(dot(grad_h(u),normal())));
field lh = integrate (f(d)*v)
+ integrate ("boundary", beta*penalty()*g(d)*v
- g(d)*dot(grad_h(v),normal()));
solver sa (a.uu());
field uh(Xh);
uh.set_u() = sa.solve(lh.u());
dout << uh;
}
|