diff --git a/docs/make.jl b/docs/make.jl index ef625f8..60b7af4 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,6 +8,7 @@ makedocs(sitename="LatticeGPU", modules=[LatticeGPU], doctest=true, pages = [ "LatticeGPU.jl" => "index.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") diff --git a/docs/src/space.md b/docs/src/space.md index a32b600..4db86c7 100644 --- a/docs/src/space.md +++ b/docs/src/space.md @@ -3,12 +3,12 @@ D-dimensional lattice points are labeled by two ordered integer 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 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 -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 assumed to be the last coordinate. Planes are also numbered from 1 to diff --git a/src/Fields/Fields.jl b/src/Fields/Fields.jl index 78ab6ab..5f20d7d 100644 --- a/src/Fields/Fields.jl +++ b/src/Fields/Fields.jl @@ -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