[Dune] Iterator for all edges of a face?

Oliver Sander sander at mi.fu-berlin.de
Thu Mar 26 13:58:27 CET 2009


Hi Dragan!
Sorry, I should have read your mail more carefully.  Intersections really
are only for elements (==codim 0 entities).

For all others you need some index magic.  For your entity of type t, 
get the
reference element by setting

const Dune::ReferenceElement<ctype,dim>& refElement
           = Dune::ReferenceElements<ctype, dim>::general(t);

Then have a look at the methods of the ReferenceElement class.
It gives you local numbers of subentities of subentities [sic].  For
example, all vertices of a given edge, or all edges of a given face.
If you are on an element can use those local numbers with the method 
`entity'
to get the corresponding subentities. Note that grid implementations are 
only
required to provide codim 0 and codim==dim.

Hope this helps,
Oliver


Dragan Vidovic schrieb:
> Hi Oliver
>
> I tried that first. Here is what grid-howto says:
>
> IntersectionIterator provides access to all entities of codimension 0
> that have an intersection of codimension
> 1 with a given entity of codimension 0.
>
> And the compiler says the same thing - it does not work for, let's
> say, codimension 1 (triangle) having an intersection of codimension
> 2 (edge) with another triangle, all in a 3d mesh.
>
> Cheers,
>
> Dragan
>
>
> On Wed, Mar 25, 2009 at 4:52 PM, Oliver Sander <sander at mi.fu-berlin.de> wrote:
>   
>> Hi Dragan!
>> Have a look at the Intersections and the IntersectionIterators.
>> They allow you to do just that.
>>
>> --
>> Oliver
>>
>> Dragan Vidovic schrieb:
>>     
>>> Hi all
>>>
>>> A beginner's question: I need to iterate all entities of dimension
>>> d-1 of an element of dimension d, for any d<=dim of the grid. Is there
>>> an iterator that would allow me to do this? I access the d-dimensional
>>> element trough a LeafIterator.
>>>
>>> I need all this in order to get areas and normals of tetrahedron
>>> faces, or lengths and vectors of triangle edges, in a uniform way.
>>>
>>> Thanks.
>>>
>>> Dragan
>>>
>>> _______________________________________________
>>> Dune mailing list
>>> Dune at dune-project.org
>>> http://lists.dune-project.org/mailman/listinfo/dune
>>>
>>>       
>> --
>> ************************************************************************
>> * Oliver Sander                ** email: sander at mi.fu-berlin.de        *
>> * Freie Universität Berlin     ** phone: + 49 (30) 838 75348           *
>> * Institut für Mathematik      ** URL  : page.mi.fu-berlin.de/~sander  *
>> * Arnimallee 6                 ** -------------------------------------*
>> * 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
>> ************************************************************************
>>
>>
>>     
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>   


-- 
************************************************************************
* Oliver Sander                ** email: sander at mi.fu-berlin.de        *
* Freie Universität Berlin     ** phone: + 49 (30) 838 75348           *
* Institut für Mathematik      ** URL  : page.mi.fu-berlin.de/~sander  *
* Arnimallee 6                 ** -------------------------------------*
* 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
************************************************************************





More information about the Dune mailing list