[Dune] face indices in UGGrid

Oliver Sander sander at mi.fu-berlin.de
Mon Oct 29 14:14:53 CET 2007


Hi Sven!

Sven Marnach schrieb:
> Hi,
>
> I'd like to implement a discretization with unknowns on the cell and
> face centers of a non-conforming UG grid.  To get a consecutive
> numbering of the unknowns, I use a LeafMultipleCodimMultipleGeomTypeMapper.
> To get the index of an unknown, I have to pass the corresponding
> Entity as an argument to the map() member function of the mapper.
>
> 1. In this grid,
>
>    +-----+--+--+
>    |     |  |  |
>    +     +--+--+
>    |     |  |  |
>    +-----+--+--+
>
>    does the right face of the left cell belong to the leaf grid? 
It does!

>    If it does, how do I get an efficient mapper which doesn't include
>    this face?
>   
I suspect you can't.  If you really don't want them you may
have to keep them in your index set and zero them out
in the matrix.
> 2. It seems quite inefficient to me that I really have to construct an
>    entity just to get the index, but the map method of the Mapper
>    interface requires this.
>   
What index do you expect to get if don't have an entity?

> 3. IN UGGrid, the entity<1>(int) method of codim 0 entities doesn't
>    seem to be implemented.  The following code snippet
>
>      typedef Dune::UGGrid<dim> GridType;
>      UnitCube<GridType,1> uc;
>      GridType& grid = uc.grid();
>      GridType::Codim<0>::LeafIterator it = grid.leafbegin<0>();
>      GridType::Codim<1>::EntityPointer qqq = it->entity<1>(0);
>
>    works with Alberta, but causes a linker error with UGGrid<2> and a
>    compiler error with UGGrid<3>.
>
>    Oliver, could you give me a hint how to implement it?  Is it
>    possible to do this without knowing anything about the UG
>    internals?  Are the EntityPointers and Entities of codim 1
>    implemented at all?
>   
No, the entities of codim 1 are not implemented at all.
Long time ago we decided that only the entities of codimension
0 and dim were mandatory, and indeed there is a capability
trait 'hasEntity' which tells you about the available entities.

Implementing edge and face iterators for UGGrid is not really
difficult, but you have to know some UG internals.  Faces
in particular don't actually exist in UG and you have to trick
your way around.

It is one of these things that I always wanted to do but never
found the time.

Good luck,
Oliver

>    Or does anybody know a way to get a consecutive numbering of the
>    unknowns without using this method?
>
> Greetings from Stuttgart,
>     Sven
>
> _______________________________________________
> 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 75217           *
* Institut für Mathematik II   ** 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