Skip to content
Snippets Groups Projects
Commit 8320d073 authored by Christian Engwer's avatar Christian Engwer
Browse files

* fixed missing compressedIndex for vertices (task #29)

* fixed bug in compressedSubIndex

[[Imported from SVN: r2883]]
parent b51e5ba7
No related branches found
No related tags found
No related merge requests found
......@@ -577,6 +577,12 @@ namespace Dune {
return persistentIndex();
}
//! consecutive, codim-wise, level-wise index
int compressedIndex () const
{
return SEntityBase<dim,dim,GridImp>::index();
}
mutable bool built_father;
mutable int father_id;
mutable FieldVector<sgrid_ctype, dim> in_father_local;
......
......@@ -343,8 +343,7 @@ namespace Dune {
template<int dim, class GridImp> template<int cc>
inline int SEntity<0,dim,GridImp>::subCompressedIndex (int i) const
{
int cindex;
if(cc == 0) // the vertex case
if(cc == dim) // the vertex case
{
// find expanded coordinates of entity in reference cube
// has components in {0,1,2}
......@@ -354,13 +353,12 @@ namespace Dune {
zref = SUnitCubeMapper<dim>::mapper.z(i,dim);
for (int i=0; i<dim; i++) zentity[i] = this->z[i] + zref[i] - 1;
cindex = this->grid->n(this->l,zentity);
return this->grid->n(this->l,zentity);
}
else
{
cindex = entity<cc>(i)->index();
return entity<cc>(i)->index();
}
return cindex;
}
template<int dim, class GridImp> template<int cc>
......
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