Grid 0.7.0
PauliVillarsInverters.h
Go to the documentation of this file.
1 /*************************************************************************************
2
3 Grid physics library, www.github.com/paboyle/Grid
4
5 Source file: ./lib/algorithms/iterative/SchurRedBlack.h
6
7 Copyright (C) 2015
8
9Author: Peter Boyle <paboyle@ph.ed.ac.uk>
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License along
22 with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25 See the full license in the file "LICENSE" in the top level distribution directory
26 *************************************************************************************/
27 /* END LEGAL */
28#pragma once
29
31
32template<class Field>
34{
35 public:
38
39 template<class Matrix>
40 void operator() (Matrix &_Matrix,const Field &src,Field &sol)
41 {
42 RealD m = _Matrix.Mass();
43 Field A (_Matrix.FermionGrid());
44
46
47 _Matrix.SetMass(1.0);
48 _Matrix.Mdag(src,A);
49 CG(HermOp,A,sol);
50 _Matrix.SetMass(m);
51 };
52};
53
54template<class Field,class SchurSolverType>
56{
57 public:
58 SchurSolverType & SchurSolver;
59 PauliVillarsSolverRBprec( SchurSolverType &_SchurSolver) : SchurSolver(_SchurSolver){};
60
61 template<class Matrix>
62 void operator() (Matrix &_Matrix,const Field &src,Field &sol)
63 {
64 RealD m = _Matrix.Mass();
65 Field A (_Matrix.FermionGrid());
66
67 _Matrix.SetMass(1.0);
68 SchurSolver(_Matrix,src,sol);
69 _Matrix.SetMass(m);
70 };
71};
72
73template<class Field,class GaugeField>
75{
76 public:
77 GaugeField & Umu;
79
81 {
82 };
83
84 template<class Matrix>
85 void operator() (Matrix &_Matrix,const Field &src,Field &sol)
86 {
88 faPV.pvInv(src,sol);
89 };
90};
91
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
double RealD
Definition Simd.h:61
void pvInv(const Vi &_src, Vi &_dst) const
ConjugateGradient< Field > & CG
void operator()(Matrix &_Matrix, const Field &src, Field &sol)
PauliVillarsSolverFourierAccel(GaugeField &_Umu, ConjugateGradient< Field > &_CG)
void operator()(Matrix &_Matrix, const Field &src, Field &sol)
PauliVillarsSolverRBprec(SchurSolverType &_SchurSolver)
void operator()(Matrix &_Matrix, const Field &src, Field &sol)
ConjugateGradient< Field > & CG
PauliVillarsSolverUnprec(ConjugateGradient< Field > &_CG)