Mercurial > repos > public > sbplib_julia
changeset 1912:e68669552ed8 feature/grids/multiblock_boundaries
Add MultiBlockBoundary
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 03 Feb 2025 23:10:12 +0100 |
parents | 418566cdd689 |
children | 27a2d37ff3b4 b0fcb29e3620 |
files | src/Grids/Grids.jl src/Grids/multiblockgrids.jl test/Grids/multiblockgrids_test.jl |
diffstat | 3 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Grids/Grids.jl Fri Jan 31 20:35:28 2025 +0100 +++ b/src/Grids/Grids.jl Mon Feb 03 23:10:12 2025 +0100 @@ -35,6 +35,8 @@ export spacing export equidistant_grid +export MultiBlockBoundary + # MappedGrid export MappedGrid @@ -48,5 +50,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 Mon Feb 03 23:10:12 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 Mon Feb 03 23:10:12 2025 +0100 @@ -0,0 +1,10 @@ +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