timprove readTime function - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 452b1fc5599e039d19dc96986a4c97cc79016887
(DIR) parent 3f5dbc246a357c9339173ebd483f807b2e27b1eb
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Fri, 27 Feb 2015 12:20:15 +0100
improve readTime function
Diffstat:
M python/sphere.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -2197,14 +2197,14 @@ class sim:
t_last = self.currentTime()
n_last = self.time_step_count[0]
- if time < t_first | time > t_last:
+ if time < t_first or time > t_last:
raise Exception('Error: The specified time {} s is outside the ' +
'range of output files [{}; {}] s.'.format(time, \
t_first, t_last))
dt_dn = (t_last - t_first)/(n_last - n_first)
- step = int((time - t_first)/dt_dn) + n_first
- sim.readstep(step, verbose=verbose)
+ step = int((time - t_first)/dt_dn) + n_first + 1
+ self.readstep(step, verbose=verbose)
def generateRadii(self, psd = 'logn',
mean = 440e-6,