[Dune-devel] Random-Access Iterators

Markus Blatt markus at dr-blatt.de
Thu Oct 2 12:07:13 CEST 2014


On Wed, Oct 01, 2014 at 11:53:49PM +0200, Christian Engwer wrote:
> On Wed, Oct 01, 2014 at 05:24:29PM +0200, Oliver Sander wrote:
> > Am 01.10.2014 um 17:18 schrieb Jö Fahlke:
> > > Am Wed,  1. Oct 2014, 16:22:48 +0200 schrieb Oliver Sander:
> > >> I would really expect property b):
> > >>
> > >>> (b) you could also want to write
> > >>>     gridView.begin() + gridView.indexSet().index( entity )
> > >>>     to obtain an iterator to "entity"
> > >>
> > >> I think people will assume this implicitly, and get confused if it doesn't hold.
> > >> On the other hand it cannot hold with mixed-element grids.  This for me is another
> > >> point against random-access iterators.
> > > 
> > > Actually, poeple have been confused about this in the _past_ already.  That
> > > is, we have had poeple expecting that iteration order == index order, and had
> > > to correct them.  That is nothing new about random access iterators.
> > > 
> > 
> > That is correct.  But so far the iteration order never appeared explicitly.
> > This changes with the random-access iterator.
> 
> But only for those grids with random access and I think in this case
> we should require (as a matter of beauty) (b) as well.

This nothing todo with beauty, more with performance as many algorithm
using random access iterators will assume this.

Without this guarantee random access iterators do not make much
sense. On the other hand other hand requiring the entities to be
stored according to the index might not make sense either in some
cases even for structured grids.

BTW: This would also be a topic for the parallel grid interface
discussion that we are talking (or not talking) about since November
2013. Surprisingly the interest in this meeting never seemed high
enough to actually do it.

Cheers,

Markus

-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141002/0df48f80/attachment.sig>


More information about the Dune-devel mailing list