<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div>Hi. </div>
<div>
<div>it's of quite possible that there is a bug in ALU. </div>
<div>Would be nice if you could provide a simple example demonstrating the problem.</div>
<div>Andreas </div>
</div>
<div><br>
</div>
<div>
<div style="font-size:10px; color:#575757">Sent from Samsung Mobile</div>
</div>
<br>
<br>
<div>-------- Original message --------</div>
<div>From: "Sacconi, Andrea" </div>
<div>Date:15/05/2014 3:08 PM (GMT+00:00) </div>
<div>To: Carsten Gräser ,dune@dune-project.org </div>
<div>Subject: Re: [Dune] Re-ordering of elements in ALUGrid and boundarySegmentIndex()
</div>
<div><br>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Carsten,<br>
<br>
thanks again for your answer. <br>
The way you described is precisely the procedure I have followed so far, and it works perfectly with Alberta. To use your example, the insertionIndex 2 is mapped into boundarySegmentIndex index 42, so I keep track of the 42 and I assign Neumann or Dirichlet
 appropriately.<br>
<br>
Unfortunately, when I switch to ALUGird, the two numbers are the same, so the mapping I need apparently doesn't work. Maybe I'm doing a silly mistake, but I fail to see where, since I just change the grid manager, so one line in the code.<br>
<br>
I will further look into this and keep you posted.<br>
Cheers,<br>
Andrea<br>
__________________________________________________________<br>
<br>
Andrea Sacconi<br>
PhD student, Applied Mathematics<br>
AMMP Section, Department of Mathematics, Imperial College London,<br>
London SW7 2AZ, UK<br>
a.sacconi11@imperial.ac.uk<br>
<br>
________________________________________<br>
From: Carsten Gräser [graeser@mi.fu-berlin.de]<br>
Sent: 15 May 2014 14:59<br>
To: Sacconi, Andrea; dune@dune-project.org<br>
Subject: Re: [Dune] Re-ordering of elements in ALUGrid and boundarySegmentIndex()<br>
<br>
Hi,<br>
<br>
Am 15.05.2014 14:56, schrieb Sacconi, Andrea:<br>
> Hi Carsten,<br>
><br>
> thanks for your prompt answer! But there is still something not clear<br>
> to me.<br>
> I have already been using both insertionIndex() and<br>
> boundarySegmentIndex() methods, which for the same intersection can<br>
> return two different integers. I thought that the permutation from the<br>
yes, that's the result of the reordering. Perhaps it was not clear<br>
enough so I'll provide more details<br>
<br>
If you want to assign data to some specific boundary segment you<br>
first have to remembere when you inserted it. Let's assume it was<br>
the 3rd inserted segment.<br>
<br>
After grid creation you have to loop over all intersections, and<br>
ask the factory for the insertionIndex. If it gives you 2 (zero based<br>
indices!) you know you've found the correct one. Then you ask this<br>
intersection for the segment index. If this gives 42, then you now that<br>
you have to assign your data to all intersections with segment index 42.<br>
<br>
> order of insertion (i.e., insertionIndex()) to the actual index<br>
> assigned to the segment (i.e., boundarySegmentIndex()) was the mapping<br>
> I needed to associate b.c. correctly, but apparently it is not enough.<br>
> What do I have to do more?<br>
Yes it is the mapping and I hope the example makes it more clear. If it<br>
does not work this way please file a bug report using a simple test<br>
case.<br>
<br>
Best,<br>
Carsten<br>
<br>
><br>
> Thanks again!<br>
> Andrea<br>
> __________________________________________________________<br>
><br>
> Andrea Sacconi<br>
> PhD student, Applied Mathematics<br>
> AMMP Section, Department of Mathematics, Imperial College London,<br>
> London SW7 2AZ, UK<br>
> a.sacconi11@imperial.ac.uk<br>
><br>
> ________________________________________<br>
> From: Carsten Gräser [graeser@mi.fu-berlin.de]<br>
> Sent: 15 May 2014 12:50<br>
> To: dune@dune-project.org; Sacconi, Andrea<br>
> Subject: Re: [Dune] Re-ordering of elements in ALUGrid and boundarySegmentIndex()<br>
><br>
> Hi Andrea,<br>
> indeed the grid interface allows that entities and boundary segments are<br>
> reordered during creation time. Hence you need to know the reordering<br>
> map if you want to associate data to entities or boundary intersections.<br>
><br>
> After the grid was created you can use the insertionIndex() methods of<br>
> the grid factory for the insertion index of entities/intersections,<br>
> i.e. the index wrt. the insertion order. At the same time you can ask<br>
> the grid for the level index/leaf index/id of entities and the segment<br>
> index associated to intersections allowing you to reconstruct this map.<br>
><br>
> So mapping the indices using the insertionIndex method should solve<br>
> your problem.<br>
><br>
> Best,<br>
> Carsten<br>
><br>
><br>
><br>
><br>
> Am 15.05.2014 13:39, schrieb Sacconi, Andrea:<br>
>> Hi all,<br>
>><br>
>> I am experiencing a problem I can't solve, maybe you will be able to shed some light on it.<br>
>><br>
>> 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.<br>
>> First point, I noticed that ALUGrid performs a re-ordering of the elements.<br>
>> 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.<br>
>><br>
>> 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.<br>
>> Am I missing something about ALUGrid I should be aware of?<br>
>><br>
>> Thanks in advance!<br>
>> Cheers,<br>
>> Andrea<br>
<br>
_______________________________________________<br>
Dune mailing list<br>
Dune@dune-project.org<br>
<a href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
</div>
</span></font>
</body>
</html>