From a31e2127e79f2a19e028038f01f7929ab5c3ebd5 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Thu, 23 Oct 2025 16:32:04 +0200 Subject: [PATCH 1/2] debug old .INI file read --- src/View/InitialConditions/Table.py | 24 +++++++++++++++++++++--- src/View/InitialConditions/Window.py | 4 ++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/View/InitialConditions/Table.py b/src/View/InitialConditions/Table.py index bf1d0f28..47425fa0 100644 --- a/src/View/InitialConditions/Table.py +++ b/src/View/InitialConditions/Table.py @@ -292,9 +292,27 @@ class InitialConditionTableModel(PamhyrTableModel): if not (line.startswith("#") or line.startswith("*") or line.startswith("$")): - line = line.split() - if int(line[0]) == reach_id: - data.append([line[4], line[2], line[3]]) + line_split = line.split() + formated = False + if len(line_split[0]) > 3: + formated = True + elif len(line_split[2]) > 10: + formated = True + elif len(line_split[3]) > 11: + formated = True + elif len(line_split[4]) > 9: + formated = True + + if formated: # old PamHyr format + if int(line[1:4]) == reach_id: + data.append([line[31:40], + line[10:20], + line[20:31]]) + else: + if int(line_split[0]) == reach_id: + data.append([line_split[4], + line_split[2], + line_split[3]]) self._undo.push( ReplaceDataCommand( diff --git a/src/View/InitialConditions/Window.py b/src/View/InitialConditions/Window.py index 90ced991..5ac10c49 100644 --- a/src/View/InitialConditions/Window.py +++ b/src/View/InitialConditions/Window.py @@ -220,6 +220,8 @@ class InitialConditionsWindow(PamhyrWindow): def _update_plot(self): self.plot_1.draw() self.plot_2.draw() + self.plot_1.idle() + self.plot_2.idle() def _propagated_update(self, key=Modules(0)): if Modules.GEOMETRY not in key: @@ -315,10 +317,12 @@ class InitialConditionsWindow(PamhyrWindow): def _import_from_results(self, results): logger.debug(f"import from results: {results}") self._table.import_from_results(results) + self._update() def _import_from_ini_file(self, file_name): logger.debug(f"import from INI file: {file_name}") self._table.read_from_ini(file_name) + self._update() def move_up(self): row = self.index_selected_row() From d93917b0811255e7b6a5666bcc95c3fa514c17fe Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Wed, 19 Nov 2025 15:27:33 +0100 Subject: [PATCH 2/2] debug internal mesher --- src/Meshing/Internal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Meshing/Internal.py b/src/Meshing/Internal.py index ed9a5c48..ba4a6d8f 100644 --- a/src/Meshing/Internal.py +++ b/src/Meshing/Internal.py @@ -205,8 +205,10 @@ class InternalMeshing(AMeshingTool): sect2.point(start2).name = '' if tag2 == '': # left end point sect2.point(start2+1).name = '' + len2 += 1 elif ltot1 < 0.0001: sect2.add_npoints(len1-len2) + len2 = len1 else: # regular case # loop on the points to insert for k in range(len1-len2):