1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-13 01:05:36 +00:00
Grid/lib/qcd/hmc/integrators/Integrator_base.h

82 lines
2.3 KiB
C
Raw Normal View History

2015-07-03 08:51:41 +01:00
//--------------------------------------------------------------------
/*! @file Integrator_base.h
* @brief Declaration of classes for the abstract Molecular Dynamics integrator
*
* @author Guido Cossu
*/
//--------------------------------------------------------------------
#ifndef INTEGRATOR_INCLUDED
#define INTEGRATOR_INCLUDED
class Observer;
/*! @brief Abstract base class for Molecular Dynamics management */
namespace Grid{
namespace QCD{
2015-07-03 18:43:14 +01:00
typedef Action<LatticeLorentzColourMatrix>* ActPtr; // now force the same size as the rest of the code
typedef std::vector<ActPtr> ActionLevel;
typedef std::vector<ActionLevel> ActionSet;
typedef std::vector<Observer*> ObserverList;
class Integrator2MN{
const double lambda = 0.1931833275037836;
void step (LatticeColourMatrix&, LatticeColourMatrix&,
int, std::vector<int>&);
};
class IntegratorLeapFrog{
void step (LatticeColourMatrix&, LatticeColourMatrix&,
int, std::vector<int>&);
};
2015-07-03 08:51:41 +01:00
2015-07-03 18:43:14 +01:00
template< class IntegratorPolicy >
2015-07-03 08:51:41 +01:00
class Integrator{
private:
2015-07-03 18:43:14 +01:00
int Nexp;
int MDsteps; // number of outer steps
RealD trajL; // trajectory length
RealD stepsize;
const std::vector<int> Nrel; // relative steps per level
const ActionSet as;
ObserverList observers;
// LatticeColourMatrix* const U; // is shared among all actions - or use a singleton...
LatticeColourMatrix P;
2015-07-03 08:51:41 +01:00
2015-07-03 18:43:14 +01:00
IntegratorPolicy TheIntegrator;// contains parameters too
void update_P(int lv,double ep);
void update_U(double ep);
2015-07-03 08:51:41 +01:00
2015-07-03 18:43:14 +01:00
void register_observers();
void notify_observers();
void integrator_step(int level ,std::vector<Integer>& clock);
2015-07-03 08:51:41 +01:00
2015-07-03 18:43:14 +01:00
public:
Integrator(int Nexp_, int MDsteps_, RealD trajL_,
ActionSet& Aset, ObserverList obs):as(Aset), observers(obs){};
~Integrator(){}
void init(LatticeLorentzColourMatrix&,
GridParallelRNG&);
double S();
void integrate(int level);
LatticeColourMatrix get_U();
2015-07-03 08:51:41 +01:00
};
namespace MDutils{
2015-07-03 18:43:14 +01:00
void generate_momenta(LatticeLorentzColourMatrix&,GridParallelRNG&);
void generate_momenta_su3(LatticeLorentzColourMatrix&,GridParallelRNG&);
2015-07-03 08:51:41 +01:00
}
}
}
#endif//INTEGRATOR_INCLUDED