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

- hasCopy(...) function added

- NFather(...) added
- PositionInFather(...) added

[[Imported from SVN: r2998]]
parent b1e22266
Branches
Tags
No related merge requests found
......@@ -49,8 +49,12 @@ namespace Dune {
enum {COARSEN_CE = UG2d::COARSEN_CE};
enum {REFINECLASS_CE = UG2d::REFINECLASS_CE};
enum {RED = UG2d::RED};
enum {YELLOW_CLASS = UG2d::YELLOW_CLASS};
enum {COARSE = UG2d::COARSE};
enum {GM_OK = UG2d::GM_OK};
......@@ -123,6 +127,18 @@ namespace Dune {
return LEVEL(theElement);
}
static int myLevel (TargetType<2,2>::T* theNode) {
using UG2d::NODE;
return LEVEL(theNode);
}
//! return true if element has an exact copy on the next level
static bool hasCopy (TargetType<0,2>::T* theElement) {
using UG2d::ELEMENT;
using UG2d::control_entries;
return REFINECLASS(theElement) == YELLOW_CLASS;
}
//! \todo Please doc me!
static int Sides_Of_Elem(TargetType<0,2>::T* theElement) {
using UG2d::element_descriptors;
......@@ -394,6 +410,17 @@ namespace Dune {
return EFATHER(theElement);
}
//! get father element of vertex
static TargetType<0,2>::T* NFather(TargetType<2,2>::T* theNode) {
return theNode->myvertex->iv.father;
}
//! get father element of vertex
static void PositionInFather(TargetType<2,2>::T* theNode, FieldVector<double, 2>& local) {
local[0] = theNode->myvertex->iv.xi[0];
local[1] = theNode->myvertex->iv.xi[1];
}
static unsigned int ReadCW(void* obj, int ce) {
return UG2d::ReadCW(obj, ce);
}
......
......@@ -46,8 +46,12 @@ namespace Dune {
enum {COARSEN_CE = UG3d::COARSEN_CE};
enum {REFINECLASS_CE = UG2d::REFINECLASS_CE};
enum {RED = UG3d::RED};
enum {YELLOW_CLASS = UG2d::YELLOW_CLASS};
enum {COARSE = UG3d::COARSE};
enum {GM_OK = UG3d::GM_OK};
......@@ -118,6 +122,13 @@ namespace Dune {
return UG3d::UG_GlobalToLocal(n, cornerCoords, EvalPoint, localCoord);
}
//! return true if element has an exact copy on the next level
static bool hasCopy (TargetType<0,3>::T* theElement) {
using UG3d::ELEMENT;
using UG3d::control_entries;
return REFINECLASS(theElement) == YELLOW_CLASS;
}
//! \todo Please doc me!
static int Sides_Of_Elem(TargetType<0,3>::T* theElement) {
using UG3d::element_descriptors;
......@@ -178,6 +189,23 @@ namespace Dune {
return LEVEL(theElement);
}
static int myLevel (TargetType<3,3>::T* theNode) {
using UG3d::NODE;
return LEVEL(theNode);
}
//! get father element of vertex
static TargetType<0,3>::T* NFather(TargetType<3,3>::T* theNode) {
return theNode->myvertex->iv.father;
}
//! get father element of vertex
static void PositionInFather(TargetType<3,3>::T* theNode, FieldVector<double, 3>& local) {
local[0] = theNode->myvertex->iv.xi[0];
local[1] = theNode->myvertex->iv.xi[1];
local[2] = theNode->myvertex->iv.xi[2];
}
static int GetSons(const UG3d::element* element, UG3d::element* sonList[MAX_SONS]) {
return UG3d::GetSons(element, sonList);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment