changeset 1331:ed3ea0630825 refactor/grids

Add some docs for Grid
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 03 May 2023 15:29:44 +0200
parents 5f05a708d730
children ad31c1022e42
files src/Grids/equidistant_grid.jl src/Grids/grid.jl src/Grids/tensor_grid.jl
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/equidistant_grid.jl	Tue May 02 22:42:25 2023 +0200
+++ b/src/Grids/equidistant_grid.jl	Wed May 03 15:29:44 2023 +0200
@@ -1,5 +1,7 @@
 """
-# TODO:
+    EquidistantGrid{T,R<:AbstractRange{T}} <: Grid{T,1}
+
+TODO
 """
 #TODO: Document recomendations for type of range. (LinRange is faster?)
 struct EquidistantGrid{T,R<:AbstractRange{T}} <: Grid{T,1}
--- a/src/Grids/grid.jl	Tue May 02 22:42:25 2023 +0200
+++ b/src/Grids/grid.jl	Wed May 03 15:29:44 2023 +0200
@@ -1,11 +1,19 @@
 """
      Grid{T,D}
 
-The top level type for grids.
+A grid with coordinates of type `T`, e.g. `SVector{3,Float64}`, and dimension
+`D`. The grid can be embedded in a higher dimension in which case the number
+of indices and the number of components of the coordinatevectors will be
+different.
 
-TODO:
-Should implement
- * interfaces for iteration and indexing
+`Grids` is top level abstract type for grids. A grid should implement Julia's interfaces for
+indexing and iteration.
+
+## Note
+
+Importantly a grid does not have to be an `AbstractArray`. The reason is to
+allow flexible handling of special types of grids like multiblock-grids, or
+grids with special indexing.
 """
 abstract type Grid{T,D} end
 
--- a/src/Grids/tensor_grid.jl	Tue May 02 22:42:25 2023 +0200
+++ b/src/Grids/tensor_grid.jl	Wed May 03 15:29:44 2023 +0200
@@ -2,6 +2,7 @@
     TensorGrid{T,D} <: Grid{T,D}
 
 * Only supports HasShape grids at the moment
+# TODO:
 """
 struct TensorGrid{T,D,GT<:NTuple{N,Grid} where N} <: Grid{T,D}
     grids::GT