diff --git a/extras/Hadrons/Environment.cc b/extras/Hadrons/Environment.cc index 68c170b8..37f2a3d7 100644 --- a/extras/Hadrons/Environment.cc +++ b/extras/Hadrons/Environment.cc @@ -41,8 +41,9 @@ using namespace Hadrons; // constructor ///////////////////////////////////////////////////////////////// Environment::Environment(void) { + nd_ = GridDefaultLatt().size(); grid4d_.reset(SpaceTimeGrid::makeFourDimGrid( - GridDefaultLatt(), GridDefaultSimd(Nd, vComplex::Nsimd()), + GridDefaultLatt(), GridDefaultSimd(nd_, vComplex::Nsimd()), GridDefaultMpi())); gridRb4d_.reset(SpaceTimeGrid::makeFourDimRedBlackGrid(grid4d_.get())); auto loc = getGrid()->LocalDimensions(); @@ -126,6 +127,11 @@ GridRedBlackCartesian * Environment::getRbGrid(const unsigned int Ls) const } } +unsigned int Environment::getNd(void) const +{ + return nd_; +} + // random number generator ///////////////////////////////////////////////////// void Environment::setSeed(const std::vector &seed) { diff --git a/extras/Hadrons/Environment.hpp b/extras/Hadrons/Environment.hpp index 041bcc0e..2628e5a0 100644 --- a/extras/Hadrons/Environment.hpp +++ b/extras/Hadrons/Environment.hpp @@ -106,6 +106,7 @@ public: void createGrid(const unsigned int Ls); GridCartesian * getGrid(const unsigned int Ls = 1) const; GridRedBlackCartesian * getRbGrid(const unsigned int Ls = 1) const; + unsigned int getNd(void) const; // random number generator void setSeed(const std::vector &seed); GridParallelRNG * get4dRng(void) const; @@ -200,6 +201,7 @@ private: std::map grid5d_; GridRbPt gridRb4d_; std::map gridRb5d_; + unsigned int nd_; // random number generator RngPt rng4d_; // module and related maps diff --git a/extras/Hadrons/Modules/MSource/SeqGamma.hpp b/extras/Hadrons/Modules/MSource/SeqGamma.hpp index 181f9532..611b0108 100644 --- a/extras/Hadrons/Modules/MSource/SeqGamma.hpp +++ b/extras/Hadrons/Modules/MSource/SeqGamma.hpp @@ -147,7 +147,7 @@ void TSeqGamma::execute(void) g = makeGammaProd(par().gamma); p = strToVec(par().mom); ph = zero; - for(unsigned int mu = 0; mu < Nd; mu++) + for(unsigned int mu = 0; mu < env().getNd(); mu++) { LatticeCoordinate(coor, mu); ph = ph + p[mu]*coor;