diff test/Grids/manifolds_test.jl @ 1999:a1b2453c02c9 feature/grids/manifolds

Add check in jacobian for the coordinate to be in the parameterspace of the chart
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 25 Apr 2025 16:05:58 +0200
parents 6dd00ea0511a
children
line wrap: on
line diff
--- a/test/Grids/manifolds_test.jl	Fri Apr 25 08:28:34 2025 +0200
+++ b/test/Grids/manifolds_test.jl	Fri Apr 25 16:05:58 2025 +0200
@@ -15,7 +15,7 @@
 
 @testset "Chart" begin
     X(ξ) = 2ξ
-    Grids.jacobian(::typeof(X), ξ) = @SVector[2,2]
+    Grids.jacobian(::typeof(X), ξ) = @SMatrix[2 0; 0 2]
     c = Chart(X, unitsquare())
     @test c isa Chart{2}
     @test parameterspace(c) == unitsquare()
@@ -27,7 +27,11 @@
         @test_throws DomainError c([3,2])
     end
 
-    @test jacobian(c, [3,2]) == [2,2]
+    @testset "jacobian(::Chart, ⋅)" begin
+        c = Chart(X, unitsquare())
+        @test_throws DomainError jacobian(c, [3,2])
+        @test jacobian(c, [.3,.2]) == [2 0; 0 2]
+    end
 
     @test Set(boundary_identifiers(Chart(X,unitsquare()))) == Set([east(),west(),south(),north()])
 end