/* * Copyright (C) 2023 * * Author: Antonin Portelli * Elements based on production templates from Raoul Hodgson * * Hadrons is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * Hadrons is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Hadrons. If not, see . * * See the full license in the file "LICENSE" in the top level distribution * directory. */ #pragma once #include #include namespace hadpresets { using namespace Grid::Hadrons; struct Test { static inline void addTestDwfSolver(Application &app, const std::string solverName, const std::string gaugeName, const double mass = 0.1, const double residual = 1.0e-8); }; void Test::addTestDwfSolver(Application &app, const std::string solverName, const std::string gaugeName, const double mass, const double residual) { const std::string prefix = solverName; // DWF action MAction::DWF::Par actionPar; actionPar.gauge = gaugeName; actionPar.Ls = 8; actionPar.M5 = 1.8; actionPar.mass = mass; actionPar.boundary = "1 1 1 -1"; actionPar.twist = "0. 0. 0. 0."; app.createModule(prefix + "_dwf", actionPar); // solver MSolver::RBPrecCG::Par solverPar; solverPar.action = prefix + "_dwf"; solverPar.guesser = ""; solverPar.maxIteration = 10000; solverPar.residual = residual; app.createModule(solverName, solverPar); } } // namespace hadpresets