The cosinus product function – post-treatment with the discontinuous Galerkin method.
The cosinus product function – post-treatment with the discontinuous Galerkin method
int main(
int argc,
char**argv) {
space Xh = uh.get_space();
geo omega = Xh.get_geo();
size_t k = Xh.degree();
size_t d = omega.dimension();
space Vh (omega,
"P"+to_string(k));
Vh.block("boundary");
space Wh (omega[
"boundary"],
"P"+to_string(k));
form m = integrate (
u*v, fopt);
uh_star [
"boundary"] = lazy_interpolate(Wh,
u_exact(
d));
space Xh1 (omega,
"P"+to_string(k+1)+
"d");
field eta_h = eh_star - eh;
Float err_linf = eh.max_abs();
Float err_star_linf = eh_star.max_abs();
Float eta_linf = eta_h.max_abs();
Float err_l2 = sqrt(integrate (omega, sqr(uh-
u_exact(
d)), iopt));
Float err_star_l2 = sqrt(integrate (omega, sqr(uh_star-
u_exact(
d)), iopt));
Float eta_l2 = sqrt(integrate (omega, sqr(eta_h), iopt));
Float err_h1 = sqrt(integrate (omega, norm2(grad_h(uh)-
grad_u(
d)), iopt));
Float err_star_h1 = sqrt(integrate (omega, norm2(grad(uh_star)-
grad_u(
d)), iopt));
Float eta_h1 = sqrt(integrate (omega, norm2(grad_h(eta_h)), iopt));
space G0h (omega,
"P0",
"vector");
field grad_eh = lazy_interpolate (G0h, grad_h(eh));
field grad_eta_h = lazy_interpolate (G0h, grad_h(eta_h));
space G1h (omega,
"P1",
"vector");
G1h.block("boundary");
form m1v = integrate(dot(uu,vv), fopt);
field l1h = integrate (dot(grad_eh,vv));
field grad_eh_p1 (G1h, 0);
pm1v.solve(l1h, grad_eh_p1);
field l2h = integrate (dot(grad_eta_h,vv));
field grad_eta_h_p1 (G1h, 0);
pm1v.solve(l2h, grad_eta_h_p1);
field s_eta_h2 = integrate (sqr(eta_h)*v0);
field s_eta_h = lazy_interpolate (X0h, sqrt(s_eta_h2));
field s_eh = lazy_interpolate (X0h, sqrt(s_eh2));
derr << "err_l2 = " << err_l2 << endl
<< "eta_l2 = " << eta_l2 << endl
<< "err_star_l2 = " << err_star_l2 << endl
<< "err_linf = " << err_linf << endl
<< "eta_linf = " << eta_linf << endl
<< "err_star_linf = " << err_star_linf << endl
<< "err_h1 = " << err_h1 << endl
<< "eta_h1 = " << eta_h1 << endl
<< "err_star_h1 = " << err_star_h1 << endl;
dout <<
catchmark (
"grad_eta_h") << grad_eta_h_p1
;
}
field lh(Float epsilon, Float t, const test &v)
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 problem page for the full documentation
see the catchmark page for the full documentation
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
see the test page for the full documentation
see the test page for the full documentation
The cosinus product function.
The cosinus product function – its gradient.
This file is part of Rheolef.
rheolef - reference manual