Commit 03c3c374 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Solver, Meshing: Mage: Add some exit condition.

Showing with 8 additions and 2 deletions
+8 -2
......@@ -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:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment