~ubuntu-branches/ubuntu/raring/rheolef/raring-proposed

« back to all changes in this revision

Viewing changes to doc/pexamples/laplace_s.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2012-05-14 14:02:09 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120514140209-dzbdlidkotyflf9e
Tags: 6.1-1
[ Pierre Saramito ]
* New upstream release 6.1 (minor changes):
  - support arbitrarily polynomial order Pk
  - source code supports g++-4.7 (closes: #671996)

[ Sylvestre Ledru ]
* update of the watch file

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 "torus.icc"
 
5
int main (int argc, char**argv) {
 
6
  environment rheolef (argc, argv);
 
7
  geo gamma (argv[1]);
 
8
  space Wh (gamma, argv[2]);
 
9
  size_t d = gamma.dimension();
 
10
  form m (Wh, Wh, "mass");
 
11
  form a (Wh, Wh, "grad_grad");
 
12
  field b = m*field(Wh,1);
 
13
  field lh = riesz(Wh, f(d));
 
14
  csr<Float> A = {{  a.uu(),     b.u()},
 
15
                  {trans(b.u()),  0   }};
 
16
  vec<Float> B =  {  lh.u(),      0   };
 
17
  solver sa (A);
 
18
  vec<Float> U = sa.solve (B);
 
19
  field uh(Wh);
 
20
  uh.set_u() = U [range(0,uh.u().size())];
 
21
  dout << uh;
 
22
}