CHROMA
unprec_nef_fermact_array_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Unpreconditioned NEF fermion action
3  */
4 
5 #include "chromabase.h"
8 
11 
14 
15 namespace Chroma
16 {
17  //! Hooks to register the class with the fermact factory
18  namespace UnprecNEFFermActArrayEnv
19  {
20  //! Callback function
21  WilsonTypeFermAct5D<LatticeFermion,
22  multi1d<LatticeColorMatrix>,
23  multi1d<LatticeColorMatrix> >* createFermAct5D(XMLReader& xml_in,
24  const std::string& path)
25  {
26  return new UnprecNEFFermActArray(CreateFermStateEnv::reader(xml_in, path),
27  UnprecNEFFermActArrayParams(xml_in, path));
28  }
29 
30  //! Callback function
31  /*! Differs in return type */
32  FermionAction<LatticeFermion,
33  multi1d<LatticeColorMatrix>,
34  multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
35  const std::string& path)
36  {
37  return createFermAct5D(xml_in, path);
38  }
39 
40  //! Name to be used
41  const std::string name = "UNPRECONDITIONED_NEF";
42 
43  //! Local registration flag
44  static bool registered = false;
45 
46  //! Register all the factories
47  bool registerAll()
48  {
49  bool success = true;
50  if (! registered)
51  {
52  success &= Chroma::TheFermionActionFactory::Instance().registerObject(name, createFermAct);
54  registered = true;
55  }
56  return success;
57  }
58  }
59 
60 
61  //! Read parameters
63  const std::string& path)
64  {
65  XMLReader paramtop(xml, path);
66 
67  // Read the stuff for the action
68  read(paramtop, "OverMass", OverMass);
69  read(paramtop, "Mass", Mass);
70  read(paramtop, "N5", N5);
71  read(paramtop, "b5", b5);
72  read(paramtop, "c5", c5);
73  }
74 
75 
76  //! Read parameters
77  void read(XMLReader& xml, const std::string& path, UnprecNEFFermActArrayParams& param)
78  {
80  param = tmp;
81  }
82 
83 
84  //! Produce an unpreconditioned linear operator for this action with arbitrary quark mass
85  UnprecDWLikeLinOpBaseArray<LatticeFermion,
86  multi1d<LatticeColorMatrix>,
87  multi1d<LatticeColorMatrix> >*
89  const Real& m_q) const
90  {
91  multi1d<Real> bb5(N5);
92  multi1d<Real> cc5(N5);
93 
94  bb5 = b5;
95  cc5 = c5;
96  return new UnprecNEFDWLinOpArray(state,OverMass,bb5,cc5,m_q,N5);
97  }
98 
99 
100  // Given a complete propagator as a source, this does all the inversions needed
101  void
102  UnprecNEFFermActArray::quarkProp(LatticePropagator& q_sol,
103  XMLWriter& xml_out,
104  const LatticePropagator& q_src,
105  int t_src, int j_decay,
107  const GroupXML_t& invParam,
108  QuarkSpinType quarkSpinType,
109  bool obsvP,
110  int& ncg_had) const
111  {
112  if (obsvP && (quarkSpinType == QUARK_SPIN_TYPE_FULL))
113  nef_quarkProp4(q_sol, xml_out, q_src, t_src, j_decay, *this, state, invParam, ncg_had);
114  else
115  {
117  quarkProp4(q_sol, xml_out, q_src, qprop, quarkSpinType, ncg_had);
118  }
119  }
120 
121 }
Primary include file for CHROMA library code.
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
SystemSolver< LatticeFermion > * qprop(Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const GroupXML_t &invParam) const
Define quark propagator routine for 4D fermions.
Unpreconditioned domain-wall Dirac operator.
Unpreconditioned domain-wall Dirac operator.
Unpreconditioned NEF fermion action.
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.
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.
Wilson-like fermion actions.
Definition: fermact.orig.h:403
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.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
bool registerAll()
Register all the factories.
const std::string name
Name to be used.
static bool registered
Local registration flag.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(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 action.
Unpreconditioned NEF domain-wall fermion linear operator.