From 0bf5496cc15be236f7e1801cdfb07c8e2984620a Mon Sep 17 00:00:00 2001 From: Piyush Sharda Date: Mon, 26 Aug 2024 22:42:38 +0200 Subject: [PATCH] adjust line numbers for Z=1e-6 --- .github/workflows/burn_cell_metal_chem_new.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/burn_cell_metal_chem_new.yml b/.github/workflows/burn_cell_metal_chem_new.yml index 62970c442..7726e963b 100644 --- a/.github/workflows/burn_cell_metal_chem_new.yml +++ b/.github/workflows/burn_cell_metal_chem_new.yml @@ -3,7 +3,7 @@ name: burn_cell_metal_chem on: [pull_request] jobs: - burn_cell_metal_chem_1: + burn_cell_metal_chem: runs-on: ubuntu-latest steps: @@ -38,7 +38,7 @@ jobs: if: ${{ failure() && hashFiles('unit_test/burn_cell_metal_chem/Backtrace.0') != '' }} run: cat unit_test/burn_cell_metal_chem/Backtrace.0 - - name: Compare to stored output at Z = 1 + - name: Compare to stored output for Z = 1 run: | set -e cd unit_test/burn_cell_metal_chem @@ -70,7 +70,7 @@ jobs: exit 1 fi - - name: Compile and run for Z = 1e-6 + - name: Run for Z = 1e-6 run: | cd unit_test/burn_cell_metal_chem ./main1d.gnu.DEBUG.ex inputs_metal_chem_1e-6 amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out @@ -79,11 +79,11 @@ jobs: if: ${{ failure() && hashFiles('unit_test/burn_cell_metal_chem/Backtrace.0') != '' }} run: cat unit_test/burn_cell_metal_chem/Backtrace.0 - - name: Compare to stored output at Z = 1e-6 + - name: Compare to stored output for Z = 1e-6 run: | set -e cd unit_test/burn_cell_metal_chem - line_numbers=(4461 4463 4465 4467 4468 4471 4472 4475 4481 4486) + line_numbers=(4438 4440 4442 4444 4445 4448 4449 4452 4458 4463) threshold=0.01 error_found=false for line_number in "${line_numbers[@]}"; do @@ -92,8 +92,8 @@ jobs: echo "Line $line_number in test.out: $value1" value1=$(awk 'NR=='"$line_number"' {match($0, /[+-]?[0-9]+([.][0-9]+)?[eE]?[+-]?[0-9]+/); if (RSTART) print substr($0, RSTART, RLENGTH); else print 0}' test.out) - # Adjust the line number for reference_solution_1.0.out - reference_line_number=$((line_number - 24)) + # Adjust the line number for reference_solution + reference_line_number=$((line_number + 12)) value2=$(awk 'NR=='"$reference_line_number"' {match($0, /[+-]?[0-9]+([.][0-9]+)?[eE]?[+-]?[0-9]+/); if (RSTART) print substr($0, RSTART, RLENGTH)}' reference_solution_1e-6.out) difference=$(awk -v val1="$value1" -v val2="$value2" 'BEGIN { printf "%.2f", (val1 - val2) / val2 }') @@ -101,7 +101,7 @@ jobs: if (( $(echo "$difference > $threshold" | bc -l) )); then echo "Line number: $line_number" echo "Value in test.out: $value1" - echo "Value in reference_solution_1.0.out: $value2" + echo "Value in reference_solution_1e-6.out: $value2" echo "Difference between test and reference value is $difference, more than allowed threshold of $threshold" echo error_found=true