Mercurial > repos > public > sbplib_julia
comparison test/Grids/tensor_grid_test.jl @ 1800:87ebdd6eed95 feature/grids/tensor_grid/spacing
Add method for spacing for tensor grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 17 Sep 2024 08:16:58 +0200 |
parents | 471a948cd2b2 |
children | 189e69d44056 |
comparison
equal
deleted
inserted
replaced
1770:fbbadc6df706 | 1800:87ebdd6eed95 |
---|---|
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 | |
144 @test spacing(TensorGrid(g₁, g₂)) == (1/10, 1/5) | |
145 end | |
146 | |
140 @testset "min_spacing" begin | 147 @testset "min_spacing" begin |
141 g₁ = EquidistantGrid(range(0,1,length=11)) | 148 g₁ = EquidistantGrid(range(0,1,length=11)) |
142 g₂ = EquidistantGrid(range(2,3,length=6)) | 149 g₂ = EquidistantGrid(range(2,3,length=6)) |
143 g₃ = ZeroDimGrid(@SVector[1,2]) | 150 g₃ = ZeroDimGrid(@SVector[1,2]) |
144 | 151 |