Bridge++  Ver. 1.3.x
io_format_gauge.h
Go to the documentation of this file.
1 
14 #ifndef IO_FORMAT_GAUGE_INCLUDED
15 #define IO_FORMAT_GAUGE_INCLUDED
16 
17 #include "io_format.h"
18 #include "commonParameters.h"
19 
20 namespace IO_Format {
21  namespace Gauge {
29  class ILDG_Format : public Format {
30  public:
32  {
33 // int nc = CommonParameters::Nc();
34 // int ndim = CommonParameters::Ndim();
35 
36  int nc = 3;
37  int ndim = 4;
38 
39  m_nin = 2 * nc * nc * ndim;
40  m_nex = 1;
41  m_matrix = 2 * nc * nc;
42  }
43 
44  int nin() const { return m_nin; }
45  int nex() const { return m_nex; }
46 
47  void file_to_field(int& s, int& t, const int i, const int j) const
48  {
49  s = i % m_matrix;
50  t = i / m_matrix;
51  }
52 
53  private:
54  int m_nin;
55  int m_nex;
56  int m_matrix;
57  };
58 
69  class JLQCD_Format : public Trivial_Format {};
70 
71 
72 #if 0
73  class JLQCD_Format : public Format {
74  public:
75  JLQCD_Format()
76  {
77  int nc = CommonParameters::Nc();
78  int ndim = CommonParameters::Ndim();
79 
80  m_nin = 2 * nc * nc;
81  m_nex = ndim;
82  m_matrix = 2 * nc * nc;
83  }
84 
85  int nin() const { return m_nin; }
86  int nex() const { return m_nex; }
87 
88  void file_to_field(int& s, int& t, const int i, const int j) const
89  {
90  s = i;
91  t = j;
92  }
93 
94  private:
95  int m_nin;
96  int m_nex;
97  int m_matrix;
98  };
99 #endif
100 
101 //----------------------------------------------------------------
102 // predefined formats
103 
104  extern const Format *ILDG;
105  extern const Format *JLQCD;
106  } // namespace Gauge
107 } // namespace IO_Format
108 #endif /* IO_FORMAT_GAUGE_INCLUDED */
virtual int nin() const
Definition: io_format.h:49
const Format * ILDG
Definition: io_format.cpp:28
virtual void file_to_field(int &s, int &t, const int i, const int j) const
Definition: io_format.h:52
virtual int nex() const
Definition: io_format.h:50
void file_to_field(int &s, int &t, const int i, const int j) const
const Format * JLQCD
Definition: io_format.cpp:29
IO_Format for data layout conversion from/to file.
Definition: io_format.cpp:20