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

Added new debug function.

parent cbc573e3
......@@ -87,15 +87,15 @@ namespace AMDiS {
int markLevel = -1;
while (elInfo) {
if (markChildren && elInfo->getLevel() <= markLevel)
markChildren = false;
int index = elInfo->getElement()->getIndex();
if (index == idx) {
markChildren = true;
markLevel = elInfo->getLevel();
}
if (markChildren && elInfo->getLevel() < markLevel)
markChildren = false;
if (elInfo->getElement()->isLeaf())
vec[index] = (markChildren ? 1.0 : 0.0);
......@@ -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)
{
FUNCNAME("debug::dbgCreateElementMap()");
......
......@@ -133,6 +133,8 @@ namespace AMDiS {
void writeCoordsFile(const FiniteElemSpace *feSpace, std::string filename);
void printElementHierarchie(Mesh *mesh, int elIndex);
/** \brief
* Traverse a mesh and store for each element all its vertex DOFs in local sorted
* 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