Skip to content

Always terminate checkIndexSet tmp loop on level 0.

Markus Blatt requested to merge bugfix/always-terminate-checkindex-tmp-loop into master

Even if neither hasEntity<0> nore hasEntityIterator<0> is true.

I just had experienced a grid missing the implementation of Dune::Capabilities::hasEntityIterator which resulted in the loop never terminating and a compiler error like:

In file included from /home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/gridcheck.hh:24,
                 from /home/mblatt/src/dune/opm-master/opm-grid/tests/test_polyhedralgrid.cpp:16:
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/checkindexset.hh: In instantiation of ‘static void Dune::CheckIndexSet<Grid, GridView, OutputStream, codim, false>::checkIndexSet(const Grid&, const GridView&, OutputStream&, bool) [with Grid = Dune::PolyhedralGrid<3, 3>; GridView = Dune::GridView<Dune::PolyhedralGridViewTraits<3, 3, double, (Dune::PartitionIteratorType)4> >; OutputStream = Dune::DebugStream<1, 4>; int codim = -894]’:
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/checkindexset.hh:539:23:   recursively required from ‘static void Dune::CheckIndexSet<Grid, GridView, OutputStream, codim, false>::checkIndexSet(const Grid&, const GridView&, OutputStream&, bool) [with Grid = Dune::PolyhedralGrid<3, 3>; GridView = Dune::GridView<Dune::PolyhedralGridViewTraits<3, 3, double, (Dune::PartitionIteratorType)4> >; OutputStream = Dune::DebugStream<1, 4>; int codim = 1]’
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/checkindexset.hh:539:23:   required from ‘static void Dune::CheckIndexSet<Grid, GridView, OutputStream, codim, false>::checkIndexSet(const Grid&, const GridView&, OutputStream&, bool) [with Grid = Dune::PolyhedralGrid<3, 3>; GridView = Dune::GridView<Dune::PolyhedralGridViewTraits<3, 3, double, (Dune::PartitionIteratorType)4> >; OutputStream = Dune::DebugStream<1, 4>; int codim = 2]’
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/checkindexset.hh:524:23:   required from ‘static void Dune::CheckIndexSet<Grid, GridView, OutputStream, codim, hasCodim>::checkIndexSet(const Grid&, const GridView&, OutputStream&, bool) [with Grid = Dune::PolyhedralGrid<3, 3>; GridView = Dune::GridView<Dune::PolyhedralGridViewTraits<3, 3, double, (Dune::PartitionIteratorType)4> >; OutputStream = Dune::DebugStream<1, 4>; int codim = 3; bool hasCodim = true]’
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/checkindexset.hh:558:22:   required from ‘void Dune::checkIndexSet(const Grid&, const GridView&, OutputStream&, bool) [with Grid = Dune::PolyhedralGrid<3, 3>; GridView = Dune::GridView<Dune::PolyhedralGridViewTraits<3, 3, double, (Dune::PartitionIteratorType)4> >; OutputStream = Dune::DebugStream<1, 4>]’
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/gridcheck.hh:1027:24:   required from ‘void gridcheck(Grid&) [with Grid = Dune::PolyhedralGrid<3, 3>]’
/home/mblatt/src/dune/opm-master/opm-grid/tests/test_polyhedralgrid.cpp:289:25:   required from here
/home/mblatt/src/dune/opm-master/dune-grid/dune/grid/test/checkindexset.hh:535:40: fatal error: template instantiation depth exceeds maximum of 900 (use -ftemplate-depth= to increase the maximum)
       derr << "WARNING: Entities for codim " << codim
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            << " are not being tested!" << std::endl;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
compilation terminated.
make[3]: *** [CMakeFiles/test_polyhedralgrid.dir/build.make:63: CMakeFiles/test_polyhedralgrid.dir/tests/test_polyhedralgrid.cpp.o] Fehler 1
make[2]: *** [CMakeFiles/Makefile2:258: CMakeFiles/test_polyhedralgrid.dir/all] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:270: CMakeFiles/test_polyhedralgrid.dir/rule] Fehler 2
make: *** [Makefile:240: test_polyhedralgrid] Fehler 2

Merge request reports

Loading