[Dune] Comments on Dune Developer Meeting 2014.
Robert Kloefkorn
robertk at posteo.de
Thu Sep 25 14:25:47 CEST 2014
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 ;-)
More information about the Dune
mailing list