CHROMA
lwldslash_w_cppf.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Wilson Dslash linear operator
4  */
5 
6 #ifndef __lwldslash_cpp_float_h__
7 #define __lwldslash_cpp_float_h__
8 
9 #include "chromabase.h"
10 #include "qdp_allocator.h"
11 #include "chroma_config.h"
13 #include "io/aniso_io.h"
14 #include "state.h"
15 #include "cpp_dslash.h"
16 #include "cpp_dslash_qdp_packer.h"
17 
18 
19 using namespace CPlusPlusWilsonDslash;
20 
21 namespace Chroma
22 {
23  //! General Wilson-Dirac dslash
24  /*!
25  * \ingroup linop
26  *
27  * DSLASH
28  *
29  * This routine is specific to Wilson fermions!
30  *
31  * Description:
32  *
33  * This routine applies the operator D' to Psi, putting the result in Chi.
34  *
35  * Nd-1
36  * ---
37  * \
38  * chi(x) := > U (x) (1 - isign gamma ) psi(x+mu)
39  * / mu mu
40  * ---
41  * mu=0
42  *
43  * Nd-1
44  * ---
45  * \ +
46  * + > U (x-mu) (1 + isign gamma ) psi(x-mu)
47  * / mu mu
48  * ---
49  * mu=0
50  *
51  */
52 
53  class CPPWilsonDslashF : public WilsonDslashBase<LatticeFermionF,
54  multi1d<LatticeColorMatrixF>,
55  multi1d<LatticeColorMatrixF> >
56  {
57  public:
58  // Typedefs to save typing
59  typedef LatticeFermionF T;
60  typedef multi1d<LatticeColorMatrixF> P;
61  typedef multi1d<LatticeColorMatrixF> Q;
62 
63  //! Empty constructor. Must use create later
65 
66  //! Full constructor
68 
69  //! Full constructor with anisotropy
71  const AnisoParam_t& aniso_);
72 
73  //! Full constructor with general coefficients
75  const multi1d<Real>& coeffs_);
76 
77  //! Creation routine
78  void create(Handle< FermState<T,P,Q> > state);
79 
80  //! Creation routine with anisotropy
81  void create(Handle< FermState<T,P,Q> > state,
82  const AnisoParam_t& aniso_);
83 
84  //! Full constructor with general coefficients
85  void create(Handle< FermState<T,P,Q> > state,
86  const multi1d<Real>& coeffs_);
87 
88  //! No real need for cleanup here
90 
91  /**
92  * Apply a dslash
93  *
94  * \param chi result (Write)
95  * \param psi source (Read)
96  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
97  * \param cb Checkerboard of OUTPUT std::vector (Read)
98  *
99  * \return The output of applying dslash on psi
100  */
101  void apply(T& chi, const T& psi,
102  enum PlusMinus isign, int cb) const;
103 
104  //! Return the fermion BC object for this linear operator
105  const FermBC<T,P,Q>& getFermBC() const {return *fbc;}
106 
107  protected:
108  //! Get the anisotropy parameters
109  const multi1d<Real>& getCoeffs() const {return coeffs;}
110 
111  //! Init internals
112  void init();
113 
114  private:
115  multi1d<Real> coeffs; /*!< Nd array of coefficients of terms in the action */
116  // multi1d<PrimitiveSU3MatrixF> packed_gauge; // fold in anisotropy
119 
120 #ifndef CHROMA_STATIC_PACKED_GAUGE
121  PrimitiveSU3MatrixF* packed_gauge;
122 #else
123  static PrimitiveSU3MatrixF* packed_gauge;
124 #endif
125 
126  };
127 
128 
129 #ifdef CHROMA_STATIC_PACKED_GAUGE
130  PrimitiveSU3MatrixF* CPPWilsonDslashF::packed_gauge = nullptr;
131 #endif
132 
133 } // End Namespace Chroma
134 
135 
136 #endif
Anisotropy parameters.
Primary include file for CHROMA library code.
General Wilson-Dirac dslash.
Handle< FermBC< T, P, Q > > fbc
multi1d< LatticeColorMatrixF > Q
Handle< Dslash< float > > D
const multi1d< Real > & getCoeffs() const
Get the anisotropy parameters.
PrimitiveSU3MatrixF * packed_gauge
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
multi1d< LatticeColorMatrixF > P
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.
Wilson Dslash linear operator.
void init(MesonSpecData_t &data, XMLWriter &xml, const std::string &path, const std::string &id_tag, const Params &params)
Do some initialization.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int cb
Definition: invbicg.cc:120
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
chi
Definition: pade_trln_w.cc:24
psi
Definition: pade_trln_w.cc:191
Support class for fermion actions and linear operators.
Parameters for anisotropy.
Definition: aniso_io.h:24