diff test/SbpOperators/boundaryops/boundary_restriction_test.jl @ 975:5be8e25c81b3 feature/tensormapping_application_promotion

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 15 Mar 2022 07:37:11 +0100
parents 775d5513da8f
children 7bf3121c6864 1ba8a398af9c
line wrap: on
line diff
--- a/test/SbpOperators/boundaryops/boundary_restriction_test.jl	Mon Mar 14 08:48:02 2022 +0100
+++ b/test/SbpOperators/boundaryops/boundary_restriction_test.jl	Tue Mar 15 07:37:11 2022 +0100
@@ -2,9 +2,8 @@
 
 using Sbplib.SbpOperators
 using Sbplib.Grids
+using Sbplib.LazyTensors
 using Sbplib.RegionIndices
-using Sbplib.LazyTensors
-
 import Sbplib.SbpOperators.BoundaryOperator
 
 @testset "boundary_restriction" begin
@@ -15,14 +14,14 @@
 
     @testset "boundary_restriction" begin
         @testset "1D" begin
-            e_l = boundary_restriction(g_1D,e_closure,Lower())
-            @test e_l == boundary_restriction(g_1D,e_closure,CartesianBoundary{1,Lower}())
+            e_l = boundary_restriction(g_1D,e_closure,CartesianBoundary{1,Lower}())
+            @test e_l == boundary_restriction(g_1D,stencil_set,CartesianBoundary{1,Lower}())
             @test e_l == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),Lower())
             @test e_l isa BoundaryOperator{T,Lower} where T
             @test e_l isa TensorMapping{T,0,1} where T
 
-            e_r = boundary_restriction(g_1D,e_closure,Upper())
-            @test e_r == boundary_restriction(g_1D,e_closure,CartesianBoundary{1,Upper}())
+            e_r = boundary_restriction(g_1D,e_closure,CartesianBoundary{1,Upper}())
+            @test e_r == boundary_restriction(g_1D,stencil_set,CartesianBoundary{1,Upper}())
             @test e_r == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),Upper())
             @test e_r isa BoundaryOperator{T,Upper} where T
             @test e_r isa TensorMapping{T,0,1} where T
@@ -30,6 +29,7 @@
 
         @testset "2D" begin
             e_w = boundary_restriction(g_2D,e_closure,CartesianBoundary{1,Upper}())
+            @test e_w == boundary_restriction(g_2D,stencil_set,CartesianBoundary{1,Upper}())
             @test e_w isa InflatedTensorMapping
             @test e_w isa TensorMapping{T,1,2} where T
         end
@@ -37,9 +37,7 @@
 
     @testset "Application" begin
         @testset "1D" begin
-            e_l = boundary_restriction(g_1D, e_closure, CartesianBoundary{1,Lower}())
-            e_r = boundary_restriction(g_1D, e_closure, CartesianBoundary{1,Upper}())
-
+            e_l, e_r = boundary_restriction.(Ref(g_1D), Ref(e_closure), boundary_identifiers(g_1D))
             v = evalOn(g_1D,x->1+x^2)
             u = fill(3.124)
 
@@ -49,11 +47,7 @@
         end
 
         @testset "2D" begin
-            e_w = boundary_restriction(g_2D, e_closure, CartesianBoundary{1,Lower}())
-            e_e = boundary_restriction(g_2D, e_closure, CartesianBoundary{1,Upper}())
-            e_s = boundary_restriction(g_2D, e_closure, CartesianBoundary{2,Lower}())
-            e_n = boundary_restriction(g_2D, e_closure, CartesianBoundary{2,Upper}())
-
+            e_w, e_e, e_s, e_n = boundary_restriction.(Ref(g_2D), Ref(e_closure), boundary_identifiers(g_2D))
             v = rand(11, 15)
             u = fill(3.124)