From 1a4205b45033aa9a8a83b4ac4eac7a471abb5029 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Wed, 4 Dec 2024 18:02:27 +0000 Subject: [PATCH] fix wall bc adi jacobian test --- moment_kinetics/test/jacobian_matrix_tests.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moment_kinetics/test/jacobian_matrix_tests.jl b/moment_kinetics/test/jacobian_matrix_tests.jl index 757126dcf..cad906ca1 100644 --- a/moment_kinetics/test/jacobian_matrix_tests.jl +++ b/moment_kinetics/test/jacobian_matrix_tests.jl @@ -3156,11 +3156,11 @@ function test_ion_dt_forcing_of_electron_ppar(test_input; rtol=(1.5e1*epsilon)^2 return nothing end -function test_electron_kinetic_equation(test_input; expected_rtol=(5.0e2*epsilon)^2) +function test_electron_kinetic_equation(test_input; rtol=(5.0e2*epsilon)^2) # Looser rtol for "wall" bc because integral corrections not accounted for in wall bc # Jacobian (yet?). - @testset "electron_kinetic_equation bc=$bc" for (bc, rtol) ∈ (("constant", expected_rtol), ("wall", expected_rtol)) + @testset "electron_kinetic_equation bc=$bc" for (bc, adi_tol) ∈ (("constant", 1.0e-15), ("wall", 1.0e-13)) println(" - electron_kinetic_equation $bc") test_input = deepcopy(test_input) test_input["output"]["run_name"] *= "_electron_kinetic_equation_$bc" @@ -3359,7 +3359,7 @@ function test_electron_kinetic_equation(test_input; expected_rtol=(5.0e2*epsilon # Jacobian matrix functions without being too messed up by floating-point # rounding errors. The result is that some entries in the Jacobian matrix # here are O(1.0e5), so it is important to use `rtol` here. - @test elementwise_isapprox(jacobian_matrix_ADI_check, jacobian_matrix; rtol=1.0e-15, atol=1.0e-15) + @test elementwise_isapprox(jacobian_matrix_ADI_check, jacobian_matrix; rtol=adi_tol, atol=1.0e-15) end end @@ -3419,7 +3419,7 @@ function test_electron_kinetic_equation(test_input; expected_rtol=(5.0e2*epsilon # Jacobian matrix functions without being too messed up by floating-point # rounding errors. The result is that some entries in the Jacobian matrix # here are O(1.0e5), so it is important to use `rtol` here. - @test elementwise_isapprox(jacobian_matrix_ADI_check, jacobian_matrix; rtol=1.0e-13, atol=1.0e-13) + @test elementwise_isapprox(jacobian_matrix_ADI_check, jacobian_matrix; rtol=10.0*adi_tol, atol=1.0e-13) end end