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

Allow dimensions to be periodic

This commit is contained in:
Quadro 2021-05-18 16:36:29 -04:00
parent c18025c0b8
commit 84e246a963

View File

@ -55,15 +55,16 @@ struct DirichletFilter: public MomentumFilterBase<MomentaField>
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
LatticeInteger coor(grid); LatticeInteger coor(grid);
LatticeColourMatrix zz(grid); zz = Zero(); LatticeColourMatrix zz(grid); zz = Zero();
Coordinate Global=grid->GlobalDimensions();
for(int mu=0;mu<Nd;mu++) { for(int mu=0;mu<Nd;mu++) {
if ( (Block[mu] <= Global[mu]) && (Block[mu]>1) ) {
// If costly could provide Grid earlier and precompute masks // If costly could provide Grid earlier and precompute masks
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);
PokeIndex<LorentzIndex>(P, P_mu, mu); PokeIndex<LorentzIndex>(P, P_mu, mu);
}
} }
} }
}; };