Mercurial > repos > public > sbplib_julia
diff src/Grids/zero_dim_grid.jl @ 1268:dbddd0f61bde refactor/grids
Add refine, coarsen, boundary_identifiers, and boundary_grid methods to ZeroDimGrid
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 24 Feb 2023 21:54:39 +0100 |
parents | 5e28ae42caf2 |
children | 8860bfcaedaa |
line wrap: on
line diff
--- a/src/Grids/zero_dim_grid.jl Fri Feb 24 21:48:01 2023 +0100 +++ b/src/Grids/zero_dim_grid.jl Fri Feb 24 21:54:39 2023 +0100 @@ -17,3 +17,10 @@ Base.IteratorSize(::Type{<:ZeroDimGrid}) = Base.HasShape{0}() Base.length(g::ZeroDimGrid) = 1 Base.size(g::ZeroDimGrid) = () + + +refine(g::ZeroDimGrid, ::Int) = g +coarsen(g::ZeroDimGrid, ::Int) = g + +boundary_identifiers(g::ZeroDimGrid) = () +boundary_grid(g::ZeroDimGrid, ::Any) = throw(ArgumentError("ZeroDimGrid has no boundaries"))