Commit a530c60e authored by Thomas Witkowski's avatar Thomas Witkowski

Changed names of some variables and functions in MeshDistributor to have a more consistant naming.

parent 75ffc1bf
......@@ -147,14 +147,14 @@ namespace AMDiS {
// array of indices of subdomain nodes in global numbering
int isngn[nnods];
for (int i = 0; i < nnods; i++)
isngn[i] = meshDistributor->mapLocalToGlobal(feSpace, i);
isngn[i] = meshDistributor->mapDofToGlobal(feSpace, i);
// array of indices of subdomain variables in global numbering
int isvgvn[ndofs];
for (int j = 0; j < nnods; j++)
for (int i = 0; i < nComponents; i++)
isvgvn[j * nComponents + i] =
meshDistributor->mapLocalToGlobal(feSpace, j) * nComponents + i;
meshDistributor->mapDofToGlobal(feSpace, j) * nComponents + i;
// array of indices of subdomain elements in global numbering
int isegn[nelems];
......@@ -343,13 +343,13 @@ namespace AMDiS {
for (cursor_type cursor = begin<row>(dmat->getBaseMatrix()),
cend = end<row>(dmat->getBaseMatrix()); cursor != cend; ++cursor) {
int rowIndex =
meshDistributor->mapLocalToGlobal(feSpace, *cursor) * nComponents +
meshDistributor->mapDofToGlobal(feSpace, *cursor) * nComponents +
ithRowComponent;
for (icursor_type icursor = begin<nz>(cursor), icend = end<nz>(cursor);
icursor != icend; ++icursor) {
int colIndex =
meshDistributor->mapLocalToGlobal(feSpace, col(*icursor)) * nComponents +
meshDistributor->mapDofToGlobal(feSpace, col(*icursor)) * nComponents +
ithColComponent;
double val = value(*icursor);
......
......@@ -1152,7 +1152,7 @@ namespace AMDiS {
// === Run mesh partitioner to calculate a new mesh partitioning. ===
partitioner->setLocalGlobalDofMap(&(dofFeData[feSpaces[0]].mapLocalGlobalDofs));
partitioner->setLocalGlobalDofMap(&(dofFeData[feSpaces[0]].mapDofToGlobal));
bool partitioningSucceed = partitioner->partition(elemWeights, ADAPTIVE_REPART);
if (!partitioningSucceed) {
MSG("Mesh partitioner created empty partition!\n");
......@@ -1988,15 +1988,15 @@ namespace AMDiS {
// === Create now the local to global index and local to DOF ===
// === index mappings. ===
dofFeData[feSpace].mapLocalGlobalDofs.clear();
dofFeData[feSpace].mapLocalDofIndex.clear();
dofFeData[feSpace].mapDofToGlobal.clear();
dofFeData[feSpace].mapLocalToDof.clear();
for (DofIndexMap::iterator dofIt = rankDofsNewGlobalIndex.begin();
dofIt != rankDofsNewGlobalIndex.end(); ++dofIt)
dofFeData[feSpace].mapLocalGlobalDofs[*(dofIt->first)] = dofIt->second;
dofFeData[feSpace].mapDofToGlobal[*(dofIt->first)] = dofIt->second;
for (unsigned int i = 0; i < rankDofs.size(); i++)
dofFeData[feSpace].mapLocalDofIndex[i] = *(rankDofs[i]);
dofFeData[feSpace].mapLocalToDof[i] = *(rankDofs[i]);
// === Update DOF admins due to new number of DOFs. ===
......@@ -2059,9 +2059,9 @@ namespace AMDiS {
for (unsigned int j = 0; j < dofs0.size(); j++) {
DegreeOfFreedom globalDof0 =
dofFeData[feSpace].mapLocalGlobalDofs[*(dofs0[j])];
dofFeData[feSpace].mapDofToGlobal[*(dofs0[j])];
DegreeOfFreedom globalDof1 =
dofFeData[feSpace].mapLocalGlobalDofs[*(dofs1[j])];
dofFeData[feSpace].mapDofToGlobal[*(dofs1[j])];
if (!periodicMap.isPeriodicOnBound(feSpace, type, globalDof0))
periodicMap.add(feSpace, type, globalDof0, globalDof1);
......@@ -2086,7 +2086,7 @@ namespace AMDiS {
// Send the global indices to the rank on the other side.
stdMpi.getSendData(it->first).reserve(dofs.size());
for (unsigned int i = 0; i < dofs.size(); i++)
stdMpi.getSendData(it->first).push_back(dofFeData[feSpace].mapLocalGlobalDofs[*(dofs[i])]);
stdMpi.getSendData(it->first).push_back(dofFeData[feSpace].mapDofToGlobal[*(dofs[i])]);
// Receive from this rank the same number of dofs.
stdMpi.recv(it->first, dofs.size());
......@@ -2112,7 +2112,7 @@ namespace AMDiS {
// Added the received DOFs to the mapping.
for (unsigned int i = 0; i < dofs.size(); i++) {
int globalDofIndex = dofFeData[feSpace].mapLocalGlobalDofs[*(dofs[i])];
int globalDofIndex = dofFeData[feSpace].mapDofToGlobal[*(dofs[i])];
int mapGlobalDofIndex = stdMpi.getRecvData(it->first)[i];
BoundaryType type = types[i];
......@@ -2144,7 +2144,7 @@ namespace AMDiS {
for (unsigned int i = 0; i < dofs.size(); i++) {
DegreeOfFreedom globalDof =
dofFeData[feSpace].mapLocalGlobalDofs[*dofs[i]];
dofFeData[feSpace].mapDofToGlobal[*dofs[i]];
std::set<BoundaryType>& assoc =
periodicMap.getAssociations(feSpace, globalDof);
......@@ -2164,13 +2164,12 @@ namespace AMDiS {
stdMpi2.startCommunication();
// NOTE: Before changing the data structure of periodic boundary DOFS,
// at this place no periodicDofAssociations are set for the received
// DOFs. I'm note sure what is correct here.
for (map<int, PeriodicDofMap>::iterator it = stdMpi2.getRecvData().begin();
it != stdMpi2.getRecvData().end(); ++it)
for (PeriodicDofMap::iterator perIt = it->second.begin();
perIt != it->second.end(); ++perIt)
for (DofMapping::iterator dofIt = perIt->second.begin();
dofIt != perIt->second.end(); ++dofIt)
periodicMap.add(feSpace, perIt->first, dofIt->second, dofIt->first);
periodicMap.add(feSpace, it->second);
}
......@@ -2217,8 +2216,8 @@ namespace AMDiS {
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
for (DofMapping::iterator it = dofFeData[feSpace].mapLocalGlobalDofs.begin();
it != dofFeData[feSpace].mapLocalGlobalDofs.end(); ++it)
for (DofMapping::iterator it = dofFeData[feSpace].mapDofToGlobal.begin();
it != dofFeData[feSpace].mapDofToGlobal.end(); ++it)
if (it->second == dof)
return it->first;
......@@ -2257,8 +2256,8 @@ namespace AMDiS {
SerUtil::serialize(out, dofFeData[feSpaces[i]].rStartDofs);
SerUtil::serialize(out, dofFeData[feSpaces[i]].isRankDof);
SerUtil::serialize(out, dofFeData[feSpaces[i]].mapLocalGlobalDofs);
SerUtil::serialize(out, dofFeData[feSpaces[i]].mapLocalDofIndex);
SerUtil::serialize(out, dofFeData[feSpaces[i]].mapDofToGlobal);
SerUtil::serialize(out, dofFeData[feSpaces[i]].mapLocalToDof);
}
periodicMap.serialize(out, feSpaces);
......@@ -2330,8 +2329,8 @@ namespace AMDiS {
SerUtil::deserialize(in, dofFeData[feSpaces[i]].rStartDofs);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].isRankDof);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapLocalGlobalDofs);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapLocalDofIndex);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapDofToGlobal);
SerUtil::deserialize(in, dofFeData[feSpaces[i]].mapLocalToDof);
}
periodicMap.deserialize(in, feSpaces);
......
......@@ -63,18 +63,16 @@ namespace AMDiS {
/// Number of DOFs in the whole domain.
int nOverallDofs;
/** \brief
* 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
* owned by another rank.
*/
/// 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
/// owned by another rank.
DofIndexToBool isRankDof;
/// Maps local to global dof indices.
DofMapping mapLocalGlobalDofs;
DofMapping mapDofToGlobal;
/// Maps local dof indices to real dof indices.
DofMapping mapLocalDofIndex;
DofMapping mapLocalToDof;
};
......@@ -242,40 +240,44 @@ namespace AMDiS {
return result;
}
inline DofMapping& getMapLocalGlobalDofs(const FiniteElemSpace *feSpace)
inline DofMapping& getMapDofToGlobal(const FiniteElemSpace *feSpace)
{
FUNCNAME("MeshDistributor::getMapLocalGlobalDofs()");
FUNCNAME("MeshDistributor::getMapDofToGlobal()");
TEST_EXIT_DBG(dofFeData.count(feSpace))("Should not happen!\n");
return dofFeData[feSpace].mapLocalGlobalDofs;
return dofFeData[feSpace].mapDofToGlobal;
}
/// Maps a local DOF to its global index.
inline DegreeOfFreedom mapLocalToGlobal(const FiniteElemSpace *feSpace,
inline DegreeOfFreedom mapDofToGlobal(const FiniteElemSpace *feSpace,
DegreeOfFreedom dof)
{
FUNCNAME("MeshDistributor::mapLocalToGlobal()");
FUNCNAME("MeshDistributor::mapDofToGlobal()");
TEST_EXIT_DBG(dofFeData.count(feSpace))
("No DOF data for FE space at addr %p!\n", feSpace);
return dofFeData[feSpace].mapLocalGlobalDofs[dof];
return dofFeData[feSpace].mapDofToGlobal[dof];
}
/// Returns for a global index the DOF index in rank's subdomain. As there
/// is no direct data structure that stores this information, we have to
/// search for it in \ref dofFeData.mapDofToGlobal. This is not very
/// efficient and this function should thus be used for debugging only.
DegreeOfFreedom mapGlobalToLocal(const FiniteElemSpace *feSpace,
DegreeOfFreedom dof);
/// Maps a local DOF to its local index.
inline DegreeOfFreedom mapLocalToDofIndex(const FiniteElemSpace *feSpace,
inline DegreeOfFreedom mapLocalToDof(const FiniteElemSpace *feSpace,
DegreeOfFreedom dof)
{
FUNCNAME("MeshDistributor::mapLocalToDofIndex()");
FUNCNAME("MeshDistributor::mapLocalToDof()");
TEST_EXIT_DBG(dofFeData.count(feSpace))
("No DOF data for FE space at addr %p!\n", feSpace);
return dofFeData[feSpace].mapLocalDofIndex[dof];
return dofFeData[feSpace].mapLocalToDof[dof];
}
/// Returns the periodic mapping handler, \ref periodicMap.
......
......@@ -482,7 +482,7 @@ namespace AMDiS {
DOFIterator<WorldVector<double> > it(&coords, USED_DOFS);
for (it.reset(); !it.end(); ++it) {
coordsToIndex[(*it)] =
pdb.dofFeData[feSpace].mapLocalGlobalDofs[it.getDOFIndex()];
pdb.dofFeData[feSpace].mapDofToGlobal[it.getDOFIndex()];
// MSG(" CHECK FOR DOF %d AT COORDS %f %f %f\n",
// coordsToIndex[(*it)], (*it)[0], (*it)[1], (*it)[2]);
......@@ -644,11 +644,11 @@ namespace AMDiS {
cout << "====== DOF MAP LOCAL -> GLOBAL ====== " << endl;
for (DofMapping::iterator it = pdb.dofFeData[feSpace].mapLocalGlobalDofs.begin();
it != pdb.dofFeData[feSpace].mapLocalGlobalDofs.end(); it++) {
for (DofMapping::iterator it = pdb.dofFeData[feSpace].mapDofToGlobal.begin();
it != pdb.dofFeData[feSpace].mapDofToGlobal.end(); it++) {
DegreeOfFreedom localdof = -1;
if (pdb.dofFeData[feSpace].mapLocalDofIndex.count(it->first) > 0)
localdof = pdb.dofFeData[feSpace].mapLocalDofIndex[it->first];
if (pdb.dofFeData[feSpace].mapLocalToDof.count(it->first) > 0)
localdof = pdb.dofFeData[feSpace].mapLocalToDof[it->first];
cout << "DOF " << it->first << " "
<< it->second << " "
......@@ -699,8 +699,8 @@ namespace AMDiS {
cout << endl;
DegreeOfFreedom localdof = -1;
for (DofMapping::iterator dofIt = pdb.dofFeData[feSpace].mapLocalGlobalDofs.begin();
dofIt != pdb.dofFeData[feSpace].mapLocalGlobalDofs.end(); ++dofIt)
for (DofMapping::iterator dofIt = pdb.dofFeData[feSpace].mapDofToGlobal.begin();
dofIt != pdb.dofFeData[feSpace].mapDofToGlobal.end(); ++dofIt)
if (dofIt->second == it->first)
localdof = dofIt->first;
......@@ -816,7 +816,7 @@ namespace AMDiS {
DOFIterator<WorldVector<double> > it(&coords, USED_DOFS);
for (it.reset(); !it.end(); ++it) {
file << it.getDOFIndex() << " "
<< pdb.dofFeData[feSpace].mapLocalGlobalDofs[it.getDOFIndex()] << " "
<< pdb.dofFeData[feSpace].mapDofToGlobal[it.getDOFIndex()] << " "
<< pdb.getIsRankDof(feSpace, it.getDOFIndex());
for (int i = 0; i < pdb.mesh->getDim(); i++)
file << " " << (*it)[i];
......
......@@ -15,6 +15,18 @@
namespace AMDiS {
void PeriodicMap::add(const FiniteElemSpace *feSpace,
PeriodicDofMap &newMap)
{
FUNCNAME("PeriodicMap::add()");
for (PeriodicDofMap::iterator it = newMap.begin(); it != newMap.end(); ++it)
for (DofMapping::iterator dofIt =it->second.begin();
dofIt != it->second.end(); ++dofIt)
add(feSpace, it->first, dofIt->second, dofIt->first);
}
void PeriodicMap::serialize(ostream &out,
vector<const FiniteElemSpace*> feSpaces)
{
......
......@@ -54,6 +54,7 @@ namespace AMDiS {
public:
PeriodicMap() {}
/// Reset all data.
void clear()
{
periodicDofMap.clear();
......@@ -61,12 +62,26 @@ namespace AMDiS {
}
/// Get a periodic DOF mapping for a given FE space.
inline PeriodicDofMap& getPeriodicMap(const FiniteElemSpace *feSpace)
{
return periodicDofMap[feSpace];
}
/** \brief
* Map a DOF
*
* \param[in] feSpace FE space from which the DOF comes from.
* \param[in] type Index of the periodic boundary. Is used to get
* the correct mapping if the DOF has multiple
* periodic associations.
* \param[in] globalDofIndex Global DOF index.
*
* \return Mapping of the global DOF index. The function fails if the
* the DOF is not periodic in the given FE space and periodic
* boundary type.
*/
inline int map(const FiniteElemSpace *feSpace,
BoundaryType type,
int globalDofIndex)
......@@ -82,6 +97,8 @@ namespace AMDiS {
}
/// Adds a new periodic mapping. Fails if there is already a mapping for
/// this DOFs that maps to a different DOF index than the given one.
inline void add(const FiniteElemSpace *feSpace,
BoundaryType type,
DegreeOfFreedom dof0, DegreeOfFreedom dof1)
......@@ -97,6 +114,10 @@ namespace AMDiS {
}
/// Adds a whole periodic mapping to the current one.
void add(const FiniteElemSpace *feSpace, PeriodicDofMap &newMap);
/// For a given global DOF index, this function returns the set of periodic
/// associations, i.e., the boundary types the DOF is associated to, for
/// this DOF.
......
......@@ -128,7 +128,7 @@ namespace AMDiS {
VecGetArray(tmp, &vecPointer);
for (int j = 0; j < nRankDofs; j++)
dofvec[meshDistributor->mapLocalToDofIndex(feSpace, j)] = vecPointer[j];
dofvec[meshDistributor->mapLocalToDof(feSpace, j)] = vecPointer[j];
VecRestoreArray(tmp, &vecPointer);
}
......@@ -192,7 +192,7 @@ namespace AMDiS {
cend = end<row>(mat->getBaseMatrix()); cursor != cend; ++cursor) {
// Global index of the current row DOF.
int rowIndex = meshDistributor->mapLocalToGlobal(feSpace, *cursor);
int rowIndex = meshDistributor->mapDofToGlobal(feSpace, *cursor);
cols.clear();
values.clear();
......@@ -200,7 +200,7 @@ namespace AMDiS {
for (icursor_type icursor = begin<nz>(cursor), icend = end<nz>(cursor);
icursor != icend; ++icursor) {
// Global index of the current column index.
int colIndex = meshDistributor->mapLocalToGlobal(feSpace, col(*icursor));
int colIndex = meshDistributor->mapDofToGlobal(feSpace, col(*icursor));
// Ignore all zero entries, expect it is a diagonal entry.
if (value(*icursor) == 0.0 && rowIndex != colIndex)
......@@ -227,7 +227,7 @@ namespace AMDiS {
// Traverse all used DOFs in the dof vector.
DOFVector<double>::Iterator dofIt(vec, USED_DOFS);
for (dofIt.reset(); !dofIt.end(); ++dofIt) {
int index = meshDistributor->mapLocalToGlobal(feSpace, dofIt.getDOFIndex());
int index = meshDistributor->mapDofToGlobal(feSpace, dofIt.getDOFIndex());
double value = *dofIt;
VecSetValues(petscVec, 1, &index, &value, ADD_VALUES);
......
......@@ -161,7 +161,7 @@ namespace AMDiS {
int nRankDofs = meshDistributor->getNumberRankDofs(feSpace);
for (int j = 0; j < nRankDofs; j++)
dv[meshDistributor->mapLocalToDofIndex(feSpace, j)] = vecPointer[c++];
dv[meshDistributor->mapLocalToDof(feSpace, j)] = vecPointer[c++];
}
VecRestoreArray(petscSolVec, &vecPointer);
......@@ -231,7 +231,7 @@ namespace AMDiS {
// Global index of the current row DOF.
int globalRowDof =
meshDistributor->mapLocalToGlobal(rowFe, *cursor);
meshDistributor->mapDofToGlobal(rowFe, *cursor);
// Test if the current row DOF is a periodic DOF.
bool periodicRow = perMap.isPeriodic(rowFe, globalRowDof);
......@@ -249,7 +249,7 @@ namespace AMDiS {
// Global index of the current column index.
int globalColDof =
meshDistributor->mapLocalToGlobal(colFe, col(*icursor));
meshDistributor->mapDofToGlobal(colFe, col(*icursor));
// Test if the current col dof is a periodic dof.
bool periodicCol = perMap.isPeriodic(colFe, globalColDof);
// Get PETSc's mat col index.
......@@ -326,7 +326,7 @@ namespace AMDiS {
// Global index of the current column index.
int globalColDof =
meshDistributor->mapLocalToGlobal(colFe, col(*icursor));
meshDistributor->mapDofToGlobal(colFe, col(*icursor));
// Ignore all zero entries, expect it is a diagonal entry.
if (value(*icursor) == 0.0 && globalRowDof != globalColDof)
......@@ -436,7 +436,7 @@ namespace AMDiS {
// Calculate global row index of the DOF.
DegreeOfFreedom globalRowDof =
meshDistributor->mapLocalToGlobal(feSpace, dofIt.getDOFIndex());
meshDistributor->mapDofToGlobal(feSpace, dofIt.getDOFIndex());
// Get PETSc's mat index of the row DOF.
int index = dofToMatIndex.get(dispAdd, globalRowDof);
......@@ -539,7 +539,7 @@ namespace AMDiS {
cend = end<row>(bmat); cursor != cend; ++cursor) {
int globalRowDof =
meshDistributor->mapLocalToGlobal(feSpaces[i], *cursor);
meshDistributor->mapDofToGlobal(feSpaces[i], *cursor);
// The corresponding global matrix row index of the current row DOF.
int petscRowIdx = dofToMatIndex.get(i, globalRowDof);
......@@ -555,7 +555,7 @@ namespace AMDiS {
TEST_EXIT_DBG(localPetscRowIdx >= 0 && localPetscRowIdx < nRankRows)
("Should not happen! \n Debug info: localRowIdx = %d globalRowIndx = %d petscRowIdx = %d localPetscRowIdx = %d rStart = %d nCompontens = %d nRankRows = %d\n",
*cursor,
meshDistributor->mapLocalToGlobal(feSpaces[i], *cursor),
meshDistributor->mapDofToGlobal(feSpaces[i], *cursor),
petscRowIdx,
localPetscRowIdx,
rankStartIndex,
......@@ -567,7 +567,7 @@ namespace AMDiS {
for (icursor_type icursor = begin<nz>(cursor),
icend = end<nz>(cursor); icursor != icend; ++icursor) {
int globalColDof =
meshDistributor->mapLocalToGlobal(feSpaces[j], col(*icursor));
meshDistributor->mapDofToGlobal(feSpaces[j], col(*icursor));
int petscColIdx = dofToMatIndex.get(j, globalColDof);
if (value(*icursor) != 0.0 || petscRowIdx == petscColIdx) {
......@@ -595,7 +595,7 @@ namespace AMDiS {
icend = end<nz>(cursor); icursor != icend; ++icursor) {
if (value(*icursor) != 0.0) {
int globalColDof =
meshDistributor->mapLocalToGlobal(feSpaces[j], col(*icursor));
meshDistributor->mapDofToGlobal(feSpaces[j], col(*icursor));
int petscColIdx = dofToMatIndex.get(j, globalColDof);
sendMatrixEntry[sendToRank].
......@@ -672,7 +672,7 @@ namespace AMDiS {
it != rankDofSet.end(); ++it)
if (meshDistributor->getIsRankDof(feSpaces[i], **it)) {
int globalIndex =
meshDistributor->mapLocalToGlobal(feSpaces[i], **it);
meshDistributor->mapDofToGlobal(feSpaces[i], **it);
int globalMatIndex =
globalIndex - meshDistributor->getStartDofs(feSpaces[i]) + offset;
......@@ -690,7 +690,7 @@ namespace AMDiS {
for (; !it.endDofIter(); it.nextDof()) {
int globalIndex =
meshDistributor->mapLocalToGlobal(feSpaces[i], it.getDofIndex());
meshDistributor->mapDofToGlobal(feSpaces[i], it.getDofIndex());
int globalMatIndex = dofToMatIndex.get(i, globalIndex);
sendGlobalDofs.push_back(globalMatIndex);
}
......@@ -707,8 +707,10 @@ namespace AMDiS {
for (DofComm::Iterator it(meshDistributor->getRecvDofs(), feSpaces[i]);
!it.end(); it.nextRank())
for (; !it.endDofIter(); it.nextDof()) {
int globalIndex = meshDistributor->mapLocalToGlobal(feSpaces[i], it.getDofIndex());
int globalMatIndex = stdMpi.getRecvData(it.getRank())[it.getDofCounter()];
int globalIndex =
meshDistributor->mapDofToGlobal(feSpaces[i], it.getDofIndex());
int globalMatIndex =
stdMpi.getRecvData(it.getRank())[it.getDofCounter()];
dofToMatIndex.add(i, globalIndex, globalMatIndex);
}
......@@ -723,7 +725,8 @@ namespace AMDiS {
vector<DegreeOfFreedom> sendGlobalDofs;
for (; !it.endDofIter(); it.nextDof()) {
int ind0 = meshDistributor->mapLocalToGlobal(feSpaces[i], it.getDofIndex());
int ind0 =
meshDistributor->mapDofToGlobal(feSpaces[i], it.getDofIndex());
int ind1 = dofToMatIndex.get(i, ind0);
sendGlobalDofs.push_back(ind0);
......
......@@ -36,7 +36,7 @@ namespace AMDiS {
!it.end(); it.nextRank())
for (; !it.endDofIter(); it.nextDof()) {
boundaryLocalDofs.insert(it.getDofIndex());
boundaryDofs.insert(meshDistributor->mapLocalToGlobal(feSpace, it.getDofIndex()));
boundaryDofs.insert(meshDistributor->mapDofToGlobal(feSpace, it.getDofIndex()));
}
......@@ -73,14 +73,14 @@ namespace AMDiS {
int counter = rStartEdgeDofs;
for (DofContainerSet::iterator it = edgeDofs.begin();
it != edgeDofs.end(); ++it)
mapGlobalBoundaryDof[meshDistributor->mapLocalToGlobal(feSpace, **it)] =
mapGlobalBoundaryDof[meshDistributor->mapDofToGlobal(feSpace, **it)] =
counter++;
}
{
int counter = nOverallEdgeDofs + rStartVertexDofs;
for (DofContainerSet::iterator it = vertexDofs.begin();
it != vertexDofs.end(); ++it)
mapGlobalBoundaryDof[meshDistributor->mapLocalToGlobal(feSpace, **it)] =
mapGlobalBoundaryDof[meshDistributor->mapDofToGlobal(feSpace, **it)] =
counter++;
}
#else
......@@ -106,7 +106,7 @@ namespace AMDiS {
if (dofIt->second &&
boundaryLocalDofs.count(dofIt->first) == 0 &&
otherBoundaryLocalDofs.count(dofIt->first) == 0)
interiorDofs.insert(meshDistributor->mapLocalToGlobal(feSpace, dofIt->first));
interiorDofs.insert(meshDistributor->mapDofToGlobal(feSpace, dofIt->first));
}
nInteriorDofs = interiorDofs.size();
......@@ -133,7 +133,7 @@ namespace AMDiS {
for (; !it.endDofIter(); it.nextDof()) {
int globalSendDof =
meshDistributor->mapLocalToGlobal(feSpace, it.getDofIndex());
meshDistributor->mapDofToGlobal(feSpace, it.getDofIndex());
TEST_EXIT_DBG(mapGlobalBoundaryDof.count(globalSendDof))
("No mapping for boundary DOF %d!\n", globalSendDof);
......@@ -154,7 +154,7 @@ namespace AMDiS {
!it.end(); it.nextRank())
for (; !it.endDofIter(); it.nextDof()) {
int globalRecvDof =
meshDistributor->mapLocalToGlobal(feSpace, it.getDofIndex());
meshDistributor->mapDofToGlobal(feSpace, it.getDofIndex());
mapGlobalBoundaryDof[globalRecvDof] =
stdMpi.getRecvData(it.getRank())[it.getDofCounter()];
boundaryDofs.insert(globalRecvDof);
......@@ -302,7 +302,7 @@ namespace AMDiS {
DOFVector<double>::Iterator dofIt(vec.getDOFVector(i), USED_DOFS);
for (dofIt.reset(); !dofIt.end(); ++dofIt) {
DegreeOfFreedom globalRowDof =
meshDistributor->mapLocalToGlobal(feSpace, dofIt.getDOFIndex());
meshDistributor->mapDofToGlobal(feSpace, dofIt.getDOFIndex());
if (boundaryDofs.count(globalRowDof)) {
int index =
(mapGlobalBoundaryDof[globalRowDof] - rStartBoundaryDofs + nInteriorDofs) * (i + 1);
......@@ -373,7 +373,7 @@ namespace AMDiS {
cend = end<row>(mat->getBaseMatrix()); cursor != cend; ++cursor) {
// Global index of the current row DOF.
int globalRowDof = meshDistributor->mapLocalToGlobal(feSpace, *cursor);
int globalRowDof = meshDistributor->mapDofToGlobal(feSpace, *cursor);
colsBoundary.clear();
colsInterior.clear();
......@@ -382,7 +382,7 @@ namespace AMDiS {
for (icursor_type icursor = begin<nz>(cursor), icend = end<nz>(cursor);
icursor != icend; ++icursor) {
int globalColDof = meshDistributor->mapLocalToGlobal(feSpace, col(*icursor));
int globalColDof = meshDistributor->mapDofToGlobal(feSpace, col(*icursor));
if (boundaryDofs.count(globalColDof)) {
TEST_EXIT_DBG(mapGlobalBoundaryDof.count(globalColDof))
......@@ -446,7 +446,7 @@ namespace AMDiS {
// Calculate global row index of the DOF.
DegreeOfFreedom globalRowDof =
meshDistributor->mapLocalToGlobal(feSpace, dofIt.getDOFIndex());
meshDistributor->mapDofToGlobal(feSpace, dofIt.getDOFIndex());
double value = *dofIt;
......
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