mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
kp to rk
This commit is contained in:
1 parent
334633f0fb
commit
143f468c26
40 files changed
+353
-353
No files matched your search
+20
-20
@@ -37,7 +37,7 @@ from Model.Results.ResultsAdisTS import Results
|
||||
from Model.Results.River.River import River, Reach, Profile
|
||||
|
||||
from Checker.Adists import (
|
||||
AdistsOutputKpChecker,
|
||||
AdistsOutputRKChecker,
|
||||
)
|
||||
|
||||
logger = logging.getLogger()
|
||||
@@ -88,7 +88,7 @@ class AdisTS(CommandLineSolver):
|
||||
@classmethod
|
||||
def checkers(cls):
|
||||
lst = [
|
||||
AdistsOutputKpChecker(),
|
||||
AdistsOutputRKChecker(),
|
||||
]
|
||||
|
||||
return lst
|
||||
@@ -254,7 +254,7 @@ class AdisTSlc(AdisTS):
|
||||
with adists_file_open(os.path.join(repertory, f"{POL_name}.ALD"), "w+") as f:
|
||||
for LC in POL_LC:
|
||||
reach_name = next(filter(lambda edge: edge.id == LC.edge, study.river.edges())).name
|
||||
f.write(f"${reach_name} {LC.begin_kp} {LC.end_kp}\n")
|
||||
f.write(f"${reach_name} {LC.begin_rk} {LC.end_rk}\n")
|
||||
f.write(f"*temps |débit massique (kg/s)\n")
|
||||
f.write(f"*---------++++++++++\n")
|
||||
|
||||
@@ -305,7 +305,7 @@ class AdisTSlc(AdisTS):
|
||||
def _export_ICs_AdisTS_Spec(self, study, pol_ics_spec_data, f, qlog, name="0"):
|
||||
|
||||
for ic_spec in pol_ics_spec_data:
|
||||
f.write(f"{ic_spec.name} = {ic_spec.reach} {ic_spec.start_kp} {ic_spec.end_kp} " +
|
||||
f.write(f"{ic_spec.name} = {ic_spec.reach} {ic_spec.start_rk} {ic_spec.end_rk} " +
|
||||
f"{ic_spec.concentration} {ic_spec.eg} {ic_spec.em} {ic_spec.ed} {ic_spec.rate}")
|
||||
|
||||
return True
|
||||
@@ -341,8 +341,8 @@ class AdisTSlc(AdisTS):
|
||||
def _export_d90_spec(self, study, d90_spec_data, f, qlog, name="0"):
|
||||
|
||||
for d90_spec in d90_spec_data:
|
||||
if (d90_spec.name is None) or (d90_spec.reach is None) or (d90_spec.start_kp is None) or \
|
||||
(d90_spec.end_kp is None) or (d90_spec.d90 is None):
|
||||
if (d90_spec.name is None) or (d90_spec.reach is None) or (d90_spec.start_rk is None) or \
|
||||
(d90_spec.end_rk is None) or (d90_spec.d90 is None):
|
||||
return
|
||||
|
||||
edges = study.river.enable_edges()
|
||||
@@ -354,7 +354,7 @@ class AdisTSlc(AdisTS):
|
||||
if id_reach not in id_edges:
|
||||
return
|
||||
|
||||
f.write(f"{d90_spec.name} = {id_reach} {d90_spec.start_kp} {d90_spec.end_kp} {d90_spec.d90}\n")
|
||||
f.write(f"{d90_spec.name} = {id_reach} {d90_spec.start_rk} {d90_spec.end_rk} {d90_spec.d90}\n")
|
||||
|
||||
def _export_DIF(self, study, repertory, qlog=None, name="0"):
|
||||
|
||||
@@ -383,8 +383,8 @@ class AdisTSlc(AdisTS):
|
||||
def _export_dif_spec(self, study, dif_spec_data, f, qlog, name="0"):
|
||||
|
||||
for dif_spec in dif_spec_data:
|
||||
if (dif_spec.reach is None) or (dif_spec.start_kp is None) or \
|
||||
(dif_spec.end_kp is None) or (dif_spec.dif is None) or (dif_spec.b is None) or (dif_spec.c is None):
|
||||
if (dif_spec.reach is None) or (dif_spec.start_rk is None) or \
|
||||
(dif_spec.end_rk is None) or (dif_spec.dif is None) or (dif_spec.b is None) or (dif_spec.c is None):
|
||||
return
|
||||
|
||||
edges = study.river.enable_edges()
|
||||
@@ -397,9 +397,9 @@ class AdisTSlc(AdisTS):
|
||||
return
|
||||
|
||||
if dif_spec.method != "generique":
|
||||
f.write(f"{dif_spec.method} = {id_reach} {dif_spec.start_kp} {dif_spec.end_kp} {dif_spec.dif}\n")
|
||||
f.write(f"{dif_spec.method} = {id_reach} {dif_spec.start_rk} {dif_spec.end_rk} {dif_spec.dif}\n")
|
||||
else:
|
||||
f.write(f"{dif_spec.method} = {id_reach} {dif_spec.start_kp} {dif_spec.end_kp} {dif_spec.dif}" +
|
||||
f.write(f"{dif_spec.method} = {id_reach} {dif_spec.start_rk} {dif_spec.end_rk} {dif_spec.dif}" +
|
||||
f"{dif_spec.b} {dif_spec.c}\n")
|
||||
|
||||
def _export_NUM(self, study, repertory, qlog=None, name="0"):
|
||||
@@ -435,29 +435,29 @@ class AdisTSlc(AdisTS):
|
||||
if name != "command_line_arguments":
|
||||
f.write(f"{dict_names[name]} = {value}\n")
|
||||
|
||||
outputkps = study.river.Output_kp_adists.OutputKp_List
|
||||
outputrks = study.river.Output_rk_adists.OutputRK_List
|
||||
|
||||
for outputkp in outputkps:
|
||||
self._export_outputkp(study, outputkp, f, qlog)
|
||||
for outputrk in outputrks:
|
||||
self._export_outputrk(study, outputrk, f, qlog)
|
||||
|
||||
return files
|
||||
|
||||
def _export_outputkp(self, study, outputkp, f, qlog, name="0"):
|
||||
if (outputkp.reach is None) or (outputkp.kp is None) or (outputkp.title is None):
|
||||
def _export_outputrk(self, study, outputrk, f, qlog, name="0"):
|
||||
if (outputrk.reach is None) or (outputrk.rk is None) or (outputrk.title is None):
|
||||
return
|
||||
|
||||
edges = study.river.enable_edges()
|
||||
|
||||
id_edges = list(map(lambda x: x.id, edges))
|
||||
|
||||
id_reach = outputkp.reach
|
||||
kp = outputkp.kp
|
||||
title = outputkp.title
|
||||
id_reach = outputrk.reach
|
||||
rk = outputrk.rk
|
||||
title = outputrk.title
|
||||
|
||||
if id_reach not in id_edges:
|
||||
return
|
||||
|
||||
f.write(f"output = {id_reach} {kp} {title}\n")
|
||||
f.write(f"output = {id_reach} {rk} {title}\n")
|
||||
|
||||
@timer
|
||||
def read_bin(self, study, repertory, results, qlog=None, name="0"):
|
||||
|
||||
Reference in new issue
Block a user