changeset 1941:1e3089197397 feature/grids/manifolds

Add tests for boundaries(::UnstructuredAtlas). Attempt implementation but more Charts functionality is needed
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 07 Feb 2025 13:59:13 +0100
parents 1bd0e23499da
children b8395f69ad80
files src/Grids/manifolds.jl test/Grids/manifolds_test.jl
diffstat 2 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/manifolds.jl	Fri Feb 07 13:58:29 2025 +0100
+++ b/src/Grids/manifolds.jl	Fri Feb 07 13:59:13 2025 +0100
@@ -115,5 +115,13 @@
 connections(a::UnstructuredAtlas) = a.connections
 
 function boundaries(a::UnstructuredAtlas)
-    return nothing
+    bs = MultiBlockBoundary[]
+
+    for c ∈ charts(a)
+        for b ∈ boundaries(c)
+            if !any(cn->b∈cn, connections(a))
+                push!(bs, b)
+            end
+        end
+    end
 end
--- a/test/Grids/manifolds_test.jl	Fri Feb 07 13:58:29 2025 +0100
+++ b/test/Grids/manifolds_test.jl	Fri Feb 07 13:59:13 2025 +0100
@@ -184,6 +184,23 @@
     end
 
     @testset "boundaries" begin
-        @test_broken false
+        c = Chart(identity, unitsquare())
+        cn = [
+            (MultiBlockBoundary{1, east}(), MultiBlockBoundary{2, west}()),
+            (MultiBlockBoundary{1, north}(), MultiBlockBoundary{3, west}()),
+            (MultiBlockBoundary{2, north}(),  MultiBlockBoundary{3, south}()),
+        ]
+
+        a = UnstructuredAtlas([c, c, c], cn)
+
+        @test_broken Set(boundaries(a)) == Set([
+            MultiBlockBoundary{1, west}(),
+            MultiBlockBoundary{1, south}(),
+            MultiBlockBoundary{2, south}(),
+            MultiBlockBoundary{2, east}(),
+            MultiBlockBoundary{3, north}(),
+            MultiBlockBoundary{3, east}(),
+        ])
+
     end
 end