Commit 2f0ed3ea authored by Thomas Witkowski's avatar Thomas Witkowski

To debug on juropa.

parent 4c2e86e3
......@@ -25,6 +25,7 @@
#include "Triangle.h"
#include "Tetrahedron.h"
#include "Parametric.h"
#include "Debug.h"
namespace AMDiS {
......@@ -1212,6 +1213,8 @@ namespace AMDiS {
for (int i = 1; i < n; i++) {
el = list->getElement(i);
TEST_EXIT_DBG(el)("Should not happen!\n");
basFct->getLocalIndices(el, admin, pdof);
int lr_set = 0;
......@@ -1221,7 +1224,13 @@ namespace AMDiS {
if (list->getNeighbourElement(i, 1) && list->getNeighbourNr(i, 1) < i)
lr_set += 2;
TEST_EXIT(lr_set)("no values set on both neighbours\n");
if (lr_set == 0 && el->getIndex() == 450) {
Element *del = debug::getLevel0ParentElement(drv->getFeSpace()->getMesh(), 450);
MSG("MACRO EL = %d\n", del->getIndex());
}
TEST_EXIT(lr_set > 0)
("No values set on both neighbours of element %d\n", el->getIndex());
/****************************************************************************/
/* values on child[0] */
......
......@@ -52,6 +52,7 @@ namespace AMDiS {
int rankStartRowIndex = rowDofMap.getStartDofs();
int nRankCols = colDofMap.getRankDofs();
int nOverallCols = colDofMap.getOverallDofs();
int rankStartColIndex = colDofMap.getStartDofs();
create(nRankRows, (!localMatrix ? nRankRows : -1));
......@@ -311,9 +312,10 @@ namespace AMDiS {
// matrices, the problem may arise, that the result is larger than the
// number of elements in a row. This is fixed in the following.
if (nRankRows < 100 || nRankCols < 100)
for (int i = 0; i < nRankRows; i++)
dnnz[i] = std::min(dnnz[i], nRankCols);
for (int i = 0; i < nRankRows; i++) {
dnnz[i] = std::min(dnnz[i], nRankCols);
onnz[i] = std::min(onnz[i], nOverallCols - nRankCols);
}
#if (DEBUG != 0)
int nMax = 0;
......
......@@ -574,7 +574,21 @@ namespace AMDiS {
dofMaps.push_back(&dofMap);
}
void MeshDistributor::removeDofMap(ParallelDofMapping &dofMap)
{
FUNCNAME("MeshDistributor::removeDofMap()");
vector<ParallelDofMapping*>::iterator it =
find(dofMaps.begin(), dofMaps.end(), &dofMap);
TEST_EXIT(it != dofMaps.end())
("Cannot find Parallel DOF mapping object which should be removed!\n");
dofMaps.erase(it);
}
void MeshDistributor::testForMacroMesh()
{
FUNCNAME("MeshDistributor::testForMacroMesh()");
......
......@@ -77,6 +77,13 @@ namespace AMDiS {
*/
void registerDofMap(ParallelDofMapping &dofMap);
/** \brief
* Removes a registered DOF mapping from the mesh distributor.
*
* \param[in] dofMap Parallel DOF mapping object to be removed.
*/
void removeDofMap(ParallelDofMapping &dofMap);
/// Adds a DOFVector to the set of \ref interchangeVecs. Thus, this vector
/// will be automatically interchanged between ranks when mesh is
/// repartitioned.
......
......@@ -24,6 +24,7 @@ namespace AMDiS {
: ParallelCoarseSpaceSolver(name),
dofMap(FESPACE_WISE, true),
dofMapSd(FESPACE_WISE, true),
parallelDofMappingsRegistered(false),
kspPrefix(""),
removeRhsNullspace(false),
hasConstantNullspace(false),
......@@ -44,6 +45,17 @@ namespace AMDiS {
}
PetscSolver::~PetscSolver()
{
if (parallelDofMappingsRegistered) {
meshDistributor->removeDofMap(dofMap);
int nLevels = meshDistributor->getMeshLevelData().getLevelNumber();
if (nLevels > 1)
meshDistributor->removeDofMap(dofMapSd);
}
}
void PetscSolver::init(vector<const FiniteElemSpace*> &fe0,
vector<const FiniteElemSpace*> &fe1,
bool createGlobalMapping)
......@@ -62,6 +74,8 @@ namespace AMDiS {
TEST_EXIT_DBG(nLevels >= 1)("Should not happen!\n");
if (createGlobalMapping) {
parallelDofMappingsRegistered = true;
dofMap.init(levelData, componentSpaces, feSpaces);
dofMap.setMpiComm(levelData.getMpiComm(0), 0);
dofMap.setDofComm(meshDistributor->getDofComm());
......
......@@ -52,7 +52,7 @@ namespace AMDiS {
public:
PetscSolver(string name);
virtual ~PetscSolver() {}
virtual ~PetscSolver();
void init(vector<const FiniteElemSpace*> &componentSpaces,
vector<const FiniteElemSpace*> &feSpaces,
......@@ -183,6 +183,11 @@ namespace AMDiS {
///
ParallelDofMapping dofMap, dofMapSd;
/// If the parallel DOF mappaings of this solver are registered to the
/// mesh distributor object, this variable is set to true to remove them
/// in the destructor.
bool parallelDofMappingsRegistered;
/// PETSc solver object
KSP kspInterior;
......
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