~ubuntu-branches/ubuntu/raring/rheolef/raring-proposed

« back to all changes in this revision

Viewing changes to doc/pexamples/helmholtz_s_sphere_error.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2012-05-14 14:02:09 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120514140209-dzbdlidkotyflf9e
Tags: 6.1-1
[ Pierre Saramito ]
* New upstream release 6.1 (minor changes):
  - support arbitrarily polynomial order Pk
  - source code supports g++-4.7 (closes: #671996)

[ Sylvestre Ledru ]
* update of the watch file

Show diffs side-by-side

added added

removed removed

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