Skip to content
Snippets Groups Projects
Commit d48fcafb authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Use Entity<0>::subEntities instead of Entity<0>::count, when available

[[Imported from SVN: r9844]]
parent fda22c30
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment