Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:11:06

0001 // This is a class the creates an N-Dimensional Phase Space     //
0002 
0003 // It is for use in computing the time development of classical //
0004 // Hamiltonian Systems.                                         //
0005 
0006 // Joe Boudreau October 2011                                    //
0007 
0008 //--------------------------------------------------------------//
0009 
0010 #ifndef _PHASE_SPACE_
0011 #define _PHASE_SPACE_
0012 #include "CLHEP/GenericFunctions/Variable.hh"
0013 #include <vector>
0014 
0015 namespace Classical {
0016 
0017   class PhaseSpace {
0018 
0019 
0020   public:
0021 
0022     // A component is like a vector: of coordinates or momenta:
0023     class Component;
0024 
0025     // constructor
0026     PhaseSpace(unsigned int NDIM);
0027 
0028     // Destructor
0029     ~PhaseSpace();
0030 
0031     // Get the dimensionality:
0032     unsigned int dim() const;
0033 
0034     // Get the coordinates:
0035     const Component & coordinates() const;
0036 
0037     // Get the momenta:
0038     const Component & momenta()     const; 
0039     
0040     // Set starting values for the coordinates or momenta:
0041     void   start (const Genfun::Variable & variable, double value);
0042 
0043     // Get starting values for the coordinates or momenta:
0044     double startValue(const Genfun::Variable & component) const ;
0045 
0046 
0047     // Each component has N-dimensions:
0048     class Component {
0049       
0050     public:
0051       
0052       // Access to the ith element;
0053       Genfun::Variable operator [] (unsigned int i) const; 
0054      
0055     private:
0056 
0057       // Constructor:
0058       Component(unsigned int NDIM, bool isMomentum);
0059 
0060       // Destructor:
0061       ~Component();
0062       
0063       // Illegal operations:
0064       Component (const Component &);
0065       Component & operator=(const Component &);
0066 
0067       // Internal clockwork;
0068       class Clockwork;
0069       Clockwork *c;
0070       friend class PhaseSpace; 
0071 
0072     };
0073       
0074   private:
0075 
0076     Component _coordinates; 
0077     Component _momenta;
0078     std::vector<double> _q0;
0079     std::vector<double> _p0;
0080     unsigned int DIM;
0081   };
0082 
0083 }
0084 #endif
0085