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

Steffen Müthing steffen.muething at ipvs.uni-stuttgart.de
Thu Jun 16 11:18:50 CEST 2011


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.

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?

Steffen

>> Modified:
>>   trunk/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh
>>   trunk/dune/pdelab/gridfunctionspace/gridfunctionspace.hh
>>   trunk/dune/pdelab/gridfunctionspace/powergridfunctionspace.hh
>> 
>> Modified: trunk/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh
>> ==============================================================================
>> --- trunk/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh	Wed Jun 15 17:11:27 2011	(r1520)
>> +++ trunk/dune/pdelab/gridfunctionspace/compositegridfunctionspace.hh	Wed Jun 15 17:11:30 2011	(r1521)
>> @@ -85,7 +85,7 @@
>>       { }
>> 
>>       const Ordering &ordering() const { return *orderingp; }
>> -      const shared_ptr<Ordering> &orderingPtr() { return orderingp; }
>> +      const shared_ptr<Ordering> &orderingPtr() const { return orderingp; }
> 
> -- 
> featured product: Debian GNU/Linux - http://www.debian.org
> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab

Steffen Müthing
Universität Stuttgart
Institut für Parallele und Verteilte Systeme
Universitätsstr. 38
70569 Stuttgart
Tel: +49 711 685 88429
Fax: +49 711 685 88340
Email: steffen.muething at ipvs.uni-stuttgart.de









More information about the dune-pdelab mailing list