Changed rounding method (to ceil) used to calculate number of iterations. Now guarantees simulation will run beyond specified time window.

这个提交包含在:
craig-warren
2018-07-17 15:45:11 +01:00
父节点 a704243598
当前提交 b2c3e54c18

查看文件

@@ -187,6 +187,8 @@ def process_singlecmds(singlecmds, G):
tmp = tmp[0].lower()
# If number of iterations given
# The +/- 1 used in calculating the number of iterations is to account for
# the fact that the solver (iterations) loop runs from 0 to < G.iterations
try:
tmp = int(tmp)
G.timewindow = (tmp - 1) * G.dt
@@ -196,7 +198,7 @@ def process_singlecmds(singlecmds, G):
tmp = float(tmp)
if tmp > 0:
G.timewindow = tmp
G.iterations = round_value((tmp / G.dt)) + 1
G.iterations = int(np.ceil(tmp / G.dt)) + 1
else:
raise CmdInputError(cmd + ' must have a value greater than zero')
if G.messages: