[Dune] Problem with compiling grid.globalIdSet()

Christoph_Gersbacher gersbach at mathematik.uni-freiburg.de
Tue Feb 24 15:57:35 CET 2015


Hi Aleksejs,

the second template parameter of the Dune::IdSet facade class is your 
implementation:

    Dune::CurvGrid::CurvIdSet<Dune::CurvilinearGrid<3, 3, double> >

The compiler tells you that you are returning a reference of type

    Dune::CurvGrid::CurvIdSet<const Dune::CurvilinearGrid<3, 3, double> >

As you can see there is an additional 'const' qualifier which - without 
knowing your code - should be correct. Have a look at your GridFamily 
traits class and make sure to always pass a 'const Grid' type 
everywhere. For the facade classes to work correctly all typedefs must 
be consistent with this global traits class!

Best
Christoph


On 02/24/2015 03:28 PM, Aleksejs Fomins wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iQIcBAEBAgAGBQJU7IqnAAoJEDkNM7UOEwMZsrYQANocOvM/Gz1m9Xj4RCIQjhTg
> xJbhtlBt5oL0nkqafgGpMohlQTWUktKwt7qC1qAfgBC3nt+EYcpySyLbIbZ4VXlH
> Q3WE8oSGmhp5YSX4KO9fJx8+7qq0IxQCp2/rF8jwwPoFX6dAjcOVSAObyC5b8I4d
> 6OhEuV1VCGvjAcUvWM5BDF4V5+uEe09jrhGoiPt+8SrR4Rt+aXqJowXJy9Dh9WPM
> 5mrNiDCyuGr69ivtF7xIwubsTxS+g6FqR9dTcH2TwpsJZ5b2Q31Hx7fGHsinLr97
> p1yiMf6i2I9/mjGkATuwHURrG9fj+onXKy5487eEYNLLcjsZNdS5Jn0/HDoTuE0s
> YS2V5lfYRac3yYZilSQO7OqCphbi8p7zWFfPegzRoNNXXQ1Hd4AC028N4YP2r05X
> 8Ts5KG7adWQTpixujzv1WfQXe4w4yEFeDi+IbHqL44FfplSuwHDNkygwlTJZ54Jr
> kDttueKoV3ZgaM620f6RDc0psbAXhI0js3eXK0JzsrTRfgAA9aTcZ7iGr202jXqV
> t/VxS4uXDPAw4S9m0M+lu71JVlfT91LcnF1RTdDVKFxk10Ltz6XOCkv4dCebj4zl
> fJilC9OfZZ1MPVYzv1dMZbBvOxqxo9aO5BoSLF7otBqzFWpOpRiwJUoJImhDdUlP
> Jl9LQzK5sv1gEtsypo93
> =9n7P
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune


-- 
Christoph Gersbacher<christoph.gersbacher at mathematik.uni-freiburg.de> 
<mailto:christoph.gersbacher at mathematik.uni-freiburg.de>
Abteilung für Angewandte Mathematik
Albert-Ludwigs-Universität Freiburg
Hermann-Herder-Str. 10
D-79104 Freiburg im Breisgau
Tel.: +49 (0)761 / 203 5645
Fax: +49 (0)761 / 203 5632
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150224/25f3ace1/attachment.html>


More information about the Dune mailing list