[Dune] IntersectionIterator Problem within dune-disc

Markus Blatt mblatt at hal.iwr.uni-heidelberg.de
Thu Aug 3 17:52:21 CEST 2006


I stumbled over a problem with the intersectionIterator within
dune-disc.

Due to the new Interface we have to know whether we assemble on th
leaf or a level of the grid and at compile time choose the correct
fuction (either ileaf{begin,end}() or ilevel{begin,end}() ).

This is easy in the assembler as it there different types for the
assembly of the leaf and level. 

The problem is that the assembler uses a subclass of LocalStiffness
for the assembling that needs the correct IntersectionIterator to
assemble the boundary conditions. As LocalStiffness::assemble is
virtual there is now way to tell assemble whether it assembles on a
leaf or level with some tempate tag passed by the assembler, like

struct LeafTag{};
struct LevelTag{};

template<typename T>
InterSectioIteratorGetter{};

template<>
InterSectionIteratorGetter<LeafTag>{
  template<typename T, typename E>
  static T begin(Entity& e){
    return e.ileafbegin();
  }
};

template<typename T>
void assemble(Entity e, T& typtag, int k)
{
  //get the interesection itertator
  IntersectionIterator iter = IntersectionIteratorGetter<T>::begin<IntersectionIterator>(e);
}

And thus let the assembler take care about that.

A possiblity would be to add the tag as a template parameter to
LocalStiffness and its subclasses and thus user has to provide is
twice:
First implicitely in calling the correct Assembler
LeafP1OperatorAssembler and second in providing the correct Tag to the
LocalStiffness assembler.

Another possiblity is to process the boundarycondition loop twice one
time with an iterator we get by ilevelbegin() and another time with an
iterator we get by ileafbegin(). Then one has to care to process all
intersections only once. This does not sound very nifty to me.

Any more ideas or proposals?

Cheers,

Markus
-- 
DUNE -- The Distributed And Unified Numerics Environment 
<http://www.dune-project.org>




More information about the Dune mailing list