Mercurial > repos > public > sbplib_julia
comparison test/Grids/EquidistantGrid_test.jl @ 1092:c4ea28d904f5 refactor/grids
Fix grid indexing with CartesianIndex
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 27 Apr 2022 10:25:53 +0200 |
parents | 9b40aeac4269 |
children |
comparison
equal
deleted
inserted
replaced
1090:9b40aeac4269 | 1092:c4ea28d904f5 |
---|---|
50 @test g[1,3] == (-1.0,7.11) | 50 @test g[1,3] == (-1.0,7.11) |
51 @test g[5,1] == (0.0,0.0) | 51 @test g[5,1] == (0.0,0.0) |
52 @test g[5,3] == (0.0,7.11) | 52 @test g[5,3] == (0.0,7.11) |
53 | 53 |
54 @test g[4,2] == (-0.25,7.11/2) | 54 @test g[4,2] == (-0.25,7.11/2) |
55 | |
56 @test g[CartesianIndex(1,3)] == (-1.0,7.11) | |
55 end | 57 end |
56 | 58 |
57 # restrict | 59 # restrict |
58 g = EquidistantGrid((5,3), (0.0,0.0), (2.0,1.0)) | 60 g = EquidistantGrid((5,3), (0.0,0.0), (2.0,1.0)) |
59 @test restrict(g, 1) == EquidistantGrid(5,0.0,2.0) | 61 @test restrict(g, 1) == EquidistantGrid(5,0.0,2.0) |