/usr/share/doc/rheolef-doc/examples/p_laplacian1.icc 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 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #include "eta.icc"
#include "nu.icc"
#include "dirichlet.icc"
p_laplacian::p_laplacian (Float p1, const geo& omega, string approx)
: p(p1), Xh(), lh(), m(), sm(), qopt(), a1(), sa1() {
Xh = space (omega, approx);
Xh.block ("boundary");
qopt.set_family(quadrature_option_type::gauss);
qopt.set_order(2*Xh.degree()-1);
trial u (Xh); test v (Xh);
lh = integrate (v);
m = integrate (u*v);
sm = solver (m.uu());
}
field p_laplacian::initial() const {
field uh (Xh, 0);
dirichlet (lh, uh);
return uh;
}
field p_laplacian::residue (const field& uh) const {
trial u (Xh); test v (Xh);
form a = integrate (compose(eta(p), norm2(grad(uh)))*dot(grad(u),grad(v)),
qopt);
field mrh = a*uh - lh;
mrh.set_b() = 0;
return mrh;
}
void p_laplacian::update_derivative (const field& uh) const {
size_t d = Xh.get_geo().dimension();
trial u (Xh); test v (Xh);
a1 = integrate (dot(compose(nu<eta>(eta(p),d), grad(uh))*grad(u),grad(v)),
qopt);
sa1 = ldlt (a1.uu());
}
field p_laplacian::derivative_solve (const field& rh) const {
field delta_uh (Xh,0);
delta_uh.set_u() = sa1.solve(rh.u());
return delta_uh;
}
|