Mercurial > repos > public > sbplib_julia
changeset 950:97e9a8337a86 feature/laplace_opset
Review: broadcast instead of map in some places
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 14 Mar 2022 08:06:50 +0100 |
parents | 7168d28b03e3 |
children | 66e8faf4bb4b |
files | test/SbpOperators/boundaryops/boundary_restriction_test.jl test/SbpOperators/boundaryops/normal_derivative_test.jl |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/test/SbpOperators/boundaryops/boundary_restriction_test.jl Mon Mar 14 08:03:40 2022 +0100 +++ b/test/SbpOperators/boundaryops/boundary_restriction_test.jl Mon Mar 14 08:06:50 2022 +0100 @@ -39,6 +39,7 @@ @testset "1D" begin e_l, e_r = map(id -> boundary_restriction(g_1D, e_closure, id), boundary_identifiers(g_1D)) + # REVIEW: Same as normal_derivative:45 v = evalOn(g_1D,x->1+x^2) u = fill(3.124) @@ -51,6 +52,7 @@ @testset "2D" begin e_w, e_e, e_s, e_n = map(id -> boundary_restriction(g_2D, e_closure, id), boundary_identifiers(g_2D)) + # REVIEW: Same as normal_derivative:45 v = rand(11, 15) u = fill(3.124)
--- a/test/SbpOperators/boundaryops/normal_derivative_test.jl Mon Mar 14 08:03:40 2022 +0100 +++ b/test/SbpOperators/boundaryops/normal_derivative_test.jl Mon Mar 14 08:06:50 2022 +0100 @@ -42,6 +42,9 @@ 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 @test d_w*v ≈ -v∂x[1,:] atol = 1e-13 @test d_e*v ≈ v∂x[end,:] atol = 1e-13 @@ -54,7 +57,7 @@ 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 @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