[Dune] Comments on Dune Developer Meeting 2014.

Andreas Dedner a.s.dedner at warwick.ac.uk
Thu Sep 25 16:58:32 CEST 2014


I forgot to say that I would like to be on that list as well....
Andreas

On 25/09/14 13:45, Martin Nolte wrote:
> Hi Robert,
>
> thanks for adding yourself to the list. You were always intended to be 
> there - we simply had no chance of asking.
>
> As for the iterators: We felt that, while the protect-the-user 
> argument was good and valid a few years ago, that is no longer true in 
> the C++11 era. Once you can use range-based for-loops, novice users 
> will prefer these of hand-written iterator loops. Those people writing 
> then (e.g., we or STL-algorithm developers) are aware of this copy and 
> will not accidentally call the postfix increment.
>
> And, as far as I am concerned: Don't protect me from myself - just 
> tell me about the pitfalls. But we could make it an experimental grid 
> extension ;-).
>
> Best,
>
> Martin
>
> On 09/25/2014 02:25 PM, Robert Kloefkorn wrote:
>> Hello Dune,
>>
>> I went through the protocol of the user meeting.
>>
>> I would like to comment on the STL forward_iterator interface change and
>> here mainly on the postfix increment.
>>
>> The problem with that method is, besides being redundant to the prefix,
>> that copying a grid iterator might not be a cheap thing, e.g. it is
>> definitely not in unstructured grids like ALUGrid or AlbertaGrid where
>> the whole iterator stack storing the tree information has to be copied.
>> For that reason we disabled this postfix increment a couple of years
>> ago, i.e. is was available in DUNE some time ago. Also, a dune grid is
>> not a STL container, but let's not go there now.
>>
>> So I would suggest to implement an EntityIterator --> STL iterator
>> wrapper class that adds the missing postfix iterator by implementing
>>
>> This operator++ (int) {
>>    This copy( *this );
>>    this->operator++ ();
>>    return copy;
>> }
>>
>> whenever a true STL iterator is needed (for whatever reason, that
>> question was not answered so far).
>>
>> The benefit would be, that nobody could accidentally use the postfix
>> increment and yielding huge performance decrease without noticing. He
>> would have to use the STL wrapper first.
>>
>> Best,
>>
>> Robert
>>
>> PS: I took the liberty to adding myself to the list of participants of
>> the "parallel features of the grid interface" meeting. I also suggest
>> that the protocol should be read-only from now on ;-)
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>>
>





More information about the Dune mailing list