comparison test/SbpOperators/boundaryops/boundary_restriction_test.jl @ 1751:f3d7e2d7a43f feature/sbp_operators/laplace_curvilinear

Merge feature/grids/manifolds
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 11 Sep 2024 16:26:19 +0200
parents 65b2d2c72fbc 471a948cd2b2
children
comparison
equal deleted inserted replaced
1731:3684db043add 1751:f3d7e2d7a43f
1 using Test 1 using Test
2 2
3 using Sbplib.SbpOperators 3 using Diffinitive.SbpOperators
4 using Sbplib.Grids 4 using Diffinitive.Grids
5 using Sbplib.LazyTensors 5 using Diffinitive.LazyTensors
6 using Sbplib.RegionIndices 6 using Diffinitive.RegionIndices
7 using Sbplib.SbpOperators: BoundaryOperator, Stencil 7 using Diffinitive.SbpOperators: BoundaryOperator, Stencil
8 8
9 using StaticArrays 9 using StaticArrays
10 10
11 @testset "boundary_restriction" begin 11 @testset "boundary_restriction" begin
12 stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order = 4) 12 stencil_set = read_stencil_set(sbp_operators_path()*"standard_diagonal.toml"; order = 4)
14 g_1D = equidistant_grid(0.0, 1.0, 11) 14 g_1D = equidistant_grid(0.0, 1.0, 11)
15 g_2D = equidistant_grid((0.0, 0.0), (1.0,1.0), 11, 15) 15 g_2D = equidistant_grid((0.0, 0.0), (1.0,1.0), 11, 15)
16 16
17 @testset "boundary_restriction" begin 17 @testset "boundary_restriction" begin
18 @testset "1D" begin 18 @testset "1D" begin
19 e_l = boundary_restriction(g_1D,stencil_set,Lower()) 19 e_l = boundary_restriction(g_1D,stencil_set,LowerBoundary())
20 @test e_l == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),Lower()) 20 @test e_l == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),LowerBoundary())
21 @test e_l isa BoundaryOperator{T,Lower} where T 21 @test e_l isa BoundaryOperator{T,LowerBoundary} where T
22 @test e_l isa LazyTensor{T,0,1} where T 22 @test e_l isa LazyTensor{T,0,1} where T
23 23
24 e_r = boundary_restriction(g_1D,stencil_set,Upper()) 24 e_r = boundary_restriction(g_1D,stencil_set,UpperBoundary())
25 @test e_r == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),Upper()) 25 @test e_r == BoundaryOperator(g_1D,Stencil{Float64}(e_closure),UpperBoundary())
26 @test e_r isa BoundaryOperator{T,Upper} where T 26 @test e_r isa BoundaryOperator{T,UpperBoundary} where T
27 @test e_r isa LazyTensor{T,0,1} where T 27 @test e_r isa LazyTensor{T,0,1} where T
28 end 28 end
29 29
30 @testset "2D" begin 30 @testset "2D" begin
31 e_w = boundary_restriction(g_2D,stencil_set,CartesianBoundary{1,Upper}()) 31 e_w = boundary_restriction(g_2D,stencil_set,CartesianBoundary{1,UpperBoundary}())
32 @test e_w isa InflatedTensor 32 @test e_w isa InflatedTensor
33 @test e_w isa LazyTensor{T,1,2} where T 33 @test e_w isa LazyTensor{T,1,2} where T
34 end 34 end
35 end 35 end
36 36