CHROMA
eoprec_constdet_two_flavor_polyprec_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 EvenOddPrecConstDetTwoFlavorPolyPrecWilsonTypeFermMonomialEnv
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  //! Identifier
38  const std::string name = "TWO_FLAVOR_EOPREC_CONSTDET_POLYPREC_FERM_MONOMIAL";
39 
40  //! Register all the factories
41  bool registerAll()
42  {
43  bool success = true;
44  if (! registered)
45  {
47  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
48  registered = true;
49  }
50  return success;
51  }
52  } //end namespace EvenOddPrec TwoFlavorWilsonFermMonomialEnv
53 
54 
55  // Constructor
58  {
59  START_CODE();
60 
61  inv_param = param.inv_param;
62 
63  {
64  std::istringstream is(param.fermact.xml);
65  XMLReader fermact_reader(is);
66 
68  << ": construct " << param.fermact.id << std::endl;
69 
70  WilsonTypeFermAct<T,P,Q>* tmp_act =
71  TheWilsonTypeFermActFactory::Instance().createObject(param.fermact.id, fermact_reader, param.fermact.path);
72 
73  PolyWilsonTypeFermAct<T,P,Q>* downcast =
74  dynamic_cast<PolyWilsonTypeFermAct<T,P,Q>*>(tmp_act);
75 
76  // Check success of the downcast
77  if( downcast == 0x0 ) {
78  QDPIO::cerr << "Unable to downcast FermAct to PolyWilsonTypeFermAct in EvenOddPrecConstDetTwoFlavorPolyPrecWilsonTypeFermMonomial()" << std::endl;
79  QDP_abort(1);
80  }
81 
82  fermact = downcast;
83  }
84 
85  // Get Chronological predictor
87  if( param.predictor.xml == "" ) {
88  // No predictor specified use zero guess
90  }
91  else
92  {
93  try
94  {
95  std::istringstream chrono_is(param.predictor.xml);
96  XMLReader chrono_xml(chrono_is);
98  chrono_xml,
99  param.predictor.path);
100  }
101  catch(const std::string& e ) {
102  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
103  QDP_abort(1);
104  }
105  }
106 
107  if( tmp == 0x0 ) {
108  QDPIO::cerr << "Failed to create ZeroGuess4DChronoPredictor" << std::endl;
109  QDP_abort(1);
110  }
112 
113  END_CODE();
114  }
115 
116 } //end namespace Chroma
117 
118 
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
Polynomial Wilson-like fermion actions with derivatives.
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.
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.