CHROMA
eoprec_constdet_two_flavor_ratio_conv_rat_monomial5d_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 
19 
20 
21 namespace Chroma
22 {
23 
24  namespace EvenOddPrecConstDetTwoFlavorRatioConvRatWilsonTypeFermMonomial5DEnv
25  {
26  namespace
27  {
28  //! Callback function for the factory
30  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
31  {
34  }
35 
36  //! Local registration flag
37  bool registered = false;
38  }
39 
40  const std::string name("TWO_FLAVOR_EOPREC_CONSTDET_RATIO_CONV_RAT_FERM_MONOMIAL5D");
41 
42  //! Register all the factories
43  bool registerAll()
44  {
45  bool success = true;
46  if (! registered)
47  {
49  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
50  registered = true;
51  }
52  return success;
53  }
54  } //end namespace EvenOddPrec TwoFlavorWilsonFermMonomialEnv
55 
56 
57  // Constructor
60  {
61  START_CODE();
62 
63  QDPIO::cout << "Constructor: " << __func__ << std::endl;
64 
65  invParam_num = param.numer.invParam;
68 
69  //*********************************************************************
70  // Fermion action
71  {
72  std::istringstream is(param.numer.fermact.xml);
73  XMLReader fermact_reader(is);
74  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
75 
76  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
78  fermact_reader,
79  param.numer.fermact.path);
80 
82 
83  // Check success of the downcast
84  if( downcast == 0x0 )
85  {
86  QDPIO::cerr << __func__ << ": unable to downcast FermAct5D to EvenOddPrecConstDetWilsonTypeFermAct5D" << std::endl;
87  QDP_abort(1);
88  }
89 
90  fermact_num = downcast;
91  }
92  //*********************************************************************
93 
94  //*********************************************************************
95  // Fermion action
96  {
97  std::istringstream is(param.denom.fermact.xml);
98  XMLReader fermact_reader(is);
99  QDPIO::cout << "Construct fermion action= " << param.denom.fermact.id << std::endl;
100 
101  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
103  fermact_reader,
104  param.denom.fermact.path);
105 
107 
108  // Check success of the downcast
109  if( downcast == 0x0 )
110  {
111  QDPIO::cerr << __func__ << ": unable to downcast FermAct5D to EvenOddPrecConstDetWilsonTypeFermAct5D" << std::endl;
112  QDP_abort(1);
113  }
114 
115  fermact_den = downcast;
116  }
117 
118  //*********************************************************************
119  // Action rational approx
120  {
121  std::istringstream is(param.denom.action.ratApprox.xml);
122  XMLReader approx_reader(is);
123  QDPIO::cout << "Construct action rational approx= " << param.denom.action.ratApprox.id << std::endl;
124 
126  param.denom.action.ratApprox.id,
127  approx_reader,
128  param.denom.action.ratApprox.path));
129 
130  (*approx)(spfe_den, sipfe_den);
131  }
132 
133  //*********************************************************************
134  // Force rational approx
135  {
136  std::istringstream is(param.denom.force.ratApprox.xml);
137  XMLReader approx_reader(is);
138  QDPIO::cout << "Construct force rational approx= " << param.denom.force.ratApprox.id << std::endl;
139 
141  param.denom.force.ratApprox.id,
142  approx_reader,
143  param.denom.force.ratApprox.path));
144 
145  RemezCoeff_t fipfe_den; // discard
146  (*approx)(fpfe_den, fipfe_den);
147  }
148  //*********************************************************************
149 
150  //*********************************************************************
151  // Get Chronological predictor
152  {
154  if( param.predictor.xml == "" ) {
155  // No predictor specified use zero guess
157  }
158  else
159  {
160  try
161  {
162  std::istringstream chrono_is(param.predictor.xml);
163  XMLReader chrono_xml(chrono_is);
165  fermact_num->size(),
166  chrono_xml,
167  param.predictor.path);
168 
169  }
170  catch(const std::string& e ) {
171  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
172  QDP_abort(1);
173  }
174  }
175 
176  if( tmp == 0x0 ) {
177  QDPIO::cerr << "Failed to create ZeroGuess5DChronoPredictor" << std::endl;
178  QDP_abort(1);
179  }
180 
182  }
183  //*********************************************************************
184 
185  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
186 
187  END_CODE();
188  }
189 
190 } //end namespace Chroma
191 
192 
Primary include file for CHROMA library code.
Chronological predictor for HMC.
Monomial factories.
Even-odd preconditioned Wilson-like fermion actions including derivatives.
Class for counted reference semantics.
Definition: handle.h:33
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:403
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_CONSTDET_RATIO_CONV_RAT_FERM_MONOMIAL5D")
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
Rational approximation aggregator.
Rational approximation factories.
GroupXML_t fermact
Definition: comp_approx.h:36
TermApprox_t action
Definition: comp_approx.h:37
TermApprox_t force
Definition: comp_approx.h:38
Convenient structure to package Remez coeffs.
Definition: remez_coeff.h:19
GroupXML_t invParam
Definition: comp_approx.h:21
GroupXML_t ratApprox
Definition: comp_approx.h:20
Zero initial guess predictor.