[dune-pdelab] constraints recomputation in time dep. problems
Oleh Krehel
krehel at am.uni-erlangen.de
Thu Mar 31 14:46:44 CEST 2011
Dear PDELab developers,
I was writing some time-dependant code, using pdelab-howto as reference, and
I was confused by the way of doing things in example03_Q2.hh(for instance).
Here's the code fragment:
while (time<tend-1e-8) {
// do time step
b.setTime(time+dt); // compute
constraints
cc.clear(); // for this
time step
Dune::PDELab::constraints(b,gfs,cc);
osm.apply(time,dt,uold,g,unew); // do one
time step
While it's obvious that constraints need to be recomputed as time changes,
the connection between cc and osm isn't so obvious:
CC *cc*;
Dune::PDELab::constraints(b,gfs,*cc*);
...
IGOS *igos*(gfs,*cc*,gfs,*cc*,lop,tlop); // new
grid operator space
...
Dune::PDELab::OneStepMethod<Real,IGOS,PDESOLVER,U,U> osm(method,*igos*
,pdesolver);
...
It's also unobvious that osm.apply(time,dt,uold,g,unew) manipulates g.time.
I think it would be better if osm.apply(time,dt,uold,g,unew) implicitly
called
b.setTime(time+dt);
cc.clear();
Dune::PDELab::constraints(b,gfs,cc);
since osm object already has reference to cc(osm - igos - cc) and b(osm -
igos - lop - b).
This also relieves the programmer of the chore to keep b.time and g.time in
sync.
Also since apply() method doesn't change uold(I assume), this should be
reflected by const in it's signature.
best regards,
Oleh Krehel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20110331/ab6a568d/attachment.htm>
More information about the dune-pdelab
mailing list