mirror of https://gitlab.com/pamhyr/pamhyr2
Solver, Meshing: Mage: Add some exit condition.
parent
19ad9c4d1a
commit
03c3c37435
|
|
@ -182,6 +182,9 @@ class MeshingWithMage(AMeshingTool):
|
|||
###########
|
||||
|
||||
def meshing(self, reach, step: float = 50):
|
||||
if reach is None or len(reach.profiles) == 0:
|
||||
return reach
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
st_file = self.export_reach_to_st(reach, tmp)
|
||||
m_file = st_file.rsplit(".ST", 1)[0] + ".M"
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ class Mage(CommandLineSolver):
|
|||
def _export_BC(self, t, bounds, repertory, qlog, name="0"):
|
||||
files = []
|
||||
|
||||
if len(bounds) == 0:
|
||||
if len(bounds) == 0 or bounds.node is None:
|
||||
return files
|
||||
|
||||
if qlog is not None:
|
||||
|
|
@ -351,6 +351,9 @@ class Mage(CommandLineSolver):
|
|||
frictions = edge.frictions
|
||||
|
||||
for friction in frictions.frictions:
|
||||
if friction.begin_strickler is None:
|
||||
continue
|
||||
|
||||
num = f"{id:>3}"
|
||||
bkp = f"{friction.begin_kp:>10.3f}"
|
||||
ekp = f"{friction.end_kp:>10.3f}"
|
||||
|
|
@ -416,7 +419,7 @@ class Mage(CommandLineSolver):
|
|||
files = []
|
||||
|
||||
reservoirs = study.river.reservoir.lst
|
||||
if len(reservoirs) == 0:
|
||||
if len(reservoirs) == 0 or reservoirs.node is None:
|
||||
return files
|
||||
|
||||
if qlog is not None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue