Skip to content
Snippets Groups Projects
Commit 746b26ef authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* Removed not required code from traverse

parent 5f346ca0
No related branches found
No related tags found
No related merge requests found
...@@ -361,10 +361,6 @@ namespace AMDiS { ...@@ -361,10 +361,6 @@ namespace AMDiS {
((info_stack[stack_used] >= 2) || (el->getFirstChild() == NULL))) { ((info_stack[stack_used] >= 2) || (el->getFirstChild() == NULL))) {
stack_used--; stack_used--;
el = elinfo_stack[stack_used]->getElement(); el = elinfo_stack[stack_used]->getElement();
if (calcDisplacement) {
displacementStack.pop();
}
} }
/* goto next macro element */ /* goto next macro element */
...@@ -401,15 +397,6 @@ namespace AMDiS { ...@@ -401,15 +397,6 @@ namespace AMDiS {
elinfo_stack[stack_used + 1]->fillElInfo(i, elinfo_stack[stack_used]); elinfo_stack[stack_used + 1]->fillElInfo(i, elinfo_stack[stack_used]);
stack_used++; stack_used++;
if (calcDisplacement) {
if (i == 0) {
displacementStack.push(displacementStack.top() * 2);
} else {
displacementStack.push(displacementStack.top() * 2 + 1);
}
}
TEST_EXIT_DBG(stack_used < stack_size) TEST_EXIT_DBG(stack_used < stack_size)
("stack_size=%d too small, level=(%d,%d)\n", ("stack_size=%d too small, level=(%d,%d)\n",
stack_size, elinfo_stack[stack_used]->getLevel()); stack_size, elinfo_stack[stack_used]->getLevel());
...@@ -417,9 +404,6 @@ namespace AMDiS { ...@@ -417,9 +404,6 @@ namespace AMDiS {
info_stack[stack_used] = 0; info_stack[stack_used] = 0;
} }
if (calcDisplacement) {
}
return elinfo_stack[stack_used]; return elinfo_stack[stack_used];
} }
...@@ -1101,14 +1085,4 @@ namespace AMDiS { ...@@ -1101,14 +1085,4 @@ namespace AMDiS {
} }
} }
void TraverseStack::startDisplacementCalculation(int level)
{
calcDisplacement = true;
displacementStack.empty();
for (int i = 0; i <= elinfo_stack[stack_used]->getLevel() - level; i++) {
displacementStack.push(0);
}
}
} }
...@@ -71,7 +71,6 @@ namespace AMDiS { ...@@ -71,7 +71,6 @@ namespace AMDiS {
stack_size(0), stack_size(0),
stack_used(0), stack_used(0),
save_stack_used(0), save_stack_used(0),
calcDisplacement(false),
myThreadId_(0), myThreadId_(0),
maxThreads_(1) maxThreads_(1)
{ {
...@@ -105,71 +104,39 @@ namespace AMDiS { ...@@ -105,71 +104,39 @@ namespace AMDiS {
*/ */
ElInfo* traverseNext(ElInfo* elinfo_old); ElInfo* traverseNext(ElInfo* elinfo_old);
/** \brief /// Returns the neighbour-th neighbour of elInfoOld
* Returns the neighbour-th neighbour of elInfoOld
*/
ElInfo* traverseNeighbour(ElInfo* elInfoOld, int neighbour); ElInfo* traverseNeighbour(ElInfo* elInfoOld, int neighbour);
/** \brief /// Returns the neighbour-th neighbour of elInfoOld
* Returns the neighbour-th neighbour of elInfoOld
*/
ElInfo* traverseNeighbour3d(ElInfo* elInfoOld, int neighbour); ElInfo* traverseNeighbour3d(ElInfo* elInfoOld, int neighbour);
/** \brief /// Returns the neighbour-th neighbour of elInfoOld
* Returns the neighbour-th neighbour of elInfoOld
*/
ElInfo* traverseNeighbour2d(ElInfo* elInfoOld, int neighbour); ElInfo* traverseNeighbour2d(ElInfo* elInfoOld, int neighbour);
/** \brief /// Not yet implemented
* Not yet implemented
*/
ElInfo* traverseMultiGridLevel(); ElInfo* traverseMultiGridLevel();
/** \brief /// Preorder traversal of all elements
* Preorder traversal of all elements
*/
ElInfo* traverseEveryElementPreorder(); ElInfo* traverseEveryElementPreorder();
/** \brief /// Inorder traversal of all elements
* Inorder traversal of all elements
*/
ElInfo* traverseEveryElementInorder(); ElInfo* traverseEveryElementInorder();
/** \brief /// Postorder traversal of all elements
* Postorder traversal of all elements
*/
ElInfo* traverseEveryElementPostorder(); ElInfo* traverseEveryElementPostorder();
/** \brief /// Only for 3d: Calls update of all ElInfo3d onjects in \ref elinfo_stack
* Only for 3d: Calls update of all ElInfo3d onjects in \ref elinfo_stack
*/
void update(); void update();
void getCoordsInElem(const ElInfo *upperElInfo, void getCoordsInElem(const ElInfo *upperElInfo,
DimMat<double> *coords); DimMat<double> *coords);
/** \brief /// Is used for parallel mesh traverse.
* Starts the calculation of the displacement relative to given level.
*/
void startDisplacementCalculation(int level);
/** \brief
* Stops the calculation of displacement information.
*/
void stopDisplacementCalculation() {
calcDisplacement = false;
}
/** \brief
* Is used for parallel mesh traverse.
*/
inline void setMyThreadId(int myThreadId) { inline void setMyThreadId(int myThreadId) {
myThreadId_ = myThreadId; myThreadId_ = myThreadId;
} }
/** \brief /// Is used for parallel mesh traverse.
* Is used for parallel mesh traverse.
*/
inline void setMaxThreads(int maxThreads) { inline void setMaxThreads(int maxThreads) {
maxThreads_ = maxThreads; maxThreads_ = maxThreads;
} }
...@@ -182,24 +149,16 @@ namespace AMDiS { ...@@ -182,24 +149,16 @@ namespace AMDiS {
} }
private: private:
/** \brief /// Enlargement of the stack
* Enlargement of the stack
*/
void enlargeTraverseStack(); void enlargeTraverseStack();
/** \brief /// Used by \ref traverseFirst() \ref traverseNext()
* Used by \ref traverseFirst() \ref traverseNext()
*/
ElInfo* traverseLeafElement(); ElInfo* traverseLeafElement();
/** \brief /// Used by \ref traverseFirst() \ref traverseNext()
* Used by \ref traverseFirst() \ref traverseNext()
*/
ElInfo* traverseLeafElementLevel(); ElInfo* traverseLeafElementLevel();
/** \brief /// Used by \ref traverseFirst() \ref traverseNext()
* Used by \ref traverseFirst() \ref traverseNext()
*/
ElInfo* traverseElementLevel(); ElInfo* traverseElementLevel();
/** \brief /** \brief
...@@ -221,14 +180,10 @@ namespace AMDiS { ...@@ -221,14 +180,10 @@ namespace AMDiS {
} }
private: private:
/** \brief /// Iterator to the current MacroElement
* Iterator to the current MacroElement
*/
std::deque<MacroElement*>::const_iterator currentMacro; std::deque<MacroElement*>::const_iterator currentMacro;
/** \brief /// Mesh which is currently traversed
* Mesh which is currently traversed
*/
Mesh* traverse_mesh; Mesh* traverse_mesh;
/** \brief /** \brief
...@@ -243,24 +198,16 @@ namespace AMDiS { ...@@ -243,24 +198,16 @@ namespace AMDiS {
*/ */
Flag traverse_fill_flag; Flag traverse_fill_flag;
/** \brief /// current macro element
* current macro element
*/
const MacroElement *traverse_mel; const MacroElement *traverse_mel;
/** \brief /// Current size of the stack
* Current size of the stack
*/
int stack_size; int stack_size;
/** \brief /// Used size of the stack
* Used size of the stack
*/
int stack_used; int stack_used;
/** \brief ///
*
*/
std::vector<ElInfo*> elinfo_stack; std::vector<ElInfo*> elinfo_stack;
/** \brief /** \brief
...@@ -271,41 +218,21 @@ namespace AMDiS { ...@@ -271,41 +218,21 @@ namespace AMDiS {
* visited. * visited.
*/ */
std::vector<int> info_stack; std::vector<int> info_stack;
/** \brief ///
*
*/
const MacroElement *save_traverse_mel; const MacroElement *save_traverse_mel;
/** \brief ///
*
*/
std::vector<ElInfo*> save_elinfo_stack; std::vector<ElInfo*> save_elinfo_stack;
/** \brief ///
*
*/
std::vector<unsigned char> save_info_stack; std::vector<unsigned char> save_info_stack;
/** \brief ///
*
*/
int save_stack_used; int save_stack_used;
/** \brief
*
*/
int id;
/** \brief
* Stack for counting the deplacement information for dual traverse.
*/
std::stack<int> displacementStack;
/** \brief ///
* True, if \ref displacementStack should be calculated. int id;
*/
bool calcDisplacement;
/** \brief /** \brief
* Is used for parallel mesh traverse. The thread with the id * Is used for parallel mesh traverse. The thread with the id
...@@ -352,9 +279,7 @@ namespace AMDiS { ...@@ -352,9 +279,7 @@ namespace AMDiS {
TEST_EXIT(m)("No traverse without mesh!\n"); TEST_EXIT(m)("No traverse without mesh!\n");
} }
/** \brief /// Performs the recursive traversal
* Performs the recursive traversal
*/
int recursive(ElInfoStack*); int recursive(ElInfoStack*);
private: private:
......
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