[Dune] [Fwd: Re: [Fwd: [Dune-Commit] dune-grid r5686 - trunk/grid]]

Christian Engwer christi at uni-hd.de
Tue Sep 29 13:43:03 CEST 2009


Hi Martin, Hi Oliver,

I do understand that there is a need for additional coapabilities, if
you want to implement new features. Still I have some questions/remarks:

1) If you need a new capabiity you can do the following:

   - add the complete capability to the new module

     geogrid.hh contains

     template<class T>
     struct HasHierarchicIndexSet
     {
 	     enum { value = false };
	 };

     #if HAVE_ALUGRID
     #include <dune/grid/alugrid.hh>
     template<...>
     struct HasHierarchicIndexSet<Alugrid>
     {
         enum { value = true };
     };
     #endif

   This way it will work for all grids in dune-grid, without the need
   to change all implementations. The only inconvience is that the
   user has alugrid.hh is automatically included.

2) The HierarchicIndexSets are something _very_ far from being part
   of the interface, thus I must agree with Oliver that it is more
   than ugly to have these capabilities in all headers.

I think that the solution proposed in point 1 is a good compromise.

What do you two think?
Christian

On Tue, Sep 29, 2009 at 01:31:47PM +0200, Martin Nolte wrote:
> Ok, yet another reply gone wrong. ;-)
> 
> -------- Original Message --------
> Subject: Re: [Dune] [Fwd: [Dune-Commit] dune-grid r5686 - trunk/grid]
> Date: Tue, 29 Sep 2009 13:30:27 +0200
> From: Martin Nolte <nolte at mathematik.uni-freiburg.de>
> To: Oliver Sander <sander at mi.fu-berlin.de>
> References: <4AC1EE24.8030108 at mi.fu-berlin.de>
> 
> Hi Oliver,
> 
> we never did. And that's why they are _not_ part of the interface (i.e.
> dune/grid/common/capabilities.hh). Yet, Geogrid tries to take advantage of
> them and therefore needs this capability to work on that grid. So, if you want
> GeometryGrid< YaspGrid >, you need this capability, otherwise not.
> 
> Of course, we can decide not to add this capability and leave it up the user
> to declare it. I would leave that decision up to the grid implementor...
> 
> I hope this course of action was not an offense against good style - I just
> needed this capability to make it work.
> 
> Yours,
> 
> Martin
> 
> Oliver Sander wrote:
> > Hi Martin!
> > I am getting old and my memory is weak: when did we decide
> > that hierarchic index sets become part of the interface?
> > 
> > Thanks,
> > Oliver
> > 
> > -------- Original-Nachricht --------
> > Betreff: 	[Dune-Commit] dune-grid r5686 - trunk/grid
> > Datum: 	Tue, 29 Sep 2009 12:48:14 +0200
> > Von: 	mnolte at dune-project.org
> > An: 	dune-commit at dune-project.org
> > 
> > 
> > 
> > Author: mnolte
> > Date: 2009-09-29 12:48:14 +0200 (Tue, 29 Sep 2009)
> > New Revision: 5686
> > 
> > Modified:
> >    trunk/grid/yaspgrid.hh
> > Log:
> > add Capability hasHierarchicIndexSet (so that it works with geogrid)
> > 
> > 
> > Modified: trunk/grid/yaspgrid.hh
> > ===================================================================
> > --- trunk/grid/yaspgrid.hh	2009-09-29 10:47:35 UTC (rev 5685)
> > +++ trunk/grid/yaspgrid.hh	2009-09-29 10:48:14 UTC (rev 5686)
> > @@ -3191,6 +3191,20 @@
> >      static const bool v = false;
> >    };
> >  
> > +
> > +
> > +  // non-standard capabilities
> > +  // -------------------------
> > +
> > +  template< class Grid >
> > +  struct hasHierarchicIndexSet;
> > +
> > +  template< int dim >
> > +  struct hasHierarchicIndexSet< YaspGrid< dim > >
> > +  {
> > +    static const bool v = false;
> > +  };
> > +
> >  }
> >  
> >  } // end namespace
> > 
> > 
> > _______________________________________________
> > Dune-Commit mailing list
> > Dune-Commit at dune-project.org
> > http://lists.dune-project.org/mailman/listinfo/dune-commit
> > 
> > 
> 




More information about the Dune mailing list