CHROMA
eoprec_constdet_two_flavor_ratio_conv_rat_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 
19 
20 
21 namespace Chroma
22 {
23 
24  namespace EvenOddPrecConstDetTwoFlavorRatioConvRatWilsonTypeFermMonomialEnv
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_MONOMIAL");
41 
42  //! Register all the factories
43  bool registerAll()
44  {
45  bool success = true;
46  if (! registered)
47  {
50  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
51  registered = true;
52  }
53  return success;
54  }
55  } //end namespace EvenOddPrec TwoFlavorWilsonFermMonomialEnv
56 
57 
58  // Constructor
61  {
62  START_CODE();
63 
64  QDPIO::cout << "Constructor: " << __func__ << std::endl;
65 
66  invParam_num = param.numer.invParam;
69 
70  //*********************************************************************
71  // Fermion action
72  {
73  std::istringstream is(param.numer.fermact.xml);
74  XMLReader fermact_reader(is);
75  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
76 
77  WilsonTypeFermAct<T,P,Q>* tmp_act =
79  fermact_reader,
80  param.numer.fermact.path);
81 
83 
84  // Check success of the downcast
85  if( downcast == 0x0 )
86  {
87  QDPIO::cerr << __func__ << ": unable to downcast FermAct to EvenOddPrecWilsonTypeFermAct" << std::endl;
88  QDP_abort(1);
89  }
90 
91  fermact_num = downcast;
92  }
93  //*********************************************************************
94 
95  //*********************************************************************
96  // Fermion action
97  {
98  std::istringstream is(param.denom.fermact.xml);
99  XMLReader fermact_reader(is);
100  QDPIO::cout << "Construct fermion action= " << param.denom.fermact.id << std::endl;
101 
102  WilsonTypeFermAct<T,P,Q>* tmp_act =
104  fermact_reader,
105  param.denom.fermact.path);
106 
108 
109  // Check success of the downcast
110  if( downcast == 0x0 )
111  {
112  QDPIO::cerr << __func__ << ": unable to downcast FermAct to EvenOddPrecWilsonTypeFermAct" << std::endl;
113  QDP_abort(1);
114  }
115 
116  fermact_den = downcast;
117  }
118 
119  //*********************************************************************
120  // Action rational approx
121  {
122  std::istringstream is(param.denom.action.ratApprox.xml);
123  XMLReader approx_reader(is);
124  QDPIO::cout << "Construct action rational approx= " << param.denom.action.ratApprox.id << std::endl;
125 
127  param.denom.action.ratApprox.id,
128  approx_reader,
129  param.denom.action.ratApprox.path));
130 
131  (*approx)(spfe_den, sipfe_den);
132  }
133 
134  //*********************************************************************
135  // Force rational approx
136  {
137  std::istringstream is(param.denom.force.ratApprox.xml);
138  XMLReader approx_reader(is);
139  QDPIO::cout << "Construct force rational approx= " << param.denom.force.ratApprox.id << std::endl;
140 
142  param.denom.force.ratApprox.id,
143  approx_reader,
144  param.denom.force.ratApprox.path));
145 
146  RemezCoeff_t fipfe_den; // discard
147  (*approx)(fpfe_den, fipfe_den);
148  }
149  //*********************************************************************
150 
151  //*********************************************************************
152  // Get Chronological predictor
153  {
155  if( param.predictor.xml == "" ) {
156  // No predictor specified use zero guess
158  }
159  else
160  {
161  try
162  {
163  std::istringstream chrono_is(param.predictor.xml);
164  XMLReader chrono_xml(chrono_is);
166  chrono_xml,
167  param.predictor.path);
168  }
169  catch(const std::string& e ) {
170  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
171  QDP_abort(1);
172  }
173  }
174 
175  if( tmp == 0x0 ) {
176  QDPIO::cerr << "Failed to create ZeroGuess4DChronoPredictor" << std::endl;
177  QDP_abort(1);
178  }
179 
181  }
182  //*********************************************************************
183 
184  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
185 
186  END_CODE();
187  }
188 
189 } //end namespace Chroma
190 
191 
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: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_CONSTDET_RATIO_CONV_RAT_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.
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.