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

Some not so important changes.

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