periodic_fermstate.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: periodic_fermstate.h,v 1.1 2006/09/19 17:53:37 edwards Exp $
00003 
00004 /*! @file
00005  * @brief Periodic ferm state and a creator
00006  */
00007 
00008 #ifndef __periodic_fermstate_h__
00009 #define __periodic_fermstate_h__
00010 
00011 #include "state.h"
00012 #include "create_state.h"
00013 #include "handle.h"
00014 #include "actions/ferm/fermbcs/periodic_fermbc.h"
00015 
00016 namespace Chroma
00017 {
00018   //! Periodic version of FermState 
00019   /*! @ingroup fermstates
00020    *
00021    * Only needs to hold a ferm field and ferm bc
00022    */
00023   template<typename T, typename P, typename Q>
00024   class PeriodicFermState : public FermState<T,P,Q>
00025   {
00026   public:
00027     //! Full constructor
00028     PeriodicFermState(const Q& q_) : 
00029       fbc(new PeriodicFermBC<T,P,Q>()), q(q_) {}
00030 
00031     //! Destructor
00032     ~PeriodicFermState() {}
00033 
00034     //! Return the link fields needed in constructing linear operators
00035     const Q& getLinks() const {return q;}
00036 
00037     //! Return the ferm BC object for this state
00038     const FermBC<T,P,Q>& getBC() const {return *fbc;}
00039 
00040     //! Return the ferm BC object for this state
00041     Handle< FermBC<T,P,Q> > getFermBC() const {return fbc;}
00042 
00043   private:
00044     PeriodicFermState() {}  // hide default constructur
00045     void operator=(const PeriodicFermState&) {} // hide =
00046 
00047   private:
00048     Handle< FermBC<T,P,Q> >  fbc;
00049     Q q;
00050   };
00051 
00052 
00053 
00054   //! Create a simple ferm connection state
00055   /*! @ingroup fermstates
00056    *
00057    * This is a factory class for producing a connection state
00058    */
00059   template<typename T, typename P, typename Q>
00060   class CreatePeriodicFermState : public CreateFermState<T,P,Q>
00061   {
00062   public:
00063     //! Full constructor
00064     CreatePeriodicFermState() : fbc(new PeriodicFermBC<T,P,Q>()) {}
00065 
00066     //! Destructor
00067     ~CreatePeriodicFermState() {}
00068    
00069     //! Construct a ConnectState
00070     PeriodicFermState<T,P,Q>* operator()(const Q& q) const
00071       {
00072         return new PeriodicFermState<T,P,Q>(q);
00073       }
00074 
00075     //! Return the ferm BC object for this state
00076     const FermBC<T,P,Q>& getBC() const {return *fbc;}
00077 
00078     //! Return the ferm BC object for this state
00079     Handle< FermBC<T,P,Q> > getFermBC() const {return fbc;}
00080 
00081   private:
00082     void operator=(const CreatePeriodicFermState&) {} // hide =
00083 
00084   private:
00085     Handle< FermBC<T,P,Q> >  fbc;
00086   };
00087 
00088 }
00089 
00090 
00091 #endif

Generated on Mon Mar 15 04:33:49 2010 for CHROMA by  doxygen 1.4.7