Mercurial > repos > public > sbplib_julia
diff src/Grids/grid.jl @ 1518:0cd6cf62af93 feature/grids/componentview
Merge refactor/component_type
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 21 Mar 2024 15:51:29 +0100 |
parents | 7ee7df7d9b61 b6f6425e34ac |
children | 2fa325f08b66 |
line wrap: on
line diff
--- a/src/Grids/grid.jl Thu Mar 21 07:43:48 2024 +0100 +++ b/src/Grids/grid.jl Thu Mar 21 15:51:29 2024 +0100 @@ -27,7 +27,7 @@ """ coordinate_size(g) -The lenght of the coordinate vector of `Grid` `g`. +The length of the coordinate vector of `Grid` `g`. """ coordinate_size(::Type{<:Grid{T}}) where T = _ncomponents(T) coordinate_size(g::Grid) = coordinate_size(typeof(g)) # TBD: Name of this function?! @@ -35,7 +35,15 @@ """ component_type(gf) -The type of the components of the elements of `gf`. +The type of the components of the elements of `gf`. I.e if `gf` is a vector +valued grid function, `component_view(gf)` is the element type of the vectors +at each grid point. + +# Examples +```julia-repl +julia> component_type([[1,2], [2,3], [3,4]]) +Int64 +``` """ component_type(T::Type) = eltype(eltype(T)) component_type(t) = component_type(typeof(t))