<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Aleksejs,<br>
      <br>
      the forward declaration you are missing can be found in line 360
      of dune/grid/common/grid.hh:<br>
      <blockquote>template< class GridImp, class IndexSetImp,<br>
                         class IndexTypeImp = unsigned int,<br>
                         class TypesImp = std::vector< GeometryType
        > > class IndexSet;<br>
      </blockquote>
      If you are not happy with the default values just explicitly state
      the optional third and fourth template parameters.<br>
      <br>
      Regards,<br>
      Christoph<br>
      <br>
      <br>
      On 02/26/2015 08:48 AM, Aleksejs Fomins wrote:<br>
    </div>
    <blockquote cite="mid:54EECFD5.2060608@lspr.ch" type="cite">
      <pre wrap="">-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Could somebody please give me some suggestions with this bug? I am still stuck on it, so any advice would be appreciated

Greetings,
Aleksejs

On 24/02/15 16:21, Aleksejs Fomins wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">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>
</pre>
        <blockquote type="cite">
          <pre wrap="">, unsigned int, std::vector<Dune::GeometryType> >]’:
</pre>
        </blockquote>
        <pre wrap="">/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>
</pre>
        <blockquote type="cite">
          <pre wrap="">; IndexTypeImp = unsigned int; TypesImp =
</pre>
        </blockquote>
        <pre wrap="">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>
</pre>
        <blockquote type="cite">
          <pre wrap="">, unsigned int, std::vector<Dune::GeometryType> >’ to type ‘const
</pre>
        </blockquote>
        <pre wrap="">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:
</pre>
        <blockquote type="cite">
          <pre wrap="">Dear Dune,
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">I am still having problems with compiling my curvgrid.globalIdSet()
method
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">When I look at YaspGrid, the method YaspGrid.globalIdSet() returns 
Dune::IdSet<...> but what is actually returned is 
YaspGlobalIdSet<const YaspGrid> : public Dune::IdSet<...>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">and that seems to work. Now, when I try to do something similar, I
get the error
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">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>
</pre>
          <blockquote type="cite">
            <pre wrap="">}’
</pre>
          </blockquote>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">const GlobalIdSet &globalIdSet () const  { return globalIdSet_; }
</pre>
        </blockquote>
        <pre wrap="">

</pre>
        <blockquote type="cite">
          <pre wrap="">Any hints will be appreciated.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Cheers, Aleksejs
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">_______________________________________________ Dune mailing list 
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a> 
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
        </blockquote>
        <pre wrap="">

_______________________________________________
Dune mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>

</pre>
      </blockquote>
      <pre wrap="">-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJU7s/VAAoJEDkNM7UOEwMZ/EcQALPsrx4QaEgIiok2oKKUW1z6
X87QcUYQtwId5/MKdM11SYF6kHBk5VratARyeKFOtBetW8uKVfLCMa0wCF5abDOx
618lPGtQr4FdDmHAvLbgA0YNVhhYKmMB7B4Ky0yt3qG1Aow6efWj1MMEnuz/2acF
Y/CNeNhUJ0wM3FQaGBkGJjeHqlCX8PZE7UkdrGg3g6tv+B31+4trKxASDdPFEahl
QmIfDVsMic0D4jhRsXIS9NowKqtjEpcls+KKg4OluOtkjC85lWPItVL9PRbnLWvS
F4fsX96lf+kXjZUE1NQCTEKJLFXsRbe3zO6UHlGZ4aubH1TMICr1A3sNX0jh3Z3v
xriW0/+0n6HGldZgB02bYI8sBIzftNtzn02+JA0XLG3uopnBMKpu65QlDAPRyhnH
FPRP9GBkgmkFU2e3Le839dbML/utSBmrBAKZfRE7W+pfx2D6O862dMGvnVDpPyej
/EYTc+eYr6WZnpabkrL1DdrODtNfyePLCoxg3jqESCUrVvVqnQ/8cdlsQUeMm127
P2MLfR8HzbK/X8ZOYO1FpIkakwWhRwr+up6gYCOMV6yweeQ49ClzLY30c35Pd11V
4Pas44Yaqmlcpuu9ZrkFWKkmCLh64nfh+2mW4gF3D9RUHGXx99qTcHgMiMgy/Z5l
OXPbOItCeCuZ0kmeLqWW
=L1Ov
-----END PGP SIGNATURE-----

_______________________________________________
Dune mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org">Dune@dune-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <title></title>
      <font color="#666666"><small>Christoph Gersbacher</small><small> 
          <a
            href="mailto:christoph.gersbacher@mathematik.uni-freiburg.de"><font
              color="#3333ff"><christoph.gersbacher@mathematik.uni-freiburg.de></font></a></small><br>
      </font>
      <div class="moz-signature">
        <div class="moz-signature"><font color="#666666"><small>Abteilung
für
              Angewandte Mathematik
            </small><br>
          </font><font color="#666666"><small>Albert-Ludwigs-Universität
              Freiburg
            </small><br>
          </font><font color="#666666"><small>Hermann-Herder-Str. 10
            </small><br>
          </font><font color="#666666"><small>D-79104 Freiburg im
              Breisgau
            </small><br>
          </font><font color="#666666"><small>Tel.: +49 (0)761 / 203
              5645
            </small><br>
          </font><font color="#666666"><small>Fax: +49 (0)761 / 203 5632</small></font>
        </div>
      </div>
    </div>
  </body>
</html>