1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Making change 1) as simple as possible 2) as much like MSink/Point.hpp as possible

This commit is contained in:
Michael Marshall 2020-03-12 13:47:51 +00:00
parent c1677fccf6
commit 3753508957

View File

@ -122,15 +122,6 @@ void TWall<FImpl>::setup(void)
envCache(Lattice<iScalar<vInteger>>, tName_, 1, envGetGrid(LatticeComplex));
envCacheLat(LatticeComplex, momphName_);
envTmpLat(LatticeComplex, "coor");
auto &src = envGet(PropagatorField, getName());
const auto NumDims = src.Grid()->Dimensions();
// Don't break existing scripts as long as they specified zero momentum in time dimension
std::vector<Real> p = strToVec<Real>(par().mom);
if (!(p.size() == NumDims - 1 || (p.size() == NumDims && p[NumDims - 1] == 0)))
{
HADRONS_ERROR(Size, "momentum has " + std::to_string(p.size())
+ " components (must have " + std::to_string(NumDims - 1) + ")");
}
}
// execution ///////////////////////////////////////////////////////////////////
@ -152,8 +143,7 @@ void TWall<FImpl>::execute(void)
envGetTmp(LatticeComplex, coor);
p = strToVec<Real>(par().mom);
ph = Zero();
const auto NumDims = src.Grid()->Dimensions();
for(unsigned int mu = 0; mu < NumDims - 1; mu++)
for(unsigned int mu = 0; mu < p.size(); mu++)
{
LatticeCoordinate(coor, mu);
ph = ph + (p[mu]/env().getDim(mu))*coor;