mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-04 05:54:32 +00:00 
			
		
		
		
	Skeleton of HMC/Integrators
This commit is contained in:
		
							
								
								
									
										0
									
								
								lib/qcd/hmc/integrators/.dirstamp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								lib/qcd/hmc/integrators/.dirstamp
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										22
									
								
								lib/qcd/hmc/integrators/Integrator_base.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								lib/qcd/hmc/integrators/Integrator_base.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
/*! 
 | 
			
		||||
  @file Integrator_base.cc
 | 
			
		||||
  @brief utilities for MD including funcs to generate initial HMC momentum
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include <Grid.h>
 | 
			
		||||
 | 
			
		||||
static const double sq3i = 1.0/sqrt(3.0);
 | 
			
		||||
 | 
			
		||||
namespace Grid{
 | 
			
		||||
  namespace QCD{
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    void MDutils::generate_momenta_su3(LatticeColourMatrix& P,GridParallelRNG& pRNG){
 | 
			
		||||
      SU3::GaussianLieAlgebraMatrix(pRNG, P);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										50
									
								
								lib/qcd/hmc/integrators/Integrator_base.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								lib/qcd/hmc/integrators/Integrator_base.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
/*! @file Integrator_base.h
 | 
			
		||||
 * @brief Declaration of classes for the abstract Molecular Dynamics integrator
 | 
			
		||||
 *
 | 
			
		||||
 * @author Guido Cossu
 | 
			
		||||
 */
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
#ifndef INTEGRATOR_INCLUDED
 | 
			
		||||
#define INTEGRATOR_INCLUDED
 | 
			
		||||
 | 
			
		||||
class Action;
 | 
			
		||||
class RandNum;
 | 
			
		||||
class Observer;
 | 
			
		||||
 | 
			
		||||
typedef std::vector<Action*> ActionLevel;
 | 
			
		||||
typedef std::vector<ActionLevel> ActionSet;
 | 
			
		||||
typedef std::vector<Observer*> ObserverList;
 | 
			
		||||
 | 
			
		||||
/*! @brief Abstract base class for Molecular Dynamics management */
 | 
			
		||||
 | 
			
		||||
namespace Grid{
 | 
			
		||||
  namespace QCD{
 | 
			
		||||
    
 | 
			
		||||
    class Integrator{
 | 
			
		||||
    private:
 | 
			
		||||
      virtual void update_P(int lv,double ep) = 0;
 | 
			
		||||
      virtual void update_U(double ep) = 0;
 | 
			
		||||
      
 | 
			
		||||
      virtual void register_observers() = 0;
 | 
			
		||||
      virtual void notify_observers() = 0;
 | 
			
		||||
      
 | 
			
		||||
    public:
 | 
			
		||||
      virtual ~Integrator(){}
 | 
			
		||||
      virtual void init(const LatticeColourMatrix&,
 | 
			
		||||
			const GridParallelRNG& RNG)=0;
 | 
			
		||||
      virtual double S()const =0;
 | 
			
		||||
      virtual void integrate(int level) =0;
 | 
			
		||||
      virtual const LatticeColourMatrix get_U() const =0;
 | 
			
		||||
      
 | 
			
		||||
      void generate_momenta(LatticeColourMatrix& P,const RandNum& rand);
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    namespace MDutils{
 | 
			
		||||
      void generate_momenta_su3(LatticeColourMatrix& P,GridParallelRNG& RNG);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
#endif//INTEGRATOR_INCLUDED
 | 
			
		||||
		Reference in New Issue
	
	Block a user