Mercurial > repos > public > sbplib_julia
comparison test/Grids/EquidistantGrid_test.jl @ 911:a378ab959b6f
Merge feature/equidistant_grid/refine
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 15 Feb 2022 15:14:28 +0100 |
parents | e81b89ae17c4 |
children | 9b40aeac4269 6530fceef37c |
comparison
equal
deleted
inserted
replaced
864:9a2776352c2a | 911:a378ab959b6f |
---|---|
96 @test boundary_grid(g,id_t) == restrict(g,[1,2]) | 96 @test boundary_grid(g,id_t) == restrict(g,[1,2]) |
97 @test boundary_grid(g,id_b) == restrict(g,[1,2]) | 97 @test boundary_grid(g,id_b) == restrict(g,[1,2]) |
98 @test_throws DomainError boundary_grid(g,CartesianBoundary{4,Lower}()) | 98 @test_throws DomainError boundary_grid(g,CartesianBoundary{4,Lower}()) |
99 end | 99 end |
100 end | 100 end |
101 | |
102 @testset "refine" begin | |
103 @test refine(EquidistantGrid{Float64}(), 1) == EquidistantGrid{Float64}() | |
104 @test refine(EquidistantGrid{Float64}(), 2) == EquidistantGrid{Float64}() | |
105 | |
106 g = EquidistantGrid((10,5),(0.,1.),(2.,3.)) | |
107 @test refine(g, 1) == g | |
108 @test refine(g, 2) == EquidistantGrid((19,9),(0.,1.),(2.,3.)) | |
109 @test refine(g, 3) == EquidistantGrid((28,13),(0.,1.),(2.,3.)) | |
110 end | |
111 | |
112 @testset "coarsen" begin | |
113 @test coarsen(EquidistantGrid{Float64}(), 1) == EquidistantGrid{Float64}() | |
114 @test coarsen(EquidistantGrid{Float64}(), 2) == EquidistantGrid{Float64}() | |
115 | |
116 g = EquidistantGrid((7,13),(0.,1.),(2.,3.)) | |
117 @test coarsen(g, 1) == g | |
118 @test coarsen(g, 2) == EquidistantGrid((4,7),(0.,1.),(2.,3.)) | |
119 @test coarsen(g, 3) == EquidistantGrid((3,5),(0.,1.),(2.,3.)) | |
120 | |
121 @test_throws DomainError(4, "Size minus 1 must be divisible by the ratio.") coarsen(g, 4) == EquidistantGrid((3,5),(0.,1.),(2.,3.)) | |
122 end | |
101 end | 123 end |