Commit e29e0d18 authored by gsell's avatar gsell

cleanup: dcomplex refactored

parent a34a9f1a
......@@ -4,7 +4,6 @@ set (_SRCS
set (_HDRS
AntiSymTenzor.h
AppTypeTraits.h
dcomplex.h
GenVektor.h
SymTenzor.h
Tenzor.h
......
......@@ -70,7 +70,7 @@ TSV_ELEMENTWISE_OPERATOR_WITH_SCALAR(TSV,unsigned int,OP,APP) \
TSV_ELEMENTWISE_OPERATOR_WITH_SCALAR(TSV,long,OP,APP) \
TSV_ELEMENTWISE_OPERATOR_WITH_SCALAR(TSV,float,OP,APP) \
TSV_ELEMENTWISE_OPERATOR_WITH_SCALAR(TSV,double,OP,APP) \
TSV_ELEMENTWISE_OPERATOR_WITH_SCALAR(TSV,dcomplex,OP,APP)
TSV_ELEMENTWISE_OPERATOR_WITH_SCALAR(TSV,std::complex<double>,OP,APP)
#define TSV_ELEMENTWISE_OPERATOR2(TSV1,TSV2,OP,APP) \
\
......
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef DCOMPLEX_H
#define DCOMPLEX_H
/***********************************************************************
*
* Work around the lack of draft standard complex<T> in all compilers.
* Correctly declare a dcomplex typedef based on the compiler capabilities
* and available C++ standard library. dcomplex is a complex number class
* storing values as doubles.
*
***********************************************************************/
// include standard complex header file
#include <complex>
typedef std::complex<double> dcomplex;
#endif // DCOMPLEX_H
......@@ -13,7 +13,7 @@
// include files
#include "PETE/IpplExpressions.h"
#include "AppTypes/dcomplex.h"
#include <complex>
// forward declarations
template<class T, unsigned Dim> class BareField;
......@@ -105,7 +105,7 @@ assign(IndexedBareField<T,D,D> a, const T& b, OP op, ExprTag<true>)
template<class T> struct IsExprTrait { enum { IsExpr = T::IsExpr } ; };
template<> struct IsExprTrait<double> { enum { IsExpr = 1 }; };
template<> struct IsExprTrait<dcomplex> { enum { IsExpr = 1 }; };
template<> struct IsExprTrait<std::complex<double>> { enum { IsExpr = 1 }; };
template<> struct IsExprTrait<float> { enum { IsExpr = 1 }; };
template<> struct IsExprTrait<short> { enum { IsExpr = 1 }; };
template<> struct IsExprTrait<int> { enum { IsExpr = 1 }; };
......@@ -168,9 +168,9 @@ FUNC(const PETE_TUTree<OpParens<TP>,A>& lhs, const double& rhs) \
} \
template<class A, class TP> \
inline void \
FUNC(const PETE_TUTree<OpParens<TP>,A>& lhs, const dcomplex& rhs)\
FUNC(const PETE_TUTree<OpParens<TP>,A>& lhs, const std::complex<double>& rhs)\
{ \
assign(lhs,PETE_Scalar<dcomplex>(rhs),OP(),ExprTag<true>()); \
assign(lhs,PETE_Scalar<std::complex<double>>(rhs),OP(),ExprTag<true>()); \
}
#ifdef UNDEFINED
......
......@@ -2,22 +2,18 @@
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef BCOND_H
#define BCOND_H
// include files
#include "AppTypes/dcomplex.h"
#include "Utility/IpplInfo.h"
#include "Utility/RefCounted.h"
#include "Utility/vmap.h"
#include <iostream>
#include <complex>
// forward declarations
template <unsigned D> class NDIndex;
......@@ -101,7 +97,7 @@ class antisymtenzor_tag
};
// Implement tag types for intrinsic types:
inline scalar_tag get_tag(dcomplex) { return scalar_tag(); }
inline scalar_tag get_tag(std::complex<double>) { return scalar_tag(); }
inline scalar_tag get_tag(double) { return scalar_tag(); }
inline scalar_tag get_tag(float) { return scalar_tag(); }
inline scalar_tag get_tag(int) { return scalar_tag(); }
......
......@@ -393,7 +393,7 @@ COMPONENT_APPLY_BUILTIN(OpPeriodicComponent,short)
COMPONENT_APPLY_BUILTIN(OpPeriodicComponent,long)
COMPONENT_APPLY_BUILTIN(OpPeriodicComponent,float)
COMPONENT_APPLY_BUILTIN(OpPeriodicComponent,double)
COMPONENT_APPLY_BUILTIN(OpPeriodicComponent,dcomplex)
COMPONENT_APPLY_BUILTIN(OpPeriodicComponent,std::complex<double>)
//////////////////////////////////////////////////////////////////////
......@@ -452,7 +452,7 @@ COMPONENT_APPLY_BUILTIN(OpInterpolationComponent,short)
COMPONENT_APPLY_BUILTIN(OpInterpolationComponent,long)
COMPONENT_APPLY_BUILTIN(OpInterpolationComponent,float)
COMPONENT_APPLY_BUILTIN(OpInterpolationComponent,double)
COMPONENT_APPLY_BUILTIN(OpInterpolationComponent,dcomplex)
COMPONENT_APPLY_BUILTIN(OpInterpolationComponent,std::complex<double>)
//////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
......@@ -2773,7 +2773,7 @@ COMPONENT_APPLY_BUILTIN(OpExtrapolateComponent,short)
COMPONENT_APPLY_BUILTIN(OpExtrapolateComponent,long)
COMPONENT_APPLY_BUILTIN(OpExtrapolateComponent,float)
COMPONENT_APPLY_BUILTIN(OpExtrapolateComponent,double)
COMPONENT_APPLY_BUILTIN(OpExtrapolateComponent,dcomplex)
COMPONENT_APPLY_BUILTIN(OpExtrapolateComponent,std::complex<double>)
//////////////////////////////////////////////////////////////////////
......@@ -3564,7 +3564,7 @@ COMPONENT_APPLY_BUILTIN(OpExtrapolateAndZeroComponent,short)
COMPONENT_APPLY_BUILTIN(OpExtrapolateAndZeroComponent,long)
COMPONENT_APPLY_BUILTIN(OpExtrapolateAndZeroComponent,float)
COMPONENT_APPLY_BUILTIN(OpExtrapolateAndZeroComponent,double)
COMPONENT_APPLY_BUILTIN(OpExtrapolateAndZeroComponent,dcomplex)
COMPONENT_APPLY_BUILTIN(OpExtrapolateAndZeroComponent,std::complex<double>)
// Special, for assigning to single component of multicomponent elemental type:
template<class T>
......@@ -3589,7 +3589,7 @@ COMPONENT_APPLY_BUILTIN(OpAssignComponent,short)
COMPONENT_APPLY_BUILTIN(OpAssignComponent,long)
COMPONENT_APPLY_BUILTIN(OpAssignComponent,float)
COMPONENT_APPLY_BUILTIN(OpAssignComponent,double)
COMPONENT_APPLY_BUILTIN(OpAssignComponent,dcomplex)
COMPONENT_APPLY_BUILTIN(OpAssignComponent,std::complex<double>)
//////////////////////////////////////////////////////////////////////
......@@ -4968,7 +4968,7 @@ COMPONENT_APPLY_BUILTIN(OpBCFunctionEqComponent,short)
COMPONENT_APPLY_BUILTIN(OpBCFunctionEqComponent,long)
COMPONENT_APPLY_BUILTIN(OpBCFunctionEqComponent,float)
COMPONENT_APPLY_BUILTIN(OpBCFunctionEqComponent,double)
COMPONENT_APPLY_BUILTIN(OpBCFunctionEqComponent,dcomplex)
COMPONENT_APPLY_BUILTIN(OpBCFunctionEqComponent,std::complex<double>)
//////////////////////////////////////////////////////////////////////
......
......@@ -3,9 +3,6 @@
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
// Ippl.h
......@@ -15,6 +12,8 @@
#ifndef IPPL_H
#define IPPL_H
#include <complex>
// IPPL Communicate classes
#include "Message/Communicate.h"
#include "Message/GlobalComm.h"
......@@ -97,7 +96,6 @@
#include "SubParticle/SubParticleAssign.h"
// IPPL Math Types
#include "AppTypes/dcomplex.h"
#include "AppTypes/Vektor.h"
#include "AppTypes/Tenzor.h"
#include "AppTypes/SymTenzor.h"
......
......@@ -3,9 +3,6 @@
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
#ifndef MESSAGE_H
......@@ -34,15 +31,11 @@
* of resolving who needs to free up the storage used for the Message elements.
***************************************************************************/
// include files
#include "Utility/Inform.h"
#include "AppTypes/dcomplex.h"
#include <complex>
#include <cstddef>
#include <vector>
#include <iostream>
#include <cstring>
#include <cstdlib>
......@@ -96,7 +89,7 @@ DEFINE_ALL_BUILTIN_TRAIT_CLASS(unsigned long)
DEFINE_ALL_BUILTIN_TRAIT_CLASS(long long)
DEFINE_ALL_BUILTIN_TRAIT_CLASS(float)
DEFINE_ALL_BUILTIN_TRAIT_CLASS(double)
DEFINE_ALL_BUILTIN_TRAIT_CLASS(dcomplex)
DEFINE_ALL_BUILTIN_TRAIT_CLASS(std::complex<double>)
/////////////////////////////////////////////////////////////////////
// a class to put single items into a Message, which can be specialized
......
......@@ -52,7 +52,7 @@
PETE_DefineUnary(Abs, (0 < a ? a : -a), FnAbs)
inline double
PETE_apply(FnAbs, dcomplex a)
PETE_apply(FnAbs, std::complex<double> a)
{
return abs(a);
}
......@@ -138,9 +138,9 @@ PETE_DefineIPPLScalar(long)
PETE_DefineIPPLScalar(float)
PETE_DefineIPPLScalar(double)
PETE_DefineScalar(dcomplex)
PETE_DefineBinaryWithScalars(eq, OpEQ, dcomplex)
PETE_DefineBinaryWithScalars(ne, OpNE, dcomplex)
PETE_DefineScalar(std::complex<double>)
PETE_DefineBinaryWithScalars(eq, OpEQ, std::complex<double>)
PETE_DefineBinaryWithScalars(ne, OpNE, std::complex<double>)
#undef PETE_DefineIPPLScalar
......
......@@ -30,7 +30,7 @@
// include files
#include "PETE/TypeComputations.h"
#include "AppTypes/dcomplex.h"
#include <complex>
// forward declarations
......@@ -59,7 +59,7 @@ inline int sign(T a) { return ((a > 0) ? 1 : (a == 0 ? 0 : -1)); }
// Complex numbers.
template<> struct PETE_Type2Index<dcomplex> {
template<> struct PETE_Type2Index<std::complex<double>> {
enum { val = 8 };
};
......@@ -92,7 +92,7 @@ _SCALAR_RNG_RETURNS_(GEN,int) \
_SCALAR_RNG_RETURNS_(GEN,long) \
_SCALAR_RNG_RETURNS_(GEN,float) \
_SCALAR_RNG_RETURNS_(GEN,double) \
_SCALAR_RNG_RETURNS_(GEN,dcomplex)
_SCALAR_RNG_RETURNS_(GEN,std::complex<double>)
_PETE_RNG_RETURNS_(RNGBitReverse)
_PETE_RNG_RETURNS_(RNGLattice<float>)
......@@ -137,7 +137,7 @@ struct FnAbs {
enum { tag = PETE_UnaryPassThruTag };
};
template<> struct PETEUnaryReturn<dcomplex, FnAbs> {
template<> struct PETEUnaryReturn<std::complex<double>, FnAbs> {
typedef double type;
};
......@@ -152,7 +152,7 @@ struct FnNorm {
enum { tag = PETE_Type2Index<double>::val };
};
template<> struct PETEUnaryReturn<dcomplex, FnNorm> {
template<> struct PETEUnaryReturn<std::complex<double>, FnNorm> {
typedef double type;
};
......@@ -161,7 +161,7 @@ struct FnArg {
enum { tag = PETE_Type2Index<double>::val };
};
template<> struct PETEUnaryReturn<dcomplex, FnArg> {
template<> struct PETEUnaryReturn<std::complex<double>, FnArg> {
typedef double type;
};
......@@ -170,7 +170,7 @@ struct FnReal {
enum { tag = PETE_Type2Index<double>::val };
};
template<> struct PETEUnaryReturn<dcomplex, FnReal> {
template<> struct PETEUnaryReturn<std::complex<double>, FnReal> {
typedef double type;
};
......@@ -179,7 +179,7 @@ struct FnImag {
enum { tag = PETE_Type2Index<double>::val };
};
template<> struct PETEUnaryReturn<dcomplex, FnImag> {
template<> struct PETEUnaryReturn<std::complex<double>, FnImag> {
typedef double type;
};
......@@ -609,7 +609,7 @@ _SCALAR_VST_RETURNS_(int)
_SCALAR_VST_RETURNS_(long)
_SCALAR_VST_RETURNS_(float)
_SCALAR_VST_RETURNS_(double)
_SCALAR_VST_RETURNS_(dcomplex)
_SCALAR_VST_RETURNS_(std::complex<double>)
#undef _SCALAR_VST_RETURNS_
......
......@@ -22,8 +22,6 @@
#include "AppTypes/Tenzor.h"
#include "AppTypes/SymTenzor.h"
#include "AppTypes/AntiSymTenzor.h"
#include "AppTypes/dcomplex.h"
////////////////////////////////////////////////////////////////////////////
// a base class for all DiscType's, that provides common routines to
......
......@@ -60,7 +60,7 @@ RNG_OPERATOR_WITH_SCALAR(GEN,int,OP,APP) \
RNG_OPERATOR_WITH_SCALAR(GEN,long,OP,APP) \
RNG_OPERATOR_WITH_SCALAR(GEN,float,OP,APP) \
RNG_OPERATOR_WITH_SCALAR(GEN,double,OP,APP) \
RNG_OPERATOR_WITH_SCALAR(GEN,dcomplex,OP,APP)
RNG_OPERATOR_WITH_SCALAR(GEN,std::complex<double>,OP,APP)
#define RNG_BASIC_MATH(GEN) \
\
......
......@@ -186,16 +186,16 @@ int main(int argc, char *argv[])
FieldLayout<D> layoutPPStan1h(ndiStandard1h,allParallel,vnodes);
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// For calling FieldDebug functions from debugger, set up output format:
setFormat(4,3);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
// Conditionally-compiled loading functions (couldn't make these
double xfact, kx, yfact, ky, zfact, kz;
......
......@@ -188,16 +188,16 @@ int main(int argc, char *argv[])
FieldLayout<D> layoutPPStan1h(ndiStandard1h,allParallel,vnodes);
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// For calling FieldDebug functions from debugger, set up output format:
setFormat(4,3);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
// Conditionally-compiled loading functions (couldn't make these
double xfact, kx, yfact, ky, zfact, kz;
......
......@@ -188,16 +188,16 @@ int main(int argc, char *argv[])
FieldLayout<D> layoutPPStan1h(ndiStandard1h,allParallel,vnodes);
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// For calling FieldDebug functions from debugger, set up output format:
setFormat(4,3);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
// Conditionally-compiled loading functions (couldn't make these
double xfact, kx, yfact, ky, zfact, kz;
......
......@@ -186,16 +186,16 @@ int main(int argc, char *argv[])
FieldLayout<D> layoutPPStan1h(ndiStandard1h,allParallel,vnodes);
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// For calling FieldDebug functions from debugger, set up output format:
setFormat(4,3);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
// Conditionally-compiled loading functions (couldn't make these
double xfact, kx, yfact, ky, zfact, kz;
......
......@@ -147,32 +147,32 @@ int main(int argc, char *argv[])
#endif
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
#ifndef ONED
BareField<dcomplex,D> CFieldSPStan(layoutSPStan);
BareField<dcomplex,D> CFieldSPStan_save(layoutSPStan);
BareField<std::complex<double>,D> CFieldSPStan(layoutSPStan);
BareField<std::complex<double>,D> CFieldSPStan_save(layoutSPStan);
BareField<double,D> diffFieldSPStan(layoutSPStan);
BareField<dcomplex,D> CFieldSPPerm(layoutSPPerm);
BareField<std::complex<double>,D> CFieldSPPerm(layoutSPPerm);
#endif
// create test Fields for real-to-complex FFT
BareField<double,D> RFieldPPStan(layoutPPStan);
BareField<double,D> RFieldPPStan_save(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan0h(layoutPPStan0h);
BareField<std::complex<double>,D> CFieldPPStan0h(layoutPPStan0h);
#ifndef ONED
BareField<double,D> RFieldSPStan(layoutSPStan);
BareField<double,D> RFieldSPStan_save(layoutSPStan);
BareField<dcomplex,D> CFieldSPStan0h(layoutSPStan0h);
BareField<dcomplex,D> CFieldSPPerm0h(layoutSPPerm0h);
BareField<std::complex<double>,D> CFieldSPStan0h(layoutSPStan0h);
BareField<std::complex<double>,D> CFieldSPPerm0h(layoutSPPerm0h);
#endif
// create test Fields for sine transform and real-to-complex FFT
BareField<dcomplex,D> CFieldPPStan1h(layoutPPStan1h);
BareField<std::complex<double>,D> CFieldPPStan1h(layoutPPStan1h);
#ifndef ONED
BareField<dcomplex,D> CFieldSPStan1h(layoutSPStan1h);
BareField<dcomplex,D> CFieldSPPerm1h(layoutSPPerm1h);
BareField<std::complex<double>,D> CFieldSPStan1h(layoutSPStan1h);
BareField<std::complex<double>,D> CFieldSPPerm1h(layoutSPPerm1h);
#endif
......@@ -180,8 +180,8 @@ int main(int argc, char *argv[])
setFormat(4,3);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
double xfact, kx, yfact, ky, zfact, kz;
xfact = pi/(ngrid[0] + 1.0);
......@@ -205,7 +205,7 @@ int main(int argc, char *argv[])
// RC FFT tests
RFieldPPStan = real(CFieldPPStan_save);
CFieldPPStan0h = dcomplex(0.0,0.0);
CFieldPPStan0h = std::complex<double>(0.0,0.0);
RFieldPPStan_save = RFieldPPStan; // save input data for checking results
......
......@@ -16,7 +16,7 @@ typedef Vert Center_t;
typedef UniformCartesian<DDIM, DTYPE> Mesh_t;
typedef CenteredFieldLayout<DDIM, Mesh_t, Center_t> FieldLayout_t;
typedef Field<DTYPE, DDIM, Mesh_t, Center_t> Field_t;
typedef Field<dcomplex, DDIM, Mesh_t, Center_t> CxField_t;
typedef Field<std::complex<double>, DDIM, Mesh_t, Center_t> CxField_t;
typedef FFT<RCTransform, DDIM, DTYPE> FFT_t;
int main(int argc, char *argv[]) {
......
......@@ -125,13 +125,13 @@ int main(int argc, char *argv[])
FieldLayout<D> layoutPPStan(ndiStandard,allParallel,processes);
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
double xfact, kx, yfact, ky, zfact, kz;
xfact = pi/(ngrid[0] + 1.0);
......
......@@ -142,13 +142,13 @@ int main(int argc, char *argv[])
FieldLayout<D> layoutPPStan(ndiStandard,allParallel,Ippl::getNodes());
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
double xfact, kx, yfact, ky, zfact, kz;
xfact = pi/(ngrid[0] + 1.0);
......
......@@ -166,13 +166,13 @@ int main(int argc, char *argv[])
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
double xfact, kx, yfact, ky, zfact, kz;
xfact = pi/(ngrid[0] + 1.0);
......@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
BareField<double,D> RFieldPPStan(layoutPPStan);
BareField<double,D> RFieldPPStan_save(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan0h(layoutPPStan0h);
BareField<std::complex<double>,D> CFieldPPStan0h(layoutPPStan0h);
FFT<RCTransform,D,double> rcfft(ndiStandard, ndiStandard0h, compressTemps);
RFieldPPStan_save = RFieldPPStan;
......
......@@ -280,38 +280,38 @@ int main(int argc, char *argv[])
// create test Fields for complex-to-complex FFT
BareField<dcomplex,D> CFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan_save(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan(layoutPPStan);
BareField<std::complex<double>,D> CFieldPPStan_save(layoutPPStan);
BareField<double,D> diffFieldPPStan(layoutPPStan);
BareField<dcomplex,D> CFieldSPStan(layoutSPStan);
BareField<dcomplex,D> CFieldSPStan_save(layoutSPStan);
BareField<std::complex<double>,D> CFieldSPStan(layoutSPStan);
BareField<std::complex<double>,D> CFieldSPStan_save(layoutSPStan);
BareField<double,D> diffFieldSPStan(layoutSPStan);
BareField<dcomplex,D> CFieldSPPerm(layoutSPPerm);
BareField<std::complex<double>,D> CFieldSPPerm(layoutSPPerm);
// create test Fields for real-to-complex FFT
BareField<double,D> RFieldPPStan(layoutPPStan);
BareField<double,D> RFieldPPStan_save(layoutPPStan);
BareField<dcomplex,D> CFieldPPStan0h(layoutPPStan0h);
BareField<std::complex<double>,D> CFieldPPStan0h(layoutPPStan0h);
BareField<double,D> RFieldSPStan(layoutSPStan);
BareField<double,D> RFieldSPStan_save(layoutSPStan);
BareField<dcomplex,D> CFieldSPStan0h(layoutSPStan0h);
BareField<dcomplex,D> CFieldSPPerm0h(layoutSPPerm0h);
BareField<std::complex<double>,D> CFieldSPStan0h(layoutSPStan0h);
BareField<std::complex<double>,D> CFieldSPPerm0h(layoutSPPerm0h);
// create test Fields for sine transform and real-to-complex FFT
BareField<dcomplex,D> CFieldPPStan1h(layoutPPStan1h);
BareField<std::complex<double>,D> CFieldPPStan1h(layoutPPStan1h);
BareField<dcomplex,D> CFieldSPStan1h(layoutSPStan1h);
BareField<dcomplex,D> CFieldSPPerm1h(layoutSPPerm1h);
BareField<std::complex<double>,D> CFieldSPStan1h(layoutSPStan1h);
BareField<std::complex<double>,D> CFieldSPPerm1h(layoutSPPerm1h);
testmsg << "Initialize fields ..." << endl;
IpplTimings::stopTimer(fsetupTimer);
IpplTimings::startTimer(fInitTimer);
// Rather more complete test functions (sine or cosine mode):
dcomplex sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
dcomplex cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
std::complex<double> sfact(1.0,0.0); // (1,0) for sine mode; (0,0) for cosine mode
std::complex<double> cfact(0.0,0.0); // (0,0) for sine mode; (1,0) for cosine mode
/*
double xfact, kx, yfact, ky, zfact, kz;
......@@ -334,9 +334,9 @@ int main(int argc, char *argv[])
ndiStandard[1] * ky * yfact -
ndiStandard[2] * kz * zfact ) );
*/
CFieldPPStan = dcomplex(0.0,0.0);//
CFieldSPStan = dcomplex(0.0,0.0); //CFieldPPStan;
CFieldSPPerm = dcomplex(0.0,0.0);
CFieldPPStan = std::complex<double>(0.0,0.0);//
CFieldSPStan = std::complex<double>(0.0,0.0); //CFieldPPStan;
CFieldSPPerm = std::complex<double>(0.0,0.0);
CFieldPPStan_save = CFieldPPStan; // Save values for checking later
CFieldSPStan_save = CFieldSPStan;
......@@ -415,10 +415,10 @@ int main(int argc, char *argv[])
// RC FFT tests
RFieldPPStan = real(CFieldPPStan_save);
CFieldPPStan0h = dcomplex(0.0,0.0);
CFieldPPStan0h = std::complex<double>(0.0,0.0);
RFieldSPStan = real(CFieldSPStan_save);
CFieldSPStan0h = dcomplex(0.0,0.0);
CFieldSPPerm0h = dcomplex(0.0,0.0);
CFieldSPStan0h = std::complex<double>(0.0,0.0);
CFieldSPPerm0h = std::complex<double>(0.0,0.0);
RFieldPPStan_save = RFieldPPStan; // save input data for checking results
RFieldSPStan_save = RFieldSPStan;
......@@ -501,10 +501,10 @@ int main(int argc, char *argv[])
// Sine and RC transform tests
RFieldPPStan = RFieldPPStan_save;
CFieldPPStan1h = dcomplex(0.0,0.0);
CFieldPPStan1h = std::complex<double>(0.0,0.0);
RFieldSPStan = RFieldSPStan_save;
CFieldSPStan1h = dcomplex(0.0,0.0);
CFieldSPPerm1h = dcomplex(0.0,0.0);
CFieldSPStan1h = std::complex<double>(0.0,0.0);