]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add warnings
authorPeter Munch <peterrmuench@gmail.com>
Fri, 15 Mar 2024 18:04:50 +0000 (19:04 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 15 Mar 2024 18:04:50 +0000 (19:04 +0100)
include/deal.II/lac/precondition.h

index aa1a9a773a45cc038abdca8753e1172a5d1e3913..d5ce893bf00ed15ebf6215ef19b5fd6685cefb9c 100644 (file)
@@ -2881,6 +2881,10 @@ PreconditionJacobi<MatrixType>::initialize(const MatrixType     &A,
                                            const AdditionalData &parameters_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<MatrixType>::initialize(const MatrixType     &A,
                                         const AdditionalData &parameters_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<MatrixType>::initialize(const MatrixType     &A,
                                          const AdditionalData &parameters_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<MatrixType>::initialize(
   const typename BaseClass::AdditionalData &parameters_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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.