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<R>() |
| 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
| 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
| Type | Name |
|---|---|
| consteval size_t | getNDim () |
Protected Attributes inherited from 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
typedef Getter
typedef ValueType
Public Static Attributes Documentation
variable NDim
variable SHIFTIND
variable size
Public Functions Documentation
function AsComplexField
function ComplexFieldGet [1/2]
function ComplexFieldGet [2/2]
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()
function toString
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/algebra/complexalgebra/ascomplexfield.h