mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
BugFix: Now the stochatic EM potential weight is generated when calling for the first time
This commit is contained in:
parent
389731d373
commit
b6fe03eb26
@ -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: "
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user