2
using namespace rheolef;
5
Float u_ex (const point& x) { return 0.5*(x[0]*(1-x[0]) + x[1]*(1-x[1]) + x[2]*(1-x[2]))/Float(N); }
6
Float g (const point& x) { return u_ex(x) - 0.5/N; }
7
int main(int argc, char**argv) {
8
environment distributed(argc, argv);
10
Float prec = (argc > 2) ? atof(argv[2]) : 1e-10;
11
N = omega.dimension();
12
space Xh (omega, "P1");
13
space Wh (omega["boundary"], "P1");
14
form a (Xh, Xh, "grad_grad");
15
form ab (Xh, Xh, "mass", omega["boundary"]);
17
form m (Xh, Xh, "mass");
18
form mb (Wh, Xh, "mass") ;
20
field gh = interpolate(Wh, g);
23
uh.u = sa.solve (m.uu*fh.u + m.ub*fh.b + mb.uu*gh.u + mb.ub*gh.b - a.ub*uh.b);