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