30int main(
int argc,
char**argv) {
33 space Xh = uh.get_space();
34 geo omega = Xh.get_geo();
35 size_t k = Xh.degree();
36 size_t d = omega.dimension();
37 space Vh (omega,
"P"+to_string(k));
39 space Wh (omega[
"boundary"],
"P"+to_string(k));
47 field uh_star (Vh, 0);
50 pm.solve (
lh, uh_star);
54 space Xh1 (omega,
"P"+to_string(k+1)+
"d");
57 field eta_h = eh_star - eh;
58 Float err_linf = eh.max_abs();
59 Float err_star_linf = eh_star.max_abs();
60 Float eta_linf = eta_h.max_abs();
68 space G0h (omega,
"P0",
"vector");
72 space G1h (omega,
"P1",
"vector");
73 G1h.block(
"boundary");
77 field grad_eh_p1 (G1h, 0);
79 pm1v.solve(l1h, grad_eh_p1);
81 field grad_eta_h_p1 (G1h, 0);
82 pm1v.solve(l2h, grad_eta_h_p1);
84 space X0h (omega,
"P0");
90 derr <<
"err_l2 = " << err_l2 << endl
91 <<
"eta_l2 = " << eta_l2 << endl
92 <<
"err_star_l2 = " << err_star_l2 << endl
93 <<
"err_linf = " << err_linf << endl
94 <<
"eta_linf = " << eta_linf << endl
95 <<
"err_star_linf = " << err_star_linf << endl
96 <<
"err_h1 = " << err_h1 << endl
97 <<
"eta_h1 = " << eta_h1 << endl
98 <<
"err_star_h1 = " << err_star_h1 << endl;
99 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.
std::enable_if< details::has_field_rdof_interface< Expr >::value, details::field_expr_v2_nonlinear_terminal_field< typenameExpr::scalar_type, typenameExpr::memory_type, details::differentiate_option::gradient > >::type grad(const Expr &expr)
grad(uh): see the expression page for the full documentation
field_basic< T, M > lazy_interpolate(const space_basic< T, M > &X2h, const field_basic< T, M > &u1h)
see the interpolate page for the full documentation
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
std::enable_if< details::has_field_rdof_interface< Expr >::value, details::field_expr_v2_nonlinear_terminal_field< typenameExpr::scalar_type, typenameExpr::memory_type, details::differentiate_option::gradient > >::type grad_h(const Expr &expr)
grad_h(uh): see the expression page for the full documentation
std::enable_if< details::is_field_expr_v2_nonlinear_arg< Expr >::value &&!is_undeterminated< Result >::value, Result >::type integrate(const geo_basic< T, M > &omega, const Expr &expr, const integrate_option &iopt, Result dummy=Result())
see the integrate page for the full documentation
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
rheolef - reference manual