diff --git a/src/Solver/RubarBE.py b/src/Solver/RubarBE.py index 2b1afc51..5e934f9a 100644 --- a/src/Solver/RubarBE.py +++ b/src/Solver/RubarBE.py @@ -39,7 +39,7 @@ class Rubar3(CommandLineSolver): self._type = "rubar3" self._cmd_input = "" - self._cmd_solver = "@path @args @input -o @output" + self._cmd_solver = "@path @args @input" self._cmd_output = "" @classmethod @@ -143,6 +143,7 @@ class Rubar3(CommandLineSolver): self._export_ts(study, repertory, qlog, name=name) self._export_geomac_i(study, repertory, qlog, name=name) self._export_mail(study, repertory, qlog, name=name) + self._export_devers(study, repertory, qlog, name=name) self._export_condin(study, repertory, qlog, name=name) self._export_stricklers(study, repertory, qlog, name=name) self._export_hydro(study, repertory, qlog, name=name) @@ -331,7 +332,7 @@ class Rubar3(CommandLineSolver): if ind % 3 != 0: f.write("\n") - def _export_abshyd(self, study, repertory, qlog, name="0"): + def _export_devers(self, study, repertory, qlog, name="0"): if qlog is not None: qlog.put("Export ABSHYD file") @@ -347,9 +348,30 @@ class Rubar3(CommandLineSolver): f.write(f"{lm:>13}\n") ind = 1 - for mail in reach.get_rk(): + for mail in reach.inter_profiles_rk(): f.write(f"{ind:>4} {mail:15.3f} {reach_ind:>4}\n") + ind += 1 + reach_ind += 1 + + def _export_abshyd(self, study, repertory, qlog, name="0"): + if qlog is not None: + qlog.put("Export DEVERS file") + + with open( + os.path.join( + repertory, f"devers.{name}" + ), "w+" + ) as f: + reach_ind = 1 + for edge in study.river.enable_edges(): + reach = edge.reach + lm = len(reach) + 1 + f.write(f"{lm:>13}\n") + + ind = 1 + for mail in reach.inter_profiles_rk(): + f.write(f"{ind:>4} {0.0:15.3f} {0.0:15.3f} {1.0:>15.3f}\n") ind += 1 reach_ind += 1 @@ -406,8 +428,9 @@ class Rubar3(CommandLineSolver): ) as f: for edge in study.river.enable_edges(): reach = edge.reach + lm = len(reach) + 1 - f.write(f"0.0\n") + f.write(f"{0.0:>6.4f} {lm:>6}\n") ics = study.river.initial_conditions.get(edge) data = self._export_condin_init_data(ics) @@ -556,5 +579,5 @@ class RubarBE(Rubar3): self._type = "rubarbe" self._cmd_input = "" - self._cmd_solver = "@path @args @input -o @output" + self._cmd_solver = "@path @args @input" self._cmd_output = ""