CHROMA
seoprec_constdet_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 SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomialEnv
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_SEOPREC_CONSTDET_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 SymEvenOddPrec 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 << "SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial: construct " << param.fermact.id << std::endl;
66 
67  WilsonTypeFermAct<T,P,Q>* tmp_act =
68  TheWilsonTypeFermActFactory::Instance().createObject(param.fermact.id, fermact_reader, param.fermact.path);
69 
71  dynamic_cast<SymEvenOddPrecWilsonTypeFermAct<T,P,Q>*>(tmp_act);
72 
73  // Check success of the downcast
74  if( downcast == 0x0 ) {
75  QDPIO::cerr << "Unable to downcast FermAct to SymEvenOddPrecWilsonTypeFermAct in SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial()" << std::endl;
76  QDP_abort(1);
77  }
78 
79  fermact = downcast;
80 
81  // Get Chronological predictor
83  if( param.predictor.xml == "" ) {
84  // No predictor specified use zero guess
86  }
87  else
88  {
89  try
90  {
91  std::istringstream chrono_is(param.predictor.xml);
92  XMLReader chrono_xml(chrono_is);
94  chrono_xml,
95  param.predictor.path);
96  }
97  catch(const std::string& e ) {
98  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
99  QDP_abort(1);
100  }
101  }
102 
103  if( tmp == 0x0 ) {
104  QDPIO::cerr << "Failed to create ZeroGuess4DChronoPredictor" << std::endl;
105  QDP_abort(1);
106  }
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
Handle< const SymEvenOddPrecWilsonTypeFermAct< T, P, Q > > fermact
Symmetric even-odd preconditioned Wilson-like fermion actions including derivatives.
Wilson-like fermion actions.
Definition: fermact.orig.h:344
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_SEOPREC_CONSTDET_FERM_MONOMIAL")
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 even-odd preconditioned 4D ferm monomials.
Zero initial guess predictor.