~ubuntu-branches/ubuntu/wily/rheolef/wily

« back to all changes in this revision

Viewing changes to doc/pexamples/laplace_band.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2013-04-30 11:29:51 UTC
  • mfrom: (1.2.1) (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130430112951-g69nuqin77t75dek
Tags: 6.4-1
[ Pierre Saramito ]
* New upstream release 6.4 (major changes):
  - new powerful c++ expressions for FEM specifications
  - configure script improved (portability increased)
  - minor bug fixes
* control:
  - all architectures are considered (armel & armhf are back)
  - no more circular-dependency librheolef-dev <--> rheolef
* rules: add security compiler flags (hardening and -W,-l,relro)
* watch: include an updated version, thanks to B. Martens <bartm@debian.org>
* copyright: various file format fixes

[ Sylvestre Ledru ]
*  Standards-Version updated to 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
int main (int argc, char**argv) {
6
6
  environment rheolef(argc, argv);
7
7
  geo lambda (argv[1]);
 
8
  size_t d = lambda.dimension();
8
9
  space Xh (lambda, "P1");
9
10
  field phi_h = interpolate(Xh, phi);
10
 
  band gh (phi_h);
11
 
  field phi_h_band = phi_h [gh.band()];
12
 
  space Bh (gh.band(), "P1");
 
11
  band gamma_h (phi_h);
 
12
  field phi_h_band = phi_h [gamma_h.band()];
 
13
  space Bh (gamma_h.band(), "P1");
13
14
  Bh.block ("isolated");
14
15
  Bh.unblock ("zero");
15
 
  form m (Bh, Bh, "mass",      gh);
16
 
  form a (Bh, Bh, "grad_grad", gh);
17
 
  size_t d = lambda.dimension();
18
 
  field lh = riesz (Bh, f(d), gh);
19
 
  vector<vec<Float> > b (gh.n_connected_component());
20
 
  vector<Float>       z (gh.n_connected_component(), 0);
 
16
  trial u (Bh); test v (Bh);
 
17
  form  m  = integrate (gamma_h, u*v);
 
18
  form  a  = integrate (gamma_h, dot(grad_s(u),grad_s(v)));
 
19
  field lh = integrate (gamma_h, f(d)*v);
 
20
  vector<vec<Float> > b (gamma_h.n_connected_component());
 
21
  vector<Float>       z (gamma_h.n_connected_component(), 0);
21
22
  for (size_t i = 0; i < b.size(); i++) {
22
 
    const domain& cci = gh.band() ["cc"+itos(i)];
 
23
    const domain& cci = gamma_h.band() ["cc"+itos(i)];
23
24
    field phi_h_cci (Bh, 0);
24
25
    phi_h_cci [cci] = phi_h_band [cci];
25
26
    b[i] = phi_h_cci.u();
34
35
  vec<Float> U = sa.solve (F);
35
36
  field uh(Bh,0);
36
37
  uh.set_u() = U [range(0,uh.u().size())];
37
 
  gh.band().save();
38
 
  dout << catchmark("u")   << uh 
39
 
       << catchmark("phi") << phi_h;
 
38
  dout << catchmark("phi") << phi_h
 
39
       << catchmark("u")   << uh;
40
40
}