CHROMA
szin_write_obj_funcmap.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Write object function std::map
3  */
4 
5 #include "named_obj.h"
8 #include "io/szin_io.h"
9 #include "io/writeszin.h"
10 #include "io/writeszinqprop_w.h"
11 
12 namespace Chroma
13 {
14 
15  //! IO function std::map environment
16  /*! \ingroup inlineio */
17  namespace SZINWriteObjCallMapEnv
18  {
19  // Anonymous namespace
20  namespace
21  {
22  //! Write a propagator
23  void SZINWriteLatProp(const std::string& buffer_id,
24  const std::string& file,
25  int j_decay, int t_start, int t_end)
26  {
27  LatticePropagator obj = TheNamedObjMap::Instance().getData<LatticePropagator>(buffer_id);
28 
29  Real Kappa = 0.0;
30  writeSzinQprop(obj, file, Kappa);
31  }
32 
33  //! Write a gauge field in floating precision
34  void SZINWriteArrayLatColMat(const std::string& buffer_id,
35  const std::string& file,
36  int j_decay, int t_start, int t_end)
37  {
38  SzinGauge_t szin_out; // ignoring XML in named object
39 
40  multi1d<LatticeColorMatrix> obj =
41  TheNamedObjMap::Instance().getData< multi1d<LatticeColorMatrix> >(buffer_id);
42 
43  writeSzinTrunc(szin_out, obj, j_decay,
44  t_start, t_end,
45  file);
46  }
47 
48  //! Local registration flag
49  bool registered = false;
50 
51  } // end namespace
52 
53 
54 
55  //! Register all the factories
56  bool registerAll()
57  {
58  bool success = true;
59  if (! registered)
60  {
61  success &= TheSZINWriteObjFuncMap::Instance().registerFunction(std::string("LatticePropagator"),
62  SZINWriteLatProp);
63  success &= TheSZINWriteObjFuncMap::Instance().registerFunction(std::string("Multi1dLatticeColorMatrix"),
64  SZINWriteArrayLatColMat);
65 
66  registered = true;
67  }
68  return success;
69  }
70  }
71 
72 }
static T & Instance()
Definition: singleton.h:432
void writeSzinQprop(const LatticePropagator &q, const std::string &file, const Real kappa)
Write a SZIN propagator file. This is a simple memory dump writer.
void writeSzinTrunc(const SzinGauge_t &header0, const multi1d< LatticeColorMatrix > &u, int j_decay, int t_start, int t_end, const std::string &cfg_file)
Write a truncated SZIN configuration file.
Definition: writeszin.cc:198
Handle< MapObject< int, EVPair< LatticeColorVector > > > obj
int j_decay
Definition: meslate.cc:22
Named object support.
Named object function std::map.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979
Szin gauge field header.
Definition: szin_io.h:17
Routines associated with SZIN gauge field IO.
Write object function std::map.
Write a SZIN configuration written at configuration version 7.
Write out a SZIN propagator.