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

« back to all changes in this revision

Viewing changes to nfem/ptst/field_expr2_tst.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:
20
20
/// =========================================================================
21
21
// check field_indirect_const::const_iterator
22
22
#include "rheolef.h"
23
 
#include "rounder.h"
 
23
#include "rheolef/rounder.h"
24
24
using namespace rheolef;
25
25
using namespace std;
26
26
Float g (const point& x) { return sin(x[0]+x[1]+0.5); }
 
27
void ff (const field& gh, const field fh, string dom_name, Float prec) {
 
28
  field zh (gh.get_space());
 
29
  zh = 0.5*(gh + fh[dom_name]);
 
30
  dout << setprecision(15) << field(compose (rounder(prec),zh));
 
31
}
27
32
int main(int argc, char**argv) {
28
 
  environment distributed(argc, argv);
 
33
  environment rheolef(argc, argv);
29
34
  geo omega (argv[1]); 
30
 
  string dom_name = (argc > 2) ? argv[2] : "right";
31
 
  Float prec = (argc > 3) ? atof(argv[3]) : 1e-10;
32
 
  space Vh (omega, "P1");
33
 
  space Wh (omega[dom_name], "P1");
 
35
  space Vh (omega, argv[2]);
 
36
  string dom_name = (argc > 3) ? argv[3] : "right";
 
37
  space Wh (omega[dom_name], argv[2]);
 
38
  Float prec = (argc > 4) ? atof(argv[4]) : 1e-10;
34
39
  field fh = interpolate(Vh, g);
35
40
  field gh = interpolate(Wh, g);
36
 
  field zh (Wh);
37
 
  const field& fh2 = fh; // becomes const: check for fieild_indirect_const<T,M>
38
 
  zh = 0.5*(gh + fh2[dom_name]);
39
 
  dcout << setprecision(15) << compose (rounder(prec),zh);
 
41
  ff (gh, fh, dom_name, prec);
40
42
}