Mercurial > repos > public > sbplib_julia
comparison test/testGrids.jl @ 407:b7734413003d test/equidistantgrid
Simplify test
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 13 Oct 2020 18:09:02 +0200 |
parents | c377fc37c04b |
children | b21fea54ca10 |
comparison
equal
deleted
inserted
replaced
406:c377fc37c04b | 407:b7734413003d |
---|---|
34 p = [(-1.,0.) (-1.,7.11/2) (-1.,7.11); | 34 p = [(-1.,0.) (-1.,7.11/2) (-1.,7.11); |
35 (-0.75,0.) (-0.75,7.11/2) (-0.75,7.11); | 35 (-0.75,0.) (-0.75,7.11/2) (-0.75,7.11); |
36 (-0.5,0.) (-0.5,7.11/2) (-0.5,7.11); | 36 (-0.5,0.) (-0.5,7.11/2) (-0.5,7.11); |
37 (-0.25,0.) (-0.25,7.11/2) (-0.25,7.11); | 37 (-0.25,0.) (-0.25,7.11/2) (-0.25,7.11); |
38 (0.,0.) (0.,7.11/2) (0.,7.11)] | 38 (0.,0.) (0.,7.11/2) (0.,7.11)] |
39 approxequal = true; | |
40 for i ∈ eachindex(gp) | 39 for i ∈ eachindex(gp) |
41 approxequal=approxequal&&all(isapprox.(gp[i],p[i], atol=5e-13)); | 40 @test [gp[i]...] ≈ [p[i]...] atol=5e-13 |
42 end | 41 end |
43 @test approxequal == true | |
44 | |
45 | 42 |
46 # restrict | 43 # restrict |
47 g = EquidistantGrid((5,3), (0.0,0.0), (2.0,1.0)) | 44 g = EquidistantGrid((5,3), (0.0,0.0), (2.0,1.0)) |
48 @test restrict(g, 1) == EquidistantGrid(5,0.0,2.0) | 45 @test restrict(g, 1) == EquidistantGrid(5,0.0,2.0) |
49 @test restrict(g, 2) == EquidistantGrid(3,0.0,1.0) | 46 @test restrict(g, 2) == EquidistantGrid(3,0.0,1.0) |