diff --git a/dune/gfe/geodesicfefunctionadaptor.hh b/dune/gfe/geodesicfefunctionadaptor.hh index cb4e9d863ca245464c3c444e0912d97e5c81cee6..963660407488128b256180cd3f17ddab7d1a6b15 100644 --- a/dune/gfe/geodesicfefunctionadaptor.hh +++ b/dune/gfe/geodesicfefunctionadaptor.hh @@ -47,10 +47,14 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& P1NodalBasis<typename GridType::LeafGridView> p1Basis(grid.leafGridView()); x.resize(grid.size(dim)); - for (const auto& element : elements(grid.leafGridView())) - { + for (const auto& element : elements(grid.leafGridView())) { + // Set up a local gfe function on the father element +#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) size_t nFatherDofs = element.father().subEntities(dim); +#else + size_t nFatherDofs = element.father()->template count<dim>(); +#endif std::vector<TargetSpace> coefficients(nFatherDofs); for (int i=0; i<nFatherDofs; i++) @@ -63,8 +67,11 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>& // The embedding of this element into the father geometry const auto& geometryInFather = element.geometryInFather(); +#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) size_t nDofs = element.subEntities(dim); - +#else + size_t nDofs = element.template count<dim>(); +#endif for (int i=0; i<nDofs; i++) { if (dofMap.find(idSet.subId(element,i,dim)) != dofMap.end()) {