diff --git a/Grid/algorithms/iterative/AdefGeneric.h b/Grid/algorithms/iterative/AdefGeneric.h index cc9d2e10..e0b99fcb 100644 --- a/Grid/algorithms/iterative/AdefGeneric.h +++ b/Grid/algorithms/iterative/AdefGeneric.h @@ -538,139 +538,6 @@ class TwoLevelADEF2 : public TwoLevelCG }; -template -class TwoLevelADEF2mrhs : public TwoLevelADEF2 -{ -public: - GridBase *coarsegridmrhs; - LinearFunction &_CoarseSolverMrhs; - LinearFunction &_CoarseSolverPreciseMrhs; - LinearFunction &_CoarseGuesser; - TwoLevelADEF2mrhs(RealD tol, - Integer maxit, - LinearOperatorBase &FineLinop, - LinearFunction &Smoother, - // LinearFunction &CoarseSolver, - // LinearFunction &CoarseSolverPrecise, - LinearFunction &CoarseSolverMrhs, - LinearFunction &CoarseSolverPreciseMrhs, - LinearFunction &CoarseGuesser, - GridBase *rhsgrid, - Aggregation &Aggregates) : - TwoLevelADEF2(tol, maxit,FineLinop,Smoother,CoarseSolverMrhs,CoarseSolverPreciseMrhs,Aggregates), - _CoarseSolverMrhs(CoarseSolverMrhs), - _CoarseSolverPreciseMrhs(CoarseSolverPreciseMrhs), - _CoarseGuesser(CoarseGuesser) - { - coarsegridmrhs = rhsgrid; - }; - - virtual void Vstart(std::vector & x,std::vector & src) - { - int nrhs=x.size(); - std::cout << GridLogMessage<<"HDCG: fPcg Vstart for "<coarsegrid); - CoarseField PleftMss_proj(this->coarsegrid); - - CoarseField PleftProjMrhs(this->coarsegridmrhs); - CoarseField PleftMss_projMrhs(this->coarsegridmrhs); - - std::cout << GridLogMessage<<"HDCG: fPcg Vstart Mrhs projecting "<_Aggregates.ProjectToSubspace(PleftProj,src[rhs]); // can optimise later - InsertSliceFast(PleftProj,PleftProjMrhs,rhs,0); - this->_CoarseGuesser(PleftProj,PleftMss_proj); - InsertSliceFast(PleftMss_proj,PleftMss_projMrhs,rhs,0); - } - - std::cout << GridLogMessage<<"HDCG: fPcg Vstart Mrhs coarse solve "<_CoarseSolverPreciseMrhs(PleftProjMrhs,PleftMss_projMrhs); // Ass^{-1} r_s - - std::cout << GridLogMessage<<"HDCG: fPcg Vstart promote "<_Aggregates.PromoteFromSubspace(PleftMss_proj,x[rhs]); - } - } - - virtual void PcgM1(std::vector & in,std::vector & out){ - - int nrhs=in.size(); - std::cout << " mrhs PcgM1 for "<grid); - std::vector Min(nrhs,this->grid); - std::cout << " mrhs PcgM1 Min "<coarsegrid); - CoarseField PleftMss_proj(this->coarsegrid); - - CoarseField PleftProjMrhs(this->coarsegridmrhs); - CoarseField PleftMss_projMrhs(this->coarsegridmrhs); - std::cout << " mrhs Coarse ops "<_Smoother(in[rhs],Min[rhs]); - - std::cout << GridLogMessage<<" HermOp for "<_FineLinop.HermOp(Min[rhs],out[rhs]); - - axpy(tmp,-1.0,out[rhs],in[rhs]); // tmp = in - A Min - - // Was - // this->_Aggregates.ProjectToSubspace(PleftProj,tmp); // can optimise later - // Now: - std::cout << GridLogMessage<<" blockProject for "<_Aggregates.subspace); - - std::cout << GridLogMessage<<" InsertSlice for "<_CoarseGuesser(PleftProj,PleftMss_proj); - - std::cout << GridLogMessage<<" InsertSlice for "<_CoarseSolverMrhs(PleftProjMrhs,PleftMss_projMrhs); // Ass^{-1} [in - A Min]_s - std::cout << " Coarse solve done"<_Aggregates.PromoteFromSubspace(PleftMss_proj,tmp);// tmp = Q[in - A Min] - // std::cout << " add for "< class TwoLevelADEF1defl : public TwoLevelCG