CHROMA
rg_gaugeact.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Generic RG style plaquette + rectangle gauge action
3  */
4 
5 #include "chromabase.h"
9 
10 namespace Chroma
11 {
12 
13  namespace RGGaugeActEnv
14  {
15  namespace
16  {
18  multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml,
19  const std::string& path)
20  {
21  return new RGGaugeAct(CreateGaugeStateEnv::reader(xml, path),
22  RGGaugeActParams(xml, path));
23  }
24 
25  //! Local registration flag
26  bool registered = false;
27  }
28 
29  const std::string name = "RG_GAUGEACT";
30 
31  //! Register all the factories
32  bool registerAll()
33  {
34  bool success = true;
35  if (! registered)
36  {
37  success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
38  registered = true;
39  }
40  return success;
41  }
42  }
43 
44 
45  RGGaugeActParams::RGGaugeActParams(XMLReader& xml_in, const std::string& path) {
46  XMLReader paramtop(xml_in, path);
47 
48  try {
49  read(paramtop, "beta", beta);
50  read(paramtop, "c1", c1);
51  }
52  catch( const std::string& e ) {
53  QDPIO::cerr << "Error reading XML: " << e << std::endl;
54  QDP_abort(1);
55  }
56  }
57 
58  void read(XMLReader& xml, const std::string& path, RGGaugeActParams& p) {
59  RGGaugeActParams tmp(xml, path);
60  p=tmp;
61  }
62 
63 
64  // Private initializer
65  void
67  {
68  START_CODE();
69 
70  // Fold in normalizations and create action
71  // Here, the rectangle weight is relative to the plaquette
72  AnisoParam_t aniso; // empty aniso
73  Real coeff0 = beta;
74  plaq = new PlaqGaugeAct(cgs,coeff0,aniso);
75 
76  Real coeff1 = beta * c1;
77  rect = new RectGaugeAct(cgs,coeff1);
78 
79  END_CODE();
80  }
81 
82 }
83 
Primary include file for CHROMA library code.
Create a gauge connection state.
Definition: create_state.h:47
Abstract base class for gauge actions.
Definition: gaugeact.h:25
Class for counted reference semantics.
Definition: handle.h:33
RG gauge action.
Definition: rg_gaugeact.h:48
Handle< PlaqGaugeAct > plaq
Definition: rg_gaugeact.h:124
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
Definition: rg_gaugeact.cc:66
Handle< RectGaugeAct > rect
Definition: rg_gaugeact.h:125
Rect gauge action.
Definition: rect_gaugeact.h:54
static T & Instance()
Definition: singleton.h:432
All gauge create-state method.
Fermion action factories.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
GaugeAction< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createGaugeAct(XMLReader &xml, const std::string &path)
static bool registered
Local registration flag.
Handle< CreateGaugeState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateGaugeState readers.
bool registerAll()
Register all the factories.
Definition: rg_gaugeact.cc:32
const std::string name
Definition: rg_gaugeact.cc:29
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
Generic RG style plaquette + rectangle gauge action.
Parameters for anisotropy.
Definition: aniso_io.h:24
Parameter structure.
Definition: rg_gaugeact.h:26