comparison test/Grids/tensor_grid_test.jl @ 1534:d4adee53aa30 bugfix/sbp_operators/stencil_return_type

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 11 Apr 2024 22:51:00 +0200
parents 88e738d807cb
children d9d9ab18cdfc 611ae2308aa1
comparison
equal deleted inserted replaced
1453:e1222fbb7c4d 1534:d4adee53aa30
167 167
168 @testset "boundary_grid" begin 168 @testset "boundary_grid" begin
169 @test boundary_grid(TensorGrid(g₁, g₂), TensorGridBoundary{1, Upper}()) == TensorGrid(ZeroDimGrid(g₁[end]), g₂) 169 @test boundary_grid(TensorGrid(g₁, g₂), TensorGridBoundary{1, Upper}()) == TensorGrid(ZeroDimGrid(g₁[end]), g₂)
170 @test boundary_grid(TensorGrid(g₁, g₄), TensorGridBoundary{1, Upper}()) == TensorGrid(ZeroDimGrid(g₁[end]), g₄) 170 @test boundary_grid(TensorGrid(g₁, g₄), TensorGridBoundary{1, Upper}()) == TensorGrid(ZeroDimGrid(g₁[end]), g₄)
171 end 171 end
172
173 @testset "boundary_indices" begin
174 g₁ = EquidistantGrid(range(0,1,length=11))
175 g₂ = EquidistantGrid(range(2,3,length=6))
176 g₄ = ZeroDimGrid(@SVector[1,2])
177
178 @test boundary_indices(TensorGrid(g₁, g₂), TensorGridBoundary{1, Lower}()) == (1,:)
179 @test boundary_indices(TensorGrid(g₁, g₂), TensorGridBoundary{1, Upper}()) == (11,:)
180 @test boundary_indices(TensorGrid(g₁, g₂), TensorGridBoundary{2, Lower}()) == (:,1)
181 @test boundary_indices(TensorGrid(g₁, g₂), TensorGridBoundary{2, Upper}()) == (:,6)
182 @test boundary_indices(TensorGrid(g₁, g₄), TensorGridBoundary{1, Lower}()) == (1,)
183 @test boundary_indices(TensorGrid(g₁, g₄), TensorGridBoundary{1, Upper}()) == (11,)
184 @test boundary_indices(TensorGrid(g₄,g₁), TensorGridBoundary{2, Lower}()) == (1,)
185 @test boundary_indices(TensorGrid(g₄,g₁), TensorGridBoundary{2, Upper}()) == (11,)
186 end
172 end 187 end
173 188
174 @testset "combined_coordinate_vector_type" begin 189 @testset "combined_coordinate_vector_type" begin
175 @test Grids.combined_coordinate_vector_type(Float64) == Float64 190 @test Grids.combined_coordinate_vector_type(Float64) == Float64
176 @test Grids.combined_coordinate_vector_type(Float64, Int) == SVector{2,Float64} 191 @test Grids.combined_coordinate_vector_type(Float64, Int) == SVector{2,Float64}