/usr/share/doc/rheolef-doc/examples/laplace_s.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 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "torus.icc"
int main (int argc, char**argv) {
environment rheolef (argc, argv);
geo gamma (argv[1]);
size_t d = gamma.dimension();
space Wh (gamma, argv[2]);
trial u (Wh); test v (Wh);
form m = integrate (u*v);
form a = integrate (dot(grad_s(u),grad_s(v)));
field b = m*field(Wh,1);
field lh = integrate (f(d)*v);
csr<Float> A = {{ a.uu(), b.u()},
{trans(b.u()), 0 }};
vec<Float> B = { lh.u(), 0 };
solver sa (A);
vec<Float> U = sa.solve (B);
field uh(Wh);
uh.set_u() = U [range(0,uh.u().size())];
dout << uh;
}
|