CHROMA
eoprec_constdet_two_flavor_ratio_conv_conv_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 
17 
18 
19 namespace Chroma
20 {
21 
22  namespace EvenOddPrecConstDetTwoFlavorRatioConvConvWilsonTypeFermMonomialEnv
23  {
24  namespace
25  {
26  //! Callback function for the factory
28  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
29  {
32  }
33 
34  //! Local registration flag
35  bool registered = false;
36  }
37 
38  const std::string name("TWO_FLAVOR_EOPREC_CONSTDET_RATIO_CONV_CONV_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  QDPIO::cout << "Constructor: " << __func__ << std::endl;
62 
63  if ( param.numer.invParam.id == "NULL" ) {
64  QDPIO::cerr << "Numerator inverter parameter is NULL" << std::endl;
65  QDP_abort(1);
66  }
67  invParam_num = param.numer.invParam;
68 
69  if( param.denom.invParam.id == "NULL" ) {
70  QDPIO::cerr << "WARNING: Denominator inverter parameter is NULL." << std::endl;
71  QDPIO::cerr << "WARNING: Assuming it is same as numerator " << std::endl;
72  invParam_den = param.numer.invParam;
73  }
74  else {
75  invParam_den = param.denom.invParam;
76  }
77 
78  //*********************************************************************
79  // Fermion action
80  {
81  std::istringstream is(param.numer.fermact.xml);
82  XMLReader fermact_reader(is);
83  QDPIO::cout << "Construct numer fermion action= " << param.numer.fermact.id << std::endl;
84 
85  WilsonTypeFermAct<T,P,Q>* tmp_act =
87  fermact_reader,
88  param.numer.fermact.path);
89 
91 
92  // Check success of the downcast
93  if( downcast == 0x0 )
94  {
95  QDPIO::cerr << __func__ << ": unable to downcast FermAct to EvenOddPrecConstDetWilsonTypeFermAct" << std::endl;
96  QDP_abort(1);
97  }
98 
99  fermact_num = downcast;
100  }
101 
102  //*********************************************************************
103  // Fermion action
104  {
105  std::istringstream is(param.denom.fermact.xml);
106  XMLReader fermact_reader(is);
107  QDPIO::cout << "Construct denom fermion action= " << param.denom.fermact.id << std::endl;
108 
109  WilsonTypeFermAct<T,P,Q>* tmp_act =
111  fermact_reader,
112  param.denom.fermact.path);
113 
115 
116  // Check success of the downcast
117  if( downcast == 0x0 )
118  {
119  QDPIO::cerr << __func__ << ": unable to downcast FermAct to EvenOddPrecConstDetWilsonTypeFermAct" << std::endl;
120  QDP_abort(1);
121  }
122 
123  fermact_den = downcast;
124  }
125  //*********************************************************************
126 
127  //*********************************************************************
128  // Get Chronological predictor
129  {
131  if( param.predictor.xml == "" ) {
132  // No predictor specified use: Null guess
133  QDPIO::cout << "No predictor specified. Using NULL Predictor" << std::endl;
134  tmp = new Null4DChronoPredictor();
135  }
136  else
137  {
138  try
139  {
140  std::istringstream chrono_is(param.predictor.xml);
141  XMLReader chrono_xml(chrono_is);
143  chrono_xml,
144  param.predictor.path);
145  }
146  catch(const std::string& e ) {
147  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
148  QDP_abort(1);
149  }
150  }
151 
152  if( tmp == 0x0 ) {
153  QDPIO::cerr << "Failed to create the 4D ChronoPredictor" << std::endl;
154  QDP_abort(1);
155  }
157  }
158  //*********************************************************************
159 
160  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
161 
162  END_CODE();
163  }
164 
165 } //end namespace Chroma
166 
167 
Primary include file for CHROMA library code.
Chronological predictor for HMC.
Monomial factories.
Even-odd preconditioned Wilson-like fermion actions including derivatives.
An abstract monomial class, for inexact algorithms.
Definition: abs_monomial.h:43
Zero initial guess predictor.
static T & Instance()
Definition: singleton.h:432
Wilson-like fermion actions.
Definition: fermact.orig.h:344
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_CONSTDET_RATIO_CONV_CONV_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
Null predictor: Leaves input x0 unchanged.
Zero initial guess predictor.