Grid 0.7.0
CompactWilsonCloverFermion5D.h
Go to the documentation of this file.
1/*************************************************************************************
2
3 Grid physics library, www.github.com/paboyle/Grid
4
5 Source file: ./lib/qcd/action/fermion/CompactWilsonCloverFermion5D.h
6
7 Copyright (C) 2020 - 2025
8
9 Author: Daniel Richtmann <daniel.richtmann@gmail.com>
10 Author: Nils Meyer <nils.meyer@ur.de>
11 Author: Christoph Lehner <christoph@lhnr.de>
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License along
24 with this program; if not, write to the Free Software Foundation, Inc.,
25 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26
27 See the full license in the file "LICENSE" in the top level distribution directory
28 *************************************************************************************/
29/* END LEGAL */
30
31#pragma once
32
37
39
40// see Grid/qcd/action/fermion/CompactWilsonCloverFermion.h for description
41
42template<class Impl, class CloverHelpers>
44 public WilsonCloverHelpers<Impl>,
45 public CompactWilsonCloverHelpers<Impl> {
47 // Sizes
49
50public:
51
53
55 // Type definitions
57
58public:
59
63
67
69 // Constructors
71
72public:
73
75 GridCartesian &FiveDimGrid,
76 GridRedBlackCartesian &FiveDimRedBlackGrid,
77 GridCartesian &FourDimGrid,
78 GridRedBlackCartesian &FourDimRedBlackGrid,
79 const RealD _mass,
80 const RealD _csw_r = 0.0,
81 const RealD _csw_t = 0.0,
82 const RealD _cF = 1.0,
83 const ImplParams& impl_p = ImplParams());
84
86 // Member functions (implementing interface)
88
89public:
90
91 virtual void Instantiatable() {};
92 int ConstEE() override { return 0; };
93 int isTrivialEE() override { return 0; };
94
95 void Dhop(const FermionField& in, FermionField& out, int dag) override;
96
97 void DhopOE(const FermionField& in, FermionField& out, int dag) override;
98
99 void DhopEO(const FermionField& in, FermionField& out, int dag) override;
100
101 void DhopDir(const FermionField& in, FermionField& out, int dir, int disp) override;
102
103 void DhopDirAll(const FermionField& in, std::vector<FermionField>& out) /* override */;
104
105 void M(const FermionField& in, FermionField& out) override;
106
107 void Mdag(const FermionField& in, FermionField& out) override;
108
109 void Meooe(const FermionField& in, FermionField& out) override;
110
111 void MeooeDag(const FermionField& in, FermionField& out) override;
112
113 void Mooee(const FermionField& in, FermionField& out) override;
114
115 void MooeeDag(const FermionField& in, FermionField& out) override;
116
117 void MooeeInv(const FermionField& in, FermionField& out) override;
118
119 void MooeeInvDag(const FermionField& in, FermionField& out) override;
120
121 void Mdir(const FermionField& in, FermionField& out, int dir, int disp) override;
122
123 void MdirAll(const FermionField& in, std::vector<FermionField>& out) override;
124
125 void MDeriv(GaugeField& force, const FermionField& X, const FermionField& Y, int dag) override;
126
127 void MooDeriv(GaugeField& mat, const FermionField& U, const FermionField& V, int dag) override;
128
129 void MeeDeriv(GaugeField& mat, const FermionField& U, const FermionField& V, int dag) override;
130
132 // Member functions (internals)
134
135 void MooeeInternal(const FermionField& in,
136 FermionField& out,
137 const CloverDiagonalField& diagonal,
138 const CloverTriangleField& triangle);
139
141 // Helpers
143
144 void ImportGauge(const GaugeField& _Umu) override;
145
147 // Helpers
149
150private:
151
152 template<class Field>
153 const MaskField* getCorrectMaskField(const Field &in) const {
154 if(in.Grid()->_isCheckerBoarded) {
155 if(in.Checkerboard() == Odd) {
156 return &this->BoundaryMaskOdd;
157 } else {
158 return &this->BoundaryMaskEven;
159 }
160 } else {
161 return &this->BoundaryMask;
162 }
163 }
164
165 template<class Field>
166 void ApplyBoundaryMask(Field& f) {
167 const MaskField* m = getCorrectMaskField(f); assert(m != nullptr);
168 assert(m != nullptr);
170 }
171
173 // Member Data
175
176public:
177
181 int n_rhs;
182
184
185 CloverDiagonalField Diagonal, DiagonalEven, DiagonalOdd;
187
188 CloverTriangleField Triangle, TriangleEven, TriangleOdd;
190
191 FermionField Tmp;
192
194};
195
static const int Odd
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
double RealD
Definition Simd.h:61
static INTERNAL_PRECISION U
Definition Zolotarev.cc:230
void MooeeInternal(const FermionField &in, FermionField &out, const CloverDiagonalField &diagonal, const CloverTriangleField &triangle)
void MdirAll(const FermionField &in, std::vector< FermionField > &out) override
void MooeeInvDag(const FermionField &in, FermionField &out) override
void MooeeInv(const FermionField &in, FermionField &out) override
void MeeDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) override
void Mdir(const FermionField &in, FermionField &out, int dir, int disp) override
void DhopDir(const FermionField &in, FermionField &out, int dir, int disp) override
CompactWilsonCloverFermion5D(GaugeField &_Umu, GridCartesian &FiveDimGrid, GridRedBlackCartesian &FiveDimRedBlackGrid, GridCartesian &FourDimGrid, GridRedBlackCartesian &FourDimRedBlackGrid, const RealD _mass, const RealD _csw_r=0.0, const RealD _csw_t=0.0, const RealD _cF=1.0, const ImplParams &impl_p=ImplParams())
void MooDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) override
void Mooee(const FermionField &in, FermionField &out) override
void MeooeDag(const FermionField &in, FermionField &out) override
void M(const FermionField &in, FermionField &out) override
CompactWilsonCloverHelpers< Impl > CompactHelpers
void Dhop(const FermionField &in, FermionField &out, int dag) override
void MooeeDag(const FermionField &in, FermionField &out) override
void Meooe(const FermionField &in, FermionField &out) override
void Mdag(const FermionField &in, FermionField &out) override
void MDeriv(GaugeField &force, const FermionField &X, const FermionField &Y, int dag) override
void DhopOE(const FermionField &in, FermionField &out, int dag) override
void DhopEO(const FermionField &in, FermionField &out, int dag) override
void DhopDirAll(const FermionField &in, std::vector< FermionField > &out)
static strong_inline void ApplyBoundaryMask(Field &f, const Mask &m)
WilsonFermion5D(GaugeField &_Umu, GridCartesian &FiveDimGrid, GridRedBlackCartesian &FiveDimRedBlackGrid, GridCartesian &FourDimGrid, GridRedBlackCartesian &FourDimRedBlackGrid, double _M5, const ImplParams &p=ImplParams())