Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:35

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 _RKClassicalSolver_h__
0011 #define _RKClassicalSolver_h__
0012 #include "CLHEP/GenericFunctions/PhaseSpace.hh"
0013 #include "CLHEP/GenericFunctions/ClassicalSolver.hh"
0014 #include "CLHEP/GenericFunctions/RKIntegrator.hh"
0015 #include "CLHEP/GenericFunctions/Variable.hh"
0016 #include "CLHEP/GenericFunctions/Parameter.hh"
0017 #include <vector>
0018 
0019 namespace Classical {
0020   
0021   class RungeKuttaSolver : public Solver {
0022     
0023   public:
0024     //
0025     // Constructor--takes a hamiltonian and a point in p-space: 
0026     //
0027     RungeKuttaSolver(Genfun::GENFUNCTION H, const PhaseSpace & phaseSpace, const Genfun::RKIntegrator::RKStepper *stepper=NULL);
0028     //
0029     // Destructor:
0030     //
0031     ~RungeKuttaSolver();
0032     //
0033     // Returns the time evolution for a variable (q_i or p_i)
0034     //
0035     virtual Genfun::GENFUNCTION equationOf(const Genfun::Variable & v) const; 
0036     //
0037     // Returns the phase space 
0038     //
0039     virtual const PhaseSpace & phaseSpace() const;
0040     //
0041     // Returns the Hamiltonian (function of the 2N phase space variables). 
0042     //
0043     virtual Genfun::GENFUNCTION hamiltonian() const;
0044     //
0045     // Returns the energy (function of time).
0046     //
0047     virtual Genfun::GENFUNCTION energy() const;
0048     //
0049     // This is in the rare case that the user needs to edit starting values.
0050     // or parameterize the Hamiltonian.  Most users:  can ignore.  
0051     virtual Genfun::Parameter *takeQ0(unsigned int index);
0052     virtual Genfun::Parameter *takeP0(unsigned int index);
0053     virtual Genfun::Parameter *createControlParameter(const std::string & variableName="anon",
0054                               double defStartingValue=0.0,
0055                               double startingValueMin=0.0,
0056                               double startingValueMax=0.0) const;
0057     
0058 
0059 
0060   private:
0061     
0062     // Illegal Operations:
0063     RungeKuttaSolver (const RungeKuttaSolver &);
0064     RungeKuttaSolver & operator=(const RungeKuttaSolver &);
0065     
0066     // Clockwork 
0067     class Clockwork;
0068     Clockwork *c;
0069   };
0070   
0071 }
0072 
0073 #endif