[Dune] Problem with compiling grid.globalIdSet()

Aleksejs Fomins aleksejs.fomins at lspr.ch
Tue Feb 24 16:21:17 CET 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Christoph,

Thank you for your suggestion, this indeed was the bug, I figured it
out more or less at the same time.

Now this problem is fixed, but I have the same problem with
LeafIndexSet, but this time all of the const Grid are in place. (error
code below). What I do notice is that it finds the IndexType to be
"unsigned int" whereas in the derived derived class it is clearly "int".

I am using the default Dune::GridTraits, and, as I see, it only
explicitly specifies 2 out of 4 template parameters when defining
Dune::IndexSet.

I would be happy to know how does it determine the missing template
parameters, and why is it "unsigned int"?

Best,
Aleksejs



In file included from
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/test/test-curvgrid.cc:12:0:
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/curvilineargrid/grid.hh:
In instantiation of ‘const LeafIndexSet& Dune::CurvilinearGrid<dim,
dimworld, ct>::leafIndexSet() const [with int dim = 3; int dimworld =
3; ct = double; Dune::CurvilinearGrid<dim, dimworld, ct>::LeafIndexSet
= Dune::IndexSet<const Dune::CurvilinearGrid<3, 3, double>,
Dune::CurvGrid::CurvIndexSet<const Dune::CurvilinearGrid<3, 3, double>
> , unsigned int, std::vector<Dune::GeometryType> >]’:
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/test/gridcheck.cc:151:68:
  required from ‘void zeroEntityConsistency(Grid&) [with Grid =
Dune::CurvilinearGrid<3, 3, double>]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/test/gridcheck.cc:929:26:
  required from ‘void gridcheck(Grid&) [with Grid =
Dune::CurvilinearGrid<3, 3, double>]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/test/test-curvgrid.cc:79:17:
  required from ‘void check_grid(Dune::CurvilinearGrid<cdim, cdim,
ctype>&) [with ctype = double; int cdim = 3]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/test/test-curvgrid.cc:109:25:
  required from here
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/curvilineargrid/grid.hh:333:57:
error: invalid initialization of reference of type ‘const
LeafIndexSet& {aka const Dune::IndexSet<const Dune::CurvilinearGrid<3,
3, double>, Dune::CurvGrid::CurvIndexSet<const
Dune::CurvilinearGrid<3, 3, double> >, unsigned int,
std::vector<Dune::GeometryType> >&}’ from expression of type ‘const
IndexSetImpl {aka const Dune::CurvGrid::CurvIndexSet<const
Dune::CurvilinearGrid<3, 3, double> >}’
     const LeafIndexSet &leafIndexSet () const  { return leafIndexSet_; }
                                                         ^
In file included from
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/common/grid.hh:1408:0,
                 from
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/curvilineargrid/grid.hh:8,
                 from
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/test/test-curvgrid.cc:12:
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/common/indexidset.hh:
In instantiation of ‘const IndexSetImp& Dune::IndexSet<GridImp,
IndexSetImp, IndexTypeImp, TypesImp>::asImp() const [with GridImp =
const Dune::CurvilinearGrid<3, 3, double>; IndexSetImp =
Dune::CurvGrid::CurvIndexSet<const Dune::CurvilinearGrid<3, 3, double>
> ; IndexTypeImp = unsigned int; TypesImp =
std::vector<Dune::GeometryType>]’:
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/common/indexidset.hh:136:20:
  required from ‘Dune::IndexSet<GridImp, IndexSetImp, IndexTypeImp,
