diff --git a/extras/Hadrons/Global.hpp b/extras/Hadrons/Global.hpp index 7f60ebcb..675a97c2 100644 --- a/extras/Hadrons/Global.hpp +++ b/extras/Hadrons/Global.hpp @@ -181,6 +181,18 @@ typedef XmlWriter ResultWriter; #define RESULT_FILE_NAME(name) \ name + "." + std::to_string(vm().getTrajectory()) + "." + resultFileExt +// default Schur convention + +#ifndef HADRONS_DEFAULT_SCHUR +#define HADRONS_DEFAULT_SCHUR DiagMooee +#endif +#define _HADRONS_SCHUR_OP_(conv) Schur##conv##Operator +#define HADRONS_SCHUR_OP(conv) _HADRONS_SCHUR_OP_(conv) +#define HADRONS_DEFAULT_SCHUR_OP HADRONS_SCHUR_OP(HADRONS_DEFAULT_SCHUR) +#define _HADRONS_SCHUR_SOLVE_(conv) SchurRedBlack##conv##Solve +#define HADRONS_SCHUR_SOLVE(conv) _HADRONS_SCHUR_SOLVE_(conv) +#define HADRONS_DEFAULT_SCHUR_SOLVE HADRONS_SCHUR_SOLVE(HADRONS_DEFAULT_SCHUR) + END_HADRONS_NAMESPACE #include diff --git a/extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp b/extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp index a41a7839..387b9455 100644 --- a/extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp +++ b/extras/Hadrons/Modules/MSolver/LocalCoherenceLanczos.hpp @@ -60,10 +60,10 @@ class TLocalCoherenceLanczos: public Module { public: FERM_TYPE_ALIASES(FImpl,); - typedef LCL LCL; - typedef FineEigenPack FineEigenPack; - typedef CoarseEigenPack CoarseEigenPack; - typedef SchurDiagMooeeOperator SchurFMat; + typedef LCL LCL; + typedef FineEigenPack FineEigenPack; + typedef CoarseEigenPack CoarseEigenPack; + typedef HADRONS_DEFAULT_SCHUR_OP SchurFMat; public: // constructor TLocalCoherenceLanczos(const std::string name); diff --git a/extras/Hadrons/Modules/MSolver/RBPrecCG.hpp b/extras/Hadrons/Modules/MSolver/RBPrecCG.hpp index 54c0f2d8..77ce6cd4 100644 --- a/extras/Hadrons/Modules/MSolver/RBPrecCG.hpp +++ b/extras/Hadrons/Modules/MSolver/RBPrecCG.hpp @@ -43,9 +43,10 @@ BEGIN_MODULE_NAMESPACE(MSolver) class RBPrecCGPar: Serializable { public: - GRID_SERIALIZABLE_CLASS_MEMBERS(RBPrecCGPar, - std::string, action, - double , residual); + GRID_SERIALIZABLE_CLASS_MEMBERS(RBPrecCGPar , + std::string , action, + unsigned int , maxIteration, + double , residual); }; template @@ -117,14 +118,16 @@ void TRBPrecCG::setup(void) auto &mat = envGet(FMat, par().action); auto solver = [&mat, this](FermionField &sol, const FermionField &source) { - ConjugateGradient cg(par().residual, 10000); - SchurRedBlackDiagMooeeSolve schurSolver(cg); + ConjugateGradient cg(par().residual, + par().maxIteration); + HADRONS_DEFAULT_SCHUR_SOLVE schurSolver(cg); schurSolver(mat, source, sol); }; envCreate(SolverFn, getName(), Ls, solver); } + // execution /////////////////////////////////////////////////////////////////// template void TRBPrecCG::execute(void)