diff src/Grids/grid.jl @ 1262:5e28ae42caf2 refactor/grids

Clean up IteratorSize and eltype for EquidistantGrid, Grid, and ZeroDimGrid
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 23 Feb 2023 22:29:36 +0100
parents 198ccda331a6
children 7a67935d3f3a
line wrap: on
line diff
--- a/src/Grids/grid.jl	Thu Feb 23 12:23:49 2023 +0100
+++ b/src/Grids/grid.jl	Thu Feb 23 22:29:36 2023 +0100
@@ -11,8 +11,8 @@
 abstract type Grid{T,D} end
 
 
-Base.ndims(::Grid{T,D}) where {T,D} = D # nidms borde nog vara antalet index som används för att indexera nätet. Snarare än vilken dimension nätet har (tänk ostrukturerat)
-Base.eltype(::Grid{T,D}) where {T,D} = T # vad ska eltype vara? Inte T väl... en vektor? SVector{T,D}?
+Base.ndims(::Grid{T,D}) where {T,D} = D
+Base.eltype(::Type{<:Grid{T}}) where T = T
 
 function refine(::Grid) end
 function coarsen(::Grid) end # Should this be here? What if it is not possible?