* logged to @p{deallog}. Default
* is yes.
*/
- SolverControl (const unsigned int n = 100,
- const double tol = 1.e-10,
- const bool log_history = false,
- const bool log_result = true);
+ SolverControl (const unsigned int n = 100,
+ const double tol = 1.e-10,
+ const bool log_history = false,
+ const bool log_result = true);
/**
* Virtual destructor is needed
* other computations.
*/
virtual State check (const unsigned int step,
- const double check_value);
+ const double check_value);
/**
* Return the result of the last check operation.
/**
* Result of last check operation.
*/
- State lcheck;
+ State lcheck;
/**
* Last value of the convergence criterion.
*/
- double lvalue;
+ double lvalue;
/**
* Last step.
*/
- unsigned int lstep;
+ unsigned int lstep;
/**
* Is set to @p{true} by
* @p{set_failure_criterion} and
* enables failure checking.
*/
- bool check_failure;
+ bool check_failure;
/*
* Stores the
* Log convergence history to
* @p{deallog}.
*/
-//TODO:[GK] leading underscores are prohibited by the C++ standard in user code. what is the reason here anyway?
- bool _log_history;
+ bool m_log_history;
/**
* Log only every nth step.
*/
-//TODO:[GK] leading underscores are prohibited by the C++ standard in user code. what is the reason here anyway?
- unsigned int _log_frequency;
+ unsigned int m_log_frequency;
/**
* Log iteration result to
* success together with @p{lstep}
* and @p{lvalue} are logged.
*/
-//TODO:[GK] leading underscores are prohibited by the C++ standard in user code. what is the reason here anyway?
- bool _log_result;
+ bool m_log_result;
};
* constructor.
*/
ReductionControl (const unsigned int maxiter = 100,
- const double tolerance = 1.e-10,
- const double reduce = 1.e-2,
- const bool log_history = false,
- const bool log_result = true);
+ const double tolerance = 1.e-10,
+ const double reduce = 1.e-2,
+ const bool log_history = false,
+ const bool log_result = true);
/**
* Virtual destructor is needed
* upon the first iteration.
*/
virtual State check (const unsigned int step,
- const double check_value);
+ const double check_value);
/**
* Return the initial convergence
*/
double set_reduction (const double);
-protected:
+ protected:
/**
* Desired reduction factor.
*/
}
+
inline unsigned int
SolverControl::set_max_steps (const unsigned int newval)
{
}
+
inline void
SolverControl::set_failure_criterion (const double rel_failure_residual)
{
}
+
inline void
SolverControl::clear_failure_criterion ()
{
}
+
inline double
SolverControl::tolerance () const
{
}
+
inline double
SolverControl::set_tolerance (const double t)
{
inline void
SolverControl::log_history (const bool newval)
{
- _log_history = newval;
+ m_log_history = newval;
}
+
inline bool
SolverControl::log_history () const
{
- return _log_history;
+ return m_log_history;
}
inline void
SolverControl::log_result (const bool newval)
{
- _log_result = newval;
+ m_log_result = newval;
}
+
inline double
ReductionControl::reduction () const
{
}
+
inline double
ReductionControl::set_reduction (const double t)
{
SolverControl::SolverControl (const unsigned int maxiter,
const double tolerance,
- const bool _log_history,
- const bool _log_result)
+ const bool m_log_history,
+ const bool m_log_result)
:
maxsteps(maxiter),
tol(tolerance),
check_failure(false),
relative_failure_residual(0),
failure_residual(0),
- _log_history(_log_history),
- _log_frequency(1),
- _log_result(_log_result)
+ m_log_history(m_log_history),
+ m_log_frequency(1),
+ m_log_result(m_log_result)
{};
SolverControl::check (const unsigned int step,
const double check_value)
{
- if (_log_history && ((step % _log_frequency) == 0))
+ if (m_log_history && ((step % m_log_frequency) == 0))
deallog << "Check " << step << "\t" << check_value << std::endl;
lstep = step;
if (check_failure)
failure_residual=relative_failure_residual*check_value;
- if (_log_result)
+ if (m_log_result)
deallog << "Starting value " << check_value << std::endl;
}
(check_failure && (check_value > failure_residual))
)
{
- if (_log_result)
+ if (m_log_result)
deallog << "Failure step " << step
<< " value " << check_value << std::endl;
lcheck = failure;
if (check_value <= tol)
{
- if (_log_result)
+ if (m_log_result)
deallog << "Convergence step " << step
<< " value " << check_value << std::endl;
lcheck = success;
{
if (f==0)
f = 1;
- unsigned int old = _log_frequency;
- _log_frequency = f;
+ unsigned int old = m_log_frequency;
+ m_log_frequency = f;
return old;
}
ReductionControl::ReductionControl(const unsigned int n,
const double tol,
const double red,
- const bool _log_history,
- const bool _log_result)
+ const bool m_log_history,
+ const bool m_log_result)
:
- SolverControl (n, tol, _log_history, _log_result),
+ SolverControl (n, tol, m_log_history, m_log_result),
reduce(red)
{};
// residual already was zero
if (check_value <= reduced_tol)
{
- if (_log_result)
+ if (m_log_result)
deallog << "Convergence step " << step
<< " value " << check_value << std::endl;
lcheck = success;