CHROMA
unprec_dwf_fermact_array_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Unpreconditioned domain-wall fermion action
3  */
4 
5 #include "chromabase.h"
6 
8 
11 
12 // #include "actions/ferm/fermacts/fermact_factory_w.h"
14 
17 
18 namespace Chroma
19 {
20 
21  //! Hooks to register the class with the fermact factory
22  namespace UnprecDWFermActArrayEnv
23  {
24  //! Callback function
25  WilsonTypeFermAct5D<LatticeFermion,
26  multi1d<LatticeColorMatrix>,
27  multi1d<LatticeColorMatrix> >* createFermAct5D(XMLReader& xml_in,
28  const std::string& path)
29  {
30  return new UnprecDWFermActArray(CreateFermStateEnv::reader(xml_in, path),
31  UnprecDWFermActArrayParams(xml_in, path));
32  }
33 
34  //! Callback function
35  /*! Differs in return type */
36  FermionAction<LatticeFermion,
37  multi1d<LatticeColorMatrix>,
38  multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
39  const std::string& path)
40  {
41  return createFermAct5D(xml_in, path);
42  }
43 
44  //! Name to be used
45  const std::string name = "UNPRECONDITIONED_DWF";
46 
47  //! Local registration flag
48  static bool registered = false;
49 
50  //! Register all the factories
51  bool registerAll()
52  {
53  bool success = true;
54  if (! registered)
55  {
56  success &= Chroma::TheFermionActionFactory::Instance().registerObject(name, createFermAct);
58  registered = true;
59  }
60  return success;
61  }
62  }
63 
64 
65  //! Read parameters
67  const std::string& path)
68  {
69  XMLReader paramtop(xml, path);
70 
71  // Read the stuff for the action
72  read(paramtop, "OverMass", OverMass);
73  read(paramtop, "Mass", Mass);
74  read(paramtop, "N5", N5);
75 
76  if (paramtop.count("a5") != 0)
77  read(paramtop, "a5", a5);
78  else
79  a5 = 1.0;
80 
81  // Read optional anisoParam.
82  if (paramtop.count("AnisoParam") != 0)
83  read(paramtop, "AnisoParam", anisoParam);
84  }
85 
86 
87  //! Read parameters
88  void read(XMLReader& xml, const std::string& path, UnprecDWFermActArrayParams& param)
89  {
91  param = tmp;
92  }
93 
94 
95 
96  //! Produce an unpreconditioned linear operator for this action with arbitrary quark mass
97  UnprecDWLikeLinOpBaseArray<LatticeFermion,
98  multi1d<LatticeColorMatrix>,
99  multi1d<LatticeColorMatrix> >*
101  const Real& m_q) const
102  {
104  }
105 
106 
107  // Given a complete propagator as a source, this does all the inversions needed
108  void
109  UnprecDWFermActArray::quarkProp(LatticePropagator& q_sol,
110  XMLWriter& xml_out,
111  const LatticePropagator& q_src,
112  int t_src, int j_decay,
114  const GroupXML_t& invParam,
115  QuarkSpinType quarkSpinType,
116  bool obsvP,
117  int& ncg_had) const
118  {
119  if (obsvP && (quarkSpinType == QUARK_SPIN_TYPE_FULL))
120  {
121  Handle< SystemSolverArray<T> > qpropT(this->qpropT(state,invParam));
122  dwf_quarkProp4(q_sol, xml_out, q_src, t_src, j_decay, qpropT, state, getQuarkMass(), ncg_had);
123  }
124  else
125  {
126  Handle< SystemSolver<T> > qprop(this->qprop(state,invParam));
127  quarkProp4(q_sol, xml_out, q_src, qprop, quarkSpinType, ncg_had);
128  }
129  }
130 
131 }
Primary include file for CHROMA library code.
virtual SystemSolverArray< T > * qpropT(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return quark prop solver, solution of unpreconditioned system.
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 fermion action.
Real getQuarkMass() const
Return the 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.
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.
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.
Wilson-like fermion actions.
Definition: fermact.orig.h:403
Full quark propagator solver for domain wall fermions.
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 dwf_quarkProp4(LatticePropagator &q_sol, XMLWriter &xml_out, const LatticePropagator &q_src, int t_src, int j_decay, Handle< SystemSolverArray< LatticeFermion > > qpropT, Handle< FermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const Real &m_q, 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.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
static bool registered
Local registration flag.
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.
Hold group xml and type id.
Unpreconditioned domain-wall fermion action.
Unpreconditioned domain-wall fermion linear operator.