debug auto BC without node

compare_results
Theophile Terraz 2024-09-16 11:28:46 +02:00
parent 9a7c264ee6
commit 83c03c998a
1 changed files with 4 additions and 0 deletions

View File

@ -331,6 +331,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
def generate_uniform(self): def generate_uniform(self):
if self._data.has_node: if self._data.has_node:
node = self._data.node node = self._data.node
if node is None:
return
reach = self._data.reach(self._study.river)[0] reach = self._data.reach(self._study.river)[0]
profile = reach.profiles[-1] profile = reach.profiles[-1]
incline = abs(reach.get_incline_median_mean()) incline = abs(reach.get_incline_median_mean())
@ -360,6 +362,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
def generate_critical(self): def generate_critical(self):
if self._data.has_node: if self._data.has_node:
node = self._data.node node = self._data.node
if node is None:
return
reach = self._data.reach(self._study.river)[0] reach = self._data.reach(self._study.river)[0]
profile = reach.profiles[-1] profile = reach.profiles[-1]
z_min = profile.z_min() z_min = profile.z_min()