Mercurial > repos > public > sbplib_julia
diff src/Grids/grid.jl @ 1334:47e309eac131 refactor/grids
Add docs for coordinate_size and component_type
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 03 May 2023 15:41:45 +0200 |
parents | 79a2193da5c1 |
children | 52087a6c0682 |
line wrap: on
line diff
--- a/src/Grids/grid.jl Wed May 03 15:39:34 2023 +0200 +++ b/src/Grids/grid.jl Wed May 03 15:41:45 2023 +0200 @@ -20,9 +20,19 @@ Base.ndims(::Grid{T,D}) where {T,D} = D Base.eltype(::Type{<:Grid{T}}) where T = T +""" + coordinate_size(grid) + +The lenght of the coordinate vector for the given grid. +""" coordinate_size(::Type{<:Grid{T}}) where T = _ncomponents(T) coordinate_size(g::Grid) = coordinate_size(typeof(g)) # TBD: Name of this function?! +""" + component_type(grid) + +The type of the components of the coordinate vector. +""" component_type(::Type{<:Grid{T}}) where T = eltype(T) component_type(g::Grid) = component_type(typeof(g))