Rheolef  7.1
an efficient C++ finite element environment
harten_error.cc
Go to the documentation of this file.
1 #include "rheolef.h"
22 using namespace rheolef;
23 using namespace std;
24 #include "harten.h"
25 int main(int argc, char**argv) {
26  environment rheolef (argc, argv);
27  Float err_expected = (argc > 1) ? atof(argv[1]) : 1;
28  branch even("t","u");
29  Float t=0; field uh;
30  Float err_linf_l1 = 0;
31  dout << "# t err_l1(t)" << endl;
32  while (din >> even(t,uh)) {
33  const geo& omega = uh.get_geo();
34  integrate_option iopt;
35  iopt.set_order (2*uh.get_space().degree()+1);
36  Float err_l1 = integrate (omega, fabs(uh - harten(t)), iopt);
37  err_linf_l1 = max(err_linf_l1, err_l1);
38  dout << t << " " << err_l1 << endl;
39  }
40  dout << "# err_linf_l1 = " << err_linf_l1 << endl;
41  return (err_linf_l1 <= err_expected) ? 0 : 1;
42 }
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 geo page for the full documentation
see the environment page for the full documentation
Definition: environment.h:115
see the integrate_option page for the full documentation
idiststream din
see the diststream page for the full documentation
Definition: diststream.h:427
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
The Burgers problem: the Harten exact solution.
int main(int argc, char **argv)
Definition: harten_error.cc:25
This file is part of Rheolef.
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
Definition: integrate.h:202
rheolef - reference manual
Definition: harten.h:26