CHROMA
eoprec_constdet_two_flavor_monomial5d_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief Two-flavor collection of even-odd preconditioned 5D ferm monomials
3  */
4 
7 
10 
13 
15 
16 
17 namespace Chroma
18 {
19 
20  namespace EvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial5DEnv
21  {
22  namespace
23  {
24  //! Callback function for the factory
26  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
27  {
30  }
31 
32  //! Local registration flag
33  bool registered = false;
34  }
35 
36  const std::string name("TWO_FLAVOR_EOPREC_CONSTDET_FERM_MONOMIAL5D");
37 
38  //! Register all the factories
39  bool registerAll()
40  {
41  bool success = true;
42  if (! registered)
43  {
45  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
46  registered = true;
47  }
48  return success;
49  }
50  } //end namespace EvenOddPrec TwoFlavorWilsonFermMonomialEnv
51 
52 
53 
54  // Constructor
57  {
58  START_CODE();
59 
60  inv_param = param.inv_param;
61 
62  std::istringstream is(param.fermact.xml);
63  XMLReader fermact_reader(is);
64 
65  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
66  TheWilsonTypeFermAct5DFactory::Instance().createObject(param.fermact.id, fermact_reader, param.fermact.path);
67 
69  dynamic_cast<EvenOddPrecConstDetWilsonTypeFermAct5D<T,P,Q>*>(tmp_act);
70 
71  // Check success of the downcast
72  if( downcast == 0x0 ) {
73  QDPIO::cerr << "Unable to downcast FermAct to EvenOddPrecConstDetWilsonTypeFermAct5D in EvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial5D()" << std::endl;
74  QDP_abort(1);
75  }
76 
77  fermact = downcast;
78 
79  // Get Chronological predictor
81  if( param.predictor.xml == "" ) {
82  // No predictor specified use zero guess
83  tmp = new ZeroGuess5DChronoPredictor(fermact->size());
84  }
85  else
86  {
87  try
88  {
89  std::istringstream chrono_is(param.predictor.xml);
90  XMLReader chrono_xml(chrono_is);
92  param.predictor.id, fermact->size(), chrono_xml, param.predictor.path);
93  }
94  catch(const std::string& e ) {
95  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
96  QDP_abort(1);
97  }
98  }
99 
100  if( tmp == 0x0 ) {
101  QDPIO::cerr << "Failed to create the 5D ChronoPredictor" << std::endl;
102  QDP_abort(1);
103  }
105 
106  END_CODE();
107  }
108 
109 } //end namespace Chroma
Chronological predictor for HMC.
Monomial factories.
Wrapper class for 5D 2-flavor even-odd prec ferm monomials.
Handle< const EvenOddPrecConstDetWilsonTypeFermAct5D< T, P, Q > > fermact
Even-odd preconditioned Wilson-like fermion actions including derivatives.
An abstract monomial class, for inexact algorithms.
Definition: abs_monomial.h:43
static T & Instance()
Definition: singleton.h:432
Wilson-like fermion actions.
Definition: fermact.orig.h:403
Zero initial guess predictor.
Two-flavor collection of even-odd preconditioned 5D ferm monomials.
Fermion action factories.
All Wilson-type fermion actions.
Monomial factories.
static bool registered
Local registration flag.
const std::string name("TWO_FLAVOR_EOPREC_CONSTDET_FERM_MONOMIAL5D")
Monomial< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createMonomial(XMLReader &xml, const std::string &path)
Callback function for the factory.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
START_CODE()
::std::string string
Definition: gtest.h:1979
Zero initial guess predictor.