From e43fce1083ad93353cf1991450f77a4d349a3a2f Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Mon, 9 Dec 2019 02:55:45 -0500 Subject: [PATCH] Clean up and simplify a little. --- tests/solver/Test_dwf_hdcr.cc | 229 +++++++--------------------------- 1 file changed, 48 insertions(+), 181 deletions(-) diff --git a/tests/solver/Test_dwf_hdcr.cc b/tests/solver/Test_dwf_hdcr.cc index 58bf9032..74adc417 100644 --- a/tests/solver/Test_dwf_hdcr.cc +++ b/tests/solver/Test_dwf_hdcr.cc @@ -1,4 +1,4 @@ - /************************************************************************************* + /************************************************************************************* Grid physics library, www.github.com/paboyle/Grid @@ -111,11 +111,7 @@ public: } void operator()(const FineField &in, FineField & out) { - if ( params.domaindecompose ) { - operatorSAP(in,out); - } else { - operatorCheby(in,out); - } + operatorCheby(in,out); } //////////////////////////////////////////////////////////////////////// @@ -232,66 +228,6 @@ public: } #endif - void SAP (const FineField & src,FineField & psi){ - - Lattice > coor(src.Grid()); - Lattice > subset(src.Grid()); - - FineField r(src.Grid()); - FineField zz(src.Grid()); zz=Zero(); - FineField vec1(src.Grid()); - FineField vec2(src.Grid()); - - const RealD block=params.domainsize; - - subset=Zero(); - for(int mu=0;mu fMdagMOp(_SmootherMatrix,0.0); - Chebyshev Cheby (params.lo,params.hi,params.order,InverseApproximation); - - RealD resid; - for(int i=0;i Cheby (lo[ilo],70.0,ord,InverseApproximation); @@ -329,7 +267,6 @@ public: CoarseVector Csol(_CoarseOperator.Grid()); Csol=Zero(); ConjugateGradient CG(3.0e-3,100000); - // ConjugateGradient fCG(3.0e-2,1000); HermitianLinearOperator HermOp(_CoarseOperator); MdagMLinearOperator MdagMOp(_CoarseOperator); @@ -339,14 +276,11 @@ public: FineField vec1(in.Grid()); FineField vec2(in.Grid()); - // Chebyshev Cheby (0.5,70.0,30,InverseApproximation); - // Chebyshev ChebyAccu(0.5,70.0,30,InverseApproximation); Chebyshev Cheby (params.lo,params.hi,params.order,InverseApproximation); Chebyshev ChebyAccu(params.lo,params.hi,params.order,InverseApproximation); - // Cheby.JacksonSmooth(); - // ChebyAccu.JacksonSmooth(); - // _Aggregates.ProjectToSubspace (Csrc,in); + _Aggregates.ProjectToSubspace (Csrc,in); + // _Aggregates.PromoteFromSubspace(Csrc,out); // std::cout< CG(1.0e-3,100000); - - HermitianLinearOperator HermOp(_CoarseOperator); - MdagMLinearOperator MdagMOp(_CoarseOperator); - - FineField vec1(in.Grid()); - FineField vec2(in.Grid()); - - _Aggregates.ProjectToSubspace (Csrc,in); - _Aggregates.PromoteFromSubspace(Csrc,out); - std::cout< HermIndefOp(Ddwf); Gamma5R5HermitianLinearOperator HermIndefOpDD(DdwfDD); - CoarsenedMatrix LDOp(*Coarse5d); + CoarsenedMatrix LDOp(*Coarse5d,1); // Hermitian matrix LDOp.CoarsenOperator(FGrid,HermIndefOp,Aggregates); std::cout< PosdefLdop(LDOp); ConjugateGradient CG(1.0e-6,100000); - // CG(PosdefLdop,c_src,c_res); + CG(PosdefLdop,c_src,c_res); - // std::cout< HermIndefLdop(LDOp); - // ConjugateResidual MCR(1.0e-6,100000); - //MCR(HermIndefLdop,c_src,c_res); + std::cout< HermIndefLdop(LDOp); +// ConjugateResidual MCR(1.0e-6,100000); +// MCR(HermIndefLdop,c_src,c_res); std::cout< PreconDD(Aggregates, LDOp, - HermIndefOp,Ddwf, - HermIndefOpDD,DdwfDD); - TrivialPrecon simple; + // MultiGridPreconditioner PreconDD(Aggregates, LDOp, + // HermIndefOp,Ddwf, + // HermIndefOpDD,DdwfDD); + // TrivialPrecon simple; std::cout< simple; // ConjugateGradient fCG(1.0e-8,100000); // fCG(HermDefOp,src,result); - // exit(0); std::cout< HermOpEO(Ddwf); + ConjugateGradient pCG(1.0e-8,10000); + // pCG(HermOpEO,src_o,result_o); + + // std::cout< UPGCR(1.0e-8,100000,simple,8,128); // UPGCR(HermIndefOp,src,result); @@ -656,9 +537,9 @@ int main (int argc, char ** argv) Precon.PowerMethod(src); - std::cout< PGCRDD(1.0e-8,100000,PreconDD,8,128); // result=Zero(); // std::cout< HermOpEO(Ddwf); - ConjugateGradient pCG(1.0e-8,10000); - - LatticeFermion src_o(FrbGrid); - LatticeFermion result_o(FrbGrid); - pickCheckerboard(Odd,src_o,src); - result_o=Zero(); - - pCG(HermOpEO,src_o,result_o); - - std::cout<