From 05717467f746f70818c85ad092eaa84176cadb79 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Thu, 15 Aug 2019 14:29:27 +0200
Subject: [PATCH] [NL] TimeDiscr; Initialize double members with NaN

---
 NumLib/ODESolver/TimeDiscretization.h | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/NumLib/ODESolver/TimeDiscretization.h b/NumLib/ODESolver/TimeDiscretization.h
index 32303aeb5b7..8bf113f9281 100644
--- a/NumLib/ODESolver/TimeDiscretization.h
+++ b/NumLib/ODESolver/TimeDiscretization.h
@@ -297,8 +297,9 @@ public:
     }
 
 private:
-    double _t;        //!< \f$ t_C \f$
-    double _delta_t;  //!< the timestep size
+    double _t = std::numeric_limits<double>::quiet_NaN();  //!< \f$ t_C \f$
+    double _delta_t =
+        std::numeric_limits<double>::quiet_NaN();  //!< the timestep size
     GlobalVector& _x_old;   //!< the solution from the preceding timestep
 };
 
@@ -369,9 +370,12 @@ public:
     //! Returns the solution from the preceding timestep.
     GlobalVector const& getXOld() const { return _x_old; }
 private:
-    double _t;        //!< \f$ t_C \f$
-    double _t_old;    //!< the time of the preceding timestep
-    double _delta_t;  //!< the timestep size
+    double _t = std::numeric_limits<double>::quiet_NaN();  //!< \f$ t_C \f$
+    double _t_old =
+        std::numeric_limits<double>::quiet_NaN();  //!< the time of the
+                                                   //!< preceding timestep
+    double _delta_t =
+        std::numeric_limits<double>::quiet_NaN();  //!< the timestep size
     GlobalVector& _x_old;   //!< the solution from the preceding timestep
 };
 
@@ -443,8 +447,9 @@ public:
     GlobalVector const& getXOld() const { return _x_old; }
 private:
     const double _theta;  //!< the implicitness parameter \f$ \theta \f$
-    double _t;            //!< \f$ t_C \f$
-    double _delta_t;      //!< the timestep size
+    double _t = std::numeric_limits<double>::quiet_NaN();  //!< \f$ t_C \f$
+    double _delta_t =
+        std::numeric_limits<double>::quiet_NaN();  //!< the timestep size
     GlobalVector& _x_old;       //!< the solution from the preceding timestep
 };
 
@@ -512,8 +517,9 @@ public:
 private:
     std::size_t eff_num_steps() const { return _xs_old.size(); }
     const unsigned _num_steps;  //!< The order of the BDF method
-    double _t;                  //!< \f$ t_C \f$
-    double _delta_t;            //!< the timestep size
+    double _t = std::numeric_limits<double>::quiet_NaN();  //!< \f$ t_C \f$
+    double _delta_t =
+        std::numeric_limits<double>::quiet_NaN();  //!< the timestep size
 
     std::vector<GlobalVector*> _xs_old;  //!< solutions from the preceding timesteps
     unsigned _offset = 0;  //!< allows treating \c _xs_old as circular buffer
-- 
GitLab