Skip to content

Commit

Permalink
fix(Mover Package SFR connections across LGR model interfaces (mover.…
Browse files Browse the repository at this point in the history
…py::get_sfr_package_connections)): Follow-up fix to fbe1bb1; handle cases where parent model SFR reach along the LGR interface has both upstream and downstream connections to the inset model.
  • Loading branch information
aleaf committed Jan 16, 2025
1 parent 46dff18 commit cf49f06
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions mfsetup/mover.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,20 @@ def neighbors(i, j):
for parent_reach, inset_reach in parent_to_inset.items():
if parent_reach in inset_to_parent.values():
parent_to_inset_distance = parent_to_inset_distances[parent_reach]
inset_to_parent_distance = inset_to_parent_distances[inset_reach]
if inset_to_parent_distance < parent_to_inset_distance:
delete_parent_to_inset_items.add(parent_reach)
elif parent_to_inset_distance < inset_to_parent_distance:
del inset_to_parent[inset_reach]
else:
raise ValueError("Circular connection between SFR Packages in the Mover Package input.\n"
f"Connection distance between the end of parent reach {parent_reach} "
f"in parent model and start of inset reach {inset_reach} in inset model "
f"is equal to\nthe distance between the end of inset reach {inset_reach} "
f"and start of parent reach {parent_reach}.\nCheck input linework."
)
if inset_to_parent_distances.get(inset_reach) is not None:
inset_to_parent_distance = inset_to_parent_distances[inset_reach]
if inset_to_parent_distance < parent_to_inset_distance:
delete_parent_to_inset_items.add(parent_reach)
elif parent_to_inset_distance < inset_to_parent_distance:
del inset_to_parent[inset_reach]
else:
raise ValueError(
"Circular connection between SFR Packages in the Mover Package input.\n"
f"Connection distance between the end of parent reach {parent_reach} "
f"in parent model and start of inset reach {inset_reach} in inset model "
f"is equal to\nthe distance between the end of inset reach {inset_reach} "
f"and start of parent reach {parent_reach}.\nCheck input linework."
)
for parent_reach in delete_parent_to_inset_items:
del parent_to_inset[parent_reach]
return parent_to_inset, inset_to_parent
Expand Down

0 comments on commit cf49f06

Please sign in to comment.