Added some documentation

This commit is contained in:
Alberto Ramos 2023-10-27 12:15:52 +02:00
parent bfc5b4b508
commit cfffb3ca20
3 changed files with 27 additions and 4 deletions

View file

@ -14,11 +14,33 @@ module Fields
using CUDA
using ..Space
"""
vector_field(::Type{T}, lp::SpaceParm)
Returns a vector field of elemental type `T`.
"""
vector_field(::Type{T}, lp::SpaceParm) where {T} = CuArray{T, 3}(undef, lp.bsz, lp.ndim, lp.rsz)
"""
scalar_field(::Type{T}, lp::SpaceParm)
Returns a scalar field of elemental type `T`.
"""
scalar_field(::Type{T}, lp::SpaceParm) where {T} = CuArray{T, 2}(undef, lp.bsz, lp.rsz)
"""
nscalar_field(::Type{T}, n::Integer, lp::SpaceParm)
Returns `n` scalar fields of elemental type `T`
"""
nscalar_field(::Type{T}, n, lp::SpaceParm) where {T} = CuArray{T, 3}(undef, lp.bsz, n, lp.rsz)
"""
scalar_field(::Type{T}, lp::SpaceParm)
Returns a scalar field of elemental type `T`, with lexicografic memory layout.
"""
scalar_field_point(::Type{T}, lp::SpaceParm{N,M,D}) where {T,N,M,D} = CuArray{T, N}(undef, lp.iL...)
export vector_field, scalar_field, nscalar_field, scalar_field_point