[Dune] face loop

Martin Nolte nolte at mathematik.uni-freiburg.de
Tue Jun 5 18:45:00 CEST 2012


Hi Marco,

the DUNE interface does not provide means to obtain the elements (entities of 
codimension 0) sharing a common face (entity of codimension 1).

Moreover, I guess from your question that you are actually interested in the 
intersections rather than the faces. Ask yourself what kind of object you want 
if the grid is non-conforming.

Unfortunately, there is no intersection iterator that stops exactly once at each 
intersection of the grid view. So you have loop over all elements and then loop 
over their intersections. However, if the flux computation is expensive (and you 
don't use a surface grid), you can use the fact that each interior interection 
is visited exactly twice in order to evaluate the flux only once. Just evaluate 
it iff, e.g., the index of the inside entity is less than the index of the 
outside entity.

I hope this throws some light on the matter.

Best,

Martin

On 06/05/2012 05:27 PM, Marco Cisternino wrote:
> Hi,
> I'm looking at the tutorial codes, specifically, at evolve.hh. I see that a loop
> over the intersections is nested in a loop over the elements.
> I would like to loop over all the faces (old intersections) to compute the
> fluxes but I would need to know which elements the face belong to.
> How could I do?
> I defined the face iterator on the leaves like this:
> typedef typename GridView::template Codim<1>::template
> Partition<Dune::All_Partition>::Iterator FLeafIterator;
> Is there a way to ask for the elements of codim=0 which own the face pointed by
> FLeafIterator??
> Thanks for any help.
>
> Cheers,
> Marco
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Dr. 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