From d48fcafb298882432e12e7e4ae13a361b6dbf6fd Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Fri, 22 Aug 2014 09:31:13 +0000 Subject: [PATCH] Use Entity<0>::subEntities instead of Entity<0>::count, when available [[Imported from SVN: r9844]] --- dune/gfe/parallel/globalindex.hh | 12 ++++++++++++ dune/gfe/parallel/uniqueentitypartition.hh | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/dune/gfe/parallel/globalindex.hh b/dune/gfe/parallel/globalindex.hh index d3c665ed..5cced971 100644 --- a/dune/gfe/parallel/globalindex.hh +++ b/dune/gfe/parallel/globalindex.hh @@ -258,7 +258,11 @@ public: for(Iterator iter = gridview_.template begin<0>();iter!=gridview_.template end<0>(); ++iter) { +#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) + for (size_t i=0; i<iter->subEntities(CODIM); i++) +#else for (size_t i=0; i<iter->template count<CODIM>(); i++) +#endif { IdType id=globalIdSet.subId(*iter,i,CODIM); /** retrieve the entity's id */ @@ -369,7 +373,11 @@ namespace Dune { for (auto it = gridView.template begin<0>(); it != gridView.template end<0>(); ++it) { // Loop over all vertices +#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) + for (size_t i=0; i<it->subEntities(2); i++) +#else for (size_t i=0; i<it->template count<2>(); i++) +#endif { //int localIndex = globalVertexIndex.localIndex (*it->template subEntity<2>(i)); int localIndex = p2Mapper.map(*it, i, 2); @@ -380,7 +388,11 @@ namespace Dune { } // Loop over all edges +#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) + for (size_t i=0; i<it->subEntities(1); i++) +#else for (size_t i=0; i<it->template count<1>(); i++) +#endif { //int localIndex = globalEdgeIndex.localIndex (*it->template subEntity<1>(i)) + gridView.size(2); int localIndex = p2Mapper.map(*it, i, 1); diff --git a/dune/gfe/parallel/uniqueentitypartition.hh b/dune/gfe/parallel/uniqueentitypartition.hh index a215b9b9..31829185 100644 --- a/dune/gfe/parallel/uniqueentitypartition.hh +++ b/dune/gfe/parallel/uniqueentitypartition.hh @@ -130,7 +130,11 @@ public: // assign own rank to entities that I might have for(auto it = gridview_.template begin<0>();it!=gridview_.template end<0>(); ++it) +#if DUNE_VERSION_NEWER(DUNE_GRID,2,4) + for (int i=0; i<it->subEntities(CODIM); i++) +#else for (int i=0; i<it->template count<CODIM>(); i++) +#endif { assignment_[gridview_.indexSet().template subIndex(*it,i,CODIM)] = ( (it->template subEntity<CODIM>(i)->partitionType()==Dune::InteriorEntity) || (it->template subEntity<CODIM>(i)->partitionType()==Dune::BorderEntity) ) -- GitLab