Skip to content
Snippets Groups Projects
Commit a1c3e2b3 authored by Peter Bastian's avatar Peter Bastian
Browse files

added implementation of index methods

[[Imported from SVN: r1955]]
parent 4211adc2
Branches
Tags
No related merge requests found
......@@ -359,6 +359,28 @@ namespace Dune {
return SUnitCubeMapper<dim>::mapper.elements(cc);
}
// subentity compressed index
template<int dim, class GridImp> template<int cc>
inline int SEntity<0,dim,GridImp>::subCompressedIndex (int i) const
{
int cindex;
if(cc == 100) // the vertex case
{
// find expanded coordinates of entity in reference cube
// has components in {0,1,2}
// the grid hold the memory because its faster
FixedArray<int,dim>& zref = this->grid->zrefStatic;
FixedArray<int,dim>& zentity = this->grid->zentityStatic;
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);
}
else
{
cindex = entity<cc>(i)->index();
}
}
template<int dim, class GridImp> template<int cc>
inline typename SEntity<0,dim,GridImp>::template codim<cc>::EntityPointer SEntity<0,dim,GridImp>::entity (int i) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment