Commit c2460445 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Fixed parallel dirichlet boundary conditions problem.

parent 9a40446c
......@@ -210,8 +210,8 @@ namespace AMDiS {
if (condition && condition->isDirichlet()) {
if (condition->applyBoundaryCondition()) {
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if ((*rankDofs)[rowIndices[i]])
applyDBCs.insert(static_cast<int>(row));
if ((*rankDofs)[rowIndices[i]])
applyDBCs.insert(static_cast<int>(row));
#else
applyDBCs.insert(static_cast<int>(row));
#endif
......@@ -219,11 +219,6 @@ namespace AMDiS {
} else {
for (int j = 0; j < nCol; j++) {
DegreeOfFreedom col = colIndices[j];
// if (MPI::COMM_WORLD.Get_rank() == 0 && row <= 10 && col <= 10) {
// MSG("%d/%d entry: %e\n", row, col, elMat[i][j]);
// }
ins[row][col] += elMat[i][j];
}
}
......
......@@ -247,6 +247,15 @@ namespace AMDiS {
// owner of the row DOFs.
std::map<int, MatrixNnzEntry> sendMatrixEntry;
// First, create for all ranks we send data to MatrixNnzEntry object with 0 entries.
typedef std::map<int, DofContainer> RankToDofContainer;
RankToDofContainer& recvDofs = meshDistributor->getRecvDofs();
for (RankToDofContainer::iterator it = recvDofs.begin();
it != recvDofs.end(); ++it)
sendMatrixEntry[it->first].resize(0);
for (int i = 0; i < nComponents; i++) {
for (int j = 0; j < nComponents; j++) {
if ((*mat)[i][j]) {
......@@ -347,6 +356,7 @@ namespace AMDiS {
stdMpi.recv(meshDistributor->getSendDofs());
stdMpi.startCommunication<int>(MPI_INT);
// === Evaluate the nnz structure this rank got from other ranks and add it to ===
// === the PETSc nnz data structure. ===
......@@ -412,10 +422,12 @@ namespace AMDiS {
lastMeshNnz = meshDistributor->getLastMeshChangeIndex();
}
// === Create PETSc matrix with the computed nnz data structure. ===
MatCreateMPIAIJ(PETSC_COMM_WORLD, nRankRows, nRankRows, nOverallRows, nOverallRows,
0, d_nnz, 0, o_nnz, &petscMatrix);
// 0, PETSC_NULL, 0, PETSC_NULL, &petscMatrix);
0, d_nnz, 0, o_nnz, &petscMatrix);
#if (DEBUG != 0)
INFO(info, 8)("Fill petsc matrix 1 needed %.5f seconds\n", TIME_USED(first, clock()));
......
......@@ -432,7 +432,7 @@ namespace AMDiS {
for (int k = 0; k < nComponents; k++) {
DOFMatrix* mat = probStat[i]->getSystemMatrix(j, k);
if (mat && mat->getBoundaryManager())
removePeriodicBoundaryConditions(const_cast<BoundaryIndexMap&>(mat->getBoundaryManager()->getBoundaryConditionMap()));
removePeriodicBoundaryConditions(const_cast<BoundaryIndexMap&>(mat->getBoundaryManager()->getBoundaryConditionMap()));
}
if (probStat[i]->getSolution()->getDOFVector(j)->getBoundaryManager())
......
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