comparison test/Grids/EquidistantGrid_test.jl @ 1091:e3b41d48b5aa feature/variable_derivatives

Merge refactor/grids
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 26 Apr 2022 14:29:08 +0200
parents 9b40aeac4269
children c4ea28d904f5
comparison
equal deleted inserted replaced
1083:de972d825289 1091:e3b41d48b5aa
39 (-0.5,0.) (-0.5,7.11/2) (-0.5,7.11); 39 (-0.5,0.) (-0.5,7.11/2) (-0.5,7.11);
40 (-0.25,0.) (-0.25,7.11/2) (-0.25,7.11); 40 (-0.25,0.) (-0.25,7.11/2) (-0.25,7.11);
41 (0.,0.) (0.,7.11/2) (0.,7.11)] 41 (0.,0.) (0.,7.11/2) (0.,7.11)]
42 for i ∈ eachindex(gp) 42 for i ∈ eachindex(gp)
43 @test [gp[i]...] ≈ [p[i]...] atol=5e-13 43 @test [gp[i]...] ≈ [p[i]...] atol=5e-13
44 end
45
46
47 @testset "getindex" begin
48 g = EquidistantGrid((5,3), (-1.0,0.0), (0.0,7.11))
49 @test g[1,1] == (-1.0,0.0)
50 @test g[1,3] == (-1.0,7.11)
51 @test g[5,1] == (0.0,0.0)
52 @test g[5,3] == (0.0,7.11)
53
54 @test g[4,2] == (-0.25,7.11/2)
44 end 55 end
45 56
46 # restrict 57 # restrict
47 g = EquidistantGrid((5,3), (0.0,0.0), (2.0,1.0)) 58 g = EquidistantGrid((5,3), (0.0,0.0), (2.0,1.0))
48 @test restrict(g, 1) == EquidistantGrid(5,0.0,2.0) 59 @test restrict(g, 1) == EquidistantGrid(5,0.0,2.0)