diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc index 1191824c52c928d8ac2ca186193346a264d38922..4f60974cb817db76bf664137fd819d0c5ec47a00 100644 --- a/AMDiS/src/DOFMatrix.cc +++ b/AMDiS/src/DOFMatrix.cc @@ -197,9 +197,9 @@ namespace AMDiS { if (condition->applyBoundaryCondition()) { #ifdef HAVE_PARALLEL_DOMAIN_AMDIS if (rankDofs[rowIndices[i]]) - applyDBCs.insert(static_cast<int>(rowIndices[i])); + applyDBCs.insert(static_cast<int>(row)); #else - applyDBCs.insert(static_cast<int>(rowIndices[i])); + applyDBCs.insert(static_cast<int>(row)); #endif } } else { diff --git a/AMDiS/src/ITL_OEMSolver.h b/AMDiS/src/ITL_OEMSolver.h index 152faa9fe46dd7b655a6cff8bebbfb6a04019fe5..b2a859e393fd234cb5fd49f8480177d2c787ce47 100644 --- a/AMDiS/src/ITL_OEMSolver.h +++ b/AMDiS/src/ITL_OEMSolver.h @@ -64,18 +64,10 @@ namespace AMDiS { { itl::cyclic_iteration<value_type> iter(b, this->max_iter, this->relative, this->tolerance, this->print_cycle); -#if 0 - std::cout << "A is " << num_rows(A) << " x " << num_cols(A) - << ", one_norm(A) = " << one_norm(A) - << ", b is " << num_rows(b) - << ", one_norm(b) = " << one_norm(b) - << ", x is " << num_rows(x) - << ", one_norm(x) = " << one_norm(x) << "\n"; - if (one_norm(x) > 1e100) - x= 0.0; -#endif - error= ITLSolver()(A, x, b, *this->leftPrecon, *this->rightPrecon, iter); - iterations= iter.iterations(); + + error = ITLSolver()(A, x, b, *this->leftPrecon, *this->rightPrecon, iter); + iterations = iter.iterations(); + residual = iter.resid(); return error; } @@ -127,8 +119,9 @@ namespace AMDiS { { itl::cyclic_iteration<value_type> iter(b, this->max_iter, this->relative, this->tolerance, this->print_cycle); - error= ITLSolver()(A, x, b, *this->leftPrecon, *this->rightPrecon, iter, ell); - iterations= iter.iterations(); + error = ITLSolver()(A, x, b, *this->leftPrecon, *this->rightPrecon, iter, ell); + iterations = iter.iterations(); + residual = iter.resid(); return error; } diff --git a/AMDiS/src/ITL_Preconditioner.h b/AMDiS/src/ITL_Preconditioner.h index 91bcf146d9ffd597fd34a17ea5197472dd347d86..2acd6a48f426744cba45f584237f856a9eba6a68 100644 --- a/AMDiS/src/ITL_Preconditioner.h +++ b/AMDiS/src/ITL_Preconditioner.h @@ -142,7 +142,7 @@ namespace AMDiS { : public ITL_Preconditioner<itl::pc::identity<DOFMatrix::base_matrix_type> > { typedef ITL_Preconditioner<itl::pc::identity<DOFMatrix::base_matrix_type> > base; - + public: IdentityPreconditioner(const DOFMatrix::base_matrix_type& A) : base(A) {} }; diff --git a/AMDiS/src/Mesh.cc b/AMDiS/src/Mesh.cc index f411a43fd7fc36804e28b45130fc70b01b2942dd..d763d6612e7951b353a251ce7044f4dd8244da15 100644 --- a/AMDiS/src/Mesh.cc +++ b/AMDiS/src/Mesh.cc @@ -474,7 +474,7 @@ namespace AMDiS { traverse(-1, fill_flag, newDOFFct2); newDOF.resize(0); - } + } } diff --git a/AMDiS/src/OEMSolver.h b/AMDiS/src/OEMSolver.h index 356963f473b6922689dafbc0e64a08f31dd2f91d..ad4fb7aa40cd528800a1594c074d94f06c4773f8 100644 --- a/AMDiS/src/OEMSolver.h +++ b/AMDiS/src/OEMSolver.h @@ -182,25 +182,25 @@ namespace AMDiS { */ /// Returns solvers \ref name. - inline std::string getName() + inline std::string getName() const { return name; } /// Returns \ref tolerance - inline double getTolerance() + inline double getTolerance() const { return tolerance; } /// Returns \ref max_iter - inline int getMaxIterations() + inline int getMaxIterations() const { return max_iter; } /// Returns \ref residual - inline double getResidual() + inline double getResidual() const { return residual; } diff --git a/AMDiS/src/ProblemScal.cc b/AMDiS/src/ProblemScal.cc index 4e35e06d84232fdf335d43a80bb1f08ea37df935..47c2d0ece46fe057169220fa1d662080bf856a2c 100644 --- a/AMDiS/src/ProblemScal.cc +++ b/AMDiS/src/ProblemScal.cc @@ -587,9 +587,8 @@ namespace AMDiS { } systemMatrix->removeRowsWithDBC(systemMatrix->getApplyDBCs()); - systemMatrix->finishInsertion(); - + // TODO: ExitMatrix should be called after finishInsertion! if (systemMatrix->getBoundaryManager()) systemMatrix->getBoundaryManager()->exitMatrix(systemMatrix); @@ -599,14 +598,7 @@ namespace AMDiS { solution->getBoundaryManager()->exitVector(solution); INFO(info, 8)("buildAfterCoarsen needed %.5f seconds\n", TIME_USED(first,clock())); - -#ifdef HAVE_PARALLEL_DOMAIN_AMDIS -// PetscErrorCode ierr; -// Mat A; - -// ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr); -#endif - + createPrecon(); }