comparison 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
comparison
equal deleted inserted replaced
687:5c229c889614 688:e9e46a587370
44 """ 44 """
45 function EquidistantGrid(size::Int, limit_lower::T, limit_upper::T) where T 45 function EquidistantGrid(size::Int, limit_lower::T, limit_upper::T) where T
46 return EquidistantGrid((size,),(limit_lower,),(limit_upper,)) 46 return EquidistantGrid((size,),(limit_lower,),(limit_upper,))
47 end 47 end
48 48
49 function Base.eachindex(grid::EquidistantGrid) 49 Base.eltype(grid::EquidistantGrid{Dim,T}) where {Dim,T} = T
50 CartesianIndices(grid.size) 50
51 end 51 Base.eachindex(grid::EquidistantGrid) = CartesianIndices(grid.size)
52 52
53 Base.size(g::EquidistantGrid) = g.size 53 Base.size(g::EquidistantGrid) = g.size
54 54
55 """ 55 """
56 dimension(grid::EquidistantGrid) 56 dimension(grid::EquidistantGrid)