Mercurial > repos > public > sbplib_julia
diff src/Grids/EquidistantGrid.jl @ 666:94fe0761e6f9 feature/laplace_opset
Merge in changes from default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sun, 31 Jan 2021 20:59:29 +0100 |
parents | f0ceddeae993 |
children | 1d3e29ffc6c6 |
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl Sun Jan 31 13:13:06 2021 +0100 +++ b/src/Grids/EquidistantGrid.jl Sun Jan 31 20:59:29 2021 +0100 @@ -46,10 +46,7 @@ The dimension of the grid. """ -function dimension(grid::EquidistantGrid) - return length(grid.size) -end - +dimension(grid::EquidistantGrid{Dim}) where Dim = Dim """ spacing(grid::EquidistantGrid) @@ -95,3 +92,15 @@ return EquidistantGrid(size, limit_lower, limit_upper) end export restrict + +""" + boundary_identifiers(::EquidistantGrid) + +Returns a tuple containing the boundary identifiers for the grid, stored as + (CartesianBoundary(1,Lower), + CartesianBoundary(1,Upper), + CartesianBoundary(2,Lower), + ...) +""" +boundary_identifiers(g::EquidistantGrid) = (((ntuple(i->(CartesianBoundary{i,Lower}(),CartesianBoundary{i,Upper}()),dimension(g)))...)...,) +export boundary_identifiers