diff test/Grids/manifolds_test.jl @ 2003:524a52f190d7 feature/sbp_operators/laplace_curvilinear

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 29 Apr 2025 09:03:05 +0200
parents a1b2453c02c9
children
line wrap: on
line diff
--- a/test/Grids/manifolds_test.jl	Tue Feb 11 09:03:04 2025 +0100
+++ b/test/Grids/manifolds_test.jl	Tue Apr 29 09:03:05 2025 +0200
@@ -15,14 +15,23 @@
 
 @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 c([3,2]) == [6,4]
     @test parameterspace(c) == unitsquare()
     @test ndims(c) == 2
 
-    @test jacobian(c, [3,2]) == [2,2]
+    @testset "Calling" begin
+        c = Chart(X, unitsquare())
+        @test c([.3,.2]) == [.6,.4]
+        @test_throws DomainError c([3,2])
+    end
+
+    @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