changeset 1959:b7b557f9ac5a

Merge feature/grids/multiblock_boundaries
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 11 Feb 2025 08:59:08 +0100
parents e4500727f435 (current diff) 061f2f0d50c9 (diff)
children 00cac08777b1 608a24a7b13b
files
diffstat 3 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/Grids.jl	Tue Feb 11 08:53:09 2025 +0100
+++ b/src/Grids/Grids.jl	Tue Feb 11 08:59:08 2025 +0100
@@ -55,6 +55,7 @@
 export spacing
 export equidistant_grid
 
+export MultiBlockBoundary
 
 # MappedGrid
 export MappedGrid
@@ -69,5 +70,6 @@
 include("equidistant_grid.jl")
 include("zero_dim_grid.jl")
 include("mapped_grid.jl")
+include("multiblockgrids.jl")
 
 end # module
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Grids/multiblockgrids.jl	Tue Feb 11 08:59:08 2025 +0100
@@ -0,0 +1,9 @@
+"""
+    MultiBlockBoundary{N, BID} <: BoundaryIdentifier
+
+A boundary identifier for a multiblock grids. `N` Specifies which grid and
+`BID` which boundary on that grid.
+"""
+struct MultiBlockBoundary{N, BID} <: BoundaryIdentifier end
+grid_id(::MultiBlockBoundary{N, BID}) where {N, BID} = N
+boundary_id(::MultiBlockBoundary{N, BID}) where {N, BID} = BID()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/Grids/multiblockgrids_test.jl	Tue Feb 11 08:59:08 2025 +0100
@@ -0,0 +1,9 @@
+using Diffinitive.Grids
+
+@testset "MultiBlockBoundary" begin
+    @test MultiBlockBoundary{1,UpperBoundary}() isa BoundaryIdentifier
+
+    @test grid_id(MultiBlockBoundary{1,UpperBoundary}()) == 1
+
+    @test boundary_id(MultiBlockBoundary{1,UpperBoundary}()) == UpperBoundary()
+end