changeset 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 cca45af5e724
files src/Grids/grid.jl
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
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))