Skip to content
Snippets Groups Projects
Commit 28194295 authored by Markus Blatt's avatar Markus Blatt
Browse files

[Sovers] Corrects printed and stored no of iterations for no convergence.

Previously if the solver did not converge the number of iterations
that was printed and stored was one higher than the actual value.
parent 033377ca
No related branches found
No related tags found
No related merge requests found
...@@ -302,6 +302,9 @@ namespace Dune { ...@@ -302,6 +302,9 @@ namespace Dune {
} }
} }
//correct i which is wrong if convergence was not achieved.
i=std::min(_maxit,i);
// print // print
if (_verbose==1) if (_verbose==1)
this->printOutput(std::cout,i,def); this->printOutput(std::cout,i,def);
...@@ -437,6 +440,9 @@ namespace Dune { ...@@ -437,6 +440,9 @@ namespace Dune {
} }
} }
//correct i which is wrong if convergence was not achieved.
i=std::min(_maxit,i);
if (_verbose==1) // printing for non verbose if (_verbose==1) // printing for non verbose
this->printOutput(std::cout,i,def); this->printOutput(std::cout,i,def);
...@@ -598,6 +604,9 @@ namespace Dune { ...@@ -598,6 +604,9 @@ namespace Dune {
rholast = rho; // remember rho for recurrence rholast = rho; // remember rho for recurrence
} }
//correct i which is wrong if convergence was not achieved.
i=std::min(_maxit,i);
if (_verbose==1) // printing for non verbose if (_verbose==1) // printing for non verbose
this->printOutput(std::cout,i,def); this->printOutput(std::cout,i,def);
...@@ -864,6 +873,9 @@ namespace Dune { ...@@ -864,6 +873,9 @@ namespace Dune {
norm_old = norm; norm_old = norm;
} // end for } // end for
//correct i which is wrong if convergence was not achieved.
it=std::min((double)_maxit,it);
if (_verbose==1) // printing for non verbose if (_verbose==1) // printing for non verbose
this->printOutput(std::cout,it,norm); this->printOutput(std::cout,it,norm);
...@@ -1110,6 +1122,9 @@ namespace Dune { ...@@ -1110,6 +1122,9 @@ namespace Dune {
} }
} }
//correct i which is wrong if convergence was not achieved.
i=std::min(_maxit,i);
if (_verbose==1) // printing for non verbose if (_verbose==1) // printing for non verbose
this->printOutput(std::cout,i,def); this->printOutput(std::cout,i,def);
...@@ -1369,6 +1384,9 @@ namespace Dune { ...@@ -1369,6 +1384,9 @@ namespace Dune {
res.converged = false; res.converged = false;
} }
//correct i which is wrong if convergence was not achieved.
j=std::min(_maxit,j);
if (_verbose > 1) // print if (_verbose > 1) // print
{ {
this->printOutput(std::cout,j,norm,norm_old); this->printOutput(std::cout,j,norm,norm_old);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment