From 0ec6829edcc6e4f62a60a47aefda096883dd12f1 Mon Sep 17 00:00:00 2001 From: Guido Cossu Date: Tue, 21 Mar 2017 13:06:32 +0900 Subject: [PATCH] Fixing compilation errors for the WilsonFlow --- lib/qcd/smearing/Smearing.h | 1 + lib/qcd/smearing/WilsonFlow.h | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/qcd/smearing/Smearing.h b/lib/qcd/smearing/Smearing.h index 47b74301..932acf86 100644 --- a/lib/qcd/smearing/Smearing.h +++ b/lib/qcd/smearing/Smearing.h @@ -5,5 +5,6 @@ #include #include #include +#include #endif diff --git a/lib/qcd/smearing/WilsonFlow.h b/lib/qcd/smearing/WilsonFlow.h index a47df2ca..516fc19b 100644 --- a/lib/qcd/smearing/WilsonFlow.h +++ b/lib/qcd/smearing/WilsonFlow.h @@ -38,9 +38,9 @@ class WilsonFlow: public Smear{ unsigned int Nstep; RealD epsilon; - WilsonGaugeAction &SG; + WilsonGaugeAction &SG; - void evolve_step(); + void evolve_step(typename Gimpl::GaugeField&); RealD tau(unsigned int t)const {return epsilon*(t+1.0); } @@ -74,7 +74,8 @@ class WilsonFlow: public Smear{ RealD energyDensityPlaquette(unsigned int step, const GaugeField& U) const; }; -void WilsonFlow::evolve_step(GaugeField &U) { +template +void WilsonFlow::evolve_step(typename Gimpl::GaugeField &U) { GaugeField Z(U._grid); GaugeField tmp(U._grid); SG.deriv(U, Z); @@ -92,15 +93,15 @@ void WilsonFlow::evolve_step(GaugeField &U) { Gimpl::update_field(Z, U, -2.0*epsilon); // V(t+e) = exp(ep*Z)*W2 } -RealD energyDensityPlaquette(unsigned int step, const GaugeField& U) const { +template +RealD WilsonFlow::energyDensityPlaquette(unsigned int step, const GaugeField& U) const { RealD td = tau(step); - return 2.0 * td * td * SG.S(Uflow)/volume; + return 2.0 * td * td * SG.S(U)/U._grid->gSites(); } -void WilsonFlow::smear(GaugeField& out, const GaugeField& in) const { +template +void WilsonFlow::smear(GaugeField& out, const GaugeField& in) const { out = in; - RealD volume = out._grid->gSites(); - for (unsigned int step = 0; step < Nstep; step++) { evolve_step(out); // Energy density, plaquette @@ -110,6 +111,7 @@ void WilsonFlow::smear(GaugeField& out, const GaugeField& in) const { << " " << energyDensityPlaquette(step, out) << std::endl; } +} } // namespace QCD } // namespace Grid