CHROMA
lwldslash_w_cppd.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Wilson Dslash linear operator
4  */
5 
6 #ifndef __lwldslash_w_cpp_double_h__
7 #define __lwldslash_w_cpp_double_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 using namespace CPlusPlusWilsonDslash;
19 
20 namespace Chroma
21 {
22 
23 
24  //! General Wilson-Dirac dslash
25  /*!
26  * \ingroup linop
27  *
28  * DSLASH
29  *
30  * This routine is specific to Wilson fermions!
31  *
32  * Description:
33  *
34  * This routine applies the operator D' to Psi, putting the result in Chi.
35  *
36  * Nd-1
37  * ---
38  * \
39  * chi(x) := > U (x) (1 - isign gamma ) psi(x+mu)
40  * / mu mu
41  * ---
42  * mu=0
43  *
44  * Nd-1
45  * ---
46  * \ +
47  * + > U (x-mu) (1 + isign gamma ) psi(x-mu)
48  * / mu mu
49  * ---
50  * mu=0
51  *
52  */
53 
54  class CPPWilsonDslashD : public WilsonDslashBase<LatticeFermionD,
55  multi1d<LatticeColorMatrixD>,
56  multi1d<LatticeColorMatrixD> >
57  {
58  public:
59  // Typedefs to save typing
60  typedef LatticeFermionD T;
61  typedef multi1d<LatticeColorMatrixD> P;
62  typedef multi1d<LatticeColorMatrixD> Q;
63 
64  //! Empty constructor. Must use create later
66 
67  //! Full constructor
69 
70  //! Full constructor with anisotropy
72  const AnisoParam_t& aniso_);
73 
74  //! Full constructor with general coefficients
76  const multi1d<Real>& coeffs_);
77 
78  //! Creation routine
79  void create(Handle< FermState<T,P,Q> > state);
80 
81  //! Creation routine with anisotropy
82  void create(Handle< FermState<T,P,Q> > state,
83  const AnisoParam_t& aniso_);
84 
85  //! Full constructor with general coefficients
86  void create(Handle< FermState<T,P,Q> > state,
87  const multi1d<Real>& coeffs_);
88 
89  //! No real need for cleanup here
91 
92  /**
93  * Apply a dslash
94  *
95  * \param chi result (Write)
96  * \param psi source (Read)
97  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
98  * \param cb Checkerboard of OUTPUT std::vector (Read)
99  *
100  * \return The output of applying dslash on psi
101  */
102  void apply(T& chi, const T& psi,
103  enum PlusMinus isign, int cb) const;
104 
105  //! Return the fermion BC object for this linear operator
106  const FermBC<T,P,Q>& getFermBC() const {return *fbc;}
107 
108  protected:
109  //! Get the anisotropy parameters
110  const multi1d<Real>& getCoeffs() const {return coeffs;}
111 
112  //! Init internals
113  void init();
114 
115  private:
116  multi1d<Real> coeffs; /*!< Nd array of coefficients of terms in the action */
117  // multi1d<PrimitiveSU3MatrixD> packed_gauge; // fold in anisotropy
120 
121 #ifndef CHROMA_STATIC_PACKED_GAUGE
122  PrimitiveSU3MatrixD* packed_gauge;
123 #else
124  static PrimitiveSU3MatrixD* packed_gauge;
125 #endif
126  };
127 
128 #ifdef CHROMA_STATIC_PACKED_GAUGE
129  // initialize static gauge.
130  PrimitiveSU3MatrixD* CPPWilsonDslashD::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< Dslash< double > > D
multi1d< LatticeColorMatrixD > Q
multi1d< LatticeColorMatrixD > P
const multi1d< Real > & getCoeffs() const
Get the anisotropy parameters.
PrimitiveSU3MatrixD * packed_gauge
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Handle< FermBC< T, P, Q > > fbc
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