~ubuntu-branches/ubuntu/trusty/rheolef/trusty

« back to all changes in this revision

Viewing changes to doc/pexamples/sinusrad_error.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "rheolef.h"
 
2
using namespace rheolef;
 
3
using namespace std;
 
4
#include "sinusrad.icc"
 
5
int main(int argc, char**argv) {
 
6
  environment rheolef(argc, argv);
 
7
  field uh;
 
8
  din >> uh;
 
9
  Float error_linf_expected = (argc > 1) ? atof(argv[1]) : 1e+38;
 
10
  space Xh = uh.get_space();
 
11
  size_t d = Xh.get_geo().dimension();
 
12
  field pi_h_u = interpolate(Xh, u(d));
 
13
  field eh = pi_h_u - uh;
 
14
  form m(Xh, Xh, "mass");
 
15
  form a(Xh, Xh, "grad_grad");
 
16
  dout << "error_l2  "  << sqrt(m(eh,eh)) << endl
 
17
       << "error_h1  "  << sqrt(a(eh,eh)) << endl
 
18
       << "error_linf  "  << eh.max_abs() << endl;
 
19
  return (eh.max_abs() <= error_linf_expected) ? 0 : 1;
 
20
}