[Dune] centerUnitOuterNormal() in UGGrid

Oliver Sander sander at igpm.rwth-aachen.de
Mon Sep 16 17:24:30 CEST 2013


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





More information about the Dune mailing list