changeset 1867:de4b4f2aee4f feature/grids/manifolds

Add some tests for CartesianAtlas
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 12 Nov 2024 18:15:27 +0100
parents 1987347752ef
children 81559cb7b11c
files src/Grids/Grids.jl src/Grids/manifolds.jl test/Grids/manifolds_test.jl
diffstat 3 files changed, 30 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/Grids.jl	Tue Oct 22 15:44:03 2024 +0200
+++ b/src/Grids/Grids.jl	Tue Nov 12 18:15:27 2024 +0100
@@ -25,7 +25,12 @@
 export unitsimplex
 
 export Chart
-export ConcreteChart
+
+export Atlas
+export charts
+export connections
+export CartesianAtlas
+
 export parameterspace
 
 # Grid
--- a/src/Grids/manifolds.jl	Tue Oct 22 15:44:03 2024 +0200
+++ b/src/Grids/manifolds.jl	Tue Nov 12 18:15:27 2024 +0100
@@ -120,7 +120,7 @@
 # TBD: Can we register a error hint for when jacobian is called with a function that doesn't have a registered jacobian?
 
 
-# TBD: Should Charts, parameterspaces have boundary names?
+# TBD: Should Charts, parameterspaces, Atlases, have boundary names?
 
 """
     Atlas
--- a/test/Grids/manifolds_test.jl	Tue Oct 22 15:44:03 2024 +0200
+++ b/test/Grids/manifolds_test.jl	Tue Nov 12 18:15:27 2024 +0100
@@ -73,7 +73,29 @@
 end
 
 @testset "CartesianAtlas" begin
-    @test_broken false
+    c = Chart(identity, unitsquare())
+
+    a = CartesianAtlas([c c; c c])
+    @test a isa Atlas
+    @test charts(a) == [c c; c c]
+    @test_broken connections(a) == [
+        (
+            ((1,1), CartesianBoundary{1,UpperBoundary}()),
+            ((1,2), CartesianBoundary{1,LowerBoundary}()),
+        ),
+        (
+            ((1,1), CartesianBoundary{2,LowerBoundary}()),
+            ((2,1), CartesianBoundary{2,UpperBoundary}()),
+        ),
+        (
+            ((2,2), CartesianBoundary{1,LowerBoundary}()),
+            ((2,1), CartesianBoundary{1,UpperBoundary}()),
+        ),
+        (
+            ((2,2), CartesianBoundary{2,UpperBoundary}()),
+            ((1,2), CartesianBoundary{2,LowerBoundary}()),
+        )
+    ]
 end
 
 @testset "UnstructuredAtlas" begin