CHROMA
tprec_wilson_fermact_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Even-odd preconditioned Wilson fermion action
3  */
4 
5 #include "chromabase.h"
6 #include "actions/ferm/fermacts/prec_wilson_fermact_w.h"
7 #include "actions/ferm/linop/prec_wilson_linop_w.h"
8 
11 
14 
16 
17 namespace Chroma
18 {
19  //! Hooks to register the class with the fermact factory
20  namespace EvenOddPrecWilsonFermActEnv
21  {
22  //! Callback function
23  WilsonTypeFermAct<LatticeFermion,
24  multi1d<LatticeColorMatrix>,
25  multi1d<LatticeColorMatrix> >* createFermAct4D(XMLReader& xml_in,
26  const std::string& path)
27  {
28  return new EvenOddPrecWilsonFermAct(CreateFermStateEnv::reader(xml_in, path),
29  WilsonFermActParams(xml_in, path));
30  }
31 
32  //! Callback function
33  /*! Differs in return type */
34  FermionAction<LatticeFermion,
35  multi1d<LatticeColorMatrix>,
36  multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
37  const std::string& path)
38  {
39  return createFermAct4D(xml_in, path);
40  }
41 
42  //! Name to be used
43  const std::string name("WILSON");
44 
45  //! Local registration flag
46  static bool registered = false;
47 
48  //! Register all the factories
49  bool registerAll()
50  {
51  bool success = true;
52  if (! registered)
53  {
54  success &= Chroma::TheFermionActionFactory::Instance().registerObject(name, createFermAct);
56  registered = true;
57  }
58  return success;
59  }
60  }
61 
62 
63  //! Produce a linear operator for this action
64  /*!
65  * The operator acts on the odd subset
66  *
67  * \param state gauge field (Read)
68  */
69  EvenOddPrecConstDetLinearOperator<LatticeFermion,
70  multi1d<LatticeColorMatrix>,
71  multi1d<LatticeColorMatrix> >*
73  {
75  }
76 
77 
78  //! Return a linear operator solver for this action to solve M*psi=chi
81  const GroupXML_t& invParam) const
82  {
83  std::istringstream is(invParam.xml);
84  XMLReader paramtop(is);
85 
86  return TheLinOpFermSystemSolverFactory::Instance().createObject(invParam.id,
87  paramtop,
88  invParam.path,
89  state,
90  linOp(state));
91  }
92 
93 
94  //! Return a linear operator solver for this action to solve M^dag.M*psi=chi
97  const GroupXML_t& invParam) const
98  {
99  std::istringstream is(invParam.xml);
100  XMLReader paramtop(is);
101 
102  return TheMdagMFermSystemSolverFactory::Instance().createObject(invParam.id,
103  paramtop,
104  invParam.path,
105  state,
106  linOp(state));
107  }
108 
109 }
Primary include file for CHROMA library code.
Even-odd preconditioned linear operator.
Even-odd preconditioned Wilson fermion action.
EvenOddPrecConstDetLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
LinOpSystemSolver< T > * invLinOp(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve M*psi=chi.
MdagMSystemSolver< T > * invMdagM(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve MdagM*psi=chi.
Even-odd preconditioned Wilson-Dirac operator.
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
Wilson-like fermion actions.
Definition: fermact.orig.h:344
All ferm create-state method.
Fermion action factories.
Fermionic boundary condition reader.
Handle< CreateFermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateFermState readers.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
bool registerAll()
Register all the factories.
const std::string name
Name to be used.
WilsonTypeFermAct< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct4D(XMLReader &xml_in, const std::string &path)
Callback function.
static bool registered
Local registration flag.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
::std::string string
Definition: gtest.h:1979
Hold group xml and type id.
Params for wilson ferm acts.
Factory for solving M*psi=chi where M is not hermitian or pos. def.
Factory for producing system solvers for MdagM*psi = chi.