1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 15:55:37 +00:00

MSource::Gauss and MSource::Convolution: change LatticeComplex to ComplexField

This commit is contained in:
Nils Asmussen 2019-05-29 16:25:45 +01:00
parent 0b3f40ce16
commit de1a1dccb3
2 changed files with 8 additions and 7 deletions

View File

@ -84,7 +84,7 @@ void TConvolution<FImpl>::setup(void)
} }
envCreateLat(PropagatorField, getName()); envCreateLat(PropagatorField, getName());
envTmpLat(LatticeComplex, "momfield1"); envTmpLat(ComplexField, "momfield1");
envTmp(FFT, "fft", 1, env().getGrid()); envTmp(FFT, "fft", 1, env().getGrid());
} }
@ -92,10 +92,10 @@ void TConvolution<FImpl>::setup(void)
template <typename FImpl> template <typename FImpl>
void TConvolution<FImpl>::execute(void) void TConvolution<FImpl>::execute(void)
{ {
auto &field1 = envGet(LatticeComplex, par().field1); auto &field1 = envGet(ComplexField, par().field1);
auto &field2 = envGet(PropagatorField, par().field2); auto &field2 = envGet(PropagatorField, par().field2);
auto &out = envGet(PropagatorField, getName()); auto &out = envGet(PropagatorField, getName());
envGetTmp(LatticeComplex, momfield1); envGetTmp(ComplexField, momfield1);
envGetTmp(FFT, fft); envGetTmp(FFT, fft);
std::vector<int> mask(env().getNd(), 1); std::vector<int> mask(env().getNd(), 1);

View File

@ -28,6 +28,7 @@ public:
template <typename FImpl> template <typename FImpl>
class TGauss: public Module<GaussPar> class TGauss: public Module<GaussPar>
{ {
BASIC_TYPE_ALIASES(FImpl,);
public: public:
// constructor // constructor
TGauss(const std::string name); TGauss(const std::string name);
@ -83,16 +84,16 @@ void TGauss<FImpl>::setup(void)
+ std::to_string(env().getNd()-1) + " components"); + std::to_string(env().getNd()-1) + " components");
} }
envCreateLat(LatticeComplex, getName()); envCreateLat(ComplexField, getName());
envTmpLat(LatticeComplex, "component"); envTmpLat(ComplexField, "component");
} }
// execution /////////////////////////////////////////////////////////////////// // execution ///////////////////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
void TGauss<FImpl>::execute(void) void TGauss<FImpl>::execute(void)
{ {
auto &rho = envGet(LatticeComplex, getName()); auto &rho = envGet(ComplexField, getName());
envGetTmp(LatticeComplex, component); envGetTmp(ComplexField, component);
const int dim=env().getNd()-1; const int dim=env().getNd()-1;
const double fact=-0.5/std::pow(par().width,2); const double fact=-0.5/std::pow(par().width,2);
const Complex i(0.0, 1.0); const Complex i(0.0, 1.0);