[Dune] Re-ordering of elements in ALUGrid and boundarySegmentIndex()

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Thu May 15 14:56:56 CEST 2014

Hi Carsten,

thanks for your prompt answer! But there is still something not clear to me.
I have already been using both insertionIndex() and boundarySegmentIndex() methods, which for the same intersection can return two different integers. I thought that the permutation from the order of insertion (i.e., insertionIndex()) to the actual index assigned to the segment (i.e., boundarySegmentIndex()) was the mapping I needed to associate b.c. correctly, but apparently it is not enough. What do I have to do more?

Thanks again!

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk

From: Carsten Gräser [graeser at mi.fu-berlin.de]
Sent: 15 May 2014 12:50
To: dune at dune-project.org; Sacconi, Andrea
Subject: Re: [Dune] Re-ordering of elements in ALUGrid and boundarySegmentIndex()

Hi Andrea,
indeed the grid interface allows that entities and boundary segments are
reordered during creation time. Hence you need to know the reordering
map if you want to associate data to entities or boundary intersections.

After the grid was created you can use the insertionIndex() methods of
the grid factory for the insertion index of entities/intersections,
i.e. the index wrt. the insertion order. At the same time you can ask
the grid for the level index/leaf index/id of entities and the segment
index associated to intersections allowing you to reconstruct this map.

So mapping the indices using the insertionIndex method should solve
your problem.


Am 15.05.2014 13:39, schrieb Sacconi, Andrea:
> Hi all,
> I am experiencing a problem I can't solve, maybe you will be able to shed some light on it.
> I am using ALUGrid as grid manager; I pass to the grid factory the complete list of vertices, elements and boundary faces, and then I create the grid.
> First point, I noticed that ALUGrid performs a re-ordering of the elements.
> Now, the problem is, when I traverse the intersections and extract the boundarySegmentIndex() to which I associated somewhere else the appropriate b.c., everything goes wrong, i.e. Neumann and Dirichlet conditions got mixed up on the boundary. I clearly see this from the vtk output: my solution is not the one which is supposed to be.
> Does the element re-numbering affect the boundarySegmentIndex()? I switched to Alberta as grid manager, wiithout changing anything else, and in that case the programme works fine.
> Am I missing something about ALUGrid I should be aware of?
> Thanks in advance!
> Cheers,
> Andrea
> __________________________________________________________

More information about the Dune mailing list