comparison test/SbpOperators/boundaryops/boundary_restriction_test.jl @ 1672:3714a391545a refactor/grids/boundary_identifiers_1d

Make the boundary identifiers for EquidistantGrid subtype BoundaryIdentifer
author Vidar Stiernström <vidar.stiernstrom@gmail.com>
date Sun, 07 Jul 2024 15:15:12 -0700
parents 43aaf710463e
children 471a948cd2b2
comparison
equal deleted inserted replaced
1671:791d0f3f289a 1672:3714a391545a
12 g_1D = equidistant_grid(0.0, 1.0, 11) 12 g_1D = equidistant_grid(0.0, 1.0, 11)
13 g_2D = equidistant_grid((0.0, 0.0), (1.0,1.0), 11, 15) 13 g_2D = equidistant_grid((0.0, 0.0), (1.0,1.0), 11, 15)
14 14
15 @testset "boundary_restriction" begin 15 @testset "boundary_restriction" begin
16 @testset "1D" begin 16 @testset "1D" begin
17 e_l = boundary_restriction(g_1D,stencil_set,Lower()) 17 e_l = boundary_restriction(g_1D,stencil_set,LowerBoundary())
18 @test e_l == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),Lower()) 18 @test e_l == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),LowerBoundary())
19 @test e_l isa BoundaryOperator{T,Lower} where T 19 @test e_l isa BoundaryOperator{T,LowerBoundary} where T
20 @test e_l isa LazyTensor{T,0,1} where T 20 @test e_l isa LazyTensor{T,0,1} where T
21 21
22 e_r = boundary_restriction(g_1D,stencil_set,Upper()) 22 e_r = boundary_restriction(g_1D,stencil_set,UpperBoundary())
23 @test e_r == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),Upper()) 23 @test e_r == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),UpperBoundary())
24 @test e_r isa BoundaryOperator{T,Upper} where T 24 @test e_r isa BoundaryOperator{T,UpperBoundary} where T
25 @test e_r isa LazyTensor{T,0,1} where T 25 @test e_r isa LazyTensor{T,0,1} where T
26 end 26 end
27 27
28 @testset "2D" begin 28 @testset "2D" begin
29 e_w = boundary_restriction(g_2D,stencil_set,CartesianBoundary{1,Upper}()) 29 e_w = boundary_restriction(g_2D,stencil_set,CartesianBoundary{1,UpperBoundary}())
30 @test e_w isa InflatedTensor 30 @test e_w isa InflatedTensor
31 @test e_w isa LazyTensor{T,1,2} where T 31 @test e_w isa LazyTensor{T,1,2} where T
32 end 32 end
33 end 33 end
34 34