//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2012 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* <li> <tt>iterate = 0</tt>: continue the iteration.
* <li> @p success: the goal is reached, the iterative method can terminate
* successfully.
- * <li> @p failure: the iterative method should stop because convergence
+ * <li> @p failure: the iterative method should stop because convergence
* could not be achieved or at least was not achieved within the given
* maximal number of iterations.
* </ul>
* catching an exception of this
* class.
*/
- class NoConvergence : public std::exception
+ class NoConvergence : public std::exception
{
public:
/**
*/
const double last_residual;
};
-
-
+
+
/**
* Constructor. The parameters
* @p n and @p tol are the
const double tol = 1.e-10,
const bool log_history = false,
const bool log_result = true);
-
+
/**
* Virtual destructor is needed
* as there are virtual functions
* in this class.
*/
virtual ~SolverControl();
-
+
/**
* Interface to parameter file.
*/
* Return the result of the last check operation.
*/
State last_check() const;
-
+
/**
* Return the initial convergence
* criterion.
* called by the solver.
*/
double last_value() const;
-
+
/**
* Number of last iteration step.
*/
* Maximum number of steps.
*/
unsigned int max_steps () const;
-
+
/**
* Change maximum number of steps.
*/
* zero.
*/
void clear_failure_criterion ();
-
+
/**
* Tolerance.
*/
* enable_history_data()
*/
double final_reduction() const;
-
+
/**
* Error reduction of any
* iteration step.
* enable_history_data()
*/
double step_reduction(unsigned int step) const;
-
+
/**
* Log each iteration step. Use
* @p log_frequency for skipping
* Returns the @p log_history flag.
*/
bool log_history () const;
-
+
/**
* Set logging frequency.
*/
* Log start and end step.
*/
void log_result (const bool);
-
+
/**
* Returns the @p log_result flag.
*/
* enable_history_data().
*/
DeclException0(ExcHistoryDataRequired);
-
+
protected:
/**
* Maximum number of steps.
*/
unsigned int maxsteps;
-
+
/**
* Prescribed tolerance to be achieved.
*/
* Result of last check operation.
*/
State lcheck;
-
+
/**
* Initial value.
*/
double initial_val;
-
+
/**
* Last value of the convergence criterion.
*/
double lvalue;
-
+
/**
* Last step.
*/
* @p set_failure_criterion
*/
double relative_failure_residual;
-
+
/**
* @p failure_residual equals the
* first residual multiplied by
* known it is 0.
*/
double failure_residual;
-
+
/**
* Log convergence history to
* @p deallog.
* Log only every nth step.
*/
unsigned int m_log_frequency;
-
+
/**
* Log iteration result to
* @p deallog. If true, after
* enable_history_data().
*/
bool history_data_enabled;
-
+
/**
* Vector storing the result
* after each iteration step for
public:
/**
* Constructor. Provide the
- * reduction factor additional to
- * the arguments of the Control
- * constructor.
+ * reduction factor in addition
+ * to arguments that have the
+ * same meaning as those of the
+ * constructor of the
+ * SolverControl constructor.
*/
ReductionControl (const unsigned int maxiter = 100,
const double tolerance = 1.e-10,
* SolverControl by setting
* #reduce to zero.
*/
- ReductionControl(const SolverControl& c);
-
+ ReductionControl (const SolverControl& c);
+
/**
* Assign a SolverControl object
* to ReductionControl. The
* setting #reduce to zero.
*/
ReductionControl& operator= (const SolverControl& c);
-
+
/**
* Virtual destructor is needed
* as there are virtual functions
* in this class.
*/
virtual ~ReductionControl();
-
+
/**
* Interface to parameter file.
*/
* Read parameters from file.
*/
void parse_parameters (ParameterHandler& param);
-
+
/**
* Decide about success or failure
* of an iteration. This function
* Desired reduction factor.
*/
double reduce;
-
+
/**
* Reduced tolerance. Stop iterations
* if either this value is achieved