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

« back to all changes in this revision

Viewing changes to doc/pexamples/embankment_adapt.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 "elasticity_solve.icc"
 
5
#include "elasticity_criterion.icc"
 
6
#include "embankment.icc"
 
7
int main(int argc, char**argv) {
 
8
  environment rheolef (argc, argv);
 
9
  const Float lambda = 1;
 
10
  geo  omega (argv[1]);
 
11
  adapt_option_type options;
 
12
  string approx  = (argc > 2) ? argv[2] : "P1";
 
13
  options.err    = (argc > 3) ? atof(argv[3]) : 5e-3;
 
14
  size_t n_adapt = (argc > 4) ? atoi(argv[4]) : 5;
 
15
  options.hmin   = 0.004;
 
16
  for (size_t i = 0; true; i++) {
 
17
    space Xh = embankment_space (omega, approx);
 
18
    field uh = elasticity_solve (Xh, lambda);
 
19
    odiststream of (omega.name(), "field");
 
20
    of << catchmark("lambda")  << lambda << endl
 
21
       << catchmark("u")       << uh;
 
22
    if (i == n_adapt) break;
 
23
    field ch = elasticity_criterion (lambda,uh);
 
24
    omega = adapt(ch, options);
 
25
    odiststream og (omega.name(), "geo");
 
26
    og << omega;
 
27
  }
 
28
}