CHROMA
rbc_gaugeact.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief RG style plaquette + rectangle gauge action following RBC conventions
3  */
4 
5 #include "chromabase.h"
9 
10 namespace Chroma
11 {
12 
13  namespace RBCGaugeActEnv
14  {
15  GaugeAction< multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >* createGaugeAct(XMLReader& xml,
16  const std::string& path)
17  {
18  return new RBCGaugeAct(CreateGaugeStateEnv::reader(xml, path),
19  RBCGaugeActParams(xml, path));
20  }
21 
22  const std::string name = "RBC_GAUGEACT";
23 
24  //! Local registration flag
25  static bool registered = false;
26 
27  //! Register all the factories
28  bool registerAll()
29  {
30  bool success = true;
31  if (! registered)
32  {
33  success &= TheGaugeActFactory::Instance().registerObject(name, createGaugeAct);
34  registered = true;
35  }
36  return success;
37  }
38  }
39 
40 
41  RBCGaugeActParams::RBCGaugeActParams(XMLReader& xml_in, const std::string& path) {
42  XMLReader paramtop(xml_in, path);
43 
44  try {
45  read(paramtop, "beta", beta);
46  read(paramtop, "c1", c1);
47  }
48  catch( const std::string& e ) {
49  QDPIO::cerr << "Error reading XML: " << e << std::endl;
50  QDP_abort(1);
51  }
52  }
53 
54  void read(XMLReader& xml, const std::string& path, RBCGaugeActParams& p) {
55  RBCGaugeActParams tmp(xml, path);
56  p=tmp;
57  }
58 
59 
60  // Private initializer
61  void
63  {
64  START_CODE();
65 
66  // Fold in normalizations and create action
67  // Here, the rectangle weight is relative to the plaquette
68  AnisoParam_t aniso; // empty aniso
69  Real coeff0 = beta*(1 - 8*c1);
70  plaq = new PlaqGaugeAct(cgs,coeff0,aniso);
71 
72  Real coeff1 = beta*c1;
73  rect = new RectGaugeAct(cgs,coeff1);
74 
75  END_CODE();
76  }
77 
78 }
79 
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: rbc_gaugeact.h:50
Handle< RectGaugeAct > rect
Definition: rbc_gaugeact.h:127
void init(Handle< CreateGaugeState< P, Q > > cgs)
Private initializer.
Definition: rbc_gaugeact.cc:62
Handle< PlaqGaugeAct > plaq
Definition: rbc_gaugeact.h:126
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.
Handle< CreateGaugeState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateGaugeState readers.
const std::string name
Definition: rbc_gaugeact.cc:22
bool registerAll()
Register all the factories.
Definition: rbc_gaugeact.cc:28
static bool registered
Local registration flag.
Definition: rbc_gaugeact.cc:25
GaugeAction< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createGaugeAct(XMLReader &xml, const std::string &path)
Definition: rbc_gaugeact.cc:15
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
RG style plaquette + rectangle gauge action following RBC conventions.
Parameters for anisotropy.
Definition: aniso_io.h:24
Parameter structure.
Definition: rbc_gaugeact.h:26