changeset 1946:c63116e2ec8e feature/grids/manifolds

Make boundaries() a method of boundary_identifiers
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 07 Feb 2025 17:37:42 +0100
parents 19efb9dacfff
children 76c6bde84656
files src/Grids/Grids.jl src/Grids/manifolds.jl test/Grids/manifolds_test.jl
diffstat 3 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/Grids.jl	Fri Feb 07 15:56:26 2025 +0100
+++ b/src/Grids/Grids.jl	Fri Feb 07 17:37:42 2025 +0100
@@ -29,7 +29,6 @@
 export Atlas
 export charts
 export connections
-export boundaries
 export CartesianAtlas
 export UnstructuredAtlas
 
--- a/src/Grids/manifolds.jl	Fri Feb 07 15:56:26 2025 +0100
+++ b/src/Grids/manifolds.jl	Fri Feb 07 17:37:42 2025 +0100
@@ -33,7 +33,7 @@
 jacobian(c::Chart, ξ) = jacobian(c.mapping, ξ)
 # TBD: Can we register a error hint for when jacobian is called with a function that doesn't have a registered jacobian?
 
-boundaries(c::Chart) = boundary_identifiers(parameterspace(c))
+boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c))
 
 
 """
@@ -86,7 +86,7 @@
     return c
 end
 
-function boundaries(a::CartesianAtlas)
+function boundary_identifiers(a::CartesianAtlas)
     bs = MultiBlockBoundary[]
 
     for d ∈ 1:ndims(charts(a))
@@ -114,11 +114,11 @@
 charts(a::UnstructuredAtlas) = a.charts
 connections(a::UnstructuredAtlas) = a.connections
 
-function boundaries(a::UnstructuredAtlas)
+function boundary_identifiers(a::UnstructuredAtlas)
     bs = MultiBlockBoundary[]
 
     for (i,c) ∈ enumerate(charts(a))
-        for b ∈ boundaries(c)
+        for b ∈ boundary_identifiers(c)
             mbb = MultiBlockBoundary{i,typeof(b)}()
 
             if !any(cn->mbb∈cn, connections(a))
--- a/test/Grids/manifolds_test.jl	Fri Feb 07 15:56:26 2025 +0100
+++ b/test/Grids/manifolds_test.jl	Fri Feb 07 17:37:42 2025 +0100
@@ -24,7 +24,7 @@
 
     @test jacobian(c, [3,2]) == [2,2]
 
-    @test Set(boundaries(Chart(X,unitsquare()))) == Set([east(),west(),south(),north()])
+    @test Set(boundary_identifiers(Chart(X,unitsquare()))) == Set([east(),west(),south(),north()])
 end
 
 @testset "CartesianAtlas" begin
@@ -88,10 +88,10 @@
         ])
     end
 
-    @testset "boundaries" begin
+    @testset "boundary_identifiers" begin
         # 2D
         a = CartesianAtlas(fill(Chart(identity, unitcube()), 2,3))
-        @test Set(boundaries(a)) == Set([
+        @test Set(boundary_identifiers(a)) == Set([
             MultiBlockBoundary{(1,1), south}(),
             MultiBlockBoundary{(2,1), south}(),
             MultiBlockBoundary{(2,1), east}(),
@@ -106,7 +106,7 @@
 
         # 3D
         a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,2,3))
-        @test Set(boundaries(a)) == Set([
+        @test Set(boundary_identifiers(a)) == Set([
             MultiBlockBoundary{(1,1,1), bottom}(),
             MultiBlockBoundary{(2,1,1), bottom}(),
             MultiBlockBoundary{(1,2,1), bottom}(),
@@ -185,7 +185,7 @@
         @test connections(a) == cn
     end
 
-    @testset "boundaries" begin
+    @testset "boundary_identifiers" begin
         c = Chart(identity, unitsquare())
         cn = [
             (MultiBlockBoundary{1, east}(), MultiBlockBoundary{2, west}()),
@@ -195,7 +195,7 @@
 
         a = UnstructuredAtlas([c, c, c], cn)
 
-        @test Set(boundaries(a)) == Set([
+        @test Set(boundary_identifiers(a)) == Set([
             MultiBlockBoundary{1, west}(),
             MultiBlockBoundary{1, south}(),
             MultiBlockBoundary{2, south}(),