CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // This is a class the creates an N-Dimensional Phase Space // 00002 00003 // It is for use in computing the time development of classical // 00004 // Hamiltonian Systems. // 00005 00006 // Joe Boudreau October 2011 // 00007 00008 //--------------------------------------------------------------// 00009 00010 #ifndef _PHASE_SPACE_ 00011 #define _PHASE_SPACE_ 00012 #include "CLHEP/GenericFunctions/Variable.hh" 00013 #include <vector> 00014 00015 namespace Classical { 00016 00017 class PhaseSpace { 00018 00019 00020 public: 00021 00022 // A component is like a vector: of coordinates or momenta: 00023 class Component; 00024 00025 // constructor 00026 PhaseSpace(unsigned int NDIM); 00027 00028 // Destructor 00029 ~PhaseSpace(); 00030 00031 // Get the dimensionality: 00032 unsigned int dim() const; 00033 00034 // Get the coordinates: 00035 const Component & coordinates() const; 00036 00037 // Get the momenta: 00038 const Component & momenta() const; 00039 00040 // Set starting values for the coordinates or momenta: 00041 void start (const Genfun::Variable & variable, double value); 00042 00043 // Get starting values for the coordinates or momenta: 00044 double startValue(const Genfun::Variable & component) const ; 00045 00046 00047 // Each component has N-dimensions: 00048 class Component { 00049 00050 public: 00051 00052 // Access to the ith element; 00053 Genfun::Variable operator [] (unsigned int i) const; 00054 00055 private: 00056 00057 // Constructor: 00058 Component(unsigned int NDIM, bool isMomentum); 00059 00060 // Destructor: 00061 ~Component(); 00062 00063 // Illegal operations: 00064 Component (const Component &); 00065 Component & operator=(const Component &); 00066 00067 // Internal clockwork; 00068 class Clockwork; 00069 Clockwork *c; 00070 friend class PhaseSpace; 00071 00072 }; 00073 00074 private: 00075 00076 Component _coordinates; 00077 Component _momenta; 00078 std::vector<double> _q0; 00079 std::vector<double> _p0; 00080 unsigned int DIM; 00081 }; 00082 00083 } 00084 #endif 00085