Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/boundaryops/boundary_restriction_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 |
comparison
equal
deleted
inserted
replaced
952:6a8d7fbf55fc | 961:775d5513da8f |
---|---|
35 end | 35 end |
36 end | 36 end |
37 | 37 |
38 @testset "Application" begin | 38 @testset "Application" begin |
39 @testset "1D" begin | 39 @testset "1D" begin |
40 e_l, e_r = | 40 e_l, e_r = boundary_restriction.(Ref(g_1D), Ref(e_closure), boundary_identifiers(g_1D)) |
41 map(id -> boundary_restriction(g_1D, e_closure, id), boundary_identifiers(g_1D)) | |
42 # REVIEW: Same as normal_derivative:45 | |
43 | |
44 v = evalOn(g_1D,x->1+x^2) | 41 v = evalOn(g_1D,x->1+x^2) |
45 u = fill(3.124) | 42 u = fill(3.124) |
46 | 43 |
47 @test (e_l*v)[] == v[1] | 44 @test (e_l*v)[] == v[1] |
48 @test (e_r*v)[] == v[end] | 45 @test (e_r*v)[] == v[end] |
49 @test (e_r*v)[1] == v[end] | 46 @test (e_r*v)[1] == v[end] |
50 end | 47 end |
51 | 48 |
52 @testset "2D" begin | 49 @testset "2D" begin |
53 e_w, e_e, e_s, e_n = | 50 e_w, e_e, e_s, e_n = boundary_restriction.(Ref(g_2D), Ref(e_closure), boundary_identifiers(g_2D)) |
54 map(id -> boundary_restriction(g_2D, e_closure, id), boundary_identifiers(g_2D)) | |
55 # REVIEW: Same as normal_derivative:45 | |
56 | |
57 v = rand(11, 15) | 51 v = rand(11, 15) |
58 u = fill(3.124) | 52 u = fill(3.124) |
59 | 53 |
60 @test e_w*v == v[1,:] | 54 @test e_w*v == v[1,:] |
61 @test e_e*v == v[end,:] | 55 @test e_e*v == v[end,:] |