plaq_plus_spatial_two_plaq_gaugeact.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: plaq_plus_spatial_two_plaq_gaugeact.h,v 3.5 2007/02/22 21:11:48 bjoo Exp $
00003 /*! \file
00004  *  \brief Plaquette gauge action
00005  */
00006 
00007 #ifndef __plaq_plus_spatial_two_plaq_gaugeact_h__
00008 #define __plaq_plus_spatial_two_plaq_gaugeact_h__
00009 
00010 #include "gaugeact.h"
00011 #include "gaugebc.h"
00012 #include "io/aniso_io.h"
00013 
00014 namespace Chroma
00015 {
00016 
00017   /*! @ingroup gaugeacts */
00018   namespace PlaqPlusSpatialTwoPlaqGaugeActEnv 
00019   { 
00020     extern const string name;
00021     bool registerAll();
00022     extern  double getTime();
00023   }
00024 
00025   //! Parameter structure
00026   /*! @ingroup gaugeacts */
00027   struct PlaqPlusSpatialTwoPlaqGaugeActParams 
00028   {
00029     // Base Constructor
00030     PlaqPlusSpatialTwoPlaqGaugeActParams() {}
00031     
00032     // Read params from some root path
00033     PlaqPlusSpatialTwoPlaqGaugeActParams(XMLReader& xml_in, const std::string& path);
00034 
00035     Real coeff_plaq_s;
00036     Real coeff_plaq_t;
00037 
00038     Real coeff_two_plaq;  
00039     AnisoParam_t aniso;
00040   };
00041   
00042   /*! @ingroup gaugeacts */
00043   void read(XMLReader& xml, const string& path, PlaqPlusSpatialTwoPlaqGaugeActParams& param);
00044   
00045 
00046   //! Plaquette gauge action
00047   /*! \ingroup gaugeacts
00048    *
00049    * The standard Plaquette gauge action
00050    */
00051 
00052   class PlaqPlusSpatialTwoPlaqGaugeAct : public LinearGaugeAction
00053   {
00054   public:
00055     //! General CreateGaugeState<P,Q>
00056     PlaqPlusSpatialTwoPlaqGaugeAct(Handle< CreateGaugeState<P,Q> > cgs_, 
00057                                    const Real& coeff_plaq_s_,
00058                                    const Real& coeff_plaq_t_,
00059                                    const Real& coeff_two_plaq_,
00060                  const AnisoParam_t& aniso) : 
00061       cgs(cgs_) {
00062       param.coeff_plaq_s = coeff_plaq_s_; 
00063       param.coeff_plaq_t = coeff_plaq_t_;
00064       param.coeff_two_plaq = coeff_two_plaq_;
00065       param.aniso = aniso; 
00066       init();
00067     }
00068 
00069     //! Read coeff from a param struct
00070     PlaqPlusSpatialTwoPlaqGaugeAct(Handle< CreateGaugeState<P,Q> > cgs_, 
00071                  const PlaqPlusSpatialTwoPlaqGaugeActParams& p) :
00072       cgs(cgs_), param(p) {init();}
00073 
00074     //! Is anisotropy used?
00075     bool anisoP() const {return param.aniso.anisoP;}
00076 
00077     //! Anisotropy factor
00078     const Real anisoFactor() const {return param.aniso.xi_0;}
00079 
00080     //! Anisotropic direction
00081     int tDir() const {return param.aniso.t_dir;}
00082 
00083     //! Return the set on which the gauge action is defined
00084     /*! Defined on the even-off (red/black) set */
00085     const Set& getSet() const {return rb;}
00086 
00087     //! Compute staple
00088     void staple(LatticeColorMatrix& result,
00089                 const Handle< GaugeState<P,Q> >& state,
00090                 int mu, int cb) const;
00091 
00092     //! Compute dS/dU
00093     void deriv(multi1d<LatticeColorMatrix>& result,
00094                const Handle< GaugeState<P,Q> >& state) const;
00095 
00096     //! Produce a gauge create state object
00097     const CreateGaugeState<P,Q>& getCreateState() const {return *cgs;}
00098 
00099     //! Compute the actions
00100     Double S(const Handle< GaugeState<P,Q> >& state) const;
00101 
00102     //! Destructor is automatic
00103     ~PlaqPlusSpatialTwoPlaqGaugeAct() {}
00104 
00105     // Accessors -- non mutable members.
00106     const Real getCoeffPlaqS(void) const {return param.coeff_plaq_s;}
00107     const Real getCoeffPlaqT(void) const {return param.coeff_plaq_t;}
00108     const Real getCoeffTwoPlaq(void) const {return param.coeff_two_plaq;}
00109 
00110   protected:
00111     PlaqPlusSpatialTwoPlaqGaugeAct() {}
00112     void operator=(const PlaqPlusSpatialTwoPlaqGaugeAct& a) {}       //! Hide assignment
00113 
00114     //! Internal initializer
00115     void init();
00116 
00117   private:
00118     Handle< CreateGaugeState<P,Q> >  cgs;  // Create Gauge State
00119     PlaqPlusSpatialTwoPlaqGaugeActParams  param;   // The parameters
00120 
00121   };
00122 
00123 };
00124 
00125 
00126 #endif

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