Mercurial > repos > public > sbplib_julia
diff src/Grids/EquidistantGrid.jl @ 353:8257cc75ea6b feature/equidistant_grid/subgrid
Add doc string and allow picking several dimensions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 27 Sep 2020 21:04:59 +0200 |
parents | a18bd337a280 |
children | 64ad8ec0eae0 |
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl Sun Sep 27 14:38:05 2020 +0200 +++ b/src/Grids/EquidistantGrid.jl Sun Sep 27 21:04:59 2020 +0200 @@ -66,7 +66,12 @@ return broadcast(I -> grid.limit_lower .+ (I.-1).*h, indices) end -function subgrid(grid::EquidistantGrid, dim::Integer) +""" + subgrid(::EquidistantGrid, dim) + +Pick out given dimensions from the grid and return a grid for them +""" +function subgrid(grid::EquidistantGrid, dim) size = grid.size[dim] limit_lower = grid.limit_lower[dim] limit_upper = grid.limit_upper[dim]