I'm trying to write my own solver control, so I took the
IterationNumberControl as template and:
class IterationPrintControl : public SolverControl
{
public:
explicit IterationPrintControl(const unsigned int maxiter = 100,
const double tolerance = 1e-12,
const bool log_history = false,
const bool log_result = false);
et cetera with implementation:
olverControl::State
IterationPrintControl::check(const unsigned int step, const double
check_value)
{
// check whether the given number of iterations was reached, and return
// success in that case. Otherwise, go on to the check of the base class.
std::println( "At iteration={}/{},
error={}",step,this->maxsteps,check_value );
if (step >= this->maxsteps)
{
std::println( "stop iteration at {}",step );
if (m_log_result)
deallog << "Convergence step " << step << " value " << check_value
<< std::endl;
lstep = step;
lvalue = check_value;
lcheck = success;
return success;
}
else {
std::println( "base check in step {}",step );
return SolverControl::check(step, check_value);
}
}
Now strangely enough the very first println is not printed until maxits is
reached. It's like this check is not executed before the base case, but
after.
Can you shed any ligth on this?
V.
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/dealii/3b12a2e9-a0fa-4198-bb9a-c2d0eb5f40b2n%40googlegroups.com.