CHROMA
eoprec_wilson_coarse_fine_fermact_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Even-odd preconditioned Wilson fermion action supporting 2+2 anisotropy
3  */
4 
5 #include "chromabase.h"
8 
11 
14 
16 
17 namespace Chroma
18 {
19  //! Hooks to register the class with the fermact factory
20  namespace EvenOddPrecWilsonCoarseFineFermActEnv
21  {
22  //! Callback function
23  WilsonTypeFermAct<LatticeFermion,
24  multi1d<LatticeColorMatrix>,
25  multi1d<LatticeColorMatrix> >* createFermAct4D(XMLReader& xml_in,
26  const std::string& path)
27  {
29  WilsonCoarseFineFermActParams(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_COARSE_FINE");
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  // Init params
65  {
66  param.Mass = p.Mass;
67  param.coeffs.resize(Nd);
68  param.coeffs = 1.0;
69 
70  Real inv_gamma_f = Real(1) / p.gamma_f;
71 
72  for(int mu=0; mu < Nd; ++mu)
73  {
74  if (p.coarse_dirs[mu])
75  param.coeffs[mu] = inv_gamma_f;
76  }
77  }
78 
79 
80  //! Produce a linear operator for this action
81  /*!
82  * The operator acts on the odd subset
83  *
84  * \param state gauge field (Read)
85  */
86  EvenOddPrecConstDetLinearOperator<LatticeFermion,
87  multi1d<LatticeColorMatrix>,
88  multi1d<LatticeColorMatrix> >*
90  {
92  }
93 
94 
95  //! Return a linear operator solver for this action to solve M*psi=chi
98  const GroupXML_t& invParam) const
99  {
100  std::istringstream is(invParam.xml);
101  XMLReader paramtop(is);
102 
103  return TheLinOpFermSystemSolverFactory::Instance().createObject(invParam.id,
104  paramtop,
105  invParam.path,
106  state,
107  linOp(state));
108  }
109 
110 
111  //! Return a linear operator solver for this action to solve M^dag.M*psi=chi
114  const GroupXML_t& invParam) const
115  {
116  std::istringstream is(invParam.xml);
117  XMLReader paramtop(is);
118 
119  return TheMdagMFermSystemSolverFactory::Instance().createObject(invParam.id,
120  paramtop,
121  invParam.path,
122  state,
123  linOp(state));
124  }
125 
126 }
Primary include file for CHROMA library code.
Even-odd preconditioned linear operator.
Even-odd preconditioned WilsonCoarseFine fermion action.
void init(const WilsonCoarseFineFermActParams &param_)
Init params.
EvenOddPrecConstDetLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
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.
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.
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
int mu
Definition: cool.cc:24
Even-odd preconditioned Wilson fermion action supporting 2+2 anisotropy.
Even-odd preconditioned Wilson fermion linear operator.
All ferm create-state method.
Fermion action factories.
Fermionic boundary condition reader.
Nd
Definition: meslate.cc:74
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.
WilsonTypeFermAct< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct4D(XMLReader &xml_in, const std::string &path)
Callback function.
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.
Factory for solving M*psi=chi where M is not hermitian or pos. def.
Factory for producing system solvers for MdagM*psi = chi.