1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-24 12:45:56 +01:00

2 deep cleaner coding

This commit is contained in:
Quadro 2021-05-25 19:51:52 -04:00
parent 64b3b37476
commit 375e0698dc

View File

@ -58,6 +58,7 @@ struct DDHMCFilter: public MomentumFilterBase<MomentaField>
GridBase *grid = P.Grid(); GridBase *grid = P.Grid();
LatticeColourMatrix zz(grid); zz = Zero(); LatticeColourMatrix zz(grid); zz = Zero();
MomentaField zzz(grid); zzz = Zero();
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// Zero strictly links crossing between domains // Zero strictly links crossing between domains
@ -72,7 +73,7 @@ struct DDHMCFilter: public MomentumFilterBase<MomentaField>
for(int mu=0;mu<Nd;mu++) { for(int mu=0;mu<Nd;mu++) {
if ( (Block[mu] <= Global[mu])&&(Block[mu]>0) ) { if ( (Block[mu] <= Global[mu])&&(Block[mu]>0) ) {
#if 0
LatticeCoordinate(coor,mu); LatticeCoordinate(coor,mu);
auto P_mu = PeekIndex<LorentzIndex>(P, mu); auto P_mu = PeekIndex<LorentzIndex>(P, mu);
P_mu = where(mod(coor,Block[mu])==Integer(Block[mu]-1),zz,P_mu); P_mu = where(mod(coor,Block[mu])==Integer(Block[mu]-1),zz,P_mu);
@ -86,6 +87,16 @@ struct DDHMCFilter: public MomentumFilterBase<MomentaField>
PokeIndex<LorentzIndex>(P, P_nu, nu); PokeIndex<LorentzIndex>(P, P_nu, nu);
} }
} }
#else
LatticeCoordinate(coor,mu);
P = where(mod(coor,Block[mu])==Integer(Block[mu]-2),zzz,P); //width 4
P = where(mod(coor,Block[mu])==Integer(Block[mu]-1),zzz,P); //width 2
P = where(mod(coor,Block[mu])==Integer(0),zzz,P); //width 2
auto P_mu = PeekIndex<LorentzIndex>(P,mu);
P = where(mod(coor,Block[mu])==Integer(1),zzz,P); //width 4
PokeIndex<LorentzIndex>(P, P_mu, mu);
#endif
} }