testdunefunctionsgfs crashes when PQkNodalBasis is instantiated with a grid view
The Functions::PQkNodalBasis class is supposed to be instantiated with a GridView template parameter, and corresponding constructor argument, like this:
using GridView = typename GridType::LeafGridView;
auto gridView = grid.leafGridView();
using Basis = Functions::PQkNodalBasis<GridView,order>;
auto basis = std::make_shared<Basis>(gridView);
However, the file testdunefunctionsgfs.cc takes a strange detour:
using GridView_ = typename GridType::LeafGridView;
auto gridView_ = grid.leafGridView();
using GridView = Dune::PDELab::AllEntitySet<GridView_>;
auto gridView = GridView(gridView_,GridView::allCodims());
using Basis = Functions::PQkNodalBasis<GridView,order>;
auto basis = std::make_shared<Basis>(gridView);
with no motivation given. When changing the code to use the naive/official way shown above, I get a run-time assertion failure. Witness this by applying the following small patch to testdunefunctionsgfs.cc
diff --git a/dune/pdelab/test/testdunefunctionsgfs.cc b/dune/pdelab/test/testdunefunctionsgfs.cc
index 0caafea..6551ec4 100644
--- a/dune/pdelab/test/testdunefunctionsgfs.cc
+++ b/dune/pdelab/test/testdunefunctionsgfs.cc
@@ -77,10 +77,15 @@ void solvePoissonProblem()
VectorType rhs;
// Construct Lagrangian finite element space basis
+#if 0
using GridView_ = typename GridType::LeafGridView;
auto gridView_ = grid.leafGridView();
using GridView = Dune::PDELab::AllEntitySet<GridView_>;
auto gridView = GridView(gridView_,GridView::allCodims());
+#else
+ using GridView = typename GridType::LeafGridView;
+ auto gridView = grid.leafGridView();
+#endif
using Basis = Functions::PQkNodalBasis<GridView,order>;
auto basis = std::make_shared<Basis>(gridView);
And here is the error message:
~/dune/dune-pdelab/build-cmake/dune/pdelab/test(master)> ./testdunefunctionsgfs
testdunefunctionsgfs: /home/sander/dune/dune-pdelab/dune/pdelab/common/partitionviewentityset.hh:706: typename Dune::PDELab::PartitionViewEntitySetIndexSet<GV, Dune::PartitionSet<31u> >::Base::Index Dune::PDELab::PartitionViewEntitySetIndexSet<GV, Dune::PartitionSet<31u> >::uniqueIndex(const E&) const [with E = Dune::Entity<0, 2, const Dune::YaspGrid<2>, Dune::YaspEntity>; GV = Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2> > >; typename Dune::PDELab::PartitionViewEntitySetIndexSet<GV, Dune::PartitionSet<31u> >::Base::Index = unsigned int]: Assertion `contains(e.type())' failed.