[Dune] How to map intersections?

Oliver Sander sander at mi.fu-berlin.de
Thu Mar 26 16:56:48 CET 2009


You need a mapper and what you called a P1Layout.  The mapper
has a method that takes an element, a codimension, and a subentity
number.  The element is what your LeafIterator points to, the codimension
is 1, and the subentity number is given by the method numberInSelf()
of the IntersectionIterator.

--
Oliver


Dragan Vidovic schrieb:
> Hi all
>
> I traverse elements using a LeafIterator and then I access their faces
> using an IntersectionIterator. I associate fluxes with faces, and they
> are stored in a std::vector, so I need to map these faces to an index.
>
> I tried two things. First I tried to make a mapper that would select
> faces trough a layout like this:
>
> template<int dim>
> struct P1Layout
> {
>   bool contains (Dune::GeometryType gt)
>   {
> 	if (gt.dim()==dim-1) return true;
> 	return false;
>   }
> };
>
> But the mapper does not work with an Intersection as an argument, and
> I don't know how to turn this Intersection into an Entity that the
> mapper can use.
>
> Then I tried to use the P0Layout from the grid-howto and a different
> map function:
>
> int 	map (const typename G::Traits::template Codim< 0 >::Entity &e,
> int i, unsigned int codim) const
>
> But this function does not take a *LeafIterator as the first argument,
> and I don't know how to make what it would take, and I don't know how
> can it do the mapping from a typename, a local number, and a codim. I
> don't understand this function.
>
> So how can I map faces? I use a simplex Alugrid, so all codimensions
> should be there.
>
> Cheers,
>
> 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)   *
************************************************************************





More information about the Dune mailing list