CHROMA
unprec_wilson_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Unpreconditioned Wilson fermion linear operator
4  */
5 
6 #ifndef __unprec_wilson_linop_w_h__
7 #define __unprec_wilson_linop_w_h__
8 
9 #include "linearop.h"
11 
12 
13 namespace Chroma
14 {
15  //! Unpreconditioned Wilson-Dirac operator
16  /*!
17  * \ingroup linop
18  *
19  * This routine is specific to Wilson fermions!
20  *
21  * ~ ~+
22  * This subroutine applies the unpreconditioned matrix M or M the std::vector
23  * Psi,
24  *
25  * { ~
26  * { M(U) . Psi if ISign = PLUS
27  * Chi = {
28  * { ~ +
29  * { M(U) . Psi if ISign = MINUS
30  *
31  * Algorithm:
32 
33  * The kernel for Wilson fermions is
34 
35  * M = (d+M) - (1/2) D'
36  *
37  */
38 
39  class UnprecWilsonLinOp : public UnprecLinearOperator<LatticeFermion,
40  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
41  {
42  public:
43  // Typedefs to save typing
44  typedef LatticeFermion T;
45  typedef multi1d<LatticeColorMatrix> P;
46  typedef multi1d<LatticeColorMatrix> Q;
47 
48  //! Partial constructor
50 
51  //! Full constructor
52  UnprecWilsonLinOp(Handle< FermState<T,P,Q> > fs, const Real& Mass_)
53  {create(fs,Mass_);}
54 
55  //! Full constructor with Anisotropy
57  const Real& Mass_,
58  const AnisoParam_t& aniso)
59  {create(fs,Mass_,aniso);}
60 
61  //! Destructor is automatic
63 
64  //! Return the fermion BC object for this linear operator
65  const FermBC<T,P,Q>& getFermBC() const {return D.getFermBC();}
66 
67  //! Creation routine
68  void create(Handle< FermState<T,P,Q> > fs,
69  const Real& Mass_);
70 
71  //! Creation routine with Anisotropy
72  void create(Handle< FermState<T,P,Q> > fs,
73  const Real& Mass_,
74  const AnisoParam_t& aniso);
75 
76  //! Apply the operator onto a source std::vector
77  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign) const;
78 
79  //! Derivative of unpreconditioned Wilson dM/dU
80  void deriv(multi1d<LatticeColorMatrix>& ds_u,
81  const LatticeFermion& chi, const LatticeFermion& psi,
82  enum PlusMinus isign) const;
83 
84  //! Return flops performed by the operator()
85  unsigned long nFlops() const;
86 
87  private:
88  Real fact; // tmp holding Nd+Mass
89 
90  Real Mass;
92  };
93 
94 } // End Namespace Chroma
95 
96 
97 #endif
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
Unpreconditioned linear operator including derivatives.
Definition: linearop.h:185
Unpreconditioned Wilson-Dirac operator.
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_)
Creation routine.
void deriv(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Derivative of unpreconditioned Wilson dM/dU.
multi1d< LatticeColorMatrix > Q
multi1d< LatticeColorMatrix > P
~UnprecWilsonLinOp()
Destructor is automatic.
unsigned long nFlops() const
Return flops performed by the operator()
UnprecWilsonLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_)
Full constructor.
UnprecWilsonLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const AnisoParam_t &aniso)
Full constructor with Anisotropy.
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
UnprecWilsonLinOp()
Partial constructor.
Include possibly optimized Wilson dslash.
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Parameters for anisotropy.
Definition: aniso_io.h:24