Mercurial > repos > public > sbplib_julia
diff Grids/src/EquidistantGrid.jl @ 324:047dee8efaef
Grids.EquidistantGrid: Add constructor for 1d grid
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 24 Sep 2020 21:28:28 +0200 |
parents | 12b738f260a0 |
children |
line wrap: on
line diff
--- a/Grids/src/EquidistantGrid.jl Thu Sep 24 21:04:25 2020 +0200 +++ b/Grids/src/EquidistantGrid.jl Thu Sep 24 21:28:28 2020 +0200 @@ -21,6 +21,10 @@ end end +function EquidistantGrid(size::Int, limit_lower::T, limit_upper::T) where T + return EquidistantGrid((size,),(limit_lower,),(limit_upper,)) +end + function Base.eachindex(grid::EquidistantGrid) CartesianIndices(grid.size) end