Commit 234ea16e authored by Thomas Witkowski's avatar Thomas Witkowski

Hopefully fixed problem with local-global matrix indices for the last.

parent c9ae1359
...@@ -1686,8 +1686,6 @@ namespace AMDiS { ...@@ -1686,8 +1686,6 @@ namespace AMDiS {
vector<const FiniteElemSpace*>& dofMapSpaces = dofMaps[i]->getFeSpaces(); vector<const FiniteElemSpace*>& dofMapSpaces = dofMaps[i]->getFeSpaces();
dofMaps[i]->clear(); dofMaps[i]->clear();
if (hasPeriodicBoundary)
dofMaps[i]->setComputeMatIndex(true);
for (int j = 0; j < static_cast<int>(dofMapSpaces.size()); j++) for (int j = 0; j < static_cast<int>(dofMapSpaces.size()); j++)
updateLocalGlobalNumbering(*(dofMaps[i]), dofMapSpaces[j]); updateLocalGlobalNumbering(*(dofMaps[i]), dofMapSpaces[j]);
......
...@@ -208,12 +208,13 @@ namespace AMDiS { ...@@ -208,12 +208,13 @@ namespace AMDiS {
} }
ParallelDofMapping::ParallelDofMapping(DofMappingMode mode) ParallelDofMapping::ParallelDofMapping(DofMappingMode mode,
bool matIndexFromGlobal)
: meshLevel(0), : meshLevel(0),
levelData(NULL), levelData(NULL),
dofComm(NULL), dofComm(NULL),
globalMapping(true), globalMapping(true),
needMatIndexFromGlobal(true), needMatIndexFromGlobal(matIndexFromGlobal),
nRankDofs(1), nRankDofs(1),
nLocalDofs(1), nLocalDofs(1),
nOverallDofs(1), nOverallDofs(1),
......
...@@ -643,10 +643,13 @@ namespace AMDiS { ...@@ -643,10 +643,13 @@ namespace AMDiS {
/** \brief /** \brief
* Constructur for parallel DOF mapping. * Constructur for parallel DOF mapping.
* *
* \param[in] mode Defines if DOF mapping is defined either per * \param[in] mode Defines if DOF mapping is defined either per
* component or per FE space. * component or per FE space.
* \param[in] matIndexGlobal If true, the mat index is defined on global
* DOF indices, otherwise on local ones.
*/ */
ParallelDofMapping(DofMappingMode mode); ParallelDofMapping(DofMappingMode mode,
bool matIndexFromGlobal = false);
/** \brief /** \brief
* Initialize the parallel DOF mapping. * Initialize the parallel DOF mapping.
...@@ -694,19 +697,11 @@ namespace AMDiS { ...@@ -694,19 +697,11 @@ namespace AMDiS {
return *dofComm; return *dofComm;
} }
/// Changes the computation of matrix indices based of either local or
/// global DOF indices, see \ref needMatIndexFromGlobal
void setComputeMatIndex(bool global)
{
needMatIndexFromGlobal = global;
}
inline bool isMatIndexFromGlobal() inline bool isMatIndexFromGlobal()
{ {
return needMatIndexFromGlobal; return needMatIndexFromGlobal;
} }
/// Access the DOF mapping for a given component number. /// Access the DOF mapping for a given component number.
inline ComponentDofMap& operator[](int compNumber) inline ComponentDofMap& operator[](int compNumber)
{ {
......
...@@ -22,8 +22,8 @@ namespace AMDiS { ...@@ -22,8 +22,8 @@ namespace AMDiS {
PetscSolver::PetscSolver() PetscSolver::PetscSolver()
: ParallelCoarseSpaceMatVec(), : ParallelCoarseSpaceMatVec(),
dofMap(FESPACE_WISE), dofMap(FESPACE_WISE, true),
dofMapSd(FESPACE_WISE), dofMapSd(FESPACE_WISE, true),
kspPrefix(""), kspPrefix(""),
removeRhsNullspace(false), removeRhsNullspace(false),
hasConstantNullspace(false), hasConstantNullspace(false),
......
...@@ -1286,12 +1286,11 @@ namespace AMDiS { ...@@ -1286,12 +1286,11 @@ namespace AMDiS {
massMapping = massMatrixSolver->getDofMapping(); massMapping = massMatrixSolver->getDofMapping();
} else { } else {
massMapping = massMapping =
new ParallelDofMapping(COMPONENT_WISE); new ParallelDofMapping(COMPONENT_WISE, true);
massMapping->init(meshDistributor->getMeshLevelData(), massMapping->init(meshDistributor->getMeshLevelData(),
pressureFeSpace, pressureFeSpace); pressureFeSpace, pressureFeSpace);
massMapping->setDofComm(meshDistributor->getDofComm()); massMapping->setDofComm(meshDistributor->getDofComm());
massMapping->setMpiComm(meshDistributor->getMeshLevelData().getMpiComm(0), 0); massMapping->setMpiComm(meshDistributor->getMeshLevelData().getMpiComm(0), 0);
massMapping->setComputeMatIndex(true);
} }
(*massMapping)[0] = interfaceDofMap[pressureComponent]; (*massMapping)[0] = interfaceDofMap[pressureComponent];
massMapping->update(); massMapping->update();
......
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