diff src/Grids/multiblockgrids.jl @ 2017:ea2a15454cf2 feature/grids/multiblock_grids

Add connectio(...) to simplify the creation of grid connection tuples
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 12 Mar 2025 09:32:32 +0100
parents e68669552ed8
children a3ffc3202813
line wrap: on
line diff
--- a/src/Grids/multiblockgrids.jl	Wed Mar 12 08:59:28 2025 +0100
+++ b/src/Grids/multiblockgrids.jl	Wed Mar 12 09:32:32 2025 +0100
@@ -7,3 +7,13 @@
 struct MultiBlockBoundary{N, BID} <: BoundaryIdentifier end
 grid_id(::MultiBlockBoundary{N, BID}) where {N, BID} = N
 boundary_id(::MultiBlockBoundary{N, BID}) where {N, BID} = BID()
+
+
+function connection(k1, b1::BoundaryIdentifier, k2, b2::BoundaryIdentifier)
+    return (
+        MultiBlockBoundary{k1,typeof(b1)}(),
+        MultiBlockBoundary{k2,typeof(b2)}(),
+    )
+end
+
+connection(t::Tuple) = connection(t...)