changeset 1493:58b8da9c7e56 feature/grids/curvilinear

Implement boundary_indices
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 01 Dec 2023 12:00:07 +0100
parents d9d9ab18cdfc
children 495f7f201d54
files src/Grids/curvilinear_grid.jl test/Grids/curvilinear_grid_test.jl
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/curvilinear_grid.jl	Fri Dec 01 11:52:26 2023 +0100
+++ b/src/Grids/curvilinear_grid.jl	Fri Dec 01 12:00:07 2023 +0100
@@ -27,6 +27,7 @@
 Base.size(g::CurvilinearGrid, d) = size(g.logicalgrid, d)
 
 boundary_identifiers(g::CurvilinearGrid) = boundary_identifiers(g.logicalgrid)
+boundary_indices(g::CurvilinearGrid, id::TensorGridBoundary) = boundary_indices(g.logicalgrid, id)
 
 function boundary_grid(g::CurvilinearGrid, id::TensorGridBoundary)
     b_indices = boundary_indices(g.logicalgrid, id)
--- a/test/Grids/curvilinear_grid_test.jl	Fri Dec 01 11:52:26 2023 +0100
+++ b/test/Grids/curvilinear_grid_test.jl	Fri Dec 01 12:00:07 2023 +0100
@@ -110,6 +110,12 @@
         @test boundary_identifiers(cg) == boundary_identifiers(lg)
     end
 
+    @testset "boundary_indices" begin
+        @test boundary_indices(cg, CartesianBoundary{1,Lower}()) == boundary_indices(lg,CartesianBoundary{1,Lower}())
+        @test boundary_indices(cg, CartesianBoundary{2,Lower}()) == boundary_indices(lg,CartesianBoundary{2,Lower}())
+        @test boundary_indices(cg, CartesianBoundary{1,Upper}()) == boundary_indices(lg,CartesianBoundary{1,Upper}())
+    end
+
     @testset "boundary_grid" begin
         @test_broken boundary_grid(cg, TensorGridBoundary{1, Lower}()) == 2. * boundary_grid(lg,TensorGridBoundary{1, Lower()})
         @test_broken boundary_grid(cg, TensorGridBoundary{1, Upper}()) == 2. * boundary_grid(lg,TensorGridBoundary{1, Upper()})