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

« back to all changes in this revision

Viewing changes to doc/pexamples/level_set_sphere_check.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
using namespace rheolef;
 
3
using namespace std;
 
4
#include "sphere.icc"
 
5
int main (int argc, char**argv) {
 
6
  environment rheolef (argc,argv);
 
7
  Float tol = (argc > 1) ? atof(argv[1]) : 1e+38;
 
8
  geo gamma_h;
 
9
  din >> gamma_h;
 
10
  space Xh (gamma_h, "P1");
 
11
  form m (Xh, Xh, "mass");
 
12
  field one (Xh, 1);
 
13
  Float meas_gamma_h = m(one,one);
 
14
  size_t d = gamma_h.dimension();
 
15
  Float pi = acos(Float(-1));
 
16
  Float meas_gamma = (d == 3) ? 4*pi : 2*pi;
 
17
  Float err = fabs(meas_gamma - meas_gamma_h);
 
18
  dout << "meas(gamma_h) = " << meas_gamma_h << endl
 
19
       << "meas(gamma)   = " << meas_gamma   << endl
 
20
       << "err           = " << err          << endl;
 
21
  return (err < tol) ? 0 : 1;
 
22
}