[Dune] how to access method Dune::GenericReferenceElement via an element iterator ?

Carsten Gräser graeser at math.fu-berlin.de
Wed Dec 22 19:19:12 CET 2010


Am 22.12.2010 10:57, schrieb Jö Fahlke:
> Am Wed, 22. Dec 2010, 10:02:06 +0100 schrieb Benedikt Oswald:
>> given an element iterator for a codim 0 entity, how can I access methods like size (.) of the
>> Dune::GenericReferenceElement without a priori using the knowledge that the element
>> is of a special type, such as a tet ?
>>
>> i.e. something like:
>>
>> nNodePerEntity=(*elemit).geometry().type().size(codimofnode);
> 
>   const Dune::GenericReferenceElement<ctype, dim> &refelem =
>     Dune::GenericReferenceElements<ctype, dim>::general(elemit->type());
>   nNodePerEntity = refelem.size(codimofnode);
> 
> Note that the first GenericReferenceElement (the element itself) is without an
> 's' at the end, while the second GenericReferenceElements (the reference
> element factory) has a trailing 's'.
If you're only interested in size() you could also use

elemit->template count<Grid::dimension>()

Best,
Carsten




More information about the Dune mailing list