/usr/share/doc/rheolef-doc/examples/p_laplacian_newton.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 25 26 | #include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "p_laplacian.h"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega_h (argv[1]);
Float eps = std::numeric_limits<Float>::epsilon();
string approx = (argc > 2) ? argv[2] : "P1";
Float p = (argc > 3) ? atof(argv[3]) : 1.5;
Float tol = (argc > 4) ? atof(argv[4]) : 1e5*eps;
size_t max_iter = (argc > 5) ? atoi(argv[5]) : 500;
derr << "# P-Laplacian problem by Newton:" << endl
<< "# geo = " << omega_h.name() << endl
<< "# approx = " << approx << endl
<< "# p = " << p << endl
<< "# tol = " << tol << endl
<< "# max_iter = " << max_iter << endl;
p_laplacian F (p, omega_h, approx);
field uh = F.initial ();
int status = newton (F, uh, tol, max_iter, &derr);
dout << setprecision(numeric_limits<Float>::digits10)
<< catchmark("p") << p << endl
<< catchmark("u") << uh;
return status;
}
|