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

« back to all changes in this revision

Viewing changes to doc/pexamples/p_laplacian_fixed_point.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 "p_laplacian_fixed_point.icc"
 
5
#include "dirichlet.icc"
 
6
int main(int argc, char**argv) {
 
7
  environment rheolef (argc,argv);
 
8
  geo omega (argv[1]);
 
9
  string approx   = (argc > 2) ?      argv[2]  : "P1";
 
10
  Float  p        = (argc > 3) ? atof(argv[3]) : 1.5;
 
11
  Float tol       = (argc > 4) ? atof(argv[4]) : 1e-10;
 
12
  size_t max_iter = 500;
 
13
  derr << "# P-Laplacian problem by fixed-point:" << endl
 
14
       << "# geo = " << omega.name() << endl
 
15
       << "# approx = " << approx << endl
 
16
       << "# p = " << p << endl;
 
17
  space Xh (omega, approx);
 
18
  Xh.block ("boundary");
 
19
  field uh (Xh);
 
20
  uh ["boundary"] = 0;
 
21
  field lh = riesz (Xh, 1);
 
22
  dirichlet (lh, uh);
 
23
  int status = p_laplacian_fixed_point (p, lh, uh, tol, max_iter);
 
24
  dout << catchmark("p") << p << endl
 
25
       << catchmark("u") << uh;
 
26
  return status;
 
27
}