/usr/share/doc/rheolef-doc/examples/elasticity_taylor_dg.cc is in rheolef-doc 6.7-6.
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 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "taylor.icc"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega (argv[1]);
space Xh (omega, argv[2], "vector");
Float lambda = (argc > 3) ? atof(argv[3]) : 1;
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 (lambda*div_h(u)*div_h(v) + 2*ddot(Dh(u),Dh(v)))
+ integrate (omega.sides(),
beta*penalty()*dot(jump(u),jump(v))
- lambda*dot(jump(u),average(div_h(v)*normal()))
- lambda*dot(jump(v),average(div_h(u)*normal()))
- 2*dot(jump(u),average(Dh(v)*normal()))
- 2*dot(jump(v),average(Dh(u)*normal())));
field lh = integrate (dot(f(),v))
+ integrate (omega.boundary(),
beta*penalty()*dot(g(),jump(v))
- lambda*dot(g(),average(div_h(v)*normal()))
- 2*dot(g(),average(Dh(v)*normal())));
solver sa (a.uu());
field uh(Xh);
uh.set_u() = sa.solve(lh.u());
dout << uh;
}
|