diff --git a/AMDiS/src/Mesh.cc b/AMDiS/src/Mesh.cc index 1ada139d8cf59a81471525c4268bccbb5ad865ea..f0f4b1d52fc68a6ca079433cc67f174fc542d504 100644 --- a/AMDiS/src/Mesh.cc +++ b/AMDiS/src/Mesh.cc @@ -1280,6 +1280,16 @@ namespace AMDiS { } + // === Check if number of pre refinements is set ini init file. === + + int nPreRefine = 0; + GET_PARAMETER(0, "parallel->pre refine", "%d", &nPreRefine); + if (nPreRefine != 0) { + MSG("Calculated %d pre refines to be useful, but %d are set in init file!\n", + nrRefine, nPreRefine); + nrRefine = nPreRefine; + } + // === If we do not need to refine the mesh, return back. === if (nrRefine == 0) diff --git a/AMDiS/src/parallel/MeshManipulation.cc b/AMDiS/src/parallel/MeshManipulation.cc index ebf60fa7f7d920d884b2b9129fd5ac55243f1808..d5040cd79f0bc87fce2e7ec6eafc1213ed9fc823 100644 --- a/AMDiS/src/parallel/MeshManipulation.cc +++ b/AMDiS/src/parallel/MeshManipulation.cc @@ -25,6 +25,9 @@ namespace AMDiS { TEST_EXIT(mesh->getDim() == 2)("Not yet supported for dim != 2!\n"); + + // Create data structure that maps macro element indices to the + // corresponding pointers. std::map<int, MacroElement*> macroIndexMap; for (std::set<MacroElement*>::iterator it = newMacroEl.begin(); it != newMacroEl.end(); ++it) @@ -33,6 +36,10 @@ namespace AMDiS { std::set<int> macrosProcessed; std::map<const DegreeOfFreedom*, const DegreeOfFreedom*> mapDelDofs; + + // === Traverse mesh and put all "old" macro element to macrosProcessed === + // === that stores all macro elements which are really conected to the === + // === overall mesh structure. === TraverseStack stack; ElInfo *elInfo = stack.traverseFirst(mesh, 0, Mesh::CALL_EL_LEVEL); @@ -48,6 +55,10 @@ namespace AMDiS { } + // === Traverse all new elements and connect them to the overall mesh === + // === structure by deleting all double DOFs on macro element's vertices, === + // === edges and faces. === + for (std::set<MacroElement*>::iterator it = newMacroEl.begin(); it != newMacroEl.end(); ++it) { @@ -127,6 +138,8 @@ namespace AMDiS { } + // === Remove all DOF replacments of the form A -> B, B -> C by A -> C. === + bool changed = false; do { changed = false; @@ -144,6 +157,8 @@ namespace AMDiS { } while (changed); + // === Set new DOF pointers in all elements of the mesh. === + elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER); while (elInfo) { for (int i = 0; i < mesh->getGeo(VERTEX); i++) @@ -154,6 +169,8 @@ namespace AMDiS { } + // === And delete all double DOFs. === + for (std::map<const DegreeOfFreedom*, const DegreeOfFreedom*>::iterator it = mapDelDofs.begin(); it != mapDelDofs.end(); ++it) mesh->freeDof(const_cast<DegreeOfFreedom*>(it->first), VERTEX);