From 107cfcaca75d056b05db6ebeab391637d698e6da Mon Sep 17 00:00:00 2001 From: oguzhankoral Date: Tue, 24 Oct 2023 17:51:45 +0300 Subject: [PATCH] Reorder logging --- main.py | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/main.py b/main.py index 45003c3..a9ff8aa 100644 --- a/main.py +++ b/main.py @@ -106,6 +106,30 @@ def automate_function( completed_process = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) print(completed_process.stdout) + blockMesh_log = os.path.join(case_folder, 'log.blockMesh') + add_to_store_if_exist(automate_context, blockMesh_log) + + decomposePar_log = os.path.join(case_folder, 'log.decomposePar') + add_to_store_if_exist(automate_context, decomposePar_log) + + patchSummary_log = os.path.join(case_folder, 'log.patchSummary') + add_to_store_if_exist(automate_context, patchSummary_log) + + reconstructPar_log = os.path.join(case_folder, 'log.reconstructPar') + add_to_store_if_exist(automate_context, reconstructPar_log) + + reconstructParMesh_log = os.path.join(case_folder, 'log.reconstructParMesh') + add_to_store_if_exist(automate_context, reconstructParMesh_log) + + simpleFoam_log = os.path.join(case_folder, 'log.simpleFoam') + add_to_store_if_exist(automate_context, simpleFoam_log) + + snappyHexMesh_log = os.path.join(case_folder, 'log.snappyHexMesh') + add_to_store_if_exist(automate_context, snappyHexMesh_log) + + surfaceFeatures_log = os.path.join(case_folder, 'log.surfaceFeatures') + add_to_store_if_exist(automate_context, surfaceFeatures_log) + vtk_file = os.path.join(case_folder, 'postProcessing', 'cutPlaneSurface', '400', 'U_cutPlane.vtk') @@ -140,31 +164,6 @@ def automate_function( else: automate_context.mark_run_success("Object found to run simulation!") - blockMesh_log = os.path.join(case_folder, 'log.blockMesh') - add_to_store_if_exist(automate_context, blockMesh_log) - - decomposePar_log = os.path.join(case_folder, 'log.decomposePar') - add_to_store_if_exist(automate_context, decomposePar_log) - - patchSummary_log = os.path.join(case_folder, 'log.patchSummary') - add_to_store_if_exist(automate_context, patchSummary_log) - - reconstructPar_log = os.path.join(case_folder, 'log.reconstructPar') - add_to_store_if_exist(automate_context, reconstructPar_log) - - reconstructParMesh_log = os.path.join(case_folder, 'log.reconstructParMesh') - add_to_store_if_exist(automate_context, reconstructParMesh_log) - - simpleFoam_log = os.path.join(case_folder, 'log.simpleFoam') - add_to_store_if_exist(automate_context, simpleFoam_log) - - snappyHexMesh_log = os.path.join(case_folder, 'log.snappyHexMesh') - add_to_store_if_exist(automate_context, snappyHexMesh_log) - - surfaceFeatures_log = os.path.join(case_folder, 'log.surfaceFeatures') - add_to_store_if_exist(automate_context, surfaceFeatures_log) - - # if the function generates file results, this is how it can be # attached to the Speckle project / model # automate_context.store_file_result("./report.pdf")