CHROMA
periodic_gaugestate.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! @file
4  * @brief Periodic gauge state and a creator
5  */
6 
7 #ifndef __periodic_gaugestate_h__
8 #define __periodic_gaugestate_h__
9 
10 #include "state.h"
11 #include "create_state.h"
12 #include "handle.h"
14 
15 namespace Chroma
16 {
17 
18  /*! @ingroup gaugestates */
19  namespace CreatePeriodicGaugeStateEnv
20  {
21  extern const std::string name;
22  bool registerAll();
23  }
24 
25 
26  //! Periodic version of GaugeState
27  /*! @ingroup gaugestates
28  *
29  * Only needs to hold a gauge field and gauge bc
30  */
31  template<typename P, typename Q>
32  class PeriodicGaugeState : public GaugeState<P,Q>
33  {
34  public:
35  //! Full constructor
36  PeriodicGaugeState(const Q& q_) :
37  gbc(new PeriodicGaugeBC<P,Q>()), q(q_) {}
38 
39  //! Destructor
41 
42  //! Return the link fields needed in constructing linear operators
43  const Q& getLinks() const {return q;}
44 
45  //! Return the gauge BC object for this state
46  const GaugeBC<P,Q>& getBC() const {return *gbc;}
47 
48  //! Return the gauge BC object for this state
49  Handle< GaugeBC<P,Q> > getGaugeBC() const {return gbc;}
50 
51  private:
52  PeriodicGaugeState() {} // hide default constructur
53  void operator=(const PeriodicGaugeState<P,Q>&) {} // hide =
54 
55  private:
57  Q q;
58  };
59 
60 
61 
62  //! Create a periodic gauge connection state
63  /*! @ingroup gaugestates
64  *
65  * This is a factory class for producing a connection state
66  */
67  template<typename P, typename Q>
69  public CreateGaugeState< P, Q>
70  {
71  public:
72  //! Full constructor
74 
75  //! Destructor
77 
78  //! Construct a ConnectState
80  {
81  return new PeriodicGaugeState<P,Q>(q);
82  }
83 
84  //! Return the gauge BC object for this state
85  const GaugeBC<P,Q>& getBC() const {return *gbc;}
86 
87  //! Return the gauge BC object for this state
88  Handle< GaugeBC<P,Q> > getGaugeBC() const {return gbc;}
89 
90  private:
91  void operator=(const CreatePeriodicGaugeState<P,Q>&) {} // hide =
92 
93  private:
95  };
96 
97 }
98 
99 
100 #endif
Create a gauge connection state.
Definition: create_state.h:47
Create a periodic gauge connection state.
const GaugeBC< P, Q > & getBC() const
Return the gauge BC object for this state.
Handle< GaugeBC< P, Q > > getGaugeBC() const
Return the gauge BC object for this state.
void operator=(const CreatePeriodicGaugeState< P, Q > &)
CreatePeriodicGaugeState()
Full constructor.
PeriodicGaugeState< P, Q > * operator()(const Q &q) const
Construct a ConnectState.
Handle< GaugeBC< P, Q > > gbc
Base class for all gauge action boundary conditions.
Definition: gaugebc.h:30
Support class for fermion actions and linear operators.
Definition: state.h:74
Class for counted reference semantics.
Definition: handle.h:33
Periodic version of GaugeState.
Handle< GaugeBC< P, Q > > gbc
void operator=(const PeriodicGaugeState< P, Q > &)
PeriodicGaugeState(const Q &q_)
Full constructor.
const Q & getLinks() const
Return the link fields needed in constructing linear operators.
const GaugeBC< P, Q > & getBC() const
Return the gauge BC object for this state.
Handle< GaugeBC< P, Q > > getGaugeBC() const
Return the gauge BC object for this state.
Create a connection state.
Class for counted reference semantics.
Double q
Definition: mesq.cc:17
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::Q Q
::std::string string
Definition: gtest.h:1979
Periodic gauge boundary conditions.
Support class for fermion actions and linear operators.
multi1d< LatticeColorMatrix > P
Definition: t_clover.cc:13