CHROMA
lcm_tst_leapfrog_recursive.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! @file
4  * @brief Intgrator for exp(S dt)
5  *
6  * A component integrator to integrate exp(Sdt) for some
7  * monomial list S (ie this is a leapP like component)
8  */
9 
10 #ifndef LCM_TST_LEAPFROG_RECURSIVE_H
11 #define LCM_TST_LEAPFROG_RECURSIVE_H
12 
13 
14 #include "chromabase.h"
18 
19 namespace Chroma
20 {
21 
22  /*! @ingroup integrator */
23  namespace LatColMatTSTLeapfrogRecursiveIntegratorEnv
24  {
25  extern const std::string name;
26  bool registerAll();
27  }
28 
29 
30  /*! @ingroup integrator */
32  {
35  int n_steps;
36  multi1d<std::string> monomial_ids;
38  };
39 
40  /*! @ingroup integrator */
41  void read(XMLReader& xml_in,
42  const std::string& path,
44 
45  /*! @ingroup integrator */
46  void write(XMLWriter& xml_out,
47  const std::string& path,
49 
50  //! MD integrator interface for PQP leapfrog
51  /*! @ingroup integrator
52  * Specialised to multi1d<LatticeColorMatrix>
53  */
55  : public AbsRecursiveIntegrator<multi1d<LatticeColorMatrix>,
56  multi1d<LatticeColorMatrix> >
57  {
58  public:
59 
60  // Simplest Constructor
62  const multi1d<std::string>& monomial_ids_,
63  Handle< AbsComponentIntegrator< multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >& SubIntegrator_) : n_steps(n_steps_), SubIntegrator(SubIntegrator_) {
65  };
66 
67  // Construct from params struct and Hamiltonian
70  ) : n_steps(p.n_steps), SubIntegrator(IntegratorShared::createSubIntegrator(p.subintegrator_xml)) {
72  }
73 
74 
75  // Copy constructor
78 
79  // ! Destruction is automagic
81 
82 
83  void operator()( AbsFieldState<multi1d<LatticeColorMatrix>,
84  multi1d<LatticeColorMatrix> >& s,
85  const Real& traj_length) const;
86 
88  multi1d<LatticeColorMatrix> >& getSubIntegrator() const {
89  return (*SubIntegrator);
90  }
91 
92  protected:
93  //! Refresh fields in just this level
94  void refreshFieldsThisLevel(AbsFieldState<multi1d<LatticeColorMatrix>,
95  multi1d<LatticeColorMatrix> >& s) const {
96  for(int i=0; i < monomials.size(); i++) {
97  monomials[i].mon->refreshInternalFields(s);
98  }
99  }
100 
101  //! Reset Predictors in just this level
102  void resetPredictorsThisLevel(void) const {
103  for(int i=0; i < monomials.size(); ++i) {
104  monomials[i].mon->resetPredictors();
105  }
106  }
107 
108  private:
109 
110  int n_steps;
111 
112  multi1d< IntegratorShared::MonomialPair > monomials;
113 
115  multi1d<LatticeColorMatrix> > > SubIntegrator;
116 
117 
118 
119  };
120 
121 }
122 
123 
124 #endif
Abstract Hamiltonian.
Integrators.
Primary include file for CHROMA library code.
MD integrator that can be used as a component for other integrators.
Abstract field state.
Definition: field_state.h:27
MD component integrator that has a sub integrator (recursive)
Class for counted reference semantics.
Definition: handle.h:33
MD integrator interface for PQP leapfrog.
LatColMatTSTLeapfrogRecursiveIntegrator(const LatColMatTSTLeapfrogRecursiveIntegratorParams &p)
void operator()(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s, const Real &traj_length) const
Do an integration of lenght n*delta tau in n steps.
LatColMatTSTLeapfrogRecursiveIntegrator(int n_steps_, const multi1d< std::string > &monomial_ids_, Handle< AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > &SubIntegrator_)
AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > & getSubIntegrator() const
Return the next level down integrator.
void resetPredictorsThisLevel(void) const
Reset Predictors in just this level.
Handle< AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > SubIntegrator
multi1d< IntegratorShared::MonomialPair > monomials
LatColMatTSTLeapfrogRecursiveIntegrator(const LatColMatTSTLeapfrogRecursiveIntegrator &l)
void refreshFieldsThisLevel(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s) const
Refresh fields in just this level.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createSubIntegrator(const std::string &subintegrator_xml)
A routine to create a sub integrator from a generic piece of subintegrator XML.
void bindMonomials(const multi1d< std::string > &monomial_ids, multi1d< MonomialPair > &monomials)
A routine to bind Monomial IDs to an array of Monomial Handles.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int i
Definition: pbg5p_w.cc:55
multi1d< LatticeFermion > s(Ncb)
::std::string string
Definition: gtest.h:1979
int l
Definition: pade_trln_w.cc:111