changeset 632:bf8b66c596f7 feature/volume_and_boundary_operators

Use operator with odd parity in test for VolumeOpertors
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 31 Dec 2020 08:41:07 +0100
parents fb915bce2228
children fb5ac62563aa
files test/testSbpOperators.jl
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/testSbpOperators.jl	Thu Dec 31 08:28:06 2020 +0100
+++ b/test/testSbpOperators.jl	Thu Dec 31 08:41:07 2020 +0100
@@ -199,16 +199,18 @@
 
     # TODO: Test for other dimensions?
     op_x = volume_operator(g_2D,inner_stencil,closure_stencils,Parity(1),1)
-    op_y = volume_operator(g_2D,inner_stencil,closure_stencils,Parity(1),2)
+    op_y = volume_operator(g_2D,inner_stencil,closure_stencils,Parity(-1),2)
     v = zeros(size(g_2D))
     Nx = size(g_2D)[1]
+    Ny = size(g_2D)[2]
     for i = 1:Nx
         v[i,:] .= i
     end
     rx = copy(v)
     rx[1,:] .= 1.5
-    rx[end,:] .= (2*Nx-1)/2
+    rx[Nx,:] .= (2*Nx-1)/2
     ry = copy(v)
+    ry[:,Ny-1:Ny] = -v[:,Ny-1:Ny]
 
     @testset "Application" begin
         @test op_x*v ≈ rx rtol = 1e-14