mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Making change 1) as simple as possible 2) as much like MSink/Point.hpp as possible
This commit is contained in:
parent
c1677fccf6
commit
3753508957
@ -122,15 +122,6 @@ void TWall<FImpl>::setup(void)
|
|||||||
envCache(Lattice<iScalar<vInteger>>, tName_, 1, envGetGrid(LatticeComplex));
|
envCache(Lattice<iScalar<vInteger>>, tName_, 1, envGetGrid(LatticeComplex));
|
||||||
envCacheLat(LatticeComplex, momphName_);
|
envCacheLat(LatticeComplex, momphName_);
|
||||||
envTmpLat(LatticeComplex, "coor");
|
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 ///////////////////////////////////////////////////////////////////
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
@ -152,8 +143,7 @@ void TWall<FImpl>::execute(void)
|
|||||||
envGetTmp(LatticeComplex, coor);
|
envGetTmp(LatticeComplex, coor);
|
||||||
p = strToVec<Real>(par().mom);
|
p = strToVec<Real>(par().mom);
|
||||||
ph = Zero();
|
ph = Zero();
|
||||||
const auto NumDims = src.Grid()->Dimensions();
|
for(unsigned int mu = 0; mu < p.size(); mu++)
|
||||||
for(unsigned int mu = 0; mu < NumDims - 1; mu++)
|
|
||||||
{
|
{
|
||||||
LatticeCoordinate(coor, mu);
|
LatticeCoordinate(coor, mu);
|
||||||
ph = ph + (p[mu]/env().getDim(mu))*coor;
|
ph = ph + (p[mu]/env().getDim(mu))*coor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user