comparison test/Grids/tensor_grid_test.jl @ 1492:d9d9ab18cdfc feature/grids/curvilinear

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 01 Dec 2023 11:52:26 +0100
parents 0322c181a1cd 88e738d807cb
children b02917bcd7d5
comparison
equal deleted inserted replaced
1451:2e08f3444354 1492:d9d9ab18cdfc
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}