CHROMA
unprec_two_flavor_monomial5d_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief Two-flavor collection of unpreconditioned 5D ferm monomials
3  */
4 
5 #include "chromabase.h"
8 
11 
15 
16 namespace Chroma
17 {
18 
19  namespace UnprecTwoFlavorWilsonTypeFermMonomial5DEnv
20  {
21  namespace
22  {
23  //! Callback function for the factory
25  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
26  {
29  }
30 
31  //! Local registration flag
32  bool registered = false;
33  }
34 
35  const std::string name("TWO_FLAVOR_UNPREC_FERM_MONOMIAL5D");
36 
37  //! Register all the factories
38  bool registerAll()
39  {
40  bool success = true;
41  if (! registered)
42  {
44  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
45  registered = true;
46  }
47  return success;
48  }
49  } //end namespace Unprec TwoFlavorWilsonFermMonomialEnv
50 
51 
52 
53  // Constructor
56  {
57  START_CODE();
58 
59  inv_param = param.inv_param;
60 
61  std::istringstream is(param.fermact.xml);
62  XMLReader fermact_reader(is);
63  QDPIO::cout << "UnprecTwoFlavorWilsonTypeFermMonomial5D: construct " << param.fermact.id << std::endl;
64 
65  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
66  TheWilsonTypeFermAct5DFactory::Instance().createObject(param.fermact.id, fermact_reader, param.fermact.path);
67 
69  dynamic_cast<UnprecWilsonTypeFermAct5D<T,P,Q>*>(tmp_act);
70 
71  // Check success of the downcast
72  if( downcast == 0x0 ) {
73  QDPIO::cerr << "Unable to downcast FermAct to UnprecWilsonTypeFermAct5D in UnprecTwoFlavorWilsonTypeFermMonomial5D()" << 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::string chrono_name;
90  std::istringstream chrono_is(param.predictor.xml);
91  XMLReader chrono_xml(chrono_is);
93  param.predictor.id, fermact->size(), chrono_xml, param.predictor.path);
94  }
95  catch(const std::string& e ) {
96  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
97  QDP_abort(1);
98  }
99  }
100 
101  if( tmp == 0x0 ) {
102  QDPIO::cerr << "Failed to create the 5D ChronoPredictor" << std::endl;
103  QDP_abort(1);
104  }
106 
107  QDPIO::cout << "UnprecTwoFlavorWilsonTypeFermMonomial5D: finished " << param.fermact.id << std::endl;
108 
109  END_CODE();
110  }
111 
112 } //end namespace Chroma
113 
114 
Primary include file for CHROMA library code.
Chronological predictor for HMC.
Monomial factories.
An abstract monomial class, for inexact algorithms.
Definition: abs_monomial.h:43
static T & Instance()
Definition: singleton.h:432
Wrapper class for 5D 2-flavor unprec ferm monomials.
Handle< const UnprecWilsonTypeFermAct5D< T, P, Q > > fermact
Handle< AbsChronologicalPredictor5D< T > > chrono_predictor
Unpreconditioned Wilson-like fermion actions in extra dims with derivatives.
Definition: fermact.orig.h:571
Wilson-like fermion actions.
Definition: fermact.orig.h:403
Zero initial guess predictor.
Fermion action factories.
All Wilson-type fermion actions.
Monomial factories.
static bool registered
Local registration flag.
Monomial< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createMonomial(XMLReader &xml, const std::string &path)
Callback function for the factory.
const std::string name("TWO_FLAVOR_UNPREC_FERM_MONOMIAL5D")
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
Two-flavor collection of unpreconditioned 5D ferm monomials.
Zero initial guess predictor.