changeset 1740:9f2bc8ea6a07 feature/grids/curvilinear

Add some tests for the getters
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 11 Sep 2024 09:03:55 +0200
parents e1ae5d8e30c3
children 248304f88e49
files test/Grids/mapped_grid_test.jl
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/Grids/mapped_grid_test.jl	Wed Sep 11 08:59:03 2024 +0200
+++ b/test/Grids/mapped_grid_test.jl	Wed Sep 11 09:03:55 2024 +0200
@@ -30,10 +30,20 @@
 @testset "MappedGrid" begin
     @testset "Constructor" begin
         lg = equidistant_grid((0,0), (1,1), 11, 21)
+
+
         x̄ = map(ξ̄ -> 2ξ̄, lg)
         J = map(ξ̄ -> @SArray(fill(2., 2, 2)), lg)
         mg = MappedGrid(lg, x̄, J)
 
+        @test mg isa Grid{SVector{2, Float64},2}
+        @test jacobian(mg) isa Array{<:AbstractMatrix}
+        @test logicalgrid(mg) isa Grid
+
+        @test collect(mg) == x̄
+        @test jacobian(mg) == J
+        @test logicalgrid(mg) == lg
+
         # 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
@@ -41,10 +51,6 @@
         @test_broken false # @test_throws ArgumentError("Sizes must match") MappedGrid(lg, map(ξ̄ -> @SArray[ξ̄[1], ξ̄[2], -ξ̄[1]], lg), rand(SMatrix{2,3,Float64},15,11))
 
 
-        @test mg isa Grid{SVector{2, Float64},2}
-
-        @test jacobian(mg) isa Array{<:AbstractMatrix}
-        @test logicalgrid(mg) isa Grid
     end
 
     @testset "Indexing Interface" begin