CHROMA
unprec_one_flavor_ratio_rat_rat_monomial5d_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief One-flavor collection of unpreconditioned 5D ferm monomials
3  */
4 
7 
10 
13 
14 namespace Chroma
15 {
16 
17  namespace UnprecOneFlavorWilsonTypeFermRatioRatRatMonomial5DEnv
18  {
19  namespace
20  {
21  //! Callback
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_MONOMIAL5D");
34 
35  //! Register all the factories
36  bool registerAll()
37  {
38  bool success = true;
39  if (! registered)
40  {
42  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
43  registered = true;
44  }
45  return success;
46  }
47  } //end namespace Unprec OneFlavorWilsonFermRatioRatRatMonomialEnv
48 
49 
50  // Constructor
53  {
54  START_CODE();
55 
56  QDPIO::cout << "Constructor: " << __func__ << std::endl;
57 
58  num_pf = param.num_pf;
63 
64  //*********************************************************************
65  // Fermion action
66  {
67  std::istringstream is(param.numer.fermact.xml);
68  XMLReader fermact_reader(is);
69  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
70 
71  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
73  fermact_reader,
74  param.numer.fermact.path);
75 
77 
78  // Check success of the downcast
79  if( downcast == 0x0 )
80  {
81  QDPIO::cerr << __func__ << ": unable to downcast FermAct5D to UnprecWilsonTypeFermAct5D" << std::endl;
82  QDP_abort(1);
83  }
84 
85  fermact_num = downcast;
86  }
87 
88  //*********************************************************************
89  // Action rational approx
90  {
91  std::istringstream is(param.numer.action.ratApprox.xml);
92  XMLReader approx_reader(is);
93  QDPIO::cout << "Construct action rational approx= " << param.numer.action.ratApprox.id << std::endl;
94 
96  param.numer.action.ratApprox.id,
97  approx_reader,
98  param.numer.action.ratApprox.path));
99 
100  (*approx)(spfe_num, sipfe_num);
101  }
102 
103  //*********************************************************************
104  // Force rational approx
105  {
106  std::istringstream is(param.numer.force.ratApprox.xml);
107  XMLReader approx_reader(is);
108  QDPIO::cout << "Construct force rational approx= " << param.numer.force.ratApprox.id << std::endl;
109 
111  param.numer.force.ratApprox.id,
112  approx_reader,
113  param.numer.force.ratApprox.path));
114 
115  RemezCoeff_t fipfe_num; // discard
116  (*approx)(fpfe_num, fipfe_num);
117  }
118  //*********************************************************************
119 
120  //*********************************************************************
121  // Fermion action
122  {
123  std::istringstream is(param.denom.fermact.xml);
124  XMLReader fermact_reader(is);
125  QDPIO::cout << "Construct fermion action= " << param.denom.fermact.id << std::endl;
126 
127  WilsonTypeFermAct5D<T,P,Q>* tmp_act =
129  fermact_reader,
130  param.denom.fermact.path);
131 
132  UnprecWilsonTypeFermAct5D<T,P,Q>* downcast=dynamic_cast<UnprecWilsonTypeFermAct5D<T,P,Q>*>(tmp_act);
133 
134  // Check success of the downcast
135  if( downcast == 0x0 )
136  {
137  QDPIO::cerr << __func__ << ": unable to downcast FermAct5D to UnprecWilsonTypeFermAct5D" << std::endl;
138  QDP_abort(1);
139  }
140 
141  fermact_den = downcast;
142  }
143 
144  //*********************************************************************
145  // Action rational approx
146  {
147  std::istringstream is(param.denom.action.ratApprox.xml);
148  XMLReader approx_reader(is);
149  QDPIO::cout << "Construct action rational approx= " << param.denom.action.ratApprox.id << std::endl;
150 
152  param.denom.action.ratApprox.id,
153  approx_reader,
154  param.denom.action.ratApprox.path));
155 
156  (*approx)(spfe_den, sipfe_den);
157  }
158 
159  //*********************************************************************
160  // Force rational approx
161  {
162  std::istringstream is(param.denom.force.ratApprox.xml);
163  XMLReader approx_reader(is);
164  QDPIO::cout << "Construct force rational approx= " << param.denom.force.ratApprox.id << std::endl;
165 
167  param.denom.force.ratApprox.id,
168  approx_reader,
169  param.denom.force.ratApprox.path));
170 
171  RemezCoeff_t fipfe_den; // discard
172  (*approx)(fpfe_den, fipfe_den);
173  }
174  //*********************************************************************
175 
176  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
177 
178  END_CODE();
179  }
180 
181 } //end namespace Chroma
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
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("ONE_FLAVOR_UNPREC_FERM_RATIO_RAT_RAT_MONOMIAL5D")
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 5D ferm monomials.