[Dune] centerUnitOuterNormal() in UGGrid

Oliver Sander sander at igpm.rwth-aachen.de
Thu Sep 19 08:25:48 CEST 2013


Hi Martin,
why not.  Feel free!
Best,
Oliver

Am 18.09.2013 15:32, schrieb Martin Nolte:
> Hi Oli,
> 
> should we add this to the FAQ list?
> 
> Best,
> 
> Martin
> 
> On 09/18/2013 11:30 AM, Oliver Sander wrote:
>> Hi Eike,
>> no worries.  In fact, I should have thought of an orientation problem much
>> earlier.
>> Also, one may argue that UGGrid should give an error message when an element is
>> oriented wrongly, rather than tacitly producing wrong results.  Maybe that's easy
>> to do.
>> Best,
>> Oliver
>>
>> Am 18.09.2013 11:27, schrieb Eike Mueller:
>>> Hi Oliver,
>>>
>>> thanks for looking into this and confirming that it is not a bug but rather
>>> a problem with my grid - several of my elements did indeed have the wrong
>>> orientation, i.e. the vertices were not in the
>>> correct order. The problem did not show up in ALUGrid as there the grid was
>>> 2d instead of 3d.
>>> I now fixed my code which generates the .dgf grid files such that it writes
>>> out correctly oriented elements, and then centerUnitOuterNormal() shows the
>>> expected behaviour.
>>>
>>> Apologies for the confusion,
>>>
>>> Eike
>>>
>>> On 16/09/13 16:24, Oliver Sander wrote:
>>>> Hi Eike,
>>>> that sounds like a bug.  You are right in expecting a method call
>>>> '*OuterNormal'
>>>> to return an outer normal.  Can you send a complete test case that reproduces
>>>> the problem?
>>>> Cheers,
>>>> Oliver
>>>>
>>>> Am 16.09.2013 16:30, schrieb Eike Mueller:
>>>>> Dear DUNE-list,
>>>>>
>>>>> is centerUnitOuterNormal() for the (3d-) UGGrid guaranteed to give the
>>>>> OUTER normal in all cases?
>>>>> in other word, should the following code, which calculates the scalar
>>>>> product of the outer normal and the distance between the center of the
>>>>> cell and center of its the intersection with the
>>>>> neighbouring cell always print out positive values? [Ok, of course one
>>>>> could construct some weird mapping from the reference elements to 3d such
>>>>> that this is not the case, but for the grid I'm looking
>>>>> at the cells are approximately prisms].
>>>>>
>>>>> iend = gv.template end<0,Dune::Interior_Partition>()
>>>>> for (Iterator it =gv.template
>>>>> begin<0,Dune::Interior_Partition>();it!=;++it) {
>>>>>      Entity &en = *it;
>>>>>      typename Entity::Geometry::GlobalCoordinate    centerEn =
>>>>> en.geometry().center();
>>>>>      IntersectionIterator isend = gv.iend()
>>>>>      for (IntersectionIterator is = gv.ibegin(en);is!=isend; ++is)
>>>>>      {
>>>>>          typename Entity::Geometry::GlobalCoordinate    normal =
>>>>> is.centerUnitOuterNormal();
>>>>>          typename Entity::Geometry::GlobalCoordinate    centerIs =
>>>>> is.geometry().center();
>>>>>          centerIs -= centerEn;
>>>>>          std::cout << " Normal * (centerIs - centerEn)" << normal*centerIs
>>>>> << std::endl;
>>>>>      }
>>>>> }
>>>>>
>>>>> I found that I sometimes get negative values in a cell (and all it's
>>>>> children which share the same boundary).
>>>>> In my case, I actually need the dot product between the outer normal and
>>>>> the distance between the cell and it's neighbours, and I can fix the
>>>>> problem by just adding an fabs(), but I was slightly
>>>>> surprised by this behaviour which I did not see in ALUGrid.
>>>>>
>>>>> Thanks a lot,
>>>>>
>>>>> Eike
>>>>>
>>>>> _______________________________________________
>>>>> Dune mailing list
>>>>> Dune at dune-project.org
>>>>> http://lists.dune-project.org/mailman/listinfo/dune
>>>>
>>>>
>>>> _______________________________________________
>>>> Dune mailing list
>>>> Dune at dune-project.org
>>>> http://lists.dune-project.org/mailman/listinfo/dune
>>>
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20130919/3b45196a/attachment.sig>


More information about the Dune mailing list