Mercurial > repos > public > sbplib_julia
comparison test/Grids/tensor_grid_test.jl @ 1868:81559cb7b11c feature/grids/manifolds
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 23 Jan 2025 23:22:11 +0100 |
parents | 054447ac4b0e |
children | 516eaabf1169 |
comparison
equal
deleted
inserted
replaced
1867:de4b4f2aee4f | 1868:81559cb7b11c |
---|---|
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 |