From 39a910460edb81c853c099007cca6f18d2949219 Mon Sep 17 00:00:00 2001
From: Thomas Witkowski <thomas.witkowski@gmx.de>
Date: Thu, 29 Jul 2010 12:04:54 +0000
Subject: [PATCH] Small bugfix for 4th-3D elements.

---
 AMDiS/src/Tetrahedron.cc | 67 ++++++++++++++++++++++++----------------
 1 file changed, 40 insertions(+), 27 deletions(-)

diff --git a/AMDiS/src/Tetrahedron.cc b/AMDiS/src/Tetrahedron.cc
index be3b8366..25ce025b 100644
--- a/AMDiS/src/Tetrahedron.cc
+++ b/AMDiS/src/Tetrahedron.cc
@@ -351,35 +351,48 @@ namespace AMDiS {
   {
     FUNCNAME("Tetrahedron::getNonVertexDofs()");
 
-    BoundaryObject nextBound = bound;
-    nextBound.elType = (bound.elType + 1) % 3;
-
-    if (child[0]) {
-      int childFace0 = sideOfChild[bound.elType][0][bound.ithObj];
-      int childFace1 = sideOfChild[bound.elType][1][bound.ithObj];
-
-      TEST_EXIT(childFace0 != -1 || childFace1 != -1)
-	("No new face for child elements!\n");
-
-      if (childFace0 != -1) {
-	nextBound.ithObj = childFace0;
-	child[0]->getNonVertexDofs(feSpace, nextBound, dofs);
-      }
+    switch (bound.subObj) {
+    case VERTEX:
+      return;
+      break;
+    case EDGE:
+      break;
+    case FACE:
+      {      
+	BoundaryObject nextBound = bound;
+	nextBound.elType = (bound.elType + 1) % 3;
 
-      if (childFace1 != -1) {
-	nextBound.ithObj = childFace1;
-	child[1]->getNonVertexDofs(feSpace, nextBound, dofs);
+	if (child[0]) {
+	  int childFace0 = sideOfChild[bound.elType][0][bound.ithObj];
+	  int childFace1 = sideOfChild[bound.elType][1][bound.ithObj];
+	  
+	  TEST_EXIT(childFace0 != -1 || childFace1 != -1)
+	    ("No new face for child elements!\n");
+	  
+	  if (childFace0 != -1) {
+	    nextBound.ithObj = childFace0;
+	    child[0]->getNonVertexDofs(feSpace, nextBound, dofs);
+	  }
+	  
+	  if (childFace1 != -1) {
+	    nextBound.ithObj = childFace1;
+	    child[1]->getNonVertexDofs(feSpace, nextBound, dofs);
+	  }
+	} else { 
+	  ElementDofIterator elDofIter(feSpace, true);
+	  elDofIter.reset(this);
+	  do {
+	    if (elDofIter.getCurrentPos() == 2 && 
+		elDofIter.getCurrentElementPos() == bound.ithObj) {
+	      ERROR_EXIT("Check this, if it will really work!\n");
+	      dofs.push_back(elDofIter.getDofPtr());	
+	    }	
+	  } while(elDofIter.next());      
+	}
       }
-    } else { 
-      ElementDofIterator elDofIter(feSpace, true);
-      elDofIter.reset(this);
-      do {
-	if (elDofIter.getCurrentPos() == 2 && 
-	    elDofIter.getCurrentElementPos() == bound.ithObj) {
-	  ERROR_EXIT("Check this, if it will really work!\n");
-	  dofs.push_back(elDofIter.getDofPtr());	
-	}	
-      } while(elDofIter.next());      
+      break;
+    case default:
+      ERROR_EXIT("Should not happen!\n");
     }
   }
 
-- 
GitLab