[Dune] pointer to boundary faces

Martin Nolte nolte at mathematik.uni-freiburg.de
Fri Jul 15 17:20:35 CEST 2011


Try

const ElementIterator eend = gridView.end();
for( ElementIterator eit = gridView.begin(); eit != eend; ++eit )
{
  const Entity &e = *eit;
  const IntersectionIterator iend = gridView.iend( e );
  for( IntersectionIterator iit = gridView.ibegin( e ); iit != iend; ++iit )
  {
    const Intersection &i = *iit;
    if( i.boundary() )
    {
      FaceEntityPointer fp = e.template subEntity< 1 >( i.indexInInside() );
    }
  }
}

Best,

Martin

On 07/15/2011 04:44 PM, arya fallahi wrote:
> Dear Dune team,
> 
> In my work I need to have access to pointers to a face on a boundary. Do you
> know how exactly I con do this? 
> 
> My problem is mainly with the "intersect" iterator. Can I somehow produce an
> entityPointer to an intersect in which ( intersect->boundary() = true) ?
> 
> I used the following lines but it seems intersect iterator can not provide me
> with a pointer.
> 
> 
> 
> for (EGrid::template Codim<Grid::dimension-3>::template
> Partition<InteriorBorder_Partition>::LeafIterator
>  elemit = elembit; elemit != elemeit; ++elemit)
>         {
> 
>           /** Loop over intersections of the current element.                
>                           */
>           Grid::LeafIntersectionIterator begIntersectionIter =
> elemit->ileafbegin();
>           Grid::LeafIntersectionIterator endIntersectionIter = elemit->ileafend();
> 
>           for (Grid::LeafIntersectionIterator intersect = begIntersectionIter;
> intersect != endIntersectionIter; ++intersect)
>             {
>               if (intersect->boundary() == true)
>                 {
>                   
> Grid::template Codim<Grid::dimension-2>::EntityPointer
>  facepointer (*intersect)
>                 }
>             }
>         }
> 
> 
> 
> Another solution is to loop over face iterators and find out if they belong to
> the boundary. I could not find a related function for this. Is there any
> possibility in Dune to do that?
> 
> Thank you in advance for your assistance
> 
> Best regards
> 
> Arya Fallahi
> 
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list