[Dune] specializing template classes for Dune::Grid

Matteo Semplice matteo.semplice at unito.it
Mon Sep 1 22:07:15 CEST 2014


Dear duners,
     my last attempt to update to version 2.3 halted on specializing a 
class that depend on a grid type as template parameter and, after the 
new alugrid module and the updated UG licence, I would like to give it 
another go...

I have a class R that depends on the template parameter G, which is a 
Dune Grid. Most of the methods of the class depend on the Grid dimension 
and on the Grid's cell type, so in order to implement them, I need to 
specialize the class for
1) any grid in 1 spatial dimenion
2) any grid in 2 spatial dimensions based on quad

My old implementation based on dune 2.2 had actually 3 specializations 
for Dune::OneDGrid, for Dune::AlbertaGrid<1,1>, and for 
Dune::ALUCubeGrid<2,2>, the first two being identical and I used some 
#define's in order not to rewrite the 1d code twice. However, I couldn't 
get the correct replacement for Dune::ALUCubeGrid<2,2> in the new naming 
scheme of dune 2.3 that would make the 2d code to compile.

So, the question is if it is possible to specialize as in (1) and (2), 
so that one implementation will take care of both Dune::OneDGrid and 
Dune::AlbertaGrid<1,1> and the other implementation of AluGrid and UG 
based on quad. This, of course, would be the most elegant solution.

If not, what is the translation of Dune::ALUCubeGrid<2,2> in the new 
naming scheme of dune 2.3?

Thanks in advance!

Best,
    Matteo




More information about the Dune mailing list