Mercurial > repos > public > sbplib_julia
comparison test/Grids/tensor_grid_test.jl @ 1863:516eaabf1169 refactor/grids/iterable_boundary_indices
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 22 Jan 2025 09:00:40 +0100 |
parents | 27e74f524c4f 054447ac4b0e |
children | fa96b57af6a1 |
comparison
equal
deleted
inserted
replaced
1845:aa7da5c899d8 | 1863:516eaabf1169 |
---|---|
135 @test axes(g, 1) == 1:11 | 135 @test axes(g, 1) == 1:11 |
136 @test axes(g, 2) == 1:6 | 136 @test axes(g, 2) == 1:6 |
137 @test axes(g) == (1:11,1:6) | 137 @test axes(g) == (1:11,1:6) |
138 end | 138 end |
139 | 139 |
140 @testset "spacing" begin | |
141 g₁ = EquidistantGrid(range(0,1,length=11)) | |
142 g₂ = EquidistantGrid(range(2,3,length=6)) | |
143 g₃ = ZeroDimGrid(@SVector[1,2]) | |
144 | |
145 @test spacing(TensorGrid(g₁)) == (1/10,) | |
146 @test spacing(TensorGrid(g₂)) == (1/5,) | |
147 | |
148 @test spacing(TensorGrid(g₁, g₂)) == (1/10, 1/5) | |
149 | |
150 @test spacing(TensorGrid(g₁, g₃)) == (1/10,) | |
151 @test spacing(TensorGrid(g₃, g₂)) == (1/5,) | |
152 | |
153 | |
154 @test spacing(TensorGrid(g₁, g₂, g₁)) == (1/10, 1/5, 1/10) | |
155 | |
156 @test spacing(TensorGrid(g₃, g₂, g₁)) == (1/5, 1/10) | |
157 @test spacing(TensorGrid(g₁, g₃, g₁)) == (1/10, 1/10) | |
158 @test spacing(TensorGrid(g₁, g₂, g₃)) == (1/10, 1/5) | |
159 end | |
160 | |
140 @testset "min_spacing" begin | 161 @testset "min_spacing" begin |
141 g₁ = EquidistantGrid(range(0,1,length=11)) | 162 g₁ = EquidistantGrid(range(0,1,length=11)) |
142 g₂ = EquidistantGrid(range(2,3,length=6)) | 163 g₂ = EquidistantGrid(range(2,3,length=6)) |
143 g₃ = ZeroDimGrid(@SVector[1,2]) | 164 g₃ = ZeroDimGrid(@SVector[1,2]) |
144 | 165 |