diff options
author | Paul Garlick <pgarlick@tourbillion-technology.com> | 2019-10-29 21:52:58 +0000 |
---|---|---|
committer | Paul Garlick <pgarlick@tourbillion-technology.com> | 2019-10-29 21:52:58 +0000 |
commit | 49f04a483e500af8b0e881c26778e0430b1bd4bd (patch) | |
tree | 3ffcdee164d9a7aa3097dd259276cef04334d3b4 | |
parent | e5b8f01b57823c7acf94f3f6f1eabe43f481b02a (diff) | |
download | fullSWOF-utils-49f04a483e500af8b0e881c26778e0430b1bd4bd.tar.gz |
provide for zero index case.
-rwxr-xr-x | makeBoundary | 5 |
1 files changed, 4 insertions, 1 deletions
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) |