Mercurial > repos > public > sbplib_julia
comparison test/Grids/curvilinear_grid_test.jl @ 1502:a2dc80396808 feature/grids/curvilinear
Add functions `curvilinear_grid`
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 16 Feb 2024 10:58:17 +0100 |
parents | 495f7f201d54 |
children | 704a84eef8b6 |
comparison
equal
deleted
inserted
replaced
1501:553111a15506 | 1502:a2dc80396808 |
---|---|
141 @test_broken coarsen(cg, 2) == CurvilinearGrid(coarsen(lg,2), x̄, J) | 141 @test_broken coarsen(cg, 2) == CurvilinearGrid(coarsen(lg,2), x̄, J) |
142 | 142 |
143 @test_broken false # @test_throws DomainError(3, "Size minus 1 must be divisible by the ratio.") coarsen(cg, 3) | 143 @test_broken false # @test_throws DomainError(3, "Size minus 1 must be divisible by the ratio.") coarsen(cg, 3) |
144 end | 144 end |
145 end | 145 end |
146 | |
147 @testset "curvilinear_grid" begin | |
148 x̄((ξ, η)) = @SVector[ξ, η*(1+ξ*(ξ-1))] | |
149 J((ξ, η)) = @SMatrix[ | |
150 1 0; | |
151 2ξ-1 1+ξ*(ξ-1); | |
152 ] | |
153 cg = curvilinear_grid(x̄, J, 10, 11) | |
154 @test cg isa CurvilinearGrid{SVector{2,Float64}, 2} | |
155 | |
156 lg = equidistant_grid((10,11), (0,0), (1,1)) | |
157 @test logicalgrid(cg) == lg | |
158 @test collect(cg) == map(x̄, lg) | |
159 end |