[dune-fem] Getting the list of neighbours for a given element of the grid

Robert Kloefkorn robertk at ucar.edu
Fri Oct 26 19:23:13 CEST 2012


On 10/26/2012 11:05 AM, Sacconi, Andrea wrote:
> Hi all,
> 
> just one question about the neighbours for a given element.
> 
> If you want to get all the neighbours, you enumerate all the intersections and check if the bool neighbor () is true or false.
> If it's true, calling the method outside (), you get an EntityPointer to the entity you need (i.e., the triangle that is the current neighbour under analysis).

Hi Andrea,

what exactly is the problem? You have an iterator (her the intersection
iterator) and the you iterate over all intersections and if a neighbor
is present you do the stuff that you want to do. Why do you need to
store these neighbors? And if you need to store them, use a std::vector
or something like this and then iterate over the vector.

Is that what you were asking?

Best,

Robert

PS: There is no way the create an iterator from and entity pointer.


-- 

Dr. Robert Kloefkorn           <robertk at ucar dot edu>

Institute for Mathematics Applied to Geosciences (IMAGe)
National Center for Atmospheric Research (NCAR)

1850 Table Mesa Drive, Boulder CO 80305, USA.

Phone: +1 303 497 2481




More information about the dune-fem mailing list