rheolef  6.5
p_laplacian_newton.cc
Go to the documentation of this file.
1 #include "rheolef.h"
2 using namespace rheolef;
3 using namespace std;
4 #include "p_laplacian.h"
5 int main(int argc, char**argv) {
6  environment rheolef (argc, argv);
7  geo omega_h (argv[1]);
9  string approx = (argc > 2) ? argv[2] : "P1";
10  Float p = (argc > 3) ? atof(argv[3]) : 1.5;
11  Float tol = (argc > 4) ? atof(argv[4]) : 1e5*eps;
12  size_t max_iter = (argc > 5) ? atoi(argv[5]) : 500;
13  derr << "# P-Laplacian problem by Newton:" << endl
14  << "# geo = " << omega_h.name() << endl
15  << "# approx = " << approx << endl
16  << "# p = " << p << endl
17  << "# tol = " << tol << endl
18  << "# max_iter = " << max_iter << endl;
19  p_laplacian F (p, omega_h, approx);
20  field uh = F.initial ();
21  int status = newton (F, uh, tol, max_iter, &derr);
22  dout << setprecision(numeric_limits<Float>::digits10)
23  << catchmark("p") << p << endl
24  << catchmark("u") << uh;
25  return status;
26 }
27