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

« back to all changes in this revision

Viewing changes to doc/pexamples/stokes_contraction.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 "poiseuille.h"
 
5
int main(int argc, char**argv) {
 
6
  environment rheolef (argc, argv);
 
7
  geo  omega (argv[1]);
 
8
  string sys_coord = omega.coordinate_system_name();
 
9
  Float c = omega.xmax()[1];
 
10
  space Xh (omega, "P2", "vector");
 
11
  Xh.block ("upstream");
 
12
  Xh.block ("wall");
 
13
  Xh[1].block ("axis");
 
14
  Xh[1].block ("downstream");
 
15
  space Qh  (omega, "P1");
 
16
  space Wh  (omega["upstream"], "P2");
 
17
  field uh (Xh, 0);
 
18
  field ph (Qh, 0);
 
19
  uh[0]["upstream"] = interpolate (Wh, u(c,sys_coord));
 
20
  form a (Xh, Xh, "2D_D");
 
21
  form b = - form(Xh, Qh, "div");
 
22
  form mp (Qh, Qh, "mass");
 
23
  solver_abtb stokes (a.uu(), b.uu(), mp.uu());
 
24
  stokes.solve (-(a.ub()*uh.b()), -(b.ub()*uh.b()), uh.set_u(), ph.set_u());
 
25
  dout << catchmark("inv_lambda") << 0 << endl
 
26
       << catchmark("u")  << uh
 
27
       << catchmark("p")  << ph;
 
28
}