1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

BugFix: Now the stochatic EM potential weight is generated when calling for the first time

This commit is contained in:
Vera Guelpers 2018-02-02 15:29:38 +00:00
parent 389731d373
commit b6fe03eb26
2 changed files with 6 additions and 2 deletions

View File

@ -57,9 +57,11 @@ std::vector<std::string> TStochEm::getOutput(void)
// setup /////////////////////////////////////////////////////////////////////// // setup ///////////////////////////////////////////////////////////////////////
void TStochEm::setup(void) void TStochEm::setup(void)
{ {
create_weight = false;
if (!env().hasCreatedObject("_" + getName() + "_weight")) if (!env().hasCreatedObject("_" + getName() + "_weight"))
{ {
envCacheLat(EmComp, "_" + getName() + "_weight"); envCacheLat(EmComp, "_" + getName() + "_weight");
create_weight = true;
} }
envCreateLat(EmField, getName()); envCreateLat(EmField, getName());
} }
@ -67,13 +69,13 @@ void TStochEm::setup(void)
// execution /////////////////////////////////////////////////////////////////// // execution ///////////////////////////////////////////////////////////////////
void TStochEm::execute(void) void TStochEm::execute(void)
{ {
LOG(Message) << "Generating stochatic EM potential..." << std::endl; LOG(Message) << "Generating stochastic EM potential..." << std::endl;
PhotonR photon(par().gauge, par().zmScheme); PhotonR photon(par().gauge, par().zmScheme);
auto &a = envGet(EmField, getName()); auto &a = envGet(EmField, getName());
auto &w = envGet(EmComp, "_" + getName() + "_weight"); auto &w = envGet(EmComp, "_" + getName() + "_weight");
if (!env().hasCreatedObject("_" + getName() + "_weight")) if (create_weight)
{ {
LOG(Message) << "Caching stochatic EM potential weight (gauge: " LOG(Message) << "Caching stochatic EM potential weight (gauge: "
<< par().gauge << ", zero-mode scheme: " << par().gauge << ", zero-mode scheme: "

View File

@ -60,6 +60,8 @@ public:
// dependency relation // dependency relation
virtual std::vector<std::string> getInput(void); virtual std::vector<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void); virtual std::vector<std::string> getOutput(void);
private:
bool create_weight;
protected: protected:
// setup // setup
virtual void setup(void); virtual void setup(void);