changeset 1704:e5e76c8e52c5 feature/grids/curvilinear

Fix todos and add broken test for mapped_grid(::Grid,...)
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 04 Sep 2024 15:26:59 +0200
parents 6eb5b48607e0
children 4870fc3faa25
files src/Grids/mapped_grid.jl test/Grids/mapped_grid_test.jl
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/mapped_grid.jl	Wed Sep 04 07:59:24 2024 +0200
+++ b/src/Grids/mapped_grid.jl	Wed Sep 04 15:26:59 2024 +0200
@@ -16,7 +16,6 @@
 Base.lastindex(g::MappedGrid, d) = lastindex(g.logicalgrid, d)
 
 # Iteration interface
-
 Base.iterate(g::MappedGrid) = iterate(g.physicalcoordinates)
 Base.iterate(g::MappedGrid, state) = iterate(g.physicalcoordinates, state)
 
@@ -60,7 +59,6 @@
         map(J,lg),
     )
 end
-# TODO: Delete this function
 
 function jacobian_determinant(g::MappedGrid)
     return map(jacobian(g)) do ∂x∂ξ
--- a/test/Grids/mapped_grid_test.jl	Wed Sep 04 07:59:24 2024 +0200
+++ b/test/Grids/mapped_grid_test.jl	Wed Sep 04 15:26:59 2024 +0200
@@ -35,6 +35,7 @@
 
     # TODO: Test constructor for different dims of range and domain for the coordinates
     # TODO: Test constructor with different type than TensorGrid. a dummy type?
+    # TODO: Test that the element types agree
 
     @test_broken false # @test_throws ArgumentError("Sizes must match") MappedGrid(lg, map(ξ̄ -> @SArray[ξ̄[1], ξ̄[2], -ξ̄[1]], lg), rand(SMatrix{2,3,Float64},15,11))
 
@@ -186,6 +187,8 @@
     lg = equidistant_grid((0,0), (1,1), 10, 11)
     @test logicalgrid(mg) == lg
     @test collect(mg) == map(x̄, lg)
+
+    @test_broken mapped_grid(lg, x̄, J) == mg
 end
 
 @testset "jacobian_determinant" begin