Skip to content
Snippets Groups Projects
Commit c5854e93 authored by Patrick Jaap's avatar Patrick Jaap
Browse files

Fix: LoopSolver has to execute the criteria regardless of the verbosity mode

In the current implementation this caused different solution behavior depending
on the chosen verbosity mode. Plain stop critera
were ignored in the SOLVER::QUIET case.

This patch fixed the problem.
parent 5849f018
No related branches found
No related tags found
1 merge request!59Fix: LoopSolver has to execute the criteria regardless of the verbosity mode
...@@ -157,20 +157,28 @@ void Dune::Solvers::LoopSolver<VectorType, BitVectorType>::solve() ...@@ -157,20 +157,28 @@ void Dune::Solvers::LoopSolver<VectorType, BitVectorType>::solve()
std::cout.flags(oldFormatFlags); std::cout.flags(oldFormatFlags);
std::cout << this->iterationStep_->getOutput(); std::cout << this->iterationStep_->getOutput();
}
bool stop = false; // execute the stop criteria regardless of the verbosity
for(auto&& c: criteria_) bool stop = false;
for(auto&& c: criteria_)
{
auto r = c();
stop = stop or std::get<0>(r);
if (this->verbosity_ == NumProc::FULL)
{ {
auto r = c(); std::cout << std::get<1>(r);
stop = stop or std::get<0>(r);
std::cout << std::get<1>(r);
} }
}
if (this->verbosity_ == NumProc::FULL)
{
std::cout << std::endl; std::cout << std::endl;
if (stop)
break;
} }
if (stop)
break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment