CHROMA
unprec_one_flavor_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 UnprecOneFlavorWilsonTypeFermRatMonomialEnv
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_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 OneFlavorWilsonFermRatMonomialEnv
49 
50 
51  // Constructor
54  {
55  START_CODE();
56 
57  QDPIO::cout << "Constructor: " << __func__ << std::endl;
58 
61  num_pf = param.num_pf;
62 
63  //*********************************************************************
64  // Fermion action
65  {
66  std::istringstream is(param.numer.fermact.xml);
67  XMLReader fermact_reader(is);
68  QDPIO::cout << "Construct fermion action= " << param.numer.fermact.id << std::endl;
69 
70  WilsonTypeFermAct<T,P,Q>* tmp_act =
72  fermact_reader,
73  param.numer.fermact.path);
74 #if 0
75  WilsonTypeFermAct<T,P,Q>* downcast=dynamic_cast<UnprecWilsonTypeFermAct<T,P,Q>*>(tmp_act);
76 
77  // Check success of the downcast
78  if( downcast == 0x0 )
79  {
80  QDPIO::cerr << "Unable to downcast FermAct to UnprecWilsonTypeFermAct in UnprecOneFlavorWilsonTypeFermRatMonomial()" << std::endl;
81  QDP_abort(1);
82  }
83 #endif
84  fermact = tmp_act;
85  }
86 
87  //*********************************************************************
88  // Action rational approx
89  {
90  std::istringstream is(param.numer.action.ratApprox.xml);
91  XMLReader approx_reader(is);
92  QDPIO::cout << "Construct action rational approx= " << param.numer.action.ratApprox.id << std::endl;
93 
95  param.numer.action.ratApprox.id,
96  approx_reader,
97  param.numer.action.ratApprox.path));
98 
99  (*approx)(spfe, sipfe);
100  }
101 
102  //*********************************************************************
103  // Force rational approx
104  {
105  std::istringstream is(param.numer.force.ratApprox.xml);
106  XMLReader approx_reader(is);
107  QDPIO::cout << "Construct force rational approx= " << param.numer.force.ratApprox.id << std::endl;
108 
110  param.numer.force.ratApprox.id,
111  approx_reader,
112  param.numer.force.ratApprox.path));
113 
114  RemezCoeff_t fipfe; // discard
115  (*approx)(fpfe, fipfe);
116  }
117  //*********************************************************************
118 
119  QDPIO::cout << "Finished constructing: " << __func__ << std::endl;
120 
121  END_CODE();
122  }
123 
124 
125 } //end namespace Chroma
126 
127 
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
Wrapper class for 2-flavor unprec ferm monomials.
Handle< const WilsonTypeFermAct< T, P, Q > > fermact
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_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.