Dear PDELab developers,<br><br>I was writing some time-dependant code, using pdelab-howto as reference, and<br>I was confused by the way of doing things in example03_Q2.hh(for instance).<br>Here's the code fragment:<br>
<br>while (time<tend-1e-8) {<br> // do time step<br> b.setTime(time+dt); // compute constraints<br> cc.clear(); // for this time step<br>
Dune::PDELab::constraints(b,gfs,cc);<br> osm.apply(time,dt,uold,g,unew); // do one time step<br><br>While it's obvious that constraints need to be recomputed as time changes,<br>the connection between cc and osm isn't so obvious:<br>
CC <u>cc</u>;<br>Dune::PDELab::constraints(b,gfs,<u>cc</u>);<br>...<br>IGOS <u>igos</u>(gfs,<u>cc</u>,gfs,<u>cc</u>,lop,tlop); // new grid operator space<br>...<br>Dune::PDELab::OneStepMethod<Real,IGOS,PDESOLVER,U,U> osm(method,<u>igos</u>,pdesolver);<br>
...<br>It's also unobvious that osm.apply(time,dt,uold,g,unew) manipulates g.time.<br>I think it would be better if osm.apply(time,dt,uold,g,unew) implicitly called<br><br> b.setTime(time+dt); <br>cc.clear(); <br>
Dune::PDELab::constraints(b,gfs,cc);<br><br>since osm object already has reference to cc(osm - igos - cc) and b(osm - igos - lop - b).<br>This also relieves the programmer of the chore to keep b.time and g.time in sync.<br>
Also since apply() method doesn't change uold(I assume), this should be reflected by const in it's signature.<br><br><br>best regards,<br>Oleh Krehel<br><br><br><br><br><br><br><br><br>