From 476c5698049619cad58d084b0747877ce3c062fb Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 13 Nov 2023 11:35:27 -0600 Subject: [PATCH] Used the last thermo step in the log file for comparison --- tools/regression-tests/run_tests.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/regression-tests/run_tests.py b/tools/regression-tests/run_tests.py index 429ab16004..0ff51f4f6e 100644 --- a/tools/regression-tests/run_tests.py +++ b/tools/regression-tests/run_tests.py @@ -161,9 +161,15 @@ def iterate(input_list): print("Quantities".ljust(width) + "Output".center(width) + "Reference".center(width) + "Absolute Diff.".center(width)) irun = 0 num_fields = len(thermo[irun]['keywords']) + + # get the total number of the thermo output lines + nthermo_steps = len(thermo[irun]['data']) + # get the output at thelast timestep + thermo_step = nthermo_steps - 1 + print(f"nthermo_steps = {nthermo_steps}") for i in range(num_fields): - val = thermo[irun]['data'][2][i] - ref = thermo_ref[0]['data'][2][i] + val = thermo[irun]['data'][thermo_step][i] + ref = thermo_ref[0]['data'][thermo_step][i] diff = abs(float(val) - float(ref)) print(f"{thermo[0]['keywords'][i].ljust(width)} {str(val).rjust(20)} {str(ref).rjust(20)} {str(diff).rjust(20)}") print("-"*(4*width+3))