Commit 3dc8e48f authored by Thomas Witkowski's avatar Thomas Witkowski

Fixed bugs due to last changes in parallel code.

parent 3dae32b2
......@@ -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)
......
......@@ -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];
}
......
......@@ -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);
......
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