[Dune] Re: Anfrage 2d integration in 3d grids.
Robert Kloefkorn
robertk at mathematik.uni-freiburg.de
Thu Nov 9 10:43:05 CET 2006
Leidenberger Patrick wrote:
> Hi Robert, hi Christian,
>
> Thanks a lot!!!! For the help a the tips for my code.
>
> Please allow me two more questions:
> What have to be changed in the integration if I want to use the intersection iterator
The code look something like this (just a sample):
Lets say you selected the LeafGridPart, which indirectly selects the
leaf index set and appropriate interators (i.e. LeafIterator,
LeafIntersectionIterator, have a look dune-grid/grid/common/gridpart.hh ) :
GridType grid(...);
typedef LeafGridPart<GridType> GridPartType;
GridPartType gridPart(grid);
// get type of corresponding iterator
typedef typename GridPartType :: template Codim<0> :: IteratorType
IteratorType;
// loop over all entities belonging to choosen sub set of grid
IteratorType endit = gridPart.template end<0> ();
for(IteratorType it = gridPart.template begin<0> ();
it != endit; ++it)
{
// select corresponding intersection iterator
typedef typename GridPartType :: IntersectionIteratorType
IntersectionIteratorType ;
IntersectionIteratorType endnit = gridPart.iend(*it);
for (IntersectionIteratorType nit = gridPart.ibegin(*it);
nit != endnit; ++nit)
{
// get geometry of intersection
const Geometry & faceGeo = nit.intersectionGlobal();
// from here it's the same as in the other example before
}
}
Note: I just typed this piece of code so it might not work at once when
copied to source file.
Regards
R
--
Robert Klöfkorn <robertk at mathematik.uni-freiburg.de>
Mathematisches Institut Tel: +49 (0) 761 203 5631
Abt. für Angewandte Mathematik Fax: +49 (0) 761 203 5632
Universität Freiburg
Hermann-Herder-Str. 10
79104 Freiburg
http://www.mathematik.uni-freiburg.de/IAM/homepages/robertk
More information about the Dune
mailing list