~ubuntu-branches/ubuntu/saucy/rheolef/saucy

« back to all changes in this revision

Viewing changes to doc/pexamples/dirichlet-nh-check.cc

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Saramito
  • Date: 2011-03-23 11:14:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110323111426-cjvhey7lxt6077ty
Tags: 5.93-1
* New upstream release (minor changes):
  - some extra warning message deleted in heap_allocator
  - graphic output with mayavi2 fixed
  - add doc refman in .info and .pdf format

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
Float u (const point& x) { return sin(x[0]+x[1]+x[2]); }
 
5
int main(int argc, char**argv) {
 
6
  environment distributed(argc, argv);
 
7
  field uh;
 
8
  dcin >> uh;
 
9
  Float error_l2_expected = (argc > 1) ? atof(argv[1]) : 1e-5;
 
10
  space Vh = uh.get_space();
 
11
  field pi_h_u = interpolate(Vh, u);
 
12
  field eh = pi_h_u - uh;
 
13
  form m(Vh, Vh, "mass");
 
14
  Float error_l2 = sqrt(m(eh,eh));
 
15
  dcout << "error_l2  "  << error_l2 << endl;
 
16
  return (error_l2 <= error_l2_expected) ? 0 : 1;
 
17
}