[Dune] Problem with compiling grid.globalIdSet()

Oliver Sander sander at igpm.rwth-aachen.de
Mon Mar 2 21:59:43 CET 2015


Hi all,

> When I specified "unsigned int" explicitly as the indexType in the CurvIndexSet, everything compiled no problem.
> 
> At the moment I am ok with this solution, but I completely agree with Markus
> 
> 1) indexType is a templated type. If you want it to be "unsigned int" always, don't make it templated
> 2) many grids create their own gridfamily, explicitly specifying the template parameter indexType to their bidding
> 3) However, the generic GridTraits forces the grid implementor to use "unsigned int" for indexType.
> 
> I agree that this is a bug, because it does not really forbid me from using arbitrary index type, it just makes it harder to do.
> 

my memory is imprecise, but this type passing is my doing.  IIRC, originally, the type 'unsigned int' was hardcoded
in the interface classes themselves.  I moved that to where it is now, to allow grid implementors to choose different
types for different grids.  I was aware that this is only a compromise solution, but it was the best I could do
without breaking internal interfaces.

> Solution is rather simple - add extra template argument to Dune::GridTraits, which would specify IndexType. IdType is already passed this way.
> 

Yes.  I didn't do that back then because all grid implementations need to be adapted.

> I will submit bug report next week, unless somebody believes that this is the expected behaviour.

Please go ahead.

Cheers,
Oliver

> 
> Best,
> Aleksejs
> 
> 
> On 26/02/15 11:30, Markus Blatt wrote:
>> On Thu, Feb 26, 2015 at 10:18:09AM +0100, Christoph_Gersbacher wrote:
>>> Hi Aleksejs,
>>>
>>> the forward declaration you are missing can be found in line 360 of
>>> dune/grid/common/grid.hh:
>>>
>>>    template< class GridImp, class IndexSetImp,
>>>                      class IndexTypeImp = unsigned int,
>>>                      class TypesImp = std::vector< GeometryType > >
>>>    class IndexSet;
>>>
>>> If you are not happy with the default values just explicitly state
>>> the optional third and fourth template parameters.
>>>
> 
>> Does not seem to be possible as in the GridTraits line 1426 we do:
> 
> 
>> typedef IndexSet<const GridImp,LevelIndexSetImp> LevelIndexSet;
>> typedef IndexSet<const GridImp,LeafIndexSetImp> LeafIndexSet;
>> typedef IdSet<const GridImp,GlobalIdSetImp,GIDType> GlobalIdSet;
>> typedef IdSet<const GridImp,LocalIdSetImp,LIDType> LocalIdSet;
> 
>> Markus
> 
> 
> 
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150302/4b68e017/attachment.sig>


More information about the Dune mailing list