From 9406c018c536a4acf4a103017c61deffc9a83b14 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr>
Date: Tue, 4 Jun 2019 17:02:57 +0200
Subject: [PATCH] change default value for args.max_dt to np.inf

---
 examples/example_utils.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/example_utils.py b/examples/example_utils.py
index 370f910db..553aefb07 100644
--- a/examples/example_utils.py
+++ b/examples/example_utils.py
@@ -463,10 +463,10 @@ class HysopArgParser(argparse.ArgumentParser):
                 help=('Specify timestep instead of a number of iterations '+
                         '(has priority over number of iterations).'+
                         ' This will be the initial timestep when using adaptive timestep.'))
-        simu.add_argument('-mindt', '--min-timestep', type=float, default=None, 
-                dest='min_dt',
+        simu.add_argument('-mindt', '--min-timestep', type=float, 
+                default=np.finfo(np.float64).eps, dest='min_dt',
                 help='Enforce a minimal timestep.')
-        simu.add_argument('-maxdt', '--max-timestep', type=float, default=None, 
+        simu.add_argument('-maxdt', '--max-timestep', type=float, default=np.inf, 
                 dest='max_dt',
                 help='Enforce a maximal timestep.')
         simu.add_argument('-cfl', '--cfl', type=float, default=None, 
@@ -519,7 +519,8 @@ class HysopArgParser(argparse.ArgumentParser):
             msg=('\nTimestep and number of iterations specified in the same time, '
                  + 'using timestep.')
             warnings.warn(msg, HysopArgumentWarning)
-        if ((args.min_dt is not None) and (args.max_dt is not None) and (args.min_dt > args.max_dt)):
+        if ((args.min_dt is not None) and (args.max_dt is not None) 
+                and (args.min_dt > args.max_dt)):
             msg='\nmin_dt > max_dt'
             self.error(msg)
     
-- 
GitLab