diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index bc8f7efe87e2dc898aa09ca710bc2b95325e44ed..db3769d5ac32bba92545fa7c6e900919c4fa1948 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -160,7 +160,6 @@ namespace AMDiS { } } while (doNext); - elObjects.setMesh(feSpaces[0]->getMesh()); // If the problem has been already read from a file, we need only to set @@ -532,12 +531,13 @@ namespace AMDiS { vector<double> dofs; for (int i = 0; i < nComponents; i++) { + TEST_EXIT_DBG(sendIt->second.count(vec.getFeSpace(i))) + ("Should not happen!\n"); + DofContainer &feDofs = sendIt->second[vec.getFeSpace(i)]; DOFVector<double>& dofVec = *(vec.getDOFVector(i)); int nFeDofs = feDofs.size(); - dofs.resize(dofs.size() + nFeDofs); - for (int j = 0; j < nFeDofs; j++) dofs.push_back(dofVec[*(feDofs[j])]); } @@ -947,12 +947,8 @@ namespace AMDiS { it != allBound.end(); ++it) stdMpi.recv(it->first); - MSG("DA 1\n"); - stdMpi.startCommunication(); - MSG("DA 2\n"); - // === Compare received mesh structure codes. === bool meshChanged = false; @@ -1178,7 +1174,7 @@ namespace AMDiS { // === Run mesh partitioner to calculate a new mesh partitioning. === - // partitioner->setLocalGlobalDofMap(&mapLocalGlobalDofs); + partitioner->setLocalGlobalDofMap(&(dofFeData[feSpaces[0]].mapLocalGlobalDofs)); bool partitioningSucceed = partitioner->partition(elemWeights, ADAPTIVE_REPART); if (!partitioningSucceed) { MSG("Mesh partitioner created empty partition!\n"); @@ -1919,14 +1915,13 @@ namespace AMDiS { updateLocalGlobalNumbering(feSpaces[i]); - #if (DEBUG != 0) MSG("------------- Debug information -------------\n"); for (unsigned int i = 0; i < feSpaces.size(); i++) { MSG("FE space %d:\n", i); MSG(" nRankDofs = %d\n", dofFeData[feSpaces[i]].nRankDofs); MSG(" nOverallDofs = %d\n", dofFeData[feSpaces[i]].nOverallDofs); - MSG(" rStartDofs %d\n", dofFeData[feSpaces[i]].rStartDofs); + MSG(" rStartDofs = %d\n", dofFeData[feSpaces[i]].rStartDofs); } stringstream oss; @@ -2273,6 +2268,8 @@ namespace AMDiS { { FUNCNAME("MeshDistributor::mapGlobalToLocal()"); + TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n"); + for (DofMapping::iterator it = dofFeData[feSpace].mapLocalGlobalDofs.begin(); it != dofFeData[feSpace].mapLocalGlobalDofs.end(); ++it) if (it->second == dof) diff --git a/AMDiS/src/parallel/MeshDistributor.h b/AMDiS/src/parallel/MeshDistributor.h index a5b24cb9b5476c8fe8a77a62b5b7573f9f3d2fb7..154e4db667ed3337e0d539f67204b823ca02c4fa 100644 --- a/AMDiS/src/parallel/MeshDistributor.h +++ b/AMDiS/src/parallel/MeshDistributor.h @@ -168,23 +168,39 @@ namespace AMDiS { /// Returns \ref nRankDOFs, the number of DOFs in the rank mesh. inline int getNumberRankDofs(const FiniteElemSpace *feSpace) { + FUNCNAME("MeshDistributor::getNumberRankDofs()"); + + TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n"); + return dofFeData[feSpace].nRankDofs; } /// Returns \ref rStartDofs, the first global DOF index owned by rank. inline int getStartDofs(const FiniteElemSpace *feSpace) { + FUNCNAME("MeshDistributor::getStartDofs()"); + + TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n"); + return dofFeData[feSpace].rStartDofs; } /// Returns \ref nOverallDofs, the global number of DOFs. inline int getNumberOverallDofs(const FiniteElemSpace *feSpace) { + FUNCNAME("MeshDistributor::getNumberOverallDofs()"); + + TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n"); + return dofFeData[feSpace].nOverallDofs; } inline DofMapping& getMapLocalGlobalDofs(const FiniteElemSpace *feSpace) { + FUNCNAME("MeshDistributor::getMapLocalGlobalDofs()"); + + TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n"); + return dofFeData[feSpace].mapLocalGlobalDofs; } @@ -192,6 +208,11 @@ namespace AMDiS { inline DegreeOfFreedom mapLocalToGlobal(const FiniteElemSpace *feSpace, DegreeOfFreedom dof) { + FUNCNAME("MeshDistributor::mapLocalToGlobal()"); + + TEST_EXIT_DBG(dofFeData.count(feSpace)) + ("No DOF data for FE space at addr %p!\n", feSpace); + return dofFeData[feSpace].mapLocalGlobalDofs[dof]; } @@ -202,6 +223,11 @@ namespace AMDiS { inline DegreeOfFreedom mapLocalToDofIndex(const FiniteElemSpace *feSpace, DegreeOfFreedom dof) { + FUNCNAME("MeshDistributor::mapLocalToDofIndex()"); + + TEST_EXIT_DBG(dofFeData.count(feSpace)) + ("No DOF data for FE space at addr %p!\n", feSpace); + return dofFeData[feSpace].mapLocalDofIndex[dof]; } diff --git a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc index b9c6e831f590b67e0b1256ad8cf78edbc0acc8de..8f49a34ddc86bd42ea9dd2b686199e60d9a11846 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc +++ b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc @@ -427,7 +427,7 @@ namespace AMDiS { { FUNCNAME("PetscSolverGlobalMatrix::setDofVector()"); - const FiniteElemSpace *feSpace; + const FiniteElemSpace *feSpace = meshDistributor->getFeSpace(0); // Traverse all used DOFs in the dof vector. DOFVector<double>::Iterator dofIt(vec, USED_DOFS);