Mercurial > repos > public > sbplib_julia
diff test/SbpOperators/boundaryops/normal_derivative_test.jl @ 961:775d5513da8f feature/laplace_opset
Review: Fix boundary operator tests according to review comments
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Mon, 14 Mar 2022 09:41:23 +0100 |
parents | 97e9a8337a86 |
children | 7bf3121c6864 1ba8a398af9c |
line wrap: on
line diff
--- a/test/SbpOperators/boundaryops/normal_derivative_test.jl Mon Mar 14 08:27:54 2022 +0100 +++ b/test/SbpOperators/boundaryops/normal_derivative_test.jl Mon Mar 14 09:41:23 2022 +0100 @@ -40,11 +40,7 @@ @testset "2nd order" begin stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order=2) d_closure = parse_stencil(stencil_set["d1"]["closure"]) - d_w, d_e, d_s, d_n = - map(id -> normal_derivative(g_2D, d_closure, id), boundary_identifiers(g_2D)) - # REVIEW: Would prefere to write this as - # d_w, d_e, d_s, d_n = normal_derivative.(Ref(g_2D), Ref(d_closure), boundary_identifiers(g_2D)) - # to avoid the line break + d_w, d_e, d_s, d_n = normal_derivative.(Ref(g_2D), Ref(d_closure), boundary_identifiers(g_2D)) @test d_w*v ≈ -v∂x[1,:] atol = 1e-13 @test d_e*v ≈ v∂x[end,:] atol = 1e-13 @@ -55,9 +51,8 @@ @testset "4th order" begin stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order=4) d_closure = parse_stencil(stencil_set["d1"]["closure"]) - d_w, d_e, d_s, d_n = - map(id -> normal_derivative(g_2D, d_closure, id), boundary_identifiers(g_2D)) - # REVIEW: Same as above + d_w, d_e, d_s, d_n = normal_derivative.(Ref(g_2D), Ref(d_closure), boundary_identifiers(g_2D)) + @test d_w*v ≈ -v∂x[1,:] atol = 1e-13 @test d_e*v ≈ v∂x[end,:] atol = 1e-13 @test d_s*v ≈ -v∂y[:,1] atol = 1e-13