CHROMA
unprec_clover_linop_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Even-odd preconditioned clover linear operator
3  */
4 
5 #include "chromabase.h"
7 
8 using namespace QDP::Hints;
9 
10 namespace Chroma
11 {
12  //! Creation routine with Anisotropy
13  /*!
14  * \param fs gauge field (Read)
15  * \param param_ parameters (Read)
16  */
17  void UnprecCloverLinOp::create(Handle< FermState<T,P,Q> > fs,
18  const CloverFermActParams& param_)
19  {
20  // QDPIO::cout << __PRETTY_FUNCTION__ << ": enter" << std::endl;
21 
22  param = param_;
23 
24  A.create(fs, param);
25  D.create(fs, param.anisoParam);
26 
27  // QDPIO::cout << __PRETTY_FUNCTION__ << ": exit" << std::endl;
28  }
29 
30 
31 
32  //! Apply unpreconditioned Clover fermion linear operator
33  /*!
34  * The operator acts on the entire lattice
35  *
36  * \param chi Pseudofermion field (Write)
37  * \param psi Pseudofermion field (Read)
38  * \param isign Flag ( PLUS | MINUS ) (Read)
39  */
40  void UnprecCloverLinOp::operator()(LatticeFermion & chi,
41  const LatticeFermion& psi,
42  enum PlusMinus isign) const
43  {
44  LatticeFermion tmp; moveToFastMemoryHint(tmp);
45  Real mhalf = -0.5;
46 
47  // chi = A . psi - 0.5 * D' . psi */
48  A(chi, psi, isign);
49  D(tmp, psi, isign);
50  chi += mhalf * tmp;
51 
52  getFermBC().modifyF(chi);
53  }
54 
55 
56  void
57  UnprecCloverLinOp::deriv(multi1d<LatticeColorMatrix>& ds_u,
58  const LatticeFermion& chi, const LatticeFermion& psi,
59  enum PlusMinus isign) const
60  {
61  // A. deriv will resize
62 
63  A.deriv(ds_u, chi, psi, isign);
64 
65  multi1d<LatticeColorMatrix> ds_tmp(Nd);
66 
67  ds_tmp = zero;
68  D.deriv(ds_tmp, chi, psi, isign);
69  for(int mu=0; mu < Nd; mu++) {
70  ds_u[mu] -= Real(0.5)*ds_tmp[mu];
71  }
72 
73  getFermBC().zero(ds_u);
74  }
75 
76 
77  //! Return flops performed by the operator()
78  unsigned long UnprecCloverLinOp::nFlops() const
79  {
80  unsigned long site_flops = D.nFlops()+A.nFlops()+4*Nc*Ns;
81  return site_flops*Layout::sitesOnNode();
82  }
83 
84 } // End Namespace Chroma
Primary include file for CHROMA library code.
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
int mu
Definition: cool.cc:24
Double tmp
Definition: meslate.cc:60
Nd
Definition: meslate.cc:74
multi1d< Hadron2PtContraction_t > operator()(const multi1d< LatticeColorMatrix > &u)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
A(A, psi, r, Ncb, PLUS)
Double zero
Definition: invbicg.cc:106
chi
Definition: pade_trln_w.cc:24
psi
Definition: pade_trln_w.cc:191
Params for clover ferm acts.
multi1d< LatticeColorMatrix > deriv(const EvenOddPrecLinearOperator< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &AP, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign)
Apply the operator onto a source std::vector.
Unpreconditioned Clover fermion linear operator.