[Dune] [#651] Declaration of hasHierarchicIndexSet for GeometryGrid

Dune dune at dune-project.org
Thu Nov 5 19:58:15 CET 2009


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#651 - Declaration of hasHierarchicIndexSet for GeometryGrid
User who did this - Martin Nolte (nolte)

----------
Let me remind you of a discussion on the mailing list started by commit 5686:

Oliver:
I am getting old and my memory is weak: when did we decide
that hierarchic index sets become part of the interface?

----------

Martin:
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

----------

Christian:
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..

Martin:
I understand. In this case I will not declare the capability at all. A default 
implementation is great, but only useful if I know where to include it from. 
And I don't think that geogrid.hh would be a good place for this one (I 
wouldn't want ALUGrid or AlbertaGrid to depend on geogrid.hh).

----------

This is where everybody lost interest in the problem. It works for me (dune-fem always declares this capability) and the test is an example how to make it work.

If you want me to add the code snippet to the documentation, I can do that.

As for a real solution, all my attempts to be able to add extensions to dune-grid were blocked somewhere. For example, I suggested a directory "extensions", "experimenal" or something like that for interface extensions. One could then add a namespace Extensions (like Capabilities, but stating definitely that these features are non-standard and have never been agreed upon).

Whatever the solution will be, just give me a vote on what to do and, if it does not involve a lot of work, it shall be done.
----------

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=651#comment1307

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list