diff --git a/AMDiS/src/ITL_OEMSolver.h b/AMDiS/src/ITL_OEMSolver.h index 3dc952eb41c973aaef2aa0d20c4e532c89507b7a..fcc31a03de3a1149b755ce24f06caf2c44b1e104 100644 --- a/AMDiS/src/ITL_OEMSolver.h +++ b/AMDiS/src/ITL_OEMSolver.h @@ -98,15 +98,15 @@ namespace AMDiS { public: /// The constructor reads needed parameters and sets solvers \ref name. ITL_OEMSolver_para(::std::string name) - : OEMSolver(name), para(1) + : OEMSolver(name), ell(1) { - GET_PARAMETER(0, name + "->para", "%d", ¶); + GET_PARAMETER(0, name + "->ell", "%d", &ell); } ~ITL_OEMSolver_para() {} /// Set parameter of iterative solver - void setPara(int p) { para= p; } + void setEll(int p) { ell= p; } /// Solves the system iteratively int solveSystem(const DOFMatrix::base_matrix_type& A, @@ -115,7 +115,7 @@ namespace AMDiS { { itl::cyclic_iteration<value_type> iter(b, this->max_iter, this->relative, this->tolerance, this->print_cycle); - return ITLSolver()(A, x, b, *this->leftPrecon, *this->rightPrecon, iter, para); + return ITLSolver()(A, x, b, *this->leftPrecon, *this->rightPrecon, iter, ell); } class Creator : public OEMSolverCreator @@ -132,7 +132,8 @@ namespace AMDiS { }; private: - int para; + /// parameter for bicgstab_ell iterative solver + int ell; }; diff --git a/AMDiS/src/ITL_Solver.h b/AMDiS/src/ITL_Solver.h index 3043d36be5b407971710d325b16c1fbf9cf07ea5..841e380003e825553d75329505db614466f04a68 100644 --- a/AMDiS/src/ITL_Solver.h +++ b/AMDiS/src/ITL_Solver.h @@ -84,7 +84,7 @@ namespace AMDiS { { public: /// The constructor reads required parameters and sets solvers \ref name. - BiCGSolver(::std::string name) : ITL_OEMSolver<bicg_solver_type>(name) {} + BiCGSolver(std::string name) : ITL_OEMSolver<bicg_solver_type>(name) {} }; @@ -113,7 +113,7 @@ namespace AMDiS { { public: /// The constructor reads required parameters and sets solvers \ref name. - BiCGStab(::std::string name) : ITL_OEMSolver<bicgstab_type>(name) {} + BiCGStab(std::string name) : ITL_OEMSolver<bicgstab_type>(name) {} }; @@ -142,7 +142,7 @@ namespace AMDiS { { public: /// The constructor reads required parameters and sets solvers \ref name. - BiCGStab2(::std::string name) : ITL_OEMSolver<bicgstab2_type>(name) {} + BiCGStab2(std::string name) : ITL_OEMSolver<bicgstab2_type>(name) {} }; @@ -170,7 +170,7 @@ namespace AMDiS { { public: /// The constructor reads required parameters and sets solvers \ref name. - BiCGStabEll(::std::string name) : ITL_OEMSolver_para<bicgstab_ell_type>(name) {} + BiCGStabEll(std::string name) : ITL_OEMSolver_para<bicgstab_ell_type>(name) {} }; diff --git a/AMDiS/src/OEMSolver.h b/AMDiS/src/OEMSolver.h index c338e76ed616128b0f75b3bf85e21e76297f7c1e..8c57763a63eef46061d93209957fc2371291ce0f 100644 --- a/AMDiS/src/OEMSolver.h +++ b/AMDiS/src/OEMSolver.h @@ -55,9 +55,7 @@ namespace AMDiS { typedef DOFMatrix::base_matrix_type matrix_type; typedef DOFMatrix::value_type value_type; - /** \brief - * The constructor reads needed parameters and sets solvers \ref name. - */ + /// The constructor reads needed parameters and sets solvers \ref name. OEMSolver(std::string str) : name(str), tolerance(0), @@ -155,72 +153,52 @@ namespace AMDiS { return r; } - // ===== getting-methods ====================================================== - /** \name getting methods * \{ */ - /** \brief - * Returns solvers \ref name. - */ + /// Returns solvers \ref name. inline const std::string& getName() { return name; } - /** \brief - * Returns \ref tolerance - */ + /// Returns \ref tolerance inline double getTolerance() { return tolerance; } - /** \brief - * Returns \ref max_iter - */ + /// Returns \ref max_iter inline int getMaxIterations() { return max_iter; } - /** \brief - * Returns \ref residual - */ + /// Returns \ref residual inline double getResidual() { return residual; } /** \} */ - // ===== setting-methods ====================================================== - /** \name setting methods * \{ */ - /** \brief - * Sets \ref tolerance - */ + /// Sets \ref tolerance inline void setTolerance(double tol) { tolerance = tol; } - /** \brief - * Sets \ref relative - */ + /// Sets \ref relative inline void setRelative(bool rel) { relative = rel; } - /** \brief - * Sets \ref max_iter - */ + /// Sets \ref max_iter inline void setMaxIterations(int i) { max_iter = i; } - /** \brief - * Sets \ref info - */ + /// Sets \ref info inline void setInfo(int i) { info = i; } @@ -228,34 +206,22 @@ namespace AMDiS { /** \} */ protected: - /** \brief - * solvers name. - */ + /// solvers name. std::string name; - /** \brief - * Solver tolerance |r|. Set in OEMSolver's constructor. - */ + /// Solver tolerance |r|. Set in OEMSolver's constructor. double tolerance; - /** \brief - * Relative solver tolerance |r|/|r0|. Set in OEMSolver's constructor. - */ + /// Relative solver tolerance |r|/|r0|. Set in OEMSolver's constructor. double relative; - /** \brief - * maximal number of iterations. Set in OEMSolver's constructor. - */ + /// maximal number of iterations. Set in OEMSolver's constructor. int max_iter; - /** \brief - * info level during solving the system. Set in OEMSolver's constructor. - */ + /// info level during solving the system. Set in OEMSolver's constructor. int info; - /** \brief - * current residual. - */ + /// current residual. double residual; /// Print cycle, after how many iterations the residuum norm is logged. @@ -266,10 +232,6 @@ namespace AMDiS { ITL_BasePreconditioner *rightPrecon; }; - // ============================================================================ - // ===== class OEMSolverCreator =============================================== - // ============================================================================ - /** * \ingroup Solver * @@ -281,9 +243,7 @@ namespace AMDiS { public: virtual ~OEMSolverCreator() {} - /** \brief - * Sets \ref problem - */ + /// Sets \ref problem void setName(std::string str) { name = str; } diff --git a/AMDiS/src/ProblemVec.cc b/AMDiS/src/ProblemVec.cc index 2d5c97889c9a020501397144ad102d60cd57db2f..d175ddeb971b30bf98957a175aee1c15641d2d06 100644 --- a/AMDiS/src/ProblemVec.cc +++ b/AMDiS/src/ProblemVec.cc @@ -792,20 +792,26 @@ namespace AMDiS { assembleFlag); } + int nnz = 0; + // Finish insertion for (int i = 0; i < nComponents; i++) for (int j = 0; j < nComponents; j++) - if ((*systemMatrix)[i][j]) + if ((*systemMatrix)[i][j]) { (*systemMatrix)[i][j]->finishInsertion(); + nnz += (*systemMatrix)[i][j]->getBaseMatrix().nnz(); + } -// clock_t first1 = clock(); + // clock_t first1 = clock(); solverMatrix.setMatrix(*systemMatrix); -// clock_t first2 = clock(); + // clock_t first2 = clock(); createPrecon(); -// clock_t first3 = clock(); + // clock_t first3 = clock(); + + // std::cout << "T1 = " << TIME_USED(first1, first2) << std::endl; + // std::cout << "T2 = " << TIME_USED(first2, first3) << std::endl; -// std::cout << "T1 = " << TIME_USED(first1, first2) << std::endl; -// std::cout << "T2 = " << TIME_USED(first2, first3) << std::endl; + INFO(info, 8)("fillin of assembled matrix: %d\n", nnz); #ifdef _OPENMP INFO(info, 8)("buildAfterCoarsen needed %.5f seconds system time / %.5f seconds wallclock time\n",