Skip to content
Snippets Groups Projects
Commit d5878b75 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

return 0 for other geom tpyes.

[[Imported from SVN: r3022]]
parent f02189ef
No related branches found
No related tags found
No related merge requests found
......@@ -1474,12 +1474,14 @@ namespace Dune
//! number of entities per level, codim and geometry type in this process
int size (int level, int codim, GeometryType type) const
{
if( type != simplex) return 0;
return this->levelIndexSet(level).size(codim,type);
}
//! number of leaf entities per codim and geometry type in this process
int size (int codim, GeometryType type) const
{
if( type != simplex) return 0;
return this->leafIndexSet().size(codim,type);
}
......
......@@ -488,12 +488,16 @@ namespace Dune {
markAllUsed ();
}
/** @brief Iterator to first entity of given codimension and partition type.
*/
template<int cd, PartitionIteratorType pitype>
typename LeafIteratorTypes<GridType>::template Codim<cd>::template Partition<pitype>::Iterator end () const
{
return this->grid_.template leafend<cd,pitype> ();
}
/** @brief Iterator to one past the last entity of given codim for partition type
*/
template<int cd, PartitionIteratorType pitype>
typename LeafIteratorTypes<GridType>::template Codim<cd>::template Partition<pitype>::Iterator begin () const
{
......@@ -644,8 +648,9 @@ namespace Dune {
//! return size of grid entities per level and codim
int size ( int codim , GeometryType type = unknown ) const
{
if(codim == 0) return codimLeafSet_[codim].size();
return hIndexSet_.size(codim);
//if(codim == 0) return codimLeafSet_[codim].size();
//return hIndexSet_.size(codim);
return codimLeafSet_[codim].size();
}
//! return global index
......@@ -663,9 +668,8 @@ namespace Dune {
int index (const EntityType & en) const
{
enum { codim = EntityType::codimension };
//assert(codimLeafSet_[codim].index( hIndexSet_.index(en) ) >= 0 );
if (codim == 0) return codimLeafSet_[codim].index( hIndexSet_.index(en) );
return hIndexSet_.index(en);
assert(codimLeafSet_[codim].index( hIndexSet_.index(en) ) >= 0 );
return codimLeafSet_[codim].index( hIndexSet_.index(en) );
}
//! return size of grid entities per level and codim
......
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