Mercurial > repos > public > sbplib_julia
diff src/Grids/EquidistantGrid.jl @ 765:fdd48f6ace1c operator_storage_array_of_table
Merge in default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 07 Feb 2021 21:32:21 +0100 |
parents | f0ceddeae993 |
children | 1d3e29ffc6c6 |
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl Sat Feb 06 20:45:34 2021 +0100 +++ b/src/Grids/EquidistantGrid.jl Sun Feb 07 21:32:21 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