rheolef  6.6
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 }
int newton(Problem P, Field &uh, Float &tol, size_t &max_iter, odiststream *p_derr=0)
newton – Newton nonlinear algorithm
Definition: newton.h:41
field - piecewise polynomial finite element field
Definition: field.h:225
STL namespace.
irheostream, orheostream - large data streams
Definition: compiler.h:7
field initial() const
double Float
Definition: compiler.h:177
catchmark - iostream manipulator
Definition: catchmark.h:30
Float epsilon
int main(int argc, char **argv)
odiststream derr(cerr)
Definition: diststream.h:340