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

@ -8,6 +8,7 @@ makedocs(sitename="LatticeGPU", modules=[LatticeGPU], doctest=true,
pages = [ pages = [
"LatticeGPU.jl" => "index.md", "LatticeGPU.jl" => "index.md",
"Space-time" => "space.md", "Space-time" => "space.md",
"Groups and algebras" => "groups.md" "Groups and algebras" => "groups.md",
"Fields" => "fields.md"
], ],
repo = "https://igit.ific.uv.es/alramos/latticegpu.jl") repo = "https://igit.ific.uv.es/alramos/latticegpu.jl")

View file

@ -3,12 +3,12 @@
D-dimensional lattice points are labeled by two ordered integer D-dimensional lattice points are labeled by two ordered integer
numbers: the point-in-block index ($$b$$ in the figure below) and the numbers: the point-in-block index ($$b$$ in the figure below) and the
block index ($$r$$ in the fire below). the routines [`up`](@ref) and block index ($$r$$ in the figure below). The routines [`up`](@ref) and
[`dw`](@ref) allow you to displace to the neighboring points of the [`dw`](@ref) allow you to displace to the neighboring points of the
lattice. lattice.
![blocks](blocks.png "D dimensional lattice points are labeled by its ![D dimensional lattice points are labeled by its
index (a `Tuple` of integers). Given a point (by its index), there are index (a `Tuple` of integers). Given a point (by its index), there are
routines to jump to neighboring points.") routines to jump to neighboring points.](blocks.png)
Directions are numbered fro 1 to D, and then Euclidean time is always Directions are numbered fro 1 to D, and then Euclidean time is always
assumed to be the last coordinate. Planes are also numbered from 1 to assumed to be the last coordinate. Planes are also numbered from 1 to

View file

@ -14,11 +14,33 @@ module Fields
using CUDA using CUDA
using ..Space 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) 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) 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) 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...) 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 export vector_field, scalar_field, nscalar_field, scalar_field_point