Skip to content

Class TempLat::AsComplexField

template <typename R>

ClassList > TempLat > AsComplexField

Adapts a getter whose eval() returns a complex<C> value into a complex-field expression (i.e. one exposing ComplexFieldGet(Tag<0>)/ComplexFieldGet(Tag<1>)). This is the inverse ofasFourier() .More...

  • #include <ascomplexfield.h>

Inherits the following classes: TempLat::UnaryOperator

Public Types

Type Name
typedef typename ValueType::value_type ComponentType
typedef ComplexFieldGetter Getter
typedef typename GetGetReturnType< std::decay_t< R > >::type ValueType

Public Static Attributes

Type Name
constexpr size_t NDim = GetNDim::get&lt;R&gt;()
constexpr size_t SHIFTIND = 0
constexpr size_t size = 2

Public Functions

Type Name
AsComplexField (const R & pR)
auto ComplexFieldGet (Tag< 0 > t) const
auto ComplexFieldGet (Tag< 1 > t) const
DEVICE_INLINE_FUNCTION auto eval (const IDX &... idx) const
Returns device::array<C,2>, NOT complex<C>: the assignment loops index result[0]/result[1].
auto operator() (Tag< N > t) const
std::string toString () const

Public Functions inherited from TempLat::UnaryOperator

See TempLat::UnaryOperator

Type Name
UnaryOperator (const R & pR)
device::Idx confirmGhostsUpToDate () const
void confirmSpace (const LayoutStruct< NDim > & newLayout, const SpaceStateType & spaceType) const
void doWeNeedGhosts () const
auto getDx () const
auto getKIR () const
auto getToolBox () const
virtual std::string operatorString () const
Override this method in your derived class, to have an easy implementation of your toString method.
void postGet ()
void preGet ()
std::string toString () const
If your descending class implements operatorString() and your operator is of the type "OP b" (where OP is * or whatever), this toString method does all the work for you, only adding parentheses if b contains spaces.

Public Static Functions inherited from TempLat::UnaryOperator

See TempLat::UnaryOperator

Type Name
consteval size_t getNDim ()

Protected Attributes inherited from TempLat::UnaryOperator

See TempLat::UnaryOperator

Type Name
R mR

Detailed Description

Deliberately a single node that evaluates its child ONCE and splits the result, rather than sugar for Complexify(Real(r), Imag(r)). PostGet::apply recurses structurally with no de-duplication, and a RandomGaussianField's generation counter is a refcount-shared host_ptr so two copies of the child in one tree would advance the RNG twice and draw the real and imaginary parts from different generations. Keep the child unique.

Unit test: ctest -R test-ascomplexfield

Public Types Documentation

typedef ComponentType

using TempLat::AsComplexField< R >::ComponentType =  typename ValueType::value_type;

typedef Getter

using TempLat::AsComplexField< R >::Getter =  ComplexFieldGetter;

typedef ValueType

using TempLat::AsComplexField< R >::ValueType =  typename GetGetReturnType<std::decay_t<R> >::type;

Public Static Attributes Documentation

variable NDim

constexpr size_t TempLat::AsComplexField< R >::NDim;

variable SHIFTIND

constexpr size_t TempLat::AsComplexField< R >::SHIFTIND;

variable size

constexpr size_t TempLat::AsComplexField< R >::size;

Public Functions Documentation

function AsComplexField

inline TempLat::AsComplexField::AsComplexField (
    const R & pR
) 

function ComplexFieldGet [1/2]

inline auto TempLat::AsComplexField::ComplexFieldGet (
    Tag < 0 > t
) const

function ComplexFieldGet [2/2]

inline auto TempLat::AsComplexField::ComplexFieldGet (
    Tag < 1 > t
) const

function eval

Returns device::array<C,2>, NOT complex<C>: the assignment loops index result[0]/result[1].

template<typename... IDX>
inline DEVICE_INLINE_FUNCTION auto TempLat::AsComplexField::eval (
    const IDX &... idx
) const


function operator()

template<int N>
inline auto TempLat::AsComplexField::operator() (
    Tag < N > t
) const

function toString

inline std::string TempLat::AsComplexField::toString () const


The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/algebra/complexalgebra/ascomplexfield.h