changeset 2054:c08bc343d1cd feature/sbp_operators/laplace_curvilinear

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 07 Feb 2026 22:54:36 +0100
parents a590dc4af7ea (current diff) 3a4575fa2702 (diff)
children 274f4c1ce4b5
files src/SbpOperators/boundaryops/boundary_restriction.jl src/SbpOperators/boundaryops/normal_derivative.jl test/SbpOperators/boundaryops/boundary_restriction_test.jl test/SbpOperators/boundaryops/normal_derivative_test.jl
diffstat 4 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
diff -r a590dc4af7ea -r c08bc343d1cd src/SbpOperators/boundaryops/boundary_restriction.jl
--- a/src/SbpOperators/boundaryops/boundary_restriction.jl	Fri Feb 06 17:35:25 2026 +0100
+++ b/src/SbpOperators/boundaryops/boundary_restriction.jl	Sat Feb 07 22:54:36 2026 +0100
@@ -26,6 +26,8 @@
     return BoundaryOperator(g, converted_stencil, boundary)
 end
 
+boundary_restriction(::ZeroDimGrid, stencil_set::StencilSet, boundary) = throw(ArgumentError("ZeroDimGrid has no boundaries"))
+
 function boundary_restriction(g::MappedGrid, stencil_set::StencilSet, boundary)
     return boundary_restriction(logical_grid(g), stencil_set, boundary)
 end
diff -r a590dc4af7ea -r c08bc343d1cd src/SbpOperators/boundaryops/normal_derivative.jl
--- a/src/SbpOperators/boundaryops/normal_derivative.jl	Fri Feb 06 17:35:25 2026 +0100
+++ b/src/SbpOperators/boundaryops/normal_derivative.jl	Sat Feb 07 22:54:36 2026 +0100
@@ -29,6 +29,8 @@
     return BoundaryOperator(g, scaled_stencil, boundary)
 end
 
+normal_derivative(::ZeroDimGrid, stencil_set::StencilSet, boundary) = throw(ArgumentError("ZeroDimGrid has no boundaries"))
+
 function normal_derivative(g::MappedGrid, stencil_set::StencilSet, boundary)
     k = grid_id(boundary)
     b_indices = boundary_indices(g, boundary)
diff -r a590dc4af7ea -r c08bc343d1cd test/SbpOperators/boundaryops/boundary_restriction_test.jl
--- a/test/SbpOperators/boundaryops/boundary_restriction_test.jl	Fri Feb 06 17:35:25 2026 +0100
+++ b/test/SbpOperators/boundaryops/boundary_restriction_test.jl	Sat Feb 07 22:54:36 2026 +0100
@@ -32,6 +32,11 @@
             @test e_w isa InflatedTensor
             @test e_w isa LazyTensor{T,1,2} where T
         end
+
+        @testset "0D" begin
+            g = ZeroDimGrid(1)
+            @test_throws ArgumentError("ZeroDimGrid has no boundaries") boundary_restriction(g, stencil_set, ())
+        end
     end
 
     @testset "Application" begin
diff -r a590dc4af7ea -r c08bc343d1cd test/SbpOperators/boundaryops/normal_derivative_test.jl
--- a/test/SbpOperators/boundaryops/normal_derivative_test.jl	Fri Feb 06 17:35:25 2026 +0100
+++ b/test/SbpOperators/boundaryops/normal_derivative_test.jl	Sat Feb 07 22:54:36 2026 +0100
@@ -60,6 +60,11 @@
                 @test d_n*v ≈ v∂y[:,end] atol = 1e-13
             end
         end
+
+        @testset "0D" begin
+            g = ZeroDimGrid(1)
+            @test_throws ArgumentError("ZeroDimGrid has no boundaries") normal_derivative(g, stencil_set, ())
+        end
     end
 
     @testset "MappedGrid" begin