diff --git a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc index 68033d96f00d80cb4733e991edb1b1b123d9def6..3b547ba236bae42ddc89811bf0fe20fa4c2dbe36 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc +++ b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc @@ -145,6 +145,7 @@ namespace AMDiS { *coarseSpaceMap, *coarseSpaceMap, nnzCoarse); + createPetscNnzStructureWithCoarseSpace(mat, *coarseSpaceMap, *interiorMap, @@ -185,18 +186,18 @@ namespace AMDiS { MatCreateAIJ(mpiCommGlobal, nRowsRankCoarse, nRowsRankInterior, nRowsOverallCoarse, nGlobalOverallInterior, - 100, PETSC_NULL, 100, PETSC_NULL, - // 0, nnzCoarseInt.dnnz, 0, nnzCoarseInt.onnz, + // 100, PETSC_NULL, 100, PETSC_NULL, + 0, nnzCoarseInt.dnnz, 0, nnzCoarseInt.onnz, &matCoarseInt); - MatSetOption(matCoarseInt, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); + // MatSetOption(matCoarseInt, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); MatCreateAIJ(mpiCommGlobal, nRowsRankInterior, nRowsRankCoarse, nGlobalOverallInterior, nRowsOverallCoarse, - 100, PETSC_NULL, 100, PETSC_NULL, - // 0, nnzIntCoarse.dnnz, 0, nnzIntCoarse.onnz, + // 100, PETSC_NULL, 100, PETSC_NULL, + 0, nnzIntCoarse.dnnz, 0, nnzIntCoarse.onnz, &matIntCoarse); - MatSetOption(matIntCoarse, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); + // MatSetOption(matIntCoarse, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); } // === Prepare traverse of sequentially created matrices. === @@ -340,9 +341,6 @@ namespace AMDiS { MatAssemblyEnd(matCoarseInt, MAT_FINAL_ASSEMBLY); } - AMDiS::finalize(); - exit(0); - // === Remove Dirichlet BC DOFs. === // removeDirichletBcDofs(mat); @@ -1443,9 +1441,9 @@ 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) -// for (int i = 0; i < nRankRows; i++) -// nnzInterior.dnnz[i] = std::min(nnzInterior.dnnz[i], nRankCols); + if (nRankRows < 100) + for (int i = 0; i < nRankRows; i++) + nnz.dnnz[i] = std::min(nnz.dnnz[i], nRankCols); #if (DEBUG != 0) int nMax = 0; @@ -1470,6 +1468,7 @@ namespace AMDiS { MSG("NNZ in offdiag block: max = %d, avrg = %.0f\n", nMax, (nSum > 0 ? (static_cast<double>(nSum) / nRankRows) : 0)); } - } #endif + } + }