<h3>Specific improvements</h3>
<ol>
+ <li>
+ dealii::SolverControl::NoConvergence now inherits dealii::ExceptionBase and
+ is thrown via AssertThrow(false, ... ).
+ <br>
+ (Matthias Maier, 2013/10/20)
+ </li>
+
<li>
New: parallel::distributed::BlockVector has now methods update_ghost_values,
compress, set_out_ghosts, and has_ghost_elements that do the respective
}
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (control.last_step(),
- control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (control.last_step(),
+ control.last_value()));
// otherwise exit as normal
}
}
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
// in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
// Deallocate Memory
cleanup();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
public:
/**
- * Enum denoting the different
- * states a solver can be in. See
- * the general documentation of
- * this class for more
- * information.
+ * Enum denoting the different states a solver can be in. See the general
+ * documentation of this class for more information.
*/
enum State
{
failure
};
+
+
/**
- * Class to be thrown upon
- * failing convergence of an
- * iterative solver, when either
- * the number of iterations
- * exceeds the limit or the
- * residual fails to reach the
- * desired limit, e.g. in the
- * case of a break-down.
+ * Class to be thrown upon failing convergence of an iterative solver,
+ * when either the number of iterations exceeds the limit or the residual
+ * fails to reach the desired limit, e.g. in the case of a break-down.
*
- * The residual in the last
- * iteration, as well as the
- * iteration number of the last
- * step are stored in this object
- * and can be recovered upon
- * catching an exception of this
- * class.
+ * The residual in the last iteration, as well as the iteration number of
+ * the last step are stored in this object and can be recovered upon
+ * catching an exception of this class.
*/
- class NoConvergence : public std::exception
+
+ class NoConvergence : public dealii::ExceptionBase
{
public:
- /**
- * Constructor.
- */
NoConvergence (const unsigned int last_step,
- const double last_residual);
+ const double last_residual)
+ : last_step (last_step), last_residual(last_residual)
+ {}
- /**
- * Standardized output for
- * catch handlers.
- */
- virtual const char *what () const throw ();
+ virtual ~NoConvergence () throw () {}
+
+ virtual void print_info (std::ostream &out) const
+ {
+ out << "Iterative method reported convergence failure in step "
+ << last_step << " with residual " << last_residual << std::endl;
+ }
/**
- * Iteration number of the
- * last step.
+ * Iteration number of the last step.
*/
const unsigned int last_step;
};
+
/**
- * Constructor. The parameters
- * @p n and @p tol are the
- * maximum number of iteration
- * steps before failure and the
- * tolerance to determine success
+ * Constructor. The parameters @p n and @p tol are the maximum number of
+ * iteration steps before failure and the tolerance to determine success
* of the iteration.
*
- * @p log_history specifies
- * whether the history (i.e. the
- * value to be checked and the
- * number of the iteration step)
- * shall be printed to
- * @p deallog stream. Default
- * is: do not print. Similarly,
- * @p log_result specifies the
- * whether the final result is
- * logged to @p deallog. Default
- * is yes.
+ * @p log_history specifies whether the history (i.e. the value to be
+ * checked and the number of the iteration step) shall be printed to @p
+ * deallog stream. Default is: do not print. Similarly, @p log_result
+ * specifies the whether the final result is logged to @p deallog.
+ * Default is yes.
*/
SolverControl (const unsigned int n = 100,
const double tol = 1.e-10,
const bool log_result = true);
/**
- * Virtual destructor is needed
- * as there are virtual functions
- * in this class.
+ * Virtual destructor is needed as there are virtual functions in this
+ * class.
*/
virtual ~SolverControl();
void parse_parameters (ParameterHandler ¶m);
/**
- * Decide about success or failure
- * of an iteration. This function
- * gets the current iteration step
- * to determine, whether the
- * allowed number of steps has
- * been exceeded and returns
- * @p failure in this case. If
- * @p check_value is below the
- * prescribed tolerance, it
- * returns @p success. In all
- * other cases @p iterate is
- * returned to suggest
- * continuation of the iterative
- * procedure.
+ * Decide about success or failure of an iteration. This function gets
+ * the current iteration step to determine, whether the allowed number of
+ * steps has been exceeded and returns @p failure in this case. If @p
+ * check_value is below the prescribed tolerance, it returns @p success.
+ * In all other cases @p iterate is returned to suggest continuation of
+ * the iterative procedure.
*
- * The iteration is also aborted
- * if the residual becomes a
- * denormalized value
- * (@p NaN). Note, however, that
- * this check is only performed
- * if the @p isnan function is
- * provided by the operating
- * system, which is not always
- * true. The @p configure
- * scripts checks for this and
- * sets the flag @p HAVE_ISNAN
- * in the file
- * <tt>Make.global_options</tt> if
- * this function was found.
+ * The iteration is also aborted if the residual becomes a denormalized
+ * value (@p NaN). Note, however, that this check is only performed if
+ * the @p isnan function is provided by the operating system, which is
+ * not always true. The @p configure scripts checks for this and sets the
+ * flag @p HAVE_ISNAN in the file <tt>Make.global_options</tt> if this
+ * function was found.
*
- * <tt>check()</tt> additionally
- * preserves @p step and
- * @p check_value. These
- * values are accessible by
- * <tt>last_value()</tt> and
+ * <tt>check()</tt> additionally preserves @p step and @p check_value.
+ * These values are accessible by <tt>last_value()</tt> and
* <tt>last_step()</tt>.
*
- * Derived classes may overload
- * this function, e.g. to log the
- * convergence indicators
- * (@p check_value) or to do
- * other computations.
+ * Derived classes may overload this function, e.g. to log the
+ * convergence indicators (@p check_value) or to do other computations.
*/
virtual State check (const unsigned int step,
const double check_value);
State last_check() const;
/**
- * Return the initial convergence
- * criterion.
+ * Return the initial convergence criterion.
*/
double initial_value() const;
/**
- * Return the convergence value of last
- * iteration step for which @p check was
- * called by the solver.
+ * Return the convergence value of last iteration step for which @p check
+ * was called by the solver.
*/
double last_value() const;
unsigned int set_max_steps (const unsigned int);
/**
- * Enables the failure
- * check. Solving is stopped with
- * @p ReturnState @p failure if
- * <tt>residual>failure_residual</tt> with
+ * Enables the failure check. Solving is stopped with @p ReturnState @p
+ * failure if <tt>residual>failure_residual</tt> with
* <tt>failure_residual:=rel_failure_residual*first_residual</tt>.
*/
void set_failure_criterion (const double rel_failure_residual);
/**
- * Disables failure check and
- * resets
- * @p relative_failure_residual
- * and @p failure_residual to
- * zero.
+ * Disables failure check and resets @p relative_failure_residual and @p
+ * failure_residual to zero.
*/
void clear_failure_criterion ();
double set_tolerance (const double);
/**
- * Enables writing residuals of
- * each step into a vector for
- * later analysis.
+ * Enables writing residuals of each step into a vector for later
+ * analysis.
*/
void enable_history_data();
/**
- * Average error reduction over
- * all steps.
+ * Average error reduction over all steps.
*
- * Requires
- * enable_history_data()
+ * Requires enable_history_data()
*/
double average_reduction() const;
/**
- * Error reduction of the last
- * step; for stationary
- * iterations, this approximates
- * the norm of the iteration
- * matrix.
+ * Error reduction of the last step; for stationary iterations, this
+ * approximates the norm of the iteration matrix.
*
- * Requires
- * enable_history_data()
+ * Requires enable_history_data()
*/
double final_reduction() const;
/**
- * Error reduction of any
- * iteration step.
+ * Error reduction of any iteration step.
*
- * Requires
- * enable_history_data()
+ * Requires enable_history_data()
*/
double step_reduction(unsigned int step) const;
/**
- * Log each iteration step. Use
- * @p log_frequency for skipping
- * steps.
+ * Log each iteration step. Use @p log_frequency for skipping steps.
*/
void log_history (const bool);
bool log_result () const;
/**
- * This exception is thrown if a
- * function operating on the
- * vector of history data of a
- * SolverControl object id
- * called, but storage of history
- * data was not enabled by
- * enable_history_data().
+ * This exception is thrown if a function operating on the vector of
+ * history data of a SolverControl object id called, but storage of
+ * history data was not enabled by enable_history_data().
*/
DeclException0(ExcHistoryDataRequired);
unsigned int lstep;
/**
- * Is set to @p true by
- * @p set_failure_criterion and
- * enables failure checking.
+ * Is set to @p true by @p set_failure_criterion and enables failure
+ * checking.
*/
bool check_failure;
/**
- * Stores the
- * @p rel_failure_residual set by
- * @p set_failure_criterion
+ * Stores the @p rel_failure_residual set by @p set_failure_criterion
*/
double relative_failure_residual;
/**
- * @p failure_residual equals the
- * first residual multiplied by
- * @p relative_crit set by
- * @p set_failure_criterion (see there).
+ * @p failure_residual equals the first residual multiplied by @p
+ * relative_crit set by @p set_failure_criterion (see there).
*
- * Until the first residual is
- * known it is 0.
+ * Until the first residual is known it is 0.
*/
double failure_residual;
/**
- * Log convergence history to
- * @p deallog.
+ * Log convergence history to @p deallog.
*/
bool m_log_history;
unsigned int m_log_frequency;
/**
- * Log iteration result to
- * @p deallog. If true, after
- * finishing the iteration, a
- * statement about failure or
- * success together with @p lstep
+ * Log iteration result to @p deallog. If true, after finishing the
+ * iteration, a statement about failure or success together with @p lstep
* and @p lvalue are logged.
*/
bool m_log_result;
/**
- * Control over the storage of
- * history data. Set by
+ * Control over the storage of history data. Set by
* enable_history_data().
*/
bool history_data_enabled;
/**
- * Vector storing the result
- * after each iteration step for
- * later statistical analysis.
+ * Vector storing the result after each iteration step for later
+ * statistical analysis.
*
- * Use of this vector is enabled
- * by enable_history_data().
+ * Use of this vector is enabled by enable_history_data().
*/
std::vector<double> history_data;
};
{
public:
/**
- * Constructor. Provide the
- * reduction factor in addition
- * to arguments that have the
- * same meaning as those of the
- * constructor of the
+ * Constructor. Provide the 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 bool log_result = true);
/**
- * Initialize with a
- * SolverControl object. The
- * result will emulate
- * SolverControl by setting
- * #reduce to zero.
+ * Initialize with a SolverControl object. The result will emulate
+ * SolverControl by setting #reduce to zero.
*/
ReductionControl (const SolverControl &c);
/**
- * Assign a SolverControl object
- * to ReductionControl. The
- * result of the assignment will
- * emulate SolverControl by
- * setting #reduce to zero.
+ * Assign a SolverControl object to ReductionControl. The result of the
+ * assignment will emulate SolverControl by setting #reduce to zero.
*/
ReductionControl &operator= (const SolverControl &c);
/**
- * Virtual destructor is needed
- * as there are virtual functions
- * in this class.
+ * Virtual destructor is needed as there are virtual functions in this
+ * class.
*/
virtual ~ReductionControl();
void parse_parameters (ParameterHandler ¶m);
/**
- * Decide about success or failure
- * of an iteration. This function
- * calls the one in the base
- * class, but sets the tolerance
- * to <tt>reduction * initial value</tt>
- * upon the first iteration.
+ * Decide about success or failure of an iteration. This function calls
+ * the one in the base class, but sets the tolerance to <tt>reduction *
+ * initial value</tt> upon the first iteration.
*/
virtual State check (const unsigned int step,
const double check_value);
double reduce;
/**
- * Reduced tolerance. Stop iterations
- * if either this value is achieved
- * or if the base class indicates
- * success.
+ * Reduced tolerance. Stop iterations if either this value is achieved or
+ * if the base class indicates success.
*/
double reduced_tol;
};
deallog.pop();
// in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
deallog.pop();
// in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
}
#endif // DOXYGEN
// Output
deallog.pop ();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
// Output
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
}
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (control.last_step(),
+ control.last_value()));
// otherwise exit as normal
}
this->memory.free(Vd);
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
this->memory.free(Vr);
this->memory.free(Vd);
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
// in case of failure: throw
// exception
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
// otherwise exit as normal
}
* throw exception
*/
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ {
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
+ }
else
{
/**
// and in case of failure: throw exception
if (solver_control.last_check () != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step (),
- solver_control.last_value ());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
}
/*----------------------- SolverControl ---------------------------------*/
-SolverControl::NoConvergence::NoConvergence (const unsigned int last_step,
- const double last_residual)
- :
- last_step (last_step),
- last_residual (last_residual)
-{}
-
-
-const char *
-SolverControl::NoConvergence::what () const throw ()
-{
- // have a place where to store the
- // description of the exception as a char *
- //
- // this thing obviously is not multi-threading
- // safe, but we don't care about that for now
- //
- // we need to make this object static, since
- // we want to return the data stored in it
- // and therefore need a lifetime which is
- // longer than the execution time of this
- // function
- static std::string description;
- // convert the messages printed by the
- // exceptions into a std::string
- std::ostringstream out;
- out << "Iterative method reported convergence failure in step "
- << last_step << " with residual " << last_residual;
-
- description = out.str();
- return description.c_str();
-}
-
-
-
SolverControl::SolverControl (const unsigned int maxiter,
const double tolerance,
const bool m_log_history,
solver_control.check (solver.NumIters(), solver.TrueResidual());
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
solver_control.check (0, 0);
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
solver_control.check (0, 0);
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
{
solver.solve(A,u,f,P);
}
- catch (std::exception &e)
+ catch (dealii::SolverControl::NoConvergence &e)
{
- deallog << e.what() << std::endl;
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
}
{
solver.Tsolve(A,u,f,P);
}
- catch (std::exception &e)
+ catch (dealii::SolverControl::NoConvergence &e)
{
- deallog << e.what() << std::endl;
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
}
DEAL:sor:Richardson::Convergence step 7 value 0.0004339
DEAL:sor:cg::Starting value 3.000
DEAL:sor:cg::Failure step 100 value 0.2585
-DEAL:sor::Iterative method reported convergence failure in step 100 with residual 0.258509
+DEAL:sor::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:sor:Bicgstab::Starting value 3.000
DEAL:sor:Bicgstab::Convergence step 5 value 0
DEAL:sor:GMRES::Starting value 1.462
DEAL:psor:Richardson::Convergence step 8 value 0.0004237
DEAL:psor:cg::Starting value 3.000
DEAL:psor:cg::Failure step 100 value 0.1024
-DEAL:psor::Iterative method reported convergence failure in step 100 with residual 0.102391
+DEAL:psor::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:psor:Bicgstab::Starting value 3.000
DEAL:psor:Bicgstab::Convergence step 4 value 0.0007969
DEAL:psor:GMRES::Starting value 1.467
DEAL::SOR-diff:0
DEAL:no-fail:cg::Starting value 11.00
DEAL:no-fail:cg::Failure step 10 value 0.1496
-DEAL:no-fail::Iterative method reported convergence failure in step 10 with residual 0.149566
+DEAL:no-fail::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no-fail:Bicgstab::Starting value 11.00
DEAL:no-fail:Bicgstab::Failure step 10 value 0.002830
DEAL:no-fail:Bicgstab::Failure step 10 value 0.001961
-DEAL:no-fail::Iterative method reported convergence failure in step 10 with residual 0.00196051
+DEAL:no-fail::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no-fail:GMRES::Starting value 11.00
DEAL:no-fail:GMRES::Failure step 10 value 0.8414
-DEAL:no-fail::Iterative method reported convergence failure in step 10 with residual 0.841354
+DEAL:no-fail::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no-fail:GMRES::Starting value 11.00
DEAL:no-fail:GMRES::Failure step 10 value 0.8414
-DEAL:no-fail::Iterative method reported convergence failure in step 10 with residual 0.841354
+DEAL:no-fail::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no-fail:QMRS::Starting value 11.00
DEAL:no-fail:QMRS::Failure step 10 value 0.4215
-DEAL:no-fail::Iterative method reported convergence failure in step 10 with residual 0.421504
+DEAL:no-fail::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no:Richardson::Starting value 11.00
DEAL:no:Richardson::Failure step 100 value 0.3002
-DEAL:no::Iterative method reported convergence failure in step 100 with residual 0.300171
+DEAL:no::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no:cg::Starting value 11.00
DEAL:no:cg::Convergence step 15 value 0.0005794
DEAL:no:Bicgstab::Starting value 11.00
DEAL:no:QMRS::Convergence step 16 value 0.0002583
DEAL:rich:Richardson::Starting value 11.00
DEAL:rich:Richardson::Failure step 100 value 1.219
-DEAL:rich::Iterative method reported convergence failure in step 100 with residual 1.2187
+DEAL:rich::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:rich:cg::Starting value 11.00
DEAL:rich:cg::Convergence step 15 value 0.0005794
DEAL:rich:Bicgstab::Starting value 11.00
DEAL:sor:Richardson::Convergence step 88 value 0.0009636
DEAL:sor:cg::Starting value 11.00
DEAL:sor:cg::Failure step 100 value 5.643
-DEAL:sor::Iterative method reported convergence failure in step 100 with residual 5.64329
+DEAL:sor::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:sor:Bicgstab::Starting value 11.00
DEAL:sor:Bicgstab::Convergence step 14 value 0.0009987
DEAL:sor:GMRES::Starting value 7.322
DEAL:psor:Richardson::Convergence step 89 value 0.0009736
DEAL:psor:cg::Starting value 11.00
DEAL:psor:cg::Failure step 100 value 2.935
-DEAL:psor::Iterative method reported convergence failure in step 100 with residual 2.93488
+DEAL:psor::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:psor:Bicgstab::Starting value 11.00
DEAL:psor:Bicgstab::Convergence step 11 value 0.0005151
DEAL:psor:GMRES::Starting value 7.345
{
solver.solve(A,u,f,P);
}
- catch (std::exception &e)
+ catch (dealii::SolverControl::NoConvergence &e)
{
- deallog << e.what() << std::endl;
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
}
{
solver.Tsolve(A,u,f,P);
}
- catch (std::exception &e)
+ catch (dealii::SolverControl::NoConvergence &e)
{
- deallog << e.what() << std::endl;
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
}
DEAL:no-fail:cg::Condition number estimate: 54.75
DEAL:no-fail:cg::Failure step 10 value 0.1496
DEAL:no-fail:cg:: 0.1363 0.6565 1.499 2.357 3.131 3.994 5.392 6.576 7.464
-DEAL:no-fail::Iterative method reported convergence failure in step 10 with residual 0.149566
+DEAL:no-fail::Exception: SolverControl::NoConvergence (this->control().last_step(), this->control().last_value())
DEAL:no:cg::Starting value 11.00
DEAL:no:cg::Condition number estimate: 11.01
DEAL:no:cg::Condition number estimate: 21.10
{
solver.solve(A,u,f,P);
}
- catch (std::exception &e)
+ catch (dealii::SolverControl::NoConvergence &e)
{
- deallog << e.what() << std::endl;
- // it needs to be expected for the
- // richardson solver that we end up
- // here, so don't abort
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
deallog << "Solver stopped after " << solver.control().last_step()
DEAL::Solver type: N6dealii13PETScWrappers16SolverRichardsonE
DEAL::Starting value 7.750
DEAL::Failure step 100 value 4.004
-DEAL::Iterative method reported convergence failure in step 100 with residual 4.00437
+DEAL::Exception: SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
DEAL::Solver stopped after 100 iterations
}
catch (dealii::SolverControl::NoConvergence &e)
{
- // just like for Richardson: expect to
- // get here, don't abort the program
- deallog << "Catched exception dealii::SolverControl::NoConvergence" << std::endl;
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
deallog << "Solver stopped after " << solver.control().last_step()
DEAL::Solver type: N6dealii13PETScWrappers15SolverChebychevE
DEAL::Starting value 7.551
DEAL::Failure step 100 value 2.937
-DEAL::Catched exception dealii::SolverControl::NoConvergence
+DEAL::Exception: SolverControl::NoConvergence (solver_control.last_step(), solver_control.last_value())
DEAL::Solver stopped after 100 iterations