CHROMA
unprec_one_flavor_ratio_rat_rat_monomial_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief One-flavor collection of unpreconditioned 4D ferm monomials
3  */
4 
7 
10 
13 
14 namespace Chroma
15 {
16 
17  namespace UnprecOneFlavorWilsonTypeFermRatioRatRatMonomialEnv
18  {
19  namespace
20  {
21  //! Does the work
23  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
24  {
27  }
28 
29  //! Local registration flag
30  bool registered = false;
31  }
32 
33  const std::string name("ONE_FLAVOR_UNPREC_FERM_RATIO_RAT_RAT_MONOMIAL");
34 
35  //! Register all the factories
36  bool registerAll()
37  {
38  bool success = true;
39  if (! registered)
40  {
43  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
44  registered = true;
45  }
46  return success;
47  }
48  } //end namespace Unprec OneFlavorWilsonFermRatioRatRatMonomialEnv
49 
50 
51  // Constructor
54  {
55  START_CODE();
56 
57  QDPIO::cout << "Constructor: " << __func__ << std::endl;
58 
59  num_pf = param.num_pf;
64 
65  //*********************************************************************
66  // Fermion action
67  {
68  std::istringstream is(param.numer.fermact.xml);
69  XMLReader fermact_reader(is);
70  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
71 
72  WilsonTypeFermAct<T,P,Q>* tmp_act =
74  fermact_reader,
75  param.numer.fermact.path);
76 #if 0
77  WilsonTypeFermAct<T,P,Q>* downcast=dynamic_cast<UnprecWilsonTypeFermAct<T,P,Q>*>(tmp_act);
78 
79  // Check success of the downcast
80  if( downcast == 0x0 )
81  {
82  QDPIO::cerr << __func__ << ": unable to downcast FermAct to UnprecWilsonTypeFermAct" << std::endl;
83  QDP_abort(1);
84  }
85 #endif
86  fermact_num = tmp_act;
87  }
88 
89  //*********************************************************************
90  // Action rational approx
91  {
92  std::istringstream is(param.numer.action.ratApprox.xml);
93  XMLReader approx_reader(is);
94  QDPIO::cout << "Construct action rational approx= " << param.numer.action.ratApprox.id << std::endl;
95 
97  param.numer.action.ratApprox.id,
98  approx_reader,
99  param.numer.action.ratApprox.path));
100 
101  (*approx)(spfe_num, sipfe_num);
102  }
103 
104  //*********************************************************************
105  // Force rational approx
106  {
107  std::istringstream is(param.numer.force.ratApprox.xml);
108  XMLReader approx_reader(is);
109  QDPIO::cout << "Construct force rational approx= " << param.numer.force.ratApprox.id << std::endl;
110 
112  param.numer.force.ratApprox.id,
113  approx_reader,
114  param.numer.force.ratApprox.path));
115 
116  RemezCoeff_t fipfe_num; // discard
117  (*approx)(fpfe_num, fipfe_num);
118  }
119  //*********************************************************************
120 
121  //*********************************************************************
122  // Fermion action
123  {
124  std::istringstream is(param.denom.fermact.xml);
125  XMLReader fermact_reader(is);
126  QDPIO::cout << "Construct fermion action= " << param.denom.fermact.id << std::endl;
127 
128  WilsonTypeFermAct<T,P,Q>* tmp_act =
130  fermact_reader,
131  param.denom.fermact.path);
132 
133 #if 0
134  WilsonTypeFermAct<T,P,Q>* downcast=dynamic_cast<UnprecWilsonTypeFermAct<T,P,Q>*>(tmp_act);
135 
136  // Check success of the downcast
137  if( downcast == 0x0 )
138  {
139  QDPIO::cerr << __func__ << ": unable to downcast FermAct to UnprecWilsonTypeFermAct" << std::endl;
140  QDP_abort(1);
141  }
142 #endif
143  fermact_den = tmp_act;
144  }
145 
146  //*********************************************************************
147  // Action rational approx
148  {
149  std::istringstream is(param.denom.action.ratApprox.xml);
150  XMLReader approx_reader(is);
151  QDPIO::cout << "Construct action rational approx= " << param.denom.action.ratApprox.id << std::endl;
152 
154  param.denom.action.ratApprox.id,
155  approx_reader,
156  param.denom.action.ratApprox.path));
157 
158  (*approx)(spfe_den, sipfe_den);
159  }
160 
161  //*********************************************************************
162  // Force rational approx
163  {
164  std::istringstream is(param.denom.force.ratApprox.xml);
165  XMLReader approx_reader(is);
166  QDPIO::cout << "Construct force rational approx= " << param.denom.force.ratApprox.id << std::endl;
167 
169  param.denom.force.ratApprox.id,
170  approx_reader,
171  param.denom.force.ratApprox.path));
172 
173  RemezCoeff_t fipfe_den; // discard
174  (*approx)(fpfe_den, fipfe_den);
175  }
176  //*********************************************************************
177 
178  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
179 
180  END_CODE();
181  }
182 
183 
184 } //end namespace Chroma
185 
186 
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 with derivatives.
Definition: fermact.orig.h:491
Wilson-like fermion actions.
Definition: fermact.orig.h:344
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.
bool registerAll()
Register all the factories.
const std::string name("ONE_FLAVOR_UNPREC_FERM_RATIO_RAT_RAT_MONOMIAL")
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
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
One-flavor collection of unpreconditioned 4D ferm monomials.