Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
p_laplacian_error.cc

The p-Laplacian problem on a circular geometry – error analysis.

The p-Laplacian problem on a circular geometry – error analysis

#include "rheolef.h"
using namespace rheolef;
using namespace std;
int main(int argc, char**argv) {
environment rheolef (argc,argv);
Float tol = (argc > 1) ? atof(argv[1]) : 1e-15;
field uh;
din >> catchmark("p") >> p
>> catchmark("u") >> uh;
const geo& omega = uh.get_geo();
const space& Xh = uh.get_space();
field pi_h_u = lazy_interpolate (Xh, u_exact(p));
field eh = pi_h_u - uh;
iopt.set_family(integrate_option::gauss);
iopt.set_order(2*Xh.degree());
Float err_lp = pow(integrate (omega,
pow(fabs(uh - u_exact(p)), p), iopt), 1./p);
Float err_w1p = pow(integrate (omega,
pow(norm(grad(uh) - grad_u(p)), p), iopt), 1./p);
Float err_linf = eh.max_abs();
dout << "err_linf = " << err_linf << endl
<< "err_lp = " << err_lp << endl
<< "err_w1p = " << err_w1p << endl;
return (err_linf < tol) ? 0 : 1;
}
see the Float page for the full documentation
see the field page for the full documentation
see the geo page for the full documentation
see the catchmark page for the full documentation
Definition catchmark.h:67
see the environment page for the full documentation
see the integrate_option page for the full documentation
void set_family(family_type type)
see the space page for the full documentation
int main()
Definition field2bb.cc:58
This file is part of Rheolef.
STL namespace.
The p-Laplacian problem on a circular geometry – exact solution.
rheolef - reference manual
Definition sphere.icc:25