From: guido Date: Wed, 5 Jul 2000 21:50:45 +0000 (+0000) Subject: NaN is always a failure X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d109dcf07d9c286eee4e5b2a17c6db6f0753b0ab;p=dealii-svn.git NaN is always a failure git-svn-id: https://svn.dealii.org/trunk@3138 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/solver_control.h b/deal.II/lac/include/lac/solver_control.h index afb9a12a45..df2c4b784b 100644 --- a/deal.II/lac/include/lac/solver_control.h +++ b/deal.II/lac/include/lac/solver_control.h @@ -123,6 +123,21 @@ class SolverControl : public Subscriptor * 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 + * @p{Make.global_options} if + * this function was found. + * * @p{check()} additionally * preserves @p{step} and * @p{check_value}. These @@ -167,23 +182,6 @@ class SolverControl : public Subscriptor * @p{ReturnState} @p{failure} if * @p{residual>failure_residual} with * @p{failure_residual:=rel_failure_residual*first_residual}. - * - * If a failure criterion was set - * using this method, then 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 - * the case. The @p{configure} - * scripts checks for this and - * sets the flag @p{HAVE_ISNAN} - * in the file - * @p{Make.global_options} is - * this function was found. */ void set_failure_criterion (const double rel_failure_residual); diff --git a/deal.II/lac/source/solver_control.cc b/deal.II/lac/source/solver_control.cc index 60bc3787d5..faeb234e67 100644 --- a/deal.II/lac/source/solver_control.cc +++ b/deal.II/lac/source/solver_control.cc @@ -66,11 +66,11 @@ SolverControl::check (const unsigned int step, if ((step >= maxsteps) || - (check_failure && ((check_value > failure_residual) #ifdef HAVE_ISNAN - || isnan(check_value) + isnan(check_value) || #endif - ))) + (check_failure && (check_value > failure_residual)) + ) { if (_log_result) deallog << "Failure step " << step