Skip to content

Commit 55ee465

Browse files
committed
set default to relative residual
1 parent 1da657f commit 55ee465

File tree

5 files changed

+3
-18
lines changed

5 files changed

+3
-18
lines changed

resolve/LinSolverIterative.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ namespace ReSolve
5757
return maxit_;
5858
}
5959

60-
int LinSolverIterative::setConvergenceCondition(index_type conv_cond)
61-
{
62-
if (conv_cond < 0 || conv_cond > 2)
63-
{
64-
out::error() << "Convergence condition must be 0, 1, or 2.\n";
65-
return 1;
66-
}
67-
this->conv_cond_ = conv_cond;
68-
return 0;
69-
}
70-
7160
int LinSolverIterative::setOrthogonalization(GramSchmidt* /* gs */)
7261
{
7362
out::error() << "Solver does not implement setting orthogonalization.\n";

resolve/LinSolverIterative.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,13 @@ namespace ReSolve
3636
real_type getTol() const;
3737
index_type getMaxit() const;
3838

39-
int setConvergenceCondition(index_type conv_cond);
40-
4139
void setTol(real_type new_tol);
4240
void setMaxit(index_type new_maxit);
4341

4442
protected:
4543
real_type initial_residual_norm_;
4644
real_type final_residual_norm_;
4745
index_type total_iters_;
48-
index_type conv_cond_{0}; ///< Convergence condition (0: absolute, 1: relative to tol, 2: relative to rhs norm)
4946

5047
// Parameters common for all iterative solvers
5148
real_type tol_{1e-14}; ///< Solver tolerance

resolve/LinSolverIterativeFGMRES.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace ReSolve
8383
};
8484

8585
index_type restart_{10}; ///< GMRES restart
86-
index_type conv_cond_{0}; ///< GMRES convergence condition
86+
index_type conv_cond_{2}; ///< GMRES convergence condition
8787
bool flexible_{true}; ///< If using flexible GMRES (FGMRES) algorithm
8888

8989
private:

resolve/LinSolverIterativeRandFGMRES.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace ReSolve
9898
};
9999

100100
index_type restart_{10}; ///< GMRES restart
101-
index_type conv_cond_{0}; ///< GMRES convergence condition
101+
index_type conv_cond_{2}; ///< GMRES convergence condition
102102
bool flexible_{true}; ///< If using flexible GMRES (FGMRES) algorithm
103103

104104
private:

tests/functionality/testSysRefactor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,13 @@ static int runTest(int argc, char* argv[], std::string backend)
133133
refactor, // refactorization
134134
refactor, // triangular solve
135135
"none", // preconditioner (always 'none' here)
136-
"none"); // iterative refinement
136+
"none"); // iterative refinement
137137

138138
// Configure solver (CUDA-based solver needs slightly different
139139
// settings than HIP-based one)
140140
solver.setRefinementMethod("fgmres", "cgs2");
141141
solver.getIterativeSolver().setCliParam("restart", "100");
142142
solver.getIterativeSolver().setTol(ReSolve::constants::MACHINE_EPSILON);
143-
solver.getIterativeSolver().setConvergenceCondition(2); // relative residual norm
144143
if (backend == "hip")
145144
{
146145
solver.getIterativeSolver().setMaxit(200);

0 commit comments

Comments
 (0)