CHROMA
eoprec_nef_fermact_array_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief 4D style even-odd preconditioned NEF fermion action
3  */
4 
5 #include "chromabase.h"
9 
12 
15 
16 namespace Chroma
17 {
18  //! Hooks to register the class with the fermact factory
19  namespace EvenOddPrecNEFFermActArrayEnv
20  {
21  //! Callback function
22  WilsonTypeFermAct5D<LatticeFermion,
23  multi1d<LatticeColorMatrix>,
24  multi1d<LatticeColorMatrix> >* createFermAct5D(XMLReader& xml_in,
25  const std::string& path)
26  {
28  EvenOddPrecNEFFermActArrayParams(xml_in, path));
29  }
30 
31  //! Callback function
32  /*! Differs in return type */
33  FermionAction<LatticeFermion,
34  multi1d<LatticeColorMatrix>,
35  multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
36  const std::string& path)
37  {
38  return createFermAct5D(xml_in, path);
39  }
40 
41  //! Name to be used
42  const std::string name = "NEF";
43 
44  //! Local registration flag
45  static bool registered = false;
46 
47  //! Register all the factories
48  bool registerAll()
49  {
50  bool success = true;
51  if (! registered)
52  {
53  success &= Chroma::TheFermionActionFactory::Instance().registerObject(name, createFermAct);
55  registered = true;
56  }
57  return success;
58  }
59  }
60 
61 
62  //! Read parameters
64  const std::string& path)
65  {
66  XMLReader paramtop(xml, path);
67 
68  // Read the stuff for the action
69  read(paramtop, "OverMass", OverMass);
70  read(paramtop, "Mass", Mass);
71  read(paramtop, "N5", N5);
72  read(paramtop, "b5", b5);
73  read(paramtop, "c5", c5);
74  }
75 
76 
77  //! Read parameters
78  void read(XMLReader& xml, const std::string& path, EvenOddPrecNEFFermActArrayParams& param)
79  {
81  param = tmp;
82  }
83 
84 
85 
86  //! Produce an even-odd preconditioned linear operator for this action with arbitrary quark mass
87  EvenOddPrecDWLikeLinOpBaseArray<LatticeFermion,
88  multi1d<LatticeColorMatrix>,
89  multi1d<LatticeColorMatrix> >*
91  const Real& m_q) const
92  {
94  params.b5,params.c5,m_q,params.N5);
95  }
96 
97  //! Produce an unpreconditioned linear operator for this action with arbitrary quark mass
98  UnprecDWLikeLinOpBaseArray<LatticeFermion,
99  multi1d<LatticeColorMatrix>,
100  multi1d<LatticeColorMatrix> >*
102  const Real& m_q) const
103  {
104  multi1d<Real> bb5(params.N5);
105  multi1d<Real> cc5(params.N5);
106 
107  bb5 = params.b5;
108  cc5 = params.c5;
109 
110  return new UnprecNEFDWLinOpArray(state,params.OverMass,bb5,cc5,m_q,params.N5);
111  }
112 
113 
114  // Given a complete propagator as a source, this does all the inversions needed
115  void
116  EvenOddPrecNEFFermActArray::quarkProp(LatticePropagator& q_sol,
117  XMLWriter& xml_out,
118  const LatticePropagator& q_src,
119  int t_src, int j_decay,
121  const GroupXML_t& invParam,
122  QuarkSpinType quarkSpinType,
123  bool obsvP,
124  int& ncg_had) const
125  {
126  if (obsvP && (quarkSpinType == QUARK_SPIN_TYPE_FULL))
127  nef_quarkProp4(q_sol, xml_out, q_src, t_src, j_decay, *this, state, invParam, ncg_had);
128  else
129  {
131  quarkProp4(q_sol, xml_out, q_src, qprop, quarkSpinType, ncg_had);
132  }
133  }
134 
135 }
136 
Primary include file for CHROMA library code.
SystemSolver< LatticeFermion > * qprop(Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const GroupXML_t &invParam) const
Define quark propagator routine for 4D fermions.
4D Even Odd preconditioned domain-wall Dirac operator
4D Even Odd preconditioned NEF domain-wall Dirac operator
4D style even-odd preconditioned domain-wall fermion action
EvenOddPrecNEFFermActArrayParams params
void quarkProp(LatticePropagator &q_sol, XMLWriter &xml_out, const LatticePropagator &q_src, int t_src, int j_decay, Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam, QuarkSpinType quarkSpinType, bool obsvP, int &ncg_had) const
Given a complete propagator as a source, this does all the inversions needed.
EvenOddPrecDWLikeLinOpBaseArray< T, P, Q > * precLinOp(Handle< FermState< T, P, Q > > state, const Real &m_q) const
Produce an even-odd preconditioned linear operator for this action with arbitrary quark mass.
UnprecDWLikeLinOpBaseArray< T, P, Q > * unprecLinOp(Handle< FermState< T, P, Q > > state, const Real &m_q) const
Produce an unpreconditioned linear operator for this action with arbitrary quark mass.
Support class for fermion actions and linear operators.
Definition: state.h:94
Base class for quadratic matter actions (e.g., fermions)
Definition: fermact.h:53
Class for counted reference semantics.
Definition: handle.h:33
static T & Instance()
Definition: singleton.h:432
Unpreconditioned domain-wall Dirac operator.
Unpreconditioned domain-wall Dirac operator.
Wilson-like fermion actions.
Definition: fermact.orig.h:403
4D style even-odd preconditioned NEF fermion action
4D Even Odd preconditioned NEF domain-wall fermion linear operator
All ferm create-state method.
Fermion action factories.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
QuarkSpinType
Quark spin type.
void nef_quarkProp4(LatticePropagator &q_sol, XMLWriter &xml_out, const LatticePropagator &q_src, int t_src, int j_decay, const UnprecDWFermActBaseArray< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &S_f, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const GroupXML_t &invParam, int &ncg_had)
Given a complete propagator as a source, this does all the inversions needed.
void quarkProp4(LatticeStaggeredPropagator &q_sol, XMLWriter &xml_out, const LatticeStaggeredPropagator &q_src, const StaggeredTypeFermAct< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &S_f, Handle< FermState< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const GroupXML_t &invParam, QuarkSpinType quarkSpinType, int &ncg_had)
Given a complete propagator as a source, this does all the inversions needed.
int j_decay
Definition: meslate.cc:22
Handle< CreateFermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateFermState readers.
bool registerAll()
Register all the factories.
const std::string name
Name to be used.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
static bool registered
Local registration flag.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979
Full quark propagator solver for domain wall fermions.
Full quark propagator solver.
Hold group xml and type id.
Unpreconditioned NEF domain-wall fermion linear operator.