rheolef  6.3
helmholtz_band_iterative.cc
Go to the documentation of this file.
1 #include "rheolef.h"
2 using namespace std;
3 using namespace rheolef;
4 #include "sphere.icc"
5 int main (int argc, char**argv) {
6  environment rheolef(argc, argv);
7  geo lambda (argv[1]);
8  space Xh (lambda, "P1");
9  field phi_h = interpolate(Xh, phi);
10  band gh (phi_h);
11  space Bh (gh.band(), "P1");
12  form m (Bh, Bh, "mass", gh);
13  form a (Bh, Bh, "grad_grad", gh);
14  a = m+a;
15  size_t d = lambda.dimension();
16  field lh = riesz (Bh, f(d), gh);
17  field uh (Bh,0);
18  size_t max_iter = 10000;
19  Float tol = 1e-10;
20  pminres (a.uu(), uh.set_u(), lh.u(), eye(), max_iter, tol, &derr);
21  dout << catchmark("phi") << phi_h
22  << catchmark("u") << uh;
23 }
24