Mercurial > repos > public > sbplib_julia
diff src/Grids/EquidistantGrid.jl @ 908:bc71dd5b8311 feature/equidistant_grid/refine
More docs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 15 Feb 2022 11:38:13 +0100 |
parents | e81b89ae17c4 |
children | b900fea1c057 |
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl Tue Feb 15 11:36:12 2022 +0100 +++ b/src/Grids/EquidistantGrid.jl Tue Feb 15 11:38:13 2022 +0100 @@ -146,6 +146,8 @@ Refines `grid` by a factor `r`. The factor is applied to the number of intervals which is 1 less than the size of the grid. + +See also: [`coarsen`](@ref) """ function refine(grid::EquidistantGrid, r::Int) sz = size(grid) @@ -153,6 +155,15 @@ return EquidistantGrid{dimension(grid), eltype(grid)}(new_sz, grid.limit_lower, grid.limit_upper) end +""" + coarsen(grid::EquidistantGrid, r::Int) + +Coarsens `grid` by a factor `r`. The factor is applied to the number of +intervals which is 1 less than the size of the grid. If the number of +intervals are not divisible by `r` an error is raised. + +See also: [`refine`](@ref) +""" function coarsen(grid::EquidistantGrid, r::Int) sz = size(grid)