diff --git a/examples/example_utils.py b/examples/example_utils.py index 370f910db10b931b73c25b0522ca15d5c20622a3..553aefb07f85d58df461fe41a7ed2b4c1484638b 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)