CHROMA
eoprec_logdet_two_flavor_monomial_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief Two-flavor collection of even-odd preconditioned 4D ferm monomials
3  */
4 
5 #include "chromabase.h"
8 
11 
14 
16 
17 
18 namespace Chroma
19 {
20 
21  namespace EvenOddPrecLogDetTwoFlavorWilsonTypeFermMonomialEnv
22  {
23  namespace
24  {
25  //! Callback function for the factory
27  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
28  {
31  }
32 
33  //! Local registration flag
34  bool registered = false;
35  }
36 
37  const std::string name("TWO_FLAVOR_EOPREC_LOGDET_FERM_MONOMIAL");
38 
39  //! Register all the factories
40  bool registerAll()
41  {
42  bool success = true;
43  if (! registered)
44  {
46  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
47  registered = true;
48  }
49  return success;
50  }
51  } //end namespace EvenOddPrec TwoFlavorWilsonFermMonomialEnv
52 
53 
54 
55  // Constructor
58  {
59  START_CODE();
60 
61  inv_param = param.inv_param;
62 
63  std::istringstream is(param.fermact.xml);
64  XMLReader fermact_reader(is);
65  QDPIO::cout << "EvanOddPrecLogDetTwoFlavorWilsonTypeFermMonomial: construct " << param.fermact.id << std::endl;
66 
67 
68  WilsonTypeFermAct<T,P,Q>* tmp_act =
69  TheWilsonTypeFermActFactory::Instance().createObject(param.fermact.id, fermact_reader, param.fermact.path);
70 
72  dynamic_cast<EvenOddPrecLogDetWilsonTypeFermAct<T,P,Q>*>(tmp_act);
73 
74  // Check success of the downcast
75  if( downcast == 0x0 ) {
76  QDPIO::cerr << "Unable to downcast FermAct to EvenOddPrecLogDetWilsonTypeFermAct in EvenOddPrecLogDetTwoFlavorWilsonTypeFermMonomial()" << std::endl;
77  QDP_abort(1);
78  }
79 
80  fermact = downcast;
81 
82  // Get Chronological predictor
84  if( param.predictor.xml == "" ) {
85  // No predictor specified use zero guess
87  }
88  else
89  {
90  try
91  {
92  std::istringstream chrono_is(param.predictor.xml);
93  XMLReader chrono_xml(chrono_is);
95  chrono_xml,
96  param.predictor.path);
97  }
98  catch(const std::string& e ) {
99  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
100  QDP_abort(1);
101  }
102  }
103 
104  if( tmp == 0x0 ) {
105  QDPIO::cerr << "Failed to create ZeroGuess4DChronoPredictor" << std::endl;
106  QDP_abort(1);
107  }
109 
110  END_CODE();
111  }
112 
113 } //end namespace Chroma
114 
115 
Primary include file for CHROMA library code.
Chronological predictor for HMC.
Monomial factories.
Wrapper class for 2-flavor even-odd prec ferm monomials.
Handle< const EvenOddPrecLogDetWilsonTypeFermAct< T, P, Q > > fermact
Even-odd preconditioned Wilson-like fermion action, specialised to clover like (gauge dependent diago...
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:344
Zero initial guess predictor.
Two-flavor collection of even-odd preconditioned 4D 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_LOGDET_FERM_MONOMIAL")
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.