Skip to content
Snippets Groups Projects
Commit 7b506062 authored by Oliver Sander's avatar Oliver Sander
Browse files

father() implemented

[[Imported from SVN: r1092]]
parent ef936e75
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,18 @@ namespace Dune {
return CORNER(theElement, i);
}
static typename TargetType<0,dim>::T* EFather(typename TargetType<0,dim>::T* theElement) {
#ifdef _3
using UG3d::ELEMENT;
using UG3d::father_offset;
#else
using UG2d::ELEMENT;
using UG2d::father_offset;
#endif
return EFATHER(theElement);
}
static void InitUg(int* argcp, char*** argvp) {
#ifdef _3
UG3d::InitUg(argcp, argvp);
......
......@@ -95,24 +95,7 @@ geometry()
return geo_;
}
#if 0 // commented out because it doesn't compile
#ifdef _3
template<>
inline UGGridLevelIterator<0,3,3, All_Partition>
UGGridEntity < 0, 3 ,3>::father()
{
UGGridLevelIterator<0,3,3, All_Partition> it(level()-1);
#define TAG(p) ReadCW(p, UG3d::TAG_CE)
#define EFATHER(p) ((UG3d::ELEMENT *) (p)->ge.refs[UG3d::father_offset[TAG(p)]])
UG3d::ELEMENT* fatherTarget = EFATHER(target_);
#undef TAG
#undef EFATHER
it.setToTarget(fatherTarget);
return it;
}
#endif
#endif
//************************************
//
......@@ -388,3 +371,13 @@ geometry()
{
return geo_;
}
template<int dim, int dimworld>
inline UGGridLevelIterator<0,dim,dimworld, All_Partition>
UGGridEntity < 0, dim, dimworld>::father()
{
UGGridLevelIterator<0,dim,dimworld, All_Partition> it(level()-1);
it.setToTarget(UG_NS<dimworld>::EFather(target_));
return it;
}
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