Convection-diffusion equation by the method of characteristics – error analysis.
int main (
int argc,
char **argv) {
Float tol = (argc > 1) ? atof(argv[1]) : 1e-10;
derr << "# t\terror_l2\terror_linf" << endl;
for (
Float t = 0, t_prec = 0; din >> get (t, phi_h); t_prec = t) {
const space& Xh = phi_h.get_space();
size_t d = Xh.get_geo().dimension();
field eh = phi_h - pi_h_phi;
Float err_l2 = sqrt(m(eh,eh));
Float err_linf = eh.max_abs();
err_l2_l2 += sqr(err_l2)*(t - t_prec);
err_linf_linf = max(err_linf_linf, err_linf);
dout <<
put (t, phi_h, pi_h_phi);
derr << t << "\t" << err_l2 << "\t" << err_linf << endl;
}
derr << "# error_l2_l2 = " << sqrt(err_l2_l2) << endl;
derr << "# error_linf_linf = " << err_linf_linf << endl;
return (err_linf_linf <= tol) ? 0 : 1;
}
void put(idiststream &in, odiststream &out, bool do_proj, bool do_lumped_mass, string use_proj_approx, bool def_fill_opt, size_type extract_id, const Float &scale_value, const std::pair< Float, Float > &u_range, render_type render, reuse_proj_form_type reuse)
Float phi(const point &nu, Float a, Float b)
see the Float page for the full documentation
see the branch page for the full documentation
see the field page for the full documentation
see the catchmark page for the full documentation
see the environment page for the full documentation
see the space page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
This file is part of Rheolef.
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
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 - reference manual
Convection-diffusion equation – the rotating hill benchmark.