CHROMA
unprec_two_flavor_ratio_conv_rat_monomial5d_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief Two-flavor collection of unpreconditioned 4D ferm monomials
3  */
4 
5 #include "chromabase.h"
8 
11 
14 
17 
18 
19 namespace Chroma
20 {
21 
22  namespace UnprecTwoFlavorRatioConvRatWilsonTypeFermMonomial5DEnv
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_UNPREC_RATIO_CONV_RAT_FERM_MONOMIAL5D");
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 Unprec TwoFlavorRatioConvRatWilsonFermMonomialEnv
53 
54 
55  // Constructor
58  {
59  START_CODE();
60 
61  QDPIO::cout << "Constructor: " << __func__ << std::endl;
62 
63  invParam_num = param.numer.invParam;
66 
67  //*********************************************************************
68  // Fermion action
69  {
70  std::istringstream is(param.numer.fermact.xml);
71  XMLReader fermact_reader(is);
72  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
73 
74  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
76  fermact_reader,
77  param.numer.fermact.path);
78 
80 
81  // Check success of the downcast
82  if( downcast == 0x0 )
83  {
84  QDPIO::cerr << __func__ << ": unable to downcast FermAct5D to UnprecWilsonTypeFermAct5D" << std::endl;
85  QDP_abort(1);
86  }
87 
88  fermact_num = downcast;
89  }
90  //*********************************************************************
91 
92  //*********************************************************************
93  // Fermion action
94  {
95  std::istringstream is(param.denom.fermact.xml);
96  XMLReader fermact_reader(is);
97  QDPIO::cout << "Construct fermion action= " << param.denom.fermact.id << std::endl;
98 
99  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
101  fermact_reader,
102  param.denom.fermact.path);
103 
104  UnprecWilsonTypeFermAct5D<T,P,Q>* downcast=dynamic_cast<UnprecWilsonTypeFermAct5D<T,P,Q>*>(tmp_act);
105 
106  // Check success of the downcast
107  if( downcast == 0x0 )
108  {
109  QDPIO::cerr << __func__ << ": unable to downcast FermAct5D to UnprecWilsonTypeFermAct5D" << std::endl;
110  QDP_abort(1);
111  }
112 
113  fermact_den = downcast;
114  }
115 
116  //*********************************************************************
117  // Action rational approx
118  {
119  std::istringstream is(param.denom.action.ratApprox.xml);
120  XMLReader approx_reader(is);
121  QDPIO::cout << "Construct action rational approx= " << param.denom.action.ratApprox.id << std::endl;
122 
124  param.denom.action.ratApprox.id,
125  approx_reader,
126  param.denom.action.ratApprox.path));
127 
128  (*approx)(spfe_den, sipfe_den);
129  }
130 
131  //*********************************************************************
132  // Force rational approx
133  {
134  std::istringstream is(param.denom.force.ratApprox.xml);
135  XMLReader approx_reader(is);
136  QDPIO::cout << "Construct force rational approx= " << param.denom.force.ratApprox.id << std::endl;
137 
139  param.denom.force.ratApprox.id,
140  approx_reader,
141  param.denom.force.ratApprox.path));
142 
143  RemezCoeff_t fipfe_den; // discard
144  (*approx)(fpfe_den, fipfe_den);
145  }
146  //*********************************************************************
147 
148  //*********************************************************************
149  // Get Chronological predictor
150  {
152  if( param.predictor.xml == "" ) {
153  // No predictor specified use zero guess
155  }
156  else
157  {
158  try
159  {
160  std::istringstream chrono_is(param.predictor.xml);
161  XMLReader chrono_xml(chrono_is);
163  fermact_num->size(),
164  chrono_xml,
165  param.predictor.path);
166 
167  }
168  catch(const std::string& e ) {
169  QDPIO::cerr << "Caught Exception Reading XML: " << e << std::endl;
170  QDP_abort(1);
171  }
172  }
173 
174  if( tmp == 0x0 ) {
175  QDPIO::cerr << "Failed to create ZeroGuess5DChronoPredictor" << std::endl;
176  QDP_abort(1);
177  }
178 
180  }
181  //*********************************************************************
182 
183  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
184 
185  END_CODE();
186  }
187 
188 
189 } //end namespace Chroma
190 
191 
Primary include file for CHROMA library code.
Monomial factories.
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
Unpreconditioned Wilson-like fermion actions in extra dims with derivatives.
Definition: fermact.orig.h:571
Wilson-like fermion actions.
Definition: fermact.orig.h:403
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_UNPREC_RATIO_CONV_RAT_FERM_MONOMIAL5D")
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
Two-flavor collection of unpreconditioned 4D ferm monomials.
Zero initial guess predictor.