From ee93f0218bebd84d98211d0ed87cff48951d76d7 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Fri, 27 Jan 2017 12:22:48 +0000 Subject: [PATCH] ChargedProp: remove ScalarField fs --- extras/Hadrons/Modules/MScalar/ChargedProp.cc | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/extras/Hadrons/Modules/MScalar/ChargedProp.cc b/extras/Hadrons/Modules/MScalar/ChargedProp.cc index f2890b2a..40d4504c 100644 --- a/extras/Hadrons/Modules/MScalar/ChargedProp.cc +++ b/extras/Hadrons/Modules/MScalar/ChargedProp.cc @@ -169,19 +169,12 @@ void TChargedProp::execute(void) void TChargedProp::momD1(ScalarField &s, FFT &fft) { EmField &A = *env().getObject(par().emField); - ScalarField buf(env().getGrid()), fs(env().getGrid()), result(env().getGrid()), Amu(env().getGrid()); + ScalarField buf(env().getGrid()), result(env().getGrid()), + Amu(env().getGrid()); Complex ci(0.0,1.0); result = zero; - fft.FFT_all_dim(fs, s, FFT::backward); - for (unsigned int mu = 0; mu < env().getNd(); ++mu) - { - Amu = peekLorentz(A, mu); - buf = Amu*fs; - fft.FFT_all_dim(buf, buf, FFT::forward); - result = result + ci*adj(*phase_[mu])*buf; - } for (unsigned int mu = 0; mu < env().getNd(); ++mu) { Amu = peekLorentz(A, mu); @@ -191,6 +184,14 @@ void TChargedProp::momD1(ScalarField &s, FFT &fft) fft.FFT_all_dim(buf, buf, FFT::forward); result = result - ci*buf; } + fft.FFT_all_dim(s, s, FFT::backward); + for (unsigned int mu = 0; mu < env().getNd(); ++mu) + { + Amu = peekLorentz(A, mu); + buf = Amu*s; + fft.FFT_all_dim(buf, buf, FFT::forward); + result = result + ci*adj(*phase_[mu])*buf; + } s = result; } @@ -198,18 +199,11 @@ void TChargedProp::momD1(ScalarField &s, FFT &fft) void TChargedProp::momD2(ScalarField &s, FFT &fft) { EmField &A = *env().getObject(par().emField); - ScalarField buf(env().getGrid()), fs(env().getGrid()), result(env().getGrid()), Amu(env().getGrid()); + ScalarField buf(env().getGrid()), result(env().getGrid()), + Amu(env().getGrid()); result = zero; - fft.FFT_all_dim(fs, s, FFT::backward); - for (unsigned int mu = 0; mu < env().getNd(); ++mu) - { - Amu = peekLorentz(A, mu); - buf = Amu*Amu*fs; - fft.FFT_all_dim(buf, buf, FFT::forward); - result = result + .5*adj(*phase_[mu])*buf; - } for (unsigned int mu = 0; mu < env().getNd(); ++mu) { Amu = peekLorentz(A, mu); @@ -219,6 +213,14 @@ void TChargedProp::momD2(ScalarField &s, FFT &fft) fft.FFT_all_dim(buf, buf, FFT::forward); result = result + .5*buf; } + fft.FFT_all_dim(s, s, FFT::backward); + for (unsigned int mu = 0; mu < env().getNd(); ++mu) + { + Amu = peekLorentz(A, mu); + buf = Amu*Amu*s; + fft.FFT_all_dim(buf, buf, FFT::forward); + result = result + .5*adj(*phase_[mu])*buf; + } s = result; }