Rheolef  7.1
an efficient C++ finite element environment
p_laplacian_newton.cc
Go to the documentation of this file.
1 #include "rheolef.h"
26 using namespace rheolef;
27 using namespace std;
28 #include "p_laplacian.h"
29 int main(int argc, char**argv) {
30  environment rheolef (argc, argv);
31  geo omega (argv[1]);
33  string approx = (argc > 2) ? argv[2] : "P1";
34  Float p = (argc > 3) ? atof(argv[3]) : 1.5;
35  Float tol = (argc > 4) ? atof(argv[4]) : 1e5*eps;
36  size_t max_iter = (argc > 5) ? atoi(argv[5]) : 500;
37  derr << "# P-Laplacian problem by Newton:" << endl
38  << "# geo = " << omega.name() << endl
39  << "# approx = " << approx << endl
40  << "# p = " << p << endl
41  << "# tol = " << tol << endl
42  << "# max_iter = " << max_iter << endl;
43  p_laplacian F (p, omega, approx);
44  field uh = F.initial ();
45  int status = newton (F, uh, tol, max_iter, &derr);
46  dout << setprecision(numeric_limits<Float>::digits10)
47  << catchmark("p") << p << endl
48  << catchmark("u") << uh;
49  return status;
50 }
see the Float page for the full documentation
see the field page for the full documentation
see the geo page for the full documentation
field initial() const
see the catchmark page for the full documentation
Definition: catchmark.h:67
see the environment page for the full documentation
Definition: environment.h:104
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
odiststream derr(cerr)
see the diststream page for the full documentation
Definition: diststream.h:436
This file is part of Rheolef.
int newton(const Problem &P, Field &uh, Float &tol, size_t &max_iter, odiststream *p_derr=0)
see the newton page for the full documentation
Definition: newton.h:98
The p-Laplacian problem by the Newton method – class header.
int main(int argc, char **argv)
rheolef - reference manual
Definition: sphere.icc:25
Float epsilon