[Dune] A question about the relationship between iterators and indices in dune-grid

Oliver Sander sander at mi.fu-berlin.de
Wed Sep 23 11:06:13 CEST 2009


Hi Helmer!

>
> A) I state the question in 2D (but it obviously applies similarly in 
> 3D). Consider an entity with a given codim thus corresponding to 
> either a vertex, edge or element. Is it so that the associated 
> iterator.begin() always corresponds to (or in other words: points to) 
> the entity with index=0, and moreover, will the operation ++iterator 
> always increase the corresponding entity's index with 1.
No.  Many grids do act that way, but it is not required.
>
> B) If the answer in A) turns at to be negative, i.e. that there is no 
> such obvious relationship between indices and iterators in the 
> dune-grid: how do you relate a given index to the corresponding 
> entity, or in other words, if you know the index of an entity, how do 
> you obtain a pointer to this particular entity?
There is not constant-time way to do so.  The only way is to iterate 
through all entities and stop when
you have found the one with the correct index.  Or, if you have lots of 
memory, you could store an
array of EntityPointers with an entry for each entity.  But both are 
really only theoretical options.

Yours,
Oliver
>
> Thanks in advance,
> Helmer André Friis
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> "This e-mail with attached documents is only for the addressee 
> indicated above. The e-mail and documents may contain confidential 
> information. If you are not the correct addressee or are responsible 
> for transfer of this e-mail with attached documents to the correct 
> addressee, any copying or further transfer of information contained 
> herein is expressly forbidden. If you have received this e-mail by 
> mistake, you are kindly requested to immediately inform me thereof by 
> e-mail and delete the e-mail and the received documents."
>
> _
> __http://www.iris.no_ <http://www.iris.no/>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>   


-- 
************************************************************************
* Oliver Sander                ** email: sander at mi.fu-berlin.de        *
* Freie Universität Berlin     ** phone: + 49 (30) 838 75348           *
* Institut für Mathematik      ** URL  : page.mi.fu-berlin.de/~sander  *
* Arnimallee 6                 ** -------------------------------------*
* 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
************************************************************************





More information about the Dune mailing list