[Dune] Small one about dune grid
Carsten Gräser
graeser at math.fu-berlin.de
Tue Sep 7 01:27:23 CEST 2010
Hi,
Am 06.09.2010 22:53, schrieb Aleksejs Fomins:
> Dear Dune,
>
> I have another little question:
> Say I have an ElementPointer and a local face number within that element.
> Is there a simple way to get the local numbers of corners of this face.
> The local numbers must be with respect to the ELEMENT. (meaning I want 3 numbers out of possible 4)
in principle such information is available via the subEntity
method of the reference elements. If you have an ElementPointer
ep, a local facet index i within ep and a local vertex index ii
within the i-th facet of ep. The you can obtain the local index j
of the vertex within ep by the following:
const Dune::GenericReferenceElement<double,dim>& refElement
= Dune::GenericReferenceElements<double, dim>::general(ep.type());
int j = refElement.subEntity(i, 1, ii, dim);
Unfortunately the local index i above does in general not coincide
with the local index of the corresponding vertex within the face
as entity of codimension 1. Hence the subEntity method of the
reference elements do not coincide with the subEntity method of
Entity<0,...>. For example you will in general have
ep->geometry().corner(refElement.subEntity(i,codim,ii,dim))
!= e->subEntity(i,codim).geometry().corner(ii)
This is due to the fact that you can not have embeddings
of a codim!=0 entity that conform with all elements it is
contained in. However you can still use the subEntity
method of the reference element to enumerate all vertices
of a given face.
Regards
Carsten
More information about the Dune
mailing list