diff src/Grids/EquidistantGrid.jl @ 688:e9e46a587370 feature/boundary_quads

Add eltype function to EquidistantGrids
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 12 Feb 2021 16:42:43 +0100
parents 27dcac8fb350
children dd2ab001a7b6
line wrap: on
line diff
--- a/src/Grids/EquidistantGrid.jl	Tue Feb 09 14:40:26 2021 +0100
+++ b/src/Grids/EquidistantGrid.jl	Fri Feb 12 16:42:43 2021 +0100
@@ -46,9 +46,9 @@
 	return EquidistantGrid((size,),(limit_lower,),(limit_upper,))
 end
 
-function Base.eachindex(grid::EquidistantGrid)
-    CartesianIndices(grid.size)
-end
+Base.eltype(grid::EquidistantGrid{Dim,T}) where {Dim,T} = T
+
+Base.eachindex(grid::EquidistantGrid) = CartesianIndices(grid.size)
 
 Base.size(g::EquidistantGrid) = g.size