CHROMA
gauge_createstate_aggregate.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief All gauge create-state method
3  */
4 
5 #include "chromabase.h"
6 
9 
13 
15 
16 namespace Chroma
17 {
18 
19  //! Registration aggregator
20  namespace CreateGaugeStateEnv
21  {
22  //! Local registration flag
23  static bool registered = false;
24 
25  //! Register all the factories
26  bool registerAll()
27  {
28  bool success = true;
29  if (! registered)
30  {
31  // Register all gauge BCs
33 
34  // Register all gauge states
38 
39  registered = true;
40  }
41  return success;
42  }
43 
44 
45  // Helper function for the GaugeAction readers
47  multi1d<LatticeColorMatrix> > > reader(XMLReader& xml_in,
48  const std::string& path)
49  {
50  XMLReader top(xml_in, path);
51 
52  std::string gaugestate;
53  std::string gaugestate_path;
54  if (top.count("GaugeState") != 0)
55  {
56  gaugestate_path = "GaugeState";
57  read(top, gaugestate_path + "/Name", gaugestate);
58  }
59  else
60  {
61 // QDPIO::cerr << "Error: GaugeState group not found" << std::endl;
62 // QDP_abort(1);
63 
64  gaugestate_path = ".";
66  }
67 
68  Handle< CreateGaugeState< multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >
69  cgs(TheCreateGaugeStateFactory::Instance().createObject(gaugestate,
70  top,
71  gaugestate_path));
72 
73  return cgs;
74  }
75 
76 
77  // Returns a no-smearing group
79  {
80  GroupXML_t nope;
82  nope.path = "GaugeState";
83 
84  XMLBufferWriter xml_tmp;
85  push(xml_tmp, "GaugeState");
86  write(xml_tmp, "Name", nope.id);
87  pop(xml_tmp);
88 
89  nope.xml = xml_tmp.str();
90 
91  return nope;
92  }
93 
94  }
95 }
Primary include file for CHROMA library code.
Class for counted reference semantics.
Definition: handle.h:33
static T & Instance()
Definition: singleton.h:432
All gauge create-state method.
Gauge create state factory.
Gauge boundary condition aggregator.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
bool registerAll()
Register all the factories.
GroupXML_t nullXMLGroup()
Returns a simple createstate group.
Handle< CreateGaugeState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateGaugeState readers.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
push(xml_out,"Condensates")
pop(xml_out)
::std::string string
Definition: gtest.h:1979
Periodic gauge state and a creator.
Simple gauge state and a creator.
Stout gauge state and a creator.
Hold group xml and type id.