CHROMA
tprec_wilson_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Even-odd preconditioned Wilson fermion linear operator
4  */
5 
6 #ifndef __tprec_wilson_linop_w_h__
7 #define __tprec_wilson_linop_w_h__
8 
11 #include "io/aniso_io.h"
12 
13 
14 namespace Chroma
15 {
16  //! Even-odd preconditioned Wilson-Dirac operator
17  /*!
18  * \ingroup linop
19  *
20  * This routine is specific to Wilson fermions!
21  *
22  * The kernel for Wilson fermions is
23  *
24  * M = (d+M) - (1/2) D'
25  */
26 
27  class EvenOddPrecWilsonLinOp : public EvenOddPrecConstDetLinearOperator<LatticeFermion,
28  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
29  {
30  public:
31  // Typedefs to save typing
32  typedef LatticeFermion T;
33  typedef multi1d<LatticeColorMatrix> P;
34  typedef multi1d<LatticeColorMatrix> Q;
35 
36  //! Partial constructor
38 
39  //! Full constructor
41  const Real& Mass_)
42  {create(fs,Mass_);}
43 
44  //! Full constructor with Anisotropy
46  const Real& Mass_,
47  const AnisoParam_t& aniso)
48  {create(fs,Mass_,aniso);}
49 
50  //! Destructor is automatic
52 
53  //! Return the fermion BC object for this linear operator
54  const FermBC<T,P,Q>& getFermBC() const {return D.getFermBC();}
55 
56  //! Creation routine
58  const Real& Mass_);
59 
60  //! Creation routine with Anisotropy
62  const Real& Mass_,
63  const AnisoParam_t& aniso);
64 
65  //! Apply the the even-even block onto a source std::vector
66  inline
67  void evenEvenLinOp(LatticeFermion& chi, const LatticeFermion& psi,
68  enum PlusMinus isign) const
69  {
70  chi[rb[0]] = fact*psi;
71  }
72 
73  //! Apply the inverse of the even-even block onto a source std::vector
74  inline
75  void evenEvenInvLinOp(LatticeFermion& chi, const LatticeFermion& psi,
76  enum PlusMinus isign) const
77  {
78  chi[rb[0]] = invfact*psi;
79  }
80 
81  //! Apply the the even-odd block onto a source std::vector
82  void evenOddLinOp(LatticeFermion& chi, const LatticeFermion& psi,
83  enum PlusMinus isign) const;
84 
85  //! Apply the the odd-even block onto a source std::vector
86  void oddEvenLinOp(LatticeFermion& chi, const LatticeFermion& psi,
87  enum PlusMinus isign) const;
88 
89  //! Apply the the odd-odd block onto a source std::vector
90  inline
91  void oddOddLinOp(LatticeFermion& chi, const LatticeFermion& psi,
92  enum PlusMinus isign) const
93  {
94  chi[rb[1]] = fact*psi;
95  }
96 
97  //! Override inherited one with a few more funkies
98  void operator()(LatticeFermion& chi, const LatticeFermion& psi,
99  enum PlusMinus isign) const;
100 
101 
102  //! Apply the even-even block onto a source std::vector
103  void derivEvenEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
104  const LatticeFermion& chi, const LatticeFermion& psi,
105  enum PlusMinus isign) const
106  {
107  ds_u.resize(Nd);
108  for(int mu=0; mu < Nd; mu++) {
109  ds_u[mu] = zero;
110  }
111  }
112 
113  //! Apply the the even-odd block onto a source std::vector
114  void derivEvenOddLinOp(multi1d<LatticeColorMatrix>& ds_u,
115  const LatticeFermion& chi, const LatticeFermion& psi,
116  enum PlusMinus isign) const;
117 
118  //! Apply the the odd-even block onto a source std::vector
119  void derivOddEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
120  const LatticeFermion& chi, const LatticeFermion& psi,
121  enum PlusMinus isign) const;
122 
123  //! Apply the the odd-odd block onto a source std::vector
124  void derivOddOddLinOp(multi1d<LatticeColorMatrix>& ds_u,
125  const LatticeFermion& chi, const LatticeFermion& psi,
126  enum PlusMinus isign) const
127  {
128  ds_u.resize(Nd);
129  for(int mu=0; mu < Nd; mu++) {
130  ds_u[mu] = zero;
131  }
132  }
133 
134 
135  //! Return flops performed by the operator()
136  unsigned long nFlops() const;
137 
138  private:
139  Real fact; // tmp holding Nd+Mass
140  Real invfact; // tmp holding 1/(Nd+Mass)
141 
142  Real Mass;
143  WilsonDslash D;
144  };
145 
146 } // End Namespace Chroma
147 
148 
149 #endif
Anisotropy parameters.
EvenOddPrecWilsonLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const AnisoParam_t &aniso)
Full constructor with Anisotropy.
unsigned long nFlops() const
Return flops performed by the operator()
multi1d< LatticeColorMatrix > Q
void derivEvenEvenLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
void derivOddOddLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void derivEvenOddLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
multi1d< LatticeColorMatrix > P
void evenEvenInvLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the inverse of the even-even block onto a source std::vector.
~EvenOddPrecWilsonLinOp()
Destructor is automatic.
void oddOddLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const AnisoParam_t &aniso)
Creation routine with Anisotropy.
void oddEvenLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
EvenOddPrecWilsonLinOp()
Partial constructor.
void evenEvenLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the even-even block onto a source std::vector.
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_)
Creation routine.
void derivOddEvenLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Override inherited one with a few more funkies.
void evenOddLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
EvenOddPrecWilsonLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_)
Full constructor.
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
General Wilson-Dirac dslash.
Definition: lwldslash_w.h:48
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Definition: lwldslash_w.h:92
int mu
Definition: cool.cc:24
Include possibly optimized Wilson dslash.
Preconditioned 4D Linop with Gauge Independent Even-Even part.
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Double zero
Definition: invbicg.cc:106
Parameters for anisotropy.
Definition: aniso_io.h:24