Commit 43b8af78 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Added new debug function.

parent cbc573e3
...@@ -87,15 +87,15 @@ namespace AMDiS { ...@@ -87,15 +87,15 @@ namespace AMDiS {
int markLevel = -1; int markLevel = -1;
while (elInfo) { while (elInfo) {
if (markChildren && elInfo->getLevel() <= markLevel)
markChildren = false;
int index = elInfo->getElement()->getIndex(); int index = elInfo->getElement()->getIndex();
if (index == idx) { if (index == idx) {
markChildren = true; markChildren = true;
markLevel = elInfo->getLevel(); markLevel = elInfo->getLevel();
} }
if (markChildren && elInfo->getLevel() < markLevel)
markChildren = false;
if (elInfo->getElement()->isLeaf()) if (elInfo->getElement()->isLeaf())
vec[index] = (markChildren ? 1.0 : 0.0); vec[index] = (markChildren ? 1.0 : 0.0);
...@@ -438,6 +438,38 @@ namespace AMDiS { ...@@ -438,6 +438,38 @@ namespace AMDiS {
} }
void printElementHierarchie(Mesh *mesh, int elIndex)
{
FUNCNAME("debug::printElementHierarchie()");
bool printInfo = false;
int elLevel = -1;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER);
while (elInfo) {
if (printInfo && elInfo->getLevel() <= elLevel)
return;
if (elInfo->getElement()->getIndex() == elIndex) {
printInfo = true;
elLevel = elInfo->getLevel();
MSG(" Hierarchie for elIdx = %d\n", elIndex);
} else {
if (printInfo) {
std::stringstream oss;
for (int i = 0; i < (elInfo->getLevel() - elLevel); i++)
oss << " ";
oss << "|--" << elInfo->getElement()->getIndex();
MSG("%s\n", oss.str().c_str());
}
}
elInfo = stack.traverseNext(elInfo);
}
}
void createSortedDofs(Mesh *mesh, ElementIdxToDofs &elMap) void createSortedDofs(Mesh *mesh, ElementIdxToDofs &elMap)
{ {
FUNCNAME("debug::dbgCreateElementMap()"); FUNCNAME("debug::dbgCreateElementMap()");
......
...@@ -133,6 +133,8 @@ namespace AMDiS { ...@@ -133,6 +133,8 @@ namespace AMDiS {
void writeCoordsFile(const FiniteElemSpace *feSpace, std::string filename); void writeCoordsFile(const FiniteElemSpace *feSpace, std::string filename);
void printElementHierarchie(Mesh *mesh, int elIndex);
/** \brief /** \brief
* Traverse a mesh and store for each element all its vertex DOFs in local sorted * Traverse a mesh and store for each element all its vertex DOFs in local sorted
* order (by values). * order (by values).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment