Grid 0.7.0
NaiveStaggeredFermion.h
Go to the documentation of this file.
1/*************************************************************************************
2
3Grid physics library, www.github.com/paboyle/Grid
4
5Source file: ./lib/qcd/action/fermion/ImprovedStaggered.h
6
7Copyright (C) 2015
8
9Author: Azusa Yamaguchi, Peter Boyle
10
11This program is free software; you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation; either version 2 of the License, or
14(at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along
22with this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25See the full license in the file "LICENSE" in the top level distribution
26directory
27*************************************************************************************/
28 /* END LEGAL */
29#ifndef GRID_QCD_NAIVE_STAG_FERMION_H
30#define GRID_QCD_NAIVE_STAG_FERMION_H
31
33
35public:
36 static const std::vector<int> directions;
37 static const std::vector<int> displacements;
38 static const int npoint = 8;
39};
40
41template <class Impl>
43public:
46
47 FermionField _tmp;
48 FermionField &tmp(void) { return _tmp; }
49
51 // Implement the abstract base
53 GridBase *GaugeGrid(void) { return _grid; }
55 GridBase *FermionGrid(void) { return _grid; }
57
59 // override multiply; cut number routines if pass dagger argument
60 // and also make interface more uniformly consistent
62 void M(const FermionField &in, FermionField &out);
63 void Mdag(const FermionField &in, FermionField &out);
64
66 // half checkerboard operations
68 void Meooe(const FermionField &in, FermionField &out);
69 void MeooeDag(const FermionField &in, FermionField &out);
70 void Mooee(const FermionField &in, FermionField &out);
71 void MooeeDag(const FermionField &in, FermionField &out);
72 void MooeeInv(const FermionField &in, FermionField &out);
73 void MooeeInvDag(const FermionField &in, FermionField &out);
74
76 // Derivative interface
78 // Interface calls an internal routine
79 void DhopDeriv (GaugeField &mat, const FermionField &U, const FermionField &V, int dag);
80 void DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag);
81 void DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag);
82
84 // non-hermitian hopping term; half cb or both
86 void Dhop (const FermionField &in, FermionField &out, int dag);
87 void DhopOE(const FermionField &in, FermionField &out, int dag);
88 void DhopEO(const FermionField &in, FermionField &out, int dag);
89
91 // Multigrid assistance; force term uses too
93 void Mdir(const FermionField &in, FermionField &out, int dir, int disp);
94 void MdirAll(const FermionField &in, std::vector<FermionField> &out);
95 void DhopDir(const FermionField &in, FermionField &out, int dir, int disp);
96
98 // Extra methods added by derived
100 void DerivInternal(StencilImpl &st,
101 DoubledGaugeField &U,
102 GaugeField &mat,
103 const FermionField &A, const FermionField &B, int dag);
104
105 void DhopInternal(StencilImpl &st, DoubledGaugeField &U,
106 const FermionField &in, FermionField &out, int dag);
107 void DhopInternalSerialComms(StencilImpl &st, DoubledGaugeField &U,
108 const FermionField &in, FermionField &out, int dag);
109 void DhopInternalOverlappedComms(StencilImpl &st, DoubledGaugeField &U,
110 const FermionField &in, FermionField &out, int dag);
111
113 // Grid own interface Constructor
115 NaiveStaggeredFermion(GaugeField &_U, GridCartesian &Fgrid,
116 GridRedBlackCartesian &Hgrid, RealD _mass,
117 RealD _c1, RealD _u0,
118 const ImplParams &p = ImplParams());
120 GridRedBlackCartesian &Hgrid, RealD _mass,
121 RealD _c1, RealD _u0,
122 const ImplParams &p = ImplParams());
123
124 // DoubleStore impl dependent
125 void ImportGauge (const GaugeField &_U );
126 DoubledGaugeField &GetU(void) { return Umu ; } ;
128
130 // Data members require to support the functionality
132
133 // protected:
134public:
135 // any other parameters of action ???
136 virtual int isTrivialEE(void) { return 1; };
137 virtual RealD Mass(void) { return mass; }
141
144
145 // Defines the stencils for even and odd
146 StencilImpl Stencil;
147 StencilImpl StencilEven;
148 StencilImpl StencilOdd;
149 void SloppyComms(int sloppy)
150 {
151 Stencil.SetSloppyComms(sloppy);
152 StencilEven.SetSloppyComms(sloppy);
153 StencilOdd.SetSloppyComms(sloppy);
154 }
155
156 // Copy of the gauge field , with even and odd subsets
157 DoubledGaugeField Umu;
158 DoubledGaugeField UmuEven;
159 DoubledGaugeField UmuOdd;
160
162 // Conserved current utilities
164 void ContractConservedCurrent(PropagatorField &q_in_1,
165 PropagatorField &q_in_2,
166 PropagatorField &q_out,
167 PropagatorField &src,
168 Current curr_type,
169 unsigned int mu);
170 void SeqConservedCurrent(PropagatorField &q_in,
171 PropagatorField &q_out,
172 PropagatorField &srct,
173 Current curr_type,
174 unsigned int mu,
175 unsigned int tmin,
176 unsigned int tmax,
177 ComplexField &lattice_cmplx);
178};
179
182
184
185#endif
NaiveStaggeredFermion< StaggeredImplF > NaiveStaggeredFermionF
Definition Fermion.h:443
NaiveStaggeredFermion< StaggeredImplD > NaiveStaggeredFermionD
Definition Fermion.h:444
B
#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
static const std::vector< int > directions
static const std::vector< int > displacements
StaggeredKernels< StaggeredImplF > Kernels
DoubledGaugeField & GetU(void)
void DhopInternal(StencilImpl &st, DoubledGaugeField &U, const FermionField &in, FermionField &out, int dag)
void MooeeDag(const FermionField &in, FermionField &out)
void MdirAll(const FermionField &in, std::vector< FermionField > &out)
NaiveStaggeredFermion(GridCartesian &Fgrid, GridRedBlackCartesian &Hgrid, RealD _mass, RealD _c1, RealD _u0, const ImplParams &p=ImplParams())
GridBase * GaugeRedBlackGrid(void)
void Dhop(const FermionField &in, FermionField &out, int dag)
void DhopInternalOverlappedComms(StencilImpl &st, DoubledGaugeField &U, const FermionField &in, FermionField &out, int dag)
void DhopDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
GridBase * FermionRedBlackGrid(void)
void M(const FermionField &in, FermionField &out)
void DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
FermionField & tmp(void)
void SeqConservedCurrent(PropagatorField &q_in, PropagatorField &q_out, PropagatorField &srct, Current curr_type, unsigned int mu, unsigned int tmin, unsigned int tmax, ComplexField &lattice_cmplx)
void DhopOE(const FermionField &in, FermionField &out, int dag)
void DhopEO(const FermionField &in, FermionField &out, int dag)
void DhopDir(const FermionField &in, FermionField &out, int dir, int disp)
NaiveStaggeredFermion(GaugeField &_U, GridCartesian &Fgrid, GridRedBlackCartesian &Hgrid, RealD _mass, RealD _c1, RealD _u0, const ImplParams &p=ImplParams())
void Mdag(const FermionField &in, FermionField &out)
void DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
void MooeeInv(const FermionField &in, FermionField &out)
void MeooeDag(const FermionField &in, FermionField &out)
void MooeeInvDag(const FermionField &in, FermionField &out)
void DhopInternalSerialComms(StencilImpl &st, DoubledGaugeField &U, const FermionField &in, FermionField &out, int dag)
void DerivInternal(StencilImpl &st, DoubledGaugeField &U, GaugeField &mat, const FermionField &A, const FermionField &B, int dag)
void Mooee(const FermionField &in, FermionField &out)
void ContractConservedCurrent(PropagatorField &q_in_1, PropagatorField &q_in_2, PropagatorField &q_out, PropagatorField &src, Current curr_type, unsigned int mu)
void Meooe(const FermionField &in, FermionField &out)
void Mdir(const FermionField &in, FermionField &out, int dir, int disp)
StaggeredKernels(const ImplParams &p=ImplParams())