Commit a8523376 authored by Thomas Witkowski's avatar Thomas Witkowski

MeshDistributer makes use of parallel DOF mapping.

parent 7f6405c6
...@@ -1065,7 +1065,7 @@ namespace AMDiS { ...@@ -1065,7 +1065,7 @@ namespace AMDiS {
void MeshDistributor::deserialize(istream &in, DofContainer &data, void MeshDistributor::deserialize(istream &in, DofContainer &data,
map<int, const DegreeOfFreedom*> &dofMap) map<int, const DegreeOfFreedom*> &dofIndexMap)
{ {
FUNCNAME("MeshDistributor::deserialize()"); FUNCNAME("MeshDistributor::deserialize()");
...@@ -1077,17 +1077,17 @@ namespace AMDiS { ...@@ -1077,17 +1077,17 @@ namespace AMDiS {
int dofIndex = 0; int dofIndex = 0;
SerUtil::deserialize(in, dofIndex); SerUtil::deserialize(in, dofIndex);
TEST_EXIT_DBG(dofMap.count(dofIndex) != 0) TEST_EXIT_DBG(dofIndexMap.count(dofIndex) != 0)
("Dof index could not be deserialized correctly!\n"); ("Dof index could not be deserialized correctly!\n");
data[i] = dofMap[dofIndex]; data[i] = dofIndexMap[dofIndex];
} }
} }
void MeshDistributor::deserialize(istream &in, void MeshDistributor::deserialize(istream &in,
map<int, map<const FiniteElemSpace*, DofContainer> > &data, map<int, map<const FiniteElemSpace*, DofContainer> > &data,
map<const FiniteElemSpace*, map<int, const DegreeOfFreedom*> > &dofMap) map<const FiniteElemSpace*, map<int, const DegreeOfFreedom*> > &dofIndexMap)
{ {
data.clear(); data.clear();
...@@ -1098,7 +1098,7 @@ namespace AMDiS { ...@@ -1098,7 +1098,7 @@ namespace AMDiS {
SerUtil::deserialize(in, rank); SerUtil::deserialize(in, rank);
for (unsigned int j = 0; j < feSpaces.size(); j++) for (unsigned int j = 0; j < feSpaces.size(); j++)
deserialize(in, data[rank][feSpaces[j]], dofMap[feSpaces[j]]); deserialize(in, data[rank][feSpaces[j]], dofIndexMap[feSpaces[j]]);
} }
} }
...@@ -1200,7 +1200,8 @@ namespace AMDiS { ...@@ -1200,7 +1200,8 @@ namespace AMDiS {
// === Run mesh partitioner to calculate a new mesh partitioning. === // === Run mesh partitioner to calculate a new mesh partitioning. ===
partitioner->setLocalGlobalDofMap(&(dofFeData[feSpaces[0]].mapDofToGlobal)); partitioner->setLocalGlobalDofMap(&(dofMap[feSpaces[0]].getMap()));
bool partitioningSucceed = bool partitioningSucceed =
partitioner->partition(elemWeights, ADAPTIVE_REPART); partitioner->partition(elemWeights, ADAPTIVE_REPART);
if (!partitioningSucceed) { if (!partitioningSucceed) {
...@@ -1966,29 +1967,30 @@ namespace AMDiS { ...@@ -1966,29 +1967,30 @@ namespace AMDiS {
recvDofs.init(nLevels); recvDofs.init(nLevels);
boundaryDofInfo.resize(nLevels); boundaryDofInfo.resize(nLevels);
dofMap.init(mpiComm, feSpaces, feSpaces, true, true);
dofMap.setDofComm(sendDofs, recvDofs);
for (unsigned int i = 0; i < feSpaces.size(); i++) for (unsigned int i = 0; i < feSpaces.size(); i++)
updateLocalGlobalNumbering(feSpaces[i]); updateLocalGlobalNumbering(feSpaces[i]);
dofMap.update();
#if (DEBUG != 0) #if (DEBUG != 0)
MSG("------------- Debug information -------------\n"); MSG("------------- Debug information -------------\n");
for (unsigned int i = 0; i < feSpaces.size(); i++) { for (unsigned int i = 0; i < feSpaces.size(); i++) {
MSG("FE space %d:\n", i); MSG("FE space %d:\n", i);
MSG(" nRankDofs = %d\n", dofFeData[feSpaces[i]].nRankDofs); MSG(" nRankDofs = %d\n", dofMap[feSpaces[i]].nRankDofs);
MSG(" nOverallDofs = %d\n", dofFeData[feSpaces[i]].nOverallDofs); MSG(" nOverallDofs = %d\n", dofMap[feSpaces[i]].nOverallDofs);
MSG(" rStartDofs = %d\n", dofFeData[feSpaces[i]].rStartDofs); MSG(" rStartDofs = %d\n", dofMap[feSpaces[i]].rStartDofs);
} }
stringstream oss; stringstream oss;
oss << debugOutputDir << "elementIndex-" << mpiRank << ".vtu"; oss << debugOutputDir << "elementIndex-" << mpiRank << ".vtu";
debug::writeElementIndexMesh(mesh, oss.str()); debug::writeElementIndexMesh(mesh, oss.str());
ParallelDebug::writeDebugFile(*this, debugOutputDir + "mpi-dbg", "dat"); ParallelDebug::writeDebugFile(*this, debugOutputDir + "mpi-dbg", "dat");
debug::testSortedDofs(mesh, elMap); debug::testSortedDofs(mesh, elMap);
ParallelDebug::testCommonDofs(*this, true); ParallelDebug::testCommonDofs(*this, true);
ParallelDebug::testGlobalIndexByCoords(*this); ParallelDebug::testGlobalIndexByCoords(*this);
#else #else
int tmp = 0; int tmp = 0;
Parameters::get(name + "->write parallel debug file", tmp); Parameters::get(name + "->write parallel debug file", tmp);
...@@ -2004,6 +2006,8 @@ namespace AMDiS { ...@@ -2004,6 +2006,8 @@ namespace AMDiS {
mesh->dofCompress(); mesh->dofCompress();
dofMap.clear();
// === Get all DOFs in ranks partition. === // === Get all DOFs in ranks partition. ===
std::set<const DegreeOfFreedom*> rankDofSet; std::set<const DegreeOfFreedom*> rankDofSet;
...@@ -2031,20 +2035,13 @@ namespace AMDiS { ...@@ -2031,20 +2035,13 @@ namespace AMDiS {
} }
} }
// Get displacment for global rank DOF ordering and global DOF number.
dofFeData[feSpace].nRankDofs = rankDofs.size();
mpi::getDofNumbering(mpiComm,
dofFeData[feSpace].nRankDofs,
dofFeData[feSpace].rStartDofs,
dofFeData[feSpace].nOverallDofs);
// Stores for all rank owned DOFs a new global index.
DofIndexMap rankDofsNewGlobalIndex;
for (unsigned int i = 0; i < rankDofs.size(); i++) for (unsigned int i = 0; i < rankDofs.size(); i++)
rankDofsNewGlobalIndex[rankDofs[i]] = i + dofFeData[feSpace].rStartDofs; dofMap[feSpace].insertRankDof(*(rankDofs[i]));
for (DofComm::Iterator it(recvDofs, feSpace); !it.end(); it.nextRank())
for (; !it.endDofIter(); it.nextDof())
dofMap[feSpace].insert(it.getDofIndex());
// === Send and receive new DOF indices. === // === Send and receive new DOF indices. ===
#if (DEBUG != 0) #if (DEBUG != 0)
...@@ -2053,52 +2050,15 @@ namespace AMDiS { ...@@ -2053,52 +2050,15 @@ namespace AMDiS {
recvDofs.getData()); recvDofs.getData());
#endif #endif
StdMpi<vector<DegreeOfFreedom> > stdMpi(mpiComm);
for (DofComm::Iterator it(sendDofs, feSpace); !it.end(); it.nextRank()) {
stdMpi.getSendData(it.getRank()).resize(0);
stdMpi.getSendData(it.getRank()).reserve(it.getDofs().size());
for (; !it.endDofIter(); it.nextDof())
stdMpi.getSendData(it.getRank()).
push_back(rankDofsNewGlobalIndex[it.getDof()]);
}
stdMpi.updateSendDataSize();
for (DofComm::Iterator it(recvDofs); !it.end(); it.nextRank())
stdMpi.recv(it.getRank());
stdMpi.startCommunication();
// First, we set all DOFs in ranks partition to be owend by the rank. Than, // First, we set all DOFs in ranks partition to be owend by the rank. Than,
// the DOFs in ranks partition that are owned by other rank are set to false. // the DOFs in ranks partition that are owned by other rank are set to false.
dofFeData[feSpace].isRankDof.clear(); dofFeData[feSpace].isRankDof.clear();
for (int i = 0; i < nRankAllDofs; i++) for (int i = 0; i < nRankAllDofs; i++)
dofFeData[feSpace].isRankDof[i] = true; dofFeData[feSpace].isRankDof[i] = true;
for (DofComm::Iterator it(recvDofs, feSpace); !it.end(); it.nextRank()) { for (DofComm::Iterator it(recvDofs, feSpace); !it.end(); it.nextRank())
for (; !it.endDofIter(); it.nextDof()) { for (; !it.endDofIter(); it.nextDof())
rankDofsNewGlobalIndex[it.getDof()] =
stdMpi.getRecvData(it.getRank())[it.getDofCounter()];
dofFeData[feSpace].isRankDof[it.getDofIndex()] = false; dofFeData[feSpace].isRankDof[it.getDofIndex()] = false;
}
}
// === Create now the local to global index and local to DOF ===
// === index mappings. ===
dofFeData[feSpace].mapDofToGlobal.clear();
dofFeData[feSpace].mapLocalToDof.clear();
for (DofIndexMap::iterator dofIt = rankDofsNewGlobalIndex.begin();
dofIt != rankDofsNewGlobalIndex.end(); ++dofIt)
dofFeData[feSpace].mapDofToGlobal[*(dofIt->first)] = dofIt->second;
for (unsigned int i = 0; i < rankDofs.size(); i++)
dofFeData[feSpace].mapLocalToDof[i] = *(rankDofs[i]);
// === Update DOF admins due to new number of DOFs. === // === Update DOF admins due to new number of DOFs. ===
...@@ -2163,10 +2123,8 @@ namespace AMDiS { ...@@ -2163,10 +2123,8 @@ namespace AMDiS {
BoundaryType type = bound.type; BoundaryType type = bound.type;
for (unsigned int j = 0; j < dofs0.size(); j++) { for (unsigned int j = 0; j < dofs0.size(); j++) {
DegreeOfFreedom globalDof0 = DegreeOfFreedom globalDof0 = dofMap[feSpace][*(dofs0[j])].global;
dofFeData[feSpace].mapDofToGlobal[*(dofs0[j])]; DegreeOfFreedom globalDof1 = dofMap[feSpace][*(dofs1[j])].global;
DegreeOfFreedom globalDof1 =
dofFeData[feSpace].mapDofToGlobal[*(dofs1[j])];
if (!periodicMap.isPeriodicOnBound(feSpace, type, globalDof0)) if (!periodicMap.isPeriodicOnBound(feSpace, type, globalDof0))
periodicMap.add(feSpace, type, globalDof0, globalDof1); periodicMap.add(feSpace, type, globalDof0, globalDof1);
...@@ -2191,7 +2149,7 @@ namespace AMDiS { ...@@ -2191,7 +2149,7 @@ namespace AMDiS {
// Send the global indices to the rank on the other side. // Send the global indices to the rank on the other side.
stdMpi.getSendData(it->first).reserve(dofs.size()); stdMpi.getSendData(it->first).reserve(dofs.size());
for (unsigned int i = 0; i < dofs.size(); i++) for (unsigned int i = 0; i < dofs.size(); i++)
stdMpi.getSendData(it->first).push_back(dofFeData[feSpace].mapDofToGlobal[*(dofs[i])]); stdMpi.getSendData(it->first).push_back(dofMap[feSpace][*(dofs[i])].global);
// Receive from this rank the same number of dofs. // Receive from this rank the same number of dofs.
stdMpi.recv(it->first, dofs.size()); stdMpi.recv(it->first, dofs.size());
...@@ -2217,7 +2175,7 @@ namespace AMDiS { ...@@ -2217,7 +2175,7 @@ namespace AMDiS {
// Added the received DOFs to the mapping. // Added the received DOFs to the mapping.
for (unsigned int i = 0; i < dofs.size(); i++) { for (unsigned int i = 0; i < dofs.size(); i++) {
int globalDofIndex = dofFeData[feSpace].mapDofToGlobal[*(dofs[i])]; int globalDofIndex = dofMap[feSpace][*(dofs[i])].global;
int mapGlobalDofIndex = stdMpi.getRecvData(it->first)[i]; int mapGlobalDofIndex = stdMpi.getRecvData(it->first)[i];
BoundaryType type = types[i]; BoundaryType type = types[i];
...@@ -2250,8 +2208,7 @@ namespace AMDiS { ...@@ -2250,8 +2208,7 @@ namespace AMDiS {
boundIt->rankObj.el->getAllDofs(feSpace, boundIt->rankObj, dofs); boundIt->rankObj.el->getAllDofs(feSpace, boundIt->rankObj, dofs);
for (unsigned int i = 0; i < dofs.size(); i++) { for (unsigned int i = 0; i < dofs.size(); i++) {
DegreeOfFreedom globalDof = DegreeOfFreedom globalDof = dofMap[feSpace][*dofs[i]].global;
dofFeData[feSpace].mapDofToGlobal[*dofs[i]];
std::set<BoundaryType>& assoc = std::set<BoundaryType>& assoc =
periodicMap.getAssociations(feSpace, globalDof); periodicMap.getAssociations(feSpace, globalDof);
...@@ -2323,11 +2280,13 @@ namespace AMDiS { ...@@ -2323,11 +2280,13 @@ namespace AMDiS {
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n"); TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
ERROR_EXIT("REIMPLEMENT THAT SHIT!\n");
/*
for (DofMap::iterator it = dofFeData[feSpace].mapDofToGlobal.begin(); for (DofMap::iterator it = dofFeData[feSpace].mapDofToGlobal.begin();
it != dofFeData[feSpace].mapDofToGlobal.end(); ++it) it != dofFeData[feSpace].mapDofToGlobal.end(); ++it)
if (it->second == dof) if (it->second == dof)
return it->first; return it->first;
*/
return -1; return -1;
} }
...@@ -2358,13 +2317,13 @@ namespace AMDiS { ...@@ -2358,13 +2317,13 @@ namespace AMDiS {
SerUtil::serialize(out, nFeSpace); SerUtil::serialize(out, nFeSpace);
for (unsigned int i = 0; i < nFeSpace; i++) { for (unsigned int i = 0; i < nFeSpace; i++) {
SerUtil::serialize(out, dofFeData[feSpaces[i]].nRankDofs); // SerUtil::serialize(out, dofFeData[feSpaces[i]].nRankDofs);
SerUtil::serialize(out, dofFeData[feSpaces[i]].nOverallDofs); // SerUtil::serialize(out, dofFeData[feSpaces[i]].nOverallDofs);
SerUtil::serialize(out, dofFeData[feSpaces[i]].rStartDofs); // SerUtil::serialize(out, dofFeData[feSpaces[i]].rStartDofs);
SerUtil::serialize(out, dofFeData[feSpaces[i]].isRankDof); SerUtil::serialize(out, dofFeData[feSpaces[i]].isRankDof);
SerUtil::serialize(out, dofFeData[feSpaces[i]].mapDofToGlobal); // SerUtil::serialize(out, dofFeData[feSpaces[i]].mapDofToGlobal);
SerUtil::serialize(out, dofFeData[feSpaces[i]].mapLocalToDof); // SerUtil::serialize(out, dofFeData[feSpaces[i]].mapLocalToDof);
} }
periodicMap.serialize(out, feSpaces); periodicMap.serialize(out, feSpaces);
...@@ -2395,7 +2354,7 @@ namespace AMDiS { ...@@ -2395,7 +2354,7 @@ namespace AMDiS {
// Create two maps: one from from element indices to the corresponding element // Create two maps: one from from element indices to the corresponding element
// pointers, and one map from Dof indices to the corresponding dof pointers. // pointers, and one map from Dof indices to the corresponding dof pointers.
map<int, Element*> elIndexMap; map<int, Element*> elIndexMap;
map<const FiniteElemSpace*, map<int, const DegreeOfFreedom*> > dofMap; map<const FiniteElemSpace*, map<int, const DegreeOfFreedom*> > dofIndexMap;
for (unsigned int i = 0; i < feSpaces.size(); i++) { for (unsigned int i = 0; i < feSpaces.size(); i++) {
ElementDofIterator elDofIter(feSpaces[i]); ElementDofIterator elDofIter(feSpaces[i]);
TraverseStack stack; TraverseStack stack;
...@@ -2407,7 +2366,7 @@ namespace AMDiS { ...@@ -2407,7 +2366,7 @@ namespace AMDiS {
if (el->isLeaf()) { if (el->isLeaf()) {
elDofIter.reset(el); elDofIter.reset(el);
do { do {
dofMap[feSpaces[i]][elDofIter.getDof()] = elDofIter.getDofPtr(); dofIndexMap[feSpaces[i]][elDofIter.getDof()] = elDofIter.getDofPtr();
} while (elDofIter.next()); } while (elDofIter.next());
} }
...@@ -2421,8 +2380,8 @@ namespace AMDiS { ...@@ -2421,8 +2380,8 @@ namespace AMDiS {
otherIntBoundary.deserialize(in, elIndexMap); otherIntBoundary.deserialize(in, elIndexMap);
periodicBoundary.deserialize(in, elIndexMap); periodicBoundary.deserialize(in, elIndexMap);
deserialize(in, sendDofs.getData(), dofMap); deserialize(in, sendDofs.getData(), dofIndexMap);
deserialize(in, recvDofs.getData(), dofMap); deserialize(in, recvDofs.getData(), dofIndexMap);
// === Deerialieze FE space dependent data === // === Deerialieze FE space dependent data ===
...@@ -2433,13 +2392,13 @@ namespace AMDiS { ...@@ -2433,13 +2392,13 @@ namespace AMDiS {
feSpaces.size(), nFeSpace); feSpaces.size(), nFeSpace);
for (unsigned int i = 0; i < nFeSpace; i++) { for (unsigned int i = 0; i < nFeSpace; i++) {
SerUtil::deserialize(in, dofFeData[feSpaces[i]].nRankDofs); // SerUtil::deserialize(in, dofFeData[feSpaces[i]].nRankDofs);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].nOverallDofs); // SerUtil::deserialize(in, dofFeData[feSpaces[i]].nOverallDofs);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].rStartDofs); // SerUtil::deserialize(in, dofFeData[feSpaces[i]].rStartDofs);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].isRankDof); SerUtil::deserialize(in, dofFeData[feSpaces[i]].isRankDof);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapDofToGlobal); // SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapDofToGlobal);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapLocalToDof); // SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapLocalToDof);
} }
periodicMap.deserialize(in, feSpaces); periodicMap.deserialize(in, feSpaces);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "parallel/MeshLevelData.h" #include "parallel/MeshLevelData.h"
#include "parallel/MeshPartitioner.h" #include "parallel/MeshPartitioner.h"
#include "parallel/InteriorBoundary.h" #include "parallel/InteriorBoundary.h"
#include "parallel/ParallelDofMapping.h"
#include "parallel/PeriodicMap.h" #include "parallel/PeriodicMap.h"
#include "parallel/StdMpi.h" #include "parallel/StdMpi.h"
#include "AMDiS_fwd.h" #include "AMDiS_fwd.h"
...@@ -56,25 +57,10 @@ namespace AMDiS { ...@@ -56,25 +57,10 @@ namespace AMDiS {
struct DofData struct DofData
{ {
/// Number of DOFs in the rank mesh.
int nRankDofs;
/// Is the index of the first global DOF index, which is owned by the rank.
int rStartDofs;
/// Number of DOFs in the whole domain.
int nOverallDofs;
/// Maps all DOFs in ranks partition to a bool value. If it is true, the DOF /// Maps all DOFs in ranks partition to a bool value. If it is true, the DOF
/// is owned by the rank. Otherwise, its an interior boundary DOF that is /// is owned by the rank. Otherwise, its an interior boundary DOF that is
/// owned by another rank. /// owned by another rank.
DofIndexToBool isRankDof; DofIndexToBool isRankDof;
/// Maps local to global dof indices.
DofMap mapDofToGlobal;
/// Maps local dof indices to real dof indices.
DofMap mapLocalToDof;
}; };
...@@ -171,11 +157,7 @@ namespace AMDiS { ...@@ -171,11 +157,7 @@ namespace AMDiS {
/// Returns the number of DOFs in rank's domain for a given FE space. /// Returns the number of DOFs in rank's domain for a given FE space.
inline int getNumberRankDofs(const FiniteElemSpace *feSpace) inline int getNumberRankDofs(const FiniteElemSpace *feSpace)
{ {
FUNCNAME("MeshDistributor::getNumberRankDofs()"); return dofMap[feSpace].nRankDofs;
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
return dofFeData[feSpace].nRankDofs;
} }
/// Returns the number of DOFs in rank's domain for a set of FE spaces. /// Returns the number of DOFs in rank's domain for a set of FE spaces.
...@@ -184,10 +166,8 @@ namespace AMDiS { ...@@ -184,10 +166,8 @@ namespace AMDiS {
FUNCNAME("MeshDistributor::getNumberRankDofs()"); FUNCNAME("MeshDistributor::getNumberRankDofs()");
int result = 0; int result = 0;
for (unsigned int i = 0; i < feSpaces.size(); i++) { for (unsigned int i = 0; i < feSpaces.size(); i++)
TEST_EXIT_DBG(dofFeData.count(feSpaces[i]))("Should not happen!\n"); result += dofMap[feSpaces[i]].nRankDofs;
result += dofFeData[feSpaces[i]].nRankDofs;
}
return result; return result;
} }
...@@ -195,11 +175,7 @@ namespace AMDiS { ...@@ -195,11 +175,7 @@ namespace AMDiS {
/// Returns the first global DOF index of an FE space, owned by rank. /// Returns the first global DOF index of an FE space, owned by rank.
inline int getStartDofs(const FiniteElemSpace *feSpace) inline int getStartDofs(const FiniteElemSpace *feSpace)
{ {
FUNCNAME("MeshDistributor::getStartDofs()"); return dofMap[feSpace].rStartDofs;
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
return dofFeData[feSpace].rStartDofs;
} }
/// Returns the first global DOF index for a set of FE spaces, owned by rank. /// Returns the first global DOF index for a set of FE spaces, owned by rank.
...@@ -208,11 +184,8 @@ namespace AMDiS { ...@@ -208,11 +184,8 @@ namespace AMDiS {
FUNCNAME("MeshDistributor::getStartDofs()"); FUNCNAME("MeshDistributor::getStartDofs()");
int result = 0; int result = 0;
for (unsigned int i = 0; i < feSpaces.size(); i++) { for (unsigned int i = 0; i < feSpaces.size(); i++)
TEST_EXIT_DBG(dofFeData.count(feSpaces[i]))("Should not happen!\n"); result += dofMap[feSpaces[i]].rStartDofs;
result += dofFeData[feSpaces[i]].rStartDofs;
}
return result; return result;
} }
...@@ -220,11 +193,7 @@ namespace AMDiS { ...@@ -220,11 +193,7 @@ namespace AMDiS {
/// Returns the global number of DOFs for a given FE space. /// Returns the global number of DOFs for a given FE space.
inline int getNumberOverallDofs(const FiniteElemSpace *feSpace) inline int getNumberOverallDofs(const FiniteElemSpace *feSpace)
{ {
FUNCNAME("MeshDistributor::getNumberOverallDofs()"); return dofMap[feSpace].nOverallDofs;
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
return dofFeData[feSpace].nOverallDofs;
} }
/// Returns the global number of DOFs for a set of FE spaces. /// Returns the global number of DOFs for a set of FE spaces.
...@@ -233,34 +202,22 @@ namespace AMDiS { ...@@ -233,34 +202,22 @@ namespace AMDiS {
FUNCNAME("MeshDistributor::getNumberOverallDofs()"); FUNCNAME("MeshDistributor::getNumberOverallDofs()");
int result = 0; int result = 0;
for (unsigned int i = 0; i < feSpaces.size(); i++) { for (unsigned int i = 0; i < feSpaces.size(); i++)
TEST_EXIT_DBG(dofFeData.count(feSpaces[i]))("Should not happen!\n"); result += dofMap[feSpaces[i]].nOverallDofs;
result += dofFeData[feSpaces[i]].nOverallDofs;
}
return result; return result;
} }
inline DofMap& getMapDofToGlobal(const FiniteElemSpace *feSpace) inline map<DegreeOfFreedom, MultiIndex>& getMapDofToGlobal(const FiniteElemSpace *feSpace)
{ {
FUNCNAME("MeshDistributor::getMapDofToGlobal()"); return dofMap[feSpace].getMap();
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
return dofFeData[feSpace].mapDofToGlobal;
} }
/// Maps a local DOF to its global index. /// Maps a local DOF to its global index.
inline DegreeOfFreedom mapDofToGlobal(const FiniteElemSpace *feSpace, inline DegreeOfFreedom mapDofToGlobal(const FiniteElemSpace *feSpace,
DegreeOfFreedom dof) DegreeOfFreedom dof)
{ {
FUNCNAME("MeshDistributor::mapDofToGlobal()"); return dofMap[feSpace][dof].global;
TEST_EXIT_DBG(dofFeData.count(feSpace))
("No DOF data for FE space at addr %p!\n", feSpace);
return dofFeData[feSpace].mapDofToGlobal[dof];
} }
/// Returns for a global index the DOF index in rank's subdomain. As there /// Returns for a global index the DOF index in rank's subdomain. As there
...@@ -270,18 +227,6 @@ namespace AMDiS { ...@@ -270,18 +227,6 @@ namespace AMDiS {
DegreeOfFreedom mapGlobalToLocal(const FiniteElemSpace *feSpace, DegreeOfFreedom mapGlobalToLocal(const FiniteElemSpace *feSpace,
DegreeOfFreedom dof); DegreeOfFreedom dof);
/// Maps a local DOF to its local index.
inline DegreeOfFreedom mapLocalToDof(const FiniteElemSpace *feSpace,
DegreeOfFreedom dof)