TypesImp>::IndexType Dune::IndexSet<GridImp, IndexSetImp,
IndexTypeImp, TypesImp>::index(const Entity&) const [with Entity =
Dune::Entity<0, 3, const Dune::CurvilinearGrid<3, 3, double>,
Dune::CurvGrid::CurvEntity>; GridImp = const Dune::CurvilinearGrid<3,
3, double>; IndexSetImp = Dune::CurvGrid::CurvIndexSet<const
Dune::CurvilinearGrid<3, 3, double> >; IndexTypeImp = unsigned int;
TypesImp = std::vector<Dune::GeometryType>; Dune::IndexSet<GridImp,
IndexSetImp, IndexTypeImp, TypesImp>::IndexType = unsigned int]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/test/gridcheck.cc:625:3:
  required from ‘void iteratorEquals(Grid&) [with Grid =
Dune::CurvilinearGrid<3, 3, double>]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/test/gridcheck.cc:925:19:
  required from ‘void gridcheck(Grid&) [with Grid =
Dune::CurvilinearGrid<3, 3, double>]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/test/test-curvgrid.cc:79:17:
  required from ‘void check_grid(Dune::CurvilinearGrid<cdim, cdim,
ctype>&) [with ctype = double; int cdim = 3]’
/home/fomins/gitwork/hades-github-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/test/test-curvgrid.cc:109:25:
  required from here
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/common/indexidset.hh:275:85:
error: invalid static_cast from type ‘const Dune::IndexSet<const
Dune::CurvilinearGrid<3, 3, double>,
Dune::CurvGrid::CurvIndexSet<const Dune::CurvilinearGrid<3, 3, double>
> , unsigned int, std::vector<Dune::GeometryType> >’ to type ‘const
Dune::CurvGrid::CurvIndexSet<const Dune::CurvilinearGrid<3, 3, double> >&’
     const IndexSetImp& asImp () const {return static_cast<const
IndexSetImp &>(*this);}

On 24/02/15 15:28, Aleksejs Fomins wrote:
> Dear Dune,
> 
> I am still having problems with compiling my curvgrid.globalIdSet()
> method
> 
> When I look at YaspGrid, the method YaspGrid.globalIdSet() returns 
> Dune::IdSet<...> but what is actually returned is 
> YaspGlobalIdSet<const YaspGrid> : public Dune::IdSet<...>
> 
> and that seems to work. Now, when I try to do something similar, I
> get the error
> 
> error: invalid initialization of reference of type ‘const
> GlobalIdSet& {aka const Dune::IdSet<const Dune::CurvilinearGrid<3,
> 3, double>, Dune::CurvGrid::CurvIdSet<Dune::CurvilinearGrid<3, 3,
> double> >, Dune::CurvilinearGridStorage<double, 3>::IdType>&}’ from
> expression of type ‘const IdSetImpl {aka const
> Dune::CurvGrid::CurvIdSet<const Dune::CurvilinearGrid<3, 3, double>
> >}’
> 
> const GlobalIdSet &globalIdSet () const  { return globalIdSet_; }
> 
> 
> Any hints will be appreciated.
> 
> Cheers, Aleksejs
> 
> _______________________________________________ Dune mailing list 
> Dune at dune-project.org 
> http://lists.dune-project.org/mailman/listinfo/dune
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJU7JbsAAoJEDkNM7UOEwMZmd4P/R1W5FLyx34IldmBJoag1BMc
aeir4wLSwEqkXApwk6FBDwZSFwakjA7OY5GCs1PAaHIXIO9o4xfXJraX6k19xN/J
NQybCrPIrfjZVGMREgLhNbzzzgSZi4k500uVvmEDOV94g5W0pbayDrf7pfOIkV+S
ZxrHi+dc7qRh8tCrC1iewSyGS5FivkI6AoAVsGIB0yHzicwUe7kQezhNvor1ZiBb
PGCjRa5cZsbUcLa7vs3gpKS802ICvA6l05DM3Yo3F6oqgOaLlpy9ARFMPAXREVj1
skjOUAmeXTVcYzS6rC2CSCccfaqdrSu6bwkh5Gyeds9o0wSKNsm4g3wkwGjyJH2O
mI+qqhatWXZFdSN2cqddlfxUZ19mL+1pdQk5FaOV2D1ACe9LKzBH9bnt+bkhRMoz
0+gNwJMKQT2CBMgfS/t4DQu/e7ZNGl0nsivQ7v+5xlCT4JMFigeBz2jcXrl32cWd
E27L3RVcHS35rOvOu7LTbLj6z3II2vNNw796ElnMj3StctUoU2IO1XDUZvR1PgLV
3uOwsceUnBEsxTAURz44KFpAkPWFz4s96iOu4mjEmtH8cxvtrss+po3mR2KV+dV0
U5EzMqowusp38K9IJErX1i4bhLYrPjKMqG2xnOmAZZTGR3QJOijA0NhDH4Z85ez8
GtUaJznCo41bj0l0WEPx
=/MAR
-----END PGP SIGNATURE-----




More information about the Dune mailing list