diff src/Grids/equidistant_grid.jl @ 1480:4550beef9694 feature/boundary_conditions

Merge with default
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Sat, 23 Dec 2023 23:03:13 +0100
parents 37cf9f79caa4
children 553111a15506 d7bc11053951
line wrap: on
line diff
--- a/src/Grids/equidistant_grid.jl	Sat Dec 23 23:01:28 2023 +0100
+++ b/src/Grids/equidistant_grid.jl	Sat Dec 23 23:03:13 2023 +0100
@@ -29,6 +29,7 @@
 Base.IteratorSize(::Type{<:EquidistantGrid}) = Base.HasShape{1}()
 Base.length(g::EquidistantGrid) = length(g.points)
 Base.size(g::EquidistantGrid) = size(g.points)
+Base.size(g::EquidistantGrid, d) = size(g.points)[d]
 
 
 """
@@ -50,7 +51,8 @@
 boundary_identifiers(::EquidistantGrid) = (Lower(), Upper())
 boundary_grid(g::EquidistantGrid, id::Lower) = ZeroDimGrid(g[begin])
 boundary_grid(g::EquidistantGrid, id::Upper) = ZeroDimGrid(g[end])
-
+boundary_indices(g::EquidistantGrid, id::Lower) = (1,)
+boundary_indices(g::EquidistantGrid, id::Upper) = (length(g),)
 
 """
     refine(g::EquidistantGrid, r::Int)