comparison test/Grids/mapped_grid_test.jl @ 1527:69790e9d1652 feature/grids/curvilinear

Remove tests for refine and coarsen
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 09 Apr 2024 15:26:49 +0200
parents 535f32316637
children 5d32ecb98db8
comparison
equal deleted inserted replaced
1526:4df668d00d03 1527:69790e9d1652
155 @testset test_boundary_grid(mg, TensorGridBoundary{1, Upper}(), J2) 155 @testset test_boundary_grid(mg, TensorGridBoundary{1, Upper}(), J2)
156 @testset test_boundary_grid(mg, TensorGridBoundary{2, Lower}(), J1) 156 @testset test_boundary_grid(mg, TensorGridBoundary{2, Lower}(), J1)
157 @testset test_boundary_grid(mg, TensorGridBoundary{2, Upper}(), J1) 157 @testset test_boundary_grid(mg, TensorGridBoundary{2, Upper}(), J1)
158 end 158 end
159 159
160 # TBD: Should curvilinear grid support refining and coarsening?
161 # This would require keeping the coordinate mapping around which seems burdensome, and might increase compilation time?
162 @testset "refine" begin
163 @test_broken refine(mg, 1) == mg
164 @test_broken refine(mg, 2) == MappedGrid(refine(lg,2), x̄, J)
165 @test_broken refine(mg, 3) == MappedGrid(refine(lg,3), x̄, J)
166 end
167
168 @testset "coarsen" begin
169 lg = equidistant_grid((11,11), (0,0), (1,1)) # TODO: Change dims of the grid to be different
170 x̄ = map(ξ̄ -> 2ξ̄, lg)
171 J = map(ξ̄ -> @SArray(fill(2., 2, 2)), lg)
172 mg = MappedGrid(lg, x̄, J)
173
174 @test_broken coarsen(mg, 1) == mg
175 @test_broken coarsen(mg, 2) == MappedGrid(coarsen(lg,2), x̄, J)
176
177 @test_broken false # @test_throws DomainError(3, "Size minus 1 must be divisible by the ratio.") coarsen(mg, 3)
178 end
179 end 160 end
180 161
181 @testset "mapped_grid" begin 162 @testset "mapped_grid" begin
182 x̄((ξ, η)) = @SVector[ξ, η*(1+ξ*(ξ-1))] 163 x̄((ξ, η)) = @SVector[ξ, η*(1+ξ*(ξ-1))]
183 J((ξ, η)) = @SMatrix[ 164 J((ξ, η)) = @SMatrix[