mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-18 07:47:06 +01:00
Merge branch 'feature/hadrons' into feature/qed-fvol
# Conflicts: # extras/Hadrons/Modules.hpp # extras/Hadrons/Modules/MGauge/StochEm.cc # extras/Hadrons/Modules/MScalar/ChargedProp.cc # extras/Hadrons/Modules/MScalar/ChargedProp.hpp # extras/Hadrons/modules.inc # lib/communicator/Communicator_mpi.cc
This commit is contained in:
@ -4,9 +4,9 @@ Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: extras/Hadrons/Modules/MGauge/StochEm.cc
|
||||
|
||||
Copyright (C) 2015
|
||||
Copyright (C) 2016
|
||||
Copyright (C) 2015-2018
|
||||
|
||||
Author: Antonin Portelli <antonin.portelli@me.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -57,32 +57,28 @@ std::vector<std::string> TStochEm::getOutput(void)
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
void TStochEm::setup(void)
|
||||
{
|
||||
if (!env().hasRegisteredObject("_" + getName() + "_weight"))
|
||||
if (!env().hasCreatedObject("_" + getName() + "_weight"))
|
||||
{
|
||||
env().registerLattice<EmComp>("_" + getName() + "_weight");
|
||||
envCacheLat(EmComp, "_" + getName() + "_weight");
|
||||
}
|
||||
env().registerLattice<EmField>(getName());
|
||||
envCreateLat(EmField, getName());
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
void TStochEm::execute(void)
|
||||
{
|
||||
LOG(Message) << "Generating stochastic EM potential..." << std::endl;
|
||||
|
||||
PhotonR photon(par().gauge, par().zmScheme, par().improvement);
|
||||
EmField &a = *env().createLattice<EmField>(getName());
|
||||
EmComp *w;
|
||||
auto &a = envGet(EmField, getName());
|
||||
auto &w = envGet(EmComp, "_" + getName() + "_weight");
|
||||
|
||||
if (!env().hasCreatedObject("_" + getName() + "_weight"))
|
||||
{
|
||||
LOG(Message) << "Caching stochatic EM potential weight (gauge: "
|
||||
LOG(Message) << "Caching stochastic EM potential weight (gauge: "
|
||||
<< par().gauge << ", zero-mode scheme: "
|
||||
<< par().zmScheme << ")..." << std::endl;
|
||||
w = env().createLattice<EmComp>("_" + getName() + "_weight");
|
||||
photon.StochasticWeight(*w);
|
||||
photon.StochasticWeight(w);
|
||||
}
|
||||
else
|
||||
{
|
||||
w = env().getObject<EmComp>("_" + getName() + "_weight");
|
||||
}
|
||||
LOG(Message) << "Generating stochatic EM potential..." << std::endl;
|
||||
photon.StochasticField(a, *env().get4dRng(), *w);
|
||||
photon.StochasticField(a, *env().get4dRng(), w);
|
||||
}
|
||||
|
Reference in New Issue
Block a user