CHROMA
create_state.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! @file
4  * @brief Create a connection state
5  *
6  * This is a factory class for producing a connection state
7  */
8 
9 #ifndef __create_state_h__
10 #define __create_state_h__
11 
12 #include "state.h"
13 #include "gaugebc.h"
14 #include "fermbc.h"
15 #include "handle.h"
16 
17 namespace Chroma
18 {
19  //! Create a connection state
20  /*! @ingroup state
21  *
22  * This is a factory class for producing a connection state
23  */
24  template<typename P, typename Q>
26  {
27  public:
28  //! Virtual destructor to help with cleanup;
29  virtual ~CreateState() {}
30 
31  //! Construct a ConnectState
32  virtual ConnectState<P,Q>* operator()(const Q& q) const = 0;
33 
34  //! Return the amorphous BC object for this state
35  /*! The user will supply the BC in a derived class */
36  virtual const BoundCond<P,Q>& getBC() const = 0;
37  };
38 
39 
40  //! Create a gauge connection state
41  /*! @ingroup state
42  *
43  * This is a factory class for producing a connection state
44  */
45  template<typename P, typename Q>
46  class CreateGaugeState : public CreateState<P,Q>
47  {
48  public:
49  //! Virtual destructor to help with cleanup;
50  virtual ~CreateGaugeState() {}
51 
52  //! Construct a ConnectState
53  virtual GaugeState<P,Q>* operator()(const Q& q) const = 0;
54 
55  //! Return the gauge BC object for this state
56  /*! The user will supply the BC in a derived class */
57  virtual const GaugeBC<P,Q>& getBC() const = 0;
58  };
59 
60 
61 
62  //! Create a fermion connection state
63  /*! @ingroup state
64  *
65  * This is a factory class for producing a connection state
66  */
67  template<typename T, typename P, typename Q>
68  class CreateFermState : public CreateState<P,Q>
69  {
70  public:
71  //! Virtual destructor to help with cleanup;
72  virtual ~CreateFermState() {}
73 
74  //! Construct a ConnectState
75  virtual FermState<T,P,Q>* operator()(const Q& q) const = 0;
76 
77  //! Return the gauge BC object for this state
78  /*! The user will supply the BC in a derived class */
79  virtual const FermBC<T,P,Q>& getBC() const = 0;
80 
81  //! Return the gauge BC object for this state
82  /*! This is to help the optimized linops */
83  virtual Handle< FermBC<T,P,Q> > getFermBC() const = 0;
84  };
85 
86 
87 }
88 
89 
90 #endif
Base class for all boundary conditions.
Definition: boundcond.h:19
Support class for fermion actions and linear operators.
Definition: state.h:28
Create a fermion connection state.
Definition: create_state.h:69
virtual ~CreateFermState()
Virtual destructor to help with cleanup;.
Definition: create_state.h:72
virtual Handle< FermBC< T, P, Q > > getFermBC() const =0
Return the gauge BC object for this state.
virtual const FermBC< T, P, Q > & getBC() const =0
Return the gauge BC object for this state.
virtual FermState< T, P, Q > * operator()(const Q &q) const =0
Construct a ConnectState.
Create a gauge connection state.
Definition: create_state.h:47
virtual const GaugeBC< P, Q > & getBC() const =0
Return the gauge BC object for this state.
virtual ~CreateGaugeState()
Virtual destructor to help with cleanup;.
Definition: create_state.h:50
virtual GaugeState< P, Q > * operator()(const Q &q) const =0
Construct a ConnectState.
Create a connection state.
Definition: create_state.h:26
virtual const BoundCond< P, Q > & getBC() const =0
Return the amorphous BC object for this state.
virtual ~CreateState()
Virtual destructor to help with cleanup;.
Definition: create_state.h:29
virtual ConnectState< P, Q > * operator()(const Q &q) const =0
Construct a ConnectState.
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
Support class for fermion actions and linear operators.
Definition: state.h:94
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
Fermion action boundary conditions.
Gauge boundary conditions.
Class for counted reference semantics.
Double q
Definition: mesq.cc:17
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::Q Q
Support class for fermion actions and linear operators.