[Dune] Vector of IntersectionIterators

Oliver Sander sander at mi.fu-berlin.de
Wed Mar 17 08:51:08 CET 2010


Hi Dragan!
Have you considered storing just the information that you need
in several vectors?  For example, declare

std::vector<FieldVector<double,dimworld> > normals;
std::vector<double> areas;
[...]

Loop over the intersections of your current element once
and fill the array.  Later you can access all information by index.

Not the most elegant solution, but it should work.

--
Oliver

Dragan Vidovic schrieb:
> 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
>   


-- 
************************************************************************
* 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