]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SolverControl: make constructors explicit 13335/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 3 Feb 2022 16:02:57 +0000 (11:02 -0500)
committerTimo Heister <timo.heister@gmail.com>
Thu, 3 Feb 2022 16:02:57 +0000 (11:02 -0500)
include/deal.II/lac/solver_control.h

index 3f94de2e3d931270ce03830790346d0d369670c3..47ff834133c5e56dc9bc4b71712d2b6326e9cc84 100644 (file)
@@ -90,7 +90,6 @@ public:
    * the last step are stored in this object and can be recovered upon
    * catching an exception of this class.
    */
-
   class NoConvergence : public dealii::ExceptionBase
   {
   public:
@@ -147,10 +146,10 @@ public:
    * 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_history = false,
-                const bool         log_result  = true);
+  explicit SolverControl(const unsigned int n           = 100,
+                         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
@@ -428,11 +427,11 @@ public:
    * 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,
-                   const double       reduce      = 1.e-2,
-                   const bool         log_history = false,
-                   const bool         log_result  = true);
+  explicit ReductionControl(const unsigned int maxiter     = 100,
+                            const double       tolerance   = 1.e-10,
+                            const double       reduce      = 1.e-2,
+                            const bool         log_history = false,
+                            const bool         log_result  = true);
 
   /**
    * Initialize with a SolverControl object. The result will emulate
@@ -515,10 +514,10 @@ public:
    * Constructor.  Provide exactly the same arguments as the constructor of
    * the SolverControl class.
    */
-  IterationNumberControl(const unsigned int maxiter     = 100,
-                         const double       tolerance   = 1e-12,
-                         const bool         log_history = false,
-                         const bool         log_result  = true);
+  explicit IterationNumberControl(const unsigned int maxiter     = 100,
+                                  const double       tolerance   = 1e-12,
+                                  const bool         log_history = false,
+                                  const bool         log_result  = true);
 
   /**
    * Initialize with a SolverControl object. The result will emulate
@@ -570,11 +569,11 @@ public:
    * convergence. Other arguments have the same meaning as those of the
    * constructor of the SolverControl.
    */
-  ConsecutiveControl(const unsigned int maxiter                  = 100,
-                     const double       tolerance                = 1.e-10,
-                     const unsigned int n_consecutive_iterations = 2,
-                     const bool         log_history              = false,
-                     const bool         log_result               = false);
+  explicit ConsecutiveControl(const unsigned int maxiter   = 100,
+                              const double       tolerance = 1.e-10,
+                              const unsigned int n_consecutive_iterations = 2,
+                              const bool         log_history = false,
+                              const bool         log_result  = false);
 
   /**
    * Initialize with a SolverControl object. The result will emulate

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.