[Dune] Problems concerning GridTraits

Adrian Burri burriad at mathematik.uni-freiburg.de
Fri Sep 9 14:30:02 CEST 2005


Hi,

I support the proposed idea. Maybe it's a good idea to export the type 
of the new external grid traits class under the name "Traits" in the 
grid class as well. (That was probably the intention anyway, but it 
isn't listed in the code snippet.)
Just a note regarding the naming: the access methods should be called 
{leaf,level}IndexSet according to the Dune naming conventions.

Cheers

Adi

Christian Engwer wrote:

>Hi,
>
>Peter and me are currently discussing the changes in the Grid
>interface class needed for the indexsets. We wanted to add the methods
>leafindexset, levelindexset, etc. to the interface class. These
>methods should return a reference to an indexset object and the type
>of this indexset object must be implementation specific.
>
>This leads to a problem:
>  FooGrid is derived from Grid<FooGrid>.
>  Grid uses FooGrid::Traits::LeafIndexSetType as the returntype of
>  leafIndexSet(), but when Grid<FooGrid> gets instaciated, FooGrid
>  isn't a complete class. so that it is impossible to extract
>  FooGrid::Traits::LeafIndexSetType. The reason this worked till now
>  is, that ann methods that nedded type information from
>  FooGrid::Traits were template methods. All non template methods can't
>  use FooGrid::Traits in their declaration.
>
>We propose the following small change to deal with this problem:
>  We parametrize GridDefault/Grid with the GridTraits struct instead
>  of the FooGrid class itself. This results in only very small
>  changes in the Grid implementations and few changes in common/grid.hh.
>
>  Currently the Grid class keeps all associated information:  
>
>  template<int dim, int dimw>
>  class FooGrid: public GridDefault<dim,dimworld,ctype,FooGrid<dim,dimw> >
>  {
>    typedef GridTraits<.....> Traits;
>	...
>  }
>
>  We propose to move these Informations to an external Traits structs
>  and use these traits to parametrize the interface class:
>
>  typedef GridTraits<.....> FooGridTraits;
>  template<int dim, int dimw>
>  class FooGrid: public GridDefault<dim,dimworld,FooGridTraits>
>  {
>	...
>  }
>
>This should be sufficient to solve all described problems. Are there
>any comments, any objections? We would try to get this running and
>report on the results.
>
>Cheers Christian and Peter
>
>_______________________________________________
>Dune mailing list
>Dune at hal.iwr.uni-heidelberg.de
>http://hal.iwr.uni-heidelberg.de/cgi-bin/mailman/listinfo/dune
>  
>




More information about the Dune mailing list