[dune-pdelab] [dune-pdelab-commit] dune-pdelab r1521 - trunk/dune/pdelab/gridfunctionspace

Jö Fahlke jorrit at jorrit.de
Thu Jun 16 16:01:19 CEST 2011


Am Thu, 16. Jun 2011, 11:18:50 +0200 schrieb Steffen Müthing:
> Am 15.06.2011 um 18:34 schrieb Jö Fahlke:
> 
> > Am Wed, 15. Jun 2011, 17:11:31 +0200 schrieb muething at conan.iwr.uni-heidelberg.de:
> >> Log:
> >> [Ordering] Make the orderingPtr() method const for consistency with the ordering() method
> > 
> > Not a good idea.  This change means you now can modify internal data of a
> > const CompositeGridFunctionSpace.  To illustrate: to make the change really
> > consistent you would need to write (note the const in the template argument to
> > shared_ptr)
> > 
> >      const shared_ptr<const Ordering> &orderingPtr() const { return orderingp; }
> > 
> > But that would probably introduce a lot of compilation errors.
> > 
> 
> You are right, it's not really pretty... but the problem is that during the transformation, I only
> get a const reference to the GFS that I want to extract the ordering from, so this slight
> inconsistency seemed like the easiest way around that issue.

Well, you can simply have both the const and the non-const version:

  const shared_ptr<Ordering> &orderingPtr() { return orderingp; }
  const shared_ptr<const Ordering> &orderingPtr() const { return orderingp; }

Or do you really need to modify internal data of a const GridFunctionSpace?

> 
> Thinking about it: Perhaps an Ordering only needs read-only access to its children when
> used in conjunction with a GFS? I mean, it probably shouldn't tinker with that data anyway...
> Making the children const  doesn't break anything in PDELab itself as far as I can see, but
> perhaps I overlooked something obvious or someone sees a problem in a possible future
> use case?

There is the issue of how the update() call after a grid adaption propagates
down the tree, and in particular which tree it uses to propagate.

Bye,
Jö.

-- 
In the shower, time can be measured only by the fluctuations of the
temperature.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20110616/3f51fd9e/attachment.sig>


More information about the dune-pdelab mailing list