[Dune] Problem with compiling grid.globalId()

Aleksejs Fomins aleksejs.fomins at lspr.ch
Thu Feb 12 14:56:28 CET 2015


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

Dear Dune,

I am compiling the curvilinear grid at the moment. I am having a
problem with the function

const GlobalIdSet &globalIdSet () const  { return globalIdSet_; }

where GlobalIdSet is the Dune::GridTraits<...>::GlobalIdSet<...>, and
globalIdSet_ is the implementation of the IdSet, namely

class CurvIdSet<...> : public Dune::IdSet<...>

So the return value of this function does not really match what is
really returned since one is IdSet and the other IdSetImpl, but this
is how it is done in YaspGrid and GeomGrid, so I tried to do it this
way too. Unfortunately, this throws a type mismatch error.

Could someone suggest to me what the problem could be?

In other cases, the paradigm seems to be to return
DuneClass(ClassImpl(....)), but for indices and Id's there does not
seem to be a constructor from implementation, so I am puzzled on how
to make this work...


Cheers,
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 GlobalIdSet& Dune::CurvilinearGrid<dim,
dimworld, ct>::globalIdSet() const [with int dim = 3; int dimworld =
3; ct = double; Dune::CurvilinearGrid<dim, dimworld, ct>::GlobalIdSet
= Dune::IdSet<const Dune::CurvilinearGrid<3, 3, double>,
Dune::CurvGrid::CurvIdSet<Dune::CurvilinearGrid<3, 3, double> >,
Dune::CurvilinearGridStorage<double, 3>::IdType>]’:
/home/fomins/gitwork/hades-github-lspr-ag/dune-grid/dune/grid/test/gridcheck.cc:957:7:
  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:295:55:
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_; }
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJU3LEMAAoJEDkNM7UOEwMZbsMQAIKNo7NXC3edyvYSjBjYKHjp
wJRiQ95egGQ+WCMCf4JazCg8eeKUUZOBg8C9oFrtMSULcY+sFOJc2wSesxFCoqqZ
cln/nsIxcoEkIrWMqIJLudTZ2MLN+fZE7vGorh4TjE2LVZjH2131y27epNfFKfuo
omUpwgauF0X7H0HxwYFcAP0GTzii02PGa6ZGL8XCkXcHq0e7xH5ubQm+1/mD4Rdf
yt+MD3hkSF6NocwBIXyzGTfp5zFw7gZEP9/5HSC4JOHEUUWEIChM241WB3QXoqOz
KtSxPC8QAyuLF3NCCX8IgjjAXLc1lcuO7aGdgfn9jD03vgN58fl4l5hxt7C7/357
4XPSFF2zITRebkRVDmoYZ7sCB4sYA4PdpoApNYTPypS6BtZz9Wk6WphrrA9iwpAv
9ciDLe5IHOh8LAAgCgqtYopuDNsKgQzdebnTOJ0lM4QhHZ9uV7QTRORwH4bdhvfH
Lf//u32yCRAk9/gn+HUiwDu6DwiZeDpflil/6Dnt6o9gNEFANrBJb7zZbnQ9VR0S
XYlgVpqJa/5SVp/CJgUIt6M6ombKYmahxNlAXo9mMupm+0GMc3pyqe5GjMZRLUap
OpyeHf+S8rozsKlVTon1nP2AM+gUvLcd/cpdJpyCGcsD9E/zq/N+HXWDitUSUL5t
2G3U9rp/zYZICZGkUmKG
=PCah
-----END PGP SIGNATURE-----



More information about the Dune mailing list