[Dune] Vector of IntersectionIterators

Andreas Dedner dedner at mathematik.uni-freiburg.de
Wed Mar 17 09:54:33 CET 2010


Hi,
I am afraid that the intersectionsIterators were never intended to be
stored in the way you are using them - they return a reference to an 
intersection and thus have to (or at least do) keep storage space for 
the whole intersection. That again contains at least one geometry (or 
even three) and up tp two entity pointers (which again contain 
references to entities which again have ther own geometry...).

For the meeting in Berlin Robert suggested a new concept for storing
entitypointers, called entityKey, which could be plugged into a grid to 
produce an Entity instance. See wiki notes for the Berlin meeting and
FS 575. Nobody gave any comment for that suggestion - and I must admit
that hiding the idea in FS 575 was not a very good move.
But if we can agree on such an approach than it might be possible
to extend it to Intersection as well. For a grid like Yasp this key 
could be an integer (and thus even allow random access), for ALU a 
pointer and perhaps two ints would suffice...

Andreas

Dragan Vidovic wrote:
> Hi all
> 
> I'm developing some very experimental finite volume methods and I
> really need to store some kind of references to some faces, like
> boundary faces or those where some physical parameters are
> discontinuous, and use references these later to get areas, normals,
> or to access neighbouring cells, without looping trough all cells
> every time. Since mappers can only map from an IntersectionIterator to
> an integer index and not the other way around, the only solution that
> I found after allot of experimenting was to use a std::vector of
> IntersectionIterators. Since an empty constructor for
> IntersectionIterator is not allowed, I initialize it as
> 
> std::vector<IntersectionIterator> ismap (nfaces,
> gridView.ibegin(*gridView.template begin<0>()));
> 
> and change it's elements later. There are two problems here:
> 
> 1) This takes a hell of a space. I divided the increase in memory that
> the process takes by the number of faces, and I found out that each
> IntersectionIterator takes about 1k!
> 
> 2) When this vector goes out of scope, this space is not recycled.
> 
> I'm using the newest ALUgrid, and Dune not older than two weeks.
> 
> Does anyone have some idea how to overcome these problems?
> 
> Best regards,
> 
> Dragan
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list