diff --git a/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h b/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h index fccb8330..157901ef 100644 --- a/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h +++ b/Grid/algorithms/multigrid/GeneralCoarsenedMatrix.h @@ -72,6 +72,17 @@ public: GridBase * FineGrid(void) { return _FineGrid; }; // this is all the linalg routines need to know GridCartesian * CoarseGrid(void) { return _CoarseGrid; }; // this is all the linalg routines need to know + void ShiftMatrix(RealD shift) + { + int Nd=_FineGrid->Nd(); + Coordinate zero_shift(Nd,0); + for(int p=0;poSites(); - for(int ss=0;ss_offset; - assert( o< osites); - } - } } - _A.resize(geom.npoint,CoarseGrid); _Adag.resize(geom.npoint,CoarseGrid); } @@ -127,6 +128,7 @@ public: void Mult (std::vector &A,const CoarseVector &in, CoarseVector &out) { RealD tviews=0; RealD ttot=0; RealD tmult=0; RealD texch=0; RealD text=0; RealD ttemps=0; RealD tcopy=0; + RealD tmult2=0; ttot=-usecond(); conformable(CoarseGrid(),in.Grid()); @@ -188,16 +190,17 @@ public: typedef decltype(coalescedRead(in_v[0](0))) calcComplex; int32_t ss = spb/(nbasis*npoint); int32_t bp = spb%(nbasis*npoint); - int32_t b = bp/npoint; - int32_t point= bp%npoint; + int32_t point= bp/nbasis; + int32_t b = bp%nbasis; auto SE = Stencil_v.GetEntry(point,ss); auto nbr = coalescedReadGeneralPermute(in_v[SE->_offset],SE->_permute,Nd); - auto res = coalescedRead(Aview_p[point][ss](b,0))*nbr(0); + auto res = coalescedRead(Aview_p[point][ss](0,b))*nbr(0); for(int bb=1;bb