CHROMA
eoprec_constdet_one_flavor_ratio_rat_rat_monomial_w.cc
Go to the documentation of this file.
1 /*! @file
2  * @brief One-flavor collection of even-odd preconditioned 4D ferm monomials
3  */
4 
7 
10 
13 
14 namespace Chroma
15 {
16 
17  namespace EvenOddPrecConstDetOneFlavorWilsonTypeFermRatioRatRatMonomialEnv
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_EOPREC_CONSTDET_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 EvenOddPrec OneFlavorWilsonFermRatioRatRatMonomialEnv
49 
50 
51 
52  // Constructor
55  {
56  START_CODE();
57 
58  QDPIO::cout << "Constructor: " << __func__ << std::endl;
59 
60  num_pf = param.num_pf;
65 
66  //*********************************************************************
67  // Fermion action
68  {
69  std::istringstream is(param.numer.fermact.xml);
70  XMLReader fermact_reader(is);
71  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
72 
73  WilsonTypeFermAct<T,P,Q>* tmp_act =
75  fermact_reader,
76  param.numer.fermact.path);
77 
79 
80  // Check success of the downcast
81  if( downcast == 0x0 )
82  {
83  QDPIO::cerr << __func__ << ": unable to downcast FermAct to EvenOddPrecWilsonTypeFermAct" << std::endl;
84  QDP_abort(1);
85  }
86 
87  fermact_num = downcast;
88  }
89 
90  //*********************************************************************
91  // Action rational approx
92  {
93  std::istringstream is(param.numer.action.ratApprox.xml);
94  XMLReader approx_reader(is);
95  QDPIO::cout << "Construct action rational approx= " << param.numer.action.ratApprox.id << std::endl;
96 
98  param.numer.action.ratApprox.id,
99  approx_reader,
100  param.numer.action.ratApprox.path));
101 
102  (*approx)(spfe_num, sipfe_num);
103  }
104 
105  //*********************************************************************
106  // Force rational approx
107  {
108  std::istringstream is(param.numer.force.ratApprox.xml);
109  XMLReader approx_reader(is);
110  QDPIO::cout << "Construct force rational approx= " << param.numer.force.ratApprox.id << std::endl;
111 
113  param.numer.force.ratApprox.id,
114  approx_reader,
115  param.numer.force.ratApprox.path));
116 
117  RemezCoeff_t fipfe_num; // discard
118  (*approx)(fpfe_num, fipfe_num);
119  }
120  //*********************************************************************
121 
122  //*********************************************************************
123  // Fermion action
124  {
125  std::istringstream is(param.denom.fermact.xml);
126  XMLReader fermact_reader(is);
127  QDPIO::cout << "Construct fermion action= " << param.denom.fermact.id << std::endl;
128 
129  WilsonTypeFermAct<T,P,Q>* tmp_act =
131  fermact_reader,
132  param.denom.fermact.path);
133 
135 
136  // Check success of the downcast
137  if( downcast == 0x0 )
138  {
139  QDPIO::cerr << __func__ << ": unable to downcast FermAct to EvenOddPrecWilsonTypeFermAct" << std::endl;
140  QDP_abort(1);
141  }
142 
143  fermact_den = downcast;
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 } //end namespace Chroma
184 
185 
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
One-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("ONE_FLAVOR_EOPREC_CONSTDET_FERM_RATIO_RAT_RAT_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
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