From 49f04a483e500af8b0e881c26778e0430b1bd4bd Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Tue, 29 Oct 2019 21:52:58 +0000 Subject: provide for zero index case. --- makeBoundary | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'makeBoundary') diff --git a/makeBoundary b/makeBoundary index fbb99f0..cf2ad12 100755 --- a/makeBoundary +++ b/makeBoundary @@ -294,7 +294,10 @@ ind_p = bisect.bisect(total_flow, target_flow) print('index of part-filled panel:', ind_p) # calculate target flow in part-filled panel: -panel_target_flow = target_flow - total_flow[ind_p-1] +if ind_p == 0: + panel_target_flow = target_flow +else: + panel_target_flow = target_flow - total_flow[ind_p-1] # find insertion point for target flow value: ind_q = bisect.bisect(Q_i[panel[ind_p]], panel_target_flow) -- cgit