Rheolef  7.1
an efficient C++ finite element environment
p_laplacian_newton.cc

The p-Laplacian problem by the Newton method

#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 (argv[1]);
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.name() << endl
<< "# approx = " << approx << endl
<< "# p = " << p << endl
<< "# tol = " << tol << endl
<< "# max_iter = " << max_iter << endl;
p_laplacian F (p, omega, 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;
}
rheolef::catchmark
see the catchmark page for the full documentation
Definition: catchmark.h:67
field
see the field page for the full documentation
rheolef.h
rheolef - reference manual
p
Definition: sphere.icc:25
rheolef::newton
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
rheolef::environment
see the environment page for the full documentation
Definition: environment.h:115
p_laplacian.h
The p-Laplacian problem by the Newton method – class header.
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::derr
odiststream derr(cerr)
see the diststream page for the full documentation
Definition: diststream.h:436
Float
see the Float page for the full documentation
p_laplacian
Definition: p_laplacian.h:25
p_laplacian::initial
field initial() const
Definition: p_laplacian1.icc:37
main
int main(int argc, char **argv)
Definition: p_laplacian_newton.cc:29
rheolef::dout
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
epsilon
Float epsilon
Definition: transmission_error.cc:25
rheolef::std
Definition: vec_expr_v2.h:402
mkgeo_contraction.status
status
Definition: mkgeo_contraction.sh:290
geo
see the geo page for the full documentation