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

« back to all changes in this revision

Viewing changes to doc/pexamples/streamf_cavity.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
int main (int argc, char** argv) {
 
5
  environment rheolef (argc, argv);
 
6
  field uh;
 
7
  din >> uh;
 
8
  string valued =  (uh.size() == 3) ? "vector" : "scalar";
 
9
  space Ph (uh.get_geo(), "P2", valued);
 
10
  Ph.block("top");  Ph.block("bottom");
 
11
  if (uh.get_geo().dimension() == 3) {
 
12
    Ph.block("back"); Ph.block("front");
 
13
  } else {
 
14
    Ph.block("left"); Ph.block("right");
 
15
  }
 
16
  const space& Xh = uh.get_space();
 
17
  form a (Ph, Ph, "grad_grad");
 
18
  form b (Xh, Ph, "curl");
 
19
  field psi_h (Ph, 0.);
 
20
  field lh = b*uh;
 
21
  solver sa (a.uu());
 
22
  psi_h.set_u() = sa.solve (lh.u() - a.ub()*psi_h.b());
 
23
  dout << catchmark("psi") << psi_h;
 
24
}