From: Peter Munch Date: Fri, 15 Mar 2024 18:04:50 +0000 (+0100) Subject: Add warnings X-Git-Tag: v9.6.0-rc1~476^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8be9cf347ad9f8fa21b9b68b3a3907bec38fe059;p=dealii.git Add warnings --- diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index aa1a9a773a..d5ce893bf0 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -2881,6 +2881,10 @@ PreconditionJacobi::initialize(const MatrixType &A, const AdditionalData ¶meters_in) { Assert(parameters_in.preconditioner == nullptr, ExcInternalError()); + Assert( + parameters_in.relaxation != 0.0, + ExcMessage( + "Relaxation cannot automatically be determined by PreconditionJacobi.")); AdditionalData parameters; parameters.relaxation = 1.0; @@ -2899,6 +2903,10 @@ PreconditionSOR::initialize(const MatrixType &A, const AdditionalData ¶meters_in) { Assert(parameters_in.preconditioner == nullptr, ExcInternalError()); + Assert( + parameters_in.relaxation != 0.0, + ExcMessage( + "Relaxation cannot automatically be determined by PreconditionSOR.")); AdditionalData parameters; parameters.relaxation = 1.0; @@ -2917,6 +2925,10 @@ PreconditionSSOR::initialize(const MatrixType &A, const AdditionalData ¶meters_in) { Assert(parameters_in.preconditioner == nullptr, ExcInternalError()); + Assert( + parameters_in.relaxation != 0.0, + ExcMessage( + "Relaxation cannot automatically be determined by PreconditionSSOR.")); AdditionalData parameters; parameters.relaxation = 1.0; @@ -2940,6 +2952,10 @@ PreconditionPSOR::initialize( const typename BaseClass::AdditionalData ¶meters_in) { Assert(parameters_in.preconditioner == nullptr, ExcInternalError()); + Assert( + parameters_in.relaxation != 0.0, + ExcMessage( + "Relaxation cannot automatically be determined by PreconditionPSOR.")); typename BaseClass::AdditionalData parameters; parameters.relaxation = 1.0;