Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:02

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4ClassicalRK4
0027 //
0028 // Class description:
0029 //
0030 // Integrate the equations of the motion of a particle in a magnetic field
0031 // using the classical 4th Runge-Kutta method.
0032 
0033 // Created: J.Apostolakis, V.Grichine - 30.01.1997
0034 // -------------------------------------------------------------------
0035 #ifndef G4CLASSICALRK4_HH
0036 #define G4CLASSICALRK4_HH
0037 
0038 #include "G4MagErrorStepper.hh"
0039 
0040 class G4ClassicalRK4 : public G4MagErrorStepper 
0041 {
0042   public:
0043 
0044     G4ClassicalRK4(G4EquationOfMotion* EquationMotion,
0045                    G4int numberOfVariables = 6) ;
0046 
0047     ~G4ClassicalRK4() override ;
0048 
0049     G4ClassicalRK4(const G4ClassicalRK4&) = delete;
0050     G4ClassicalRK4& operator=(const G4ClassicalRK4&) = delete;
0051       // Copy constructor and assignment operator not allowed.
0052 
0053     // A stepper that does not know about errors.
0054     // It is used by the MagErrorStepper stepper.
0055    
0056     void DumbStepper( const G4double yIn[],
0057                       const G4double dydx[],
0058                             G4double h,
0059                             G4double yOut[] ) override ;
0060       // Given values for the variables y[0,..,n-1] and their derivatives
0061       // dydx[0,...,n-1] known at x, use the classical 4th Runge-Kutta
0062       // method to advance the solution over an interval h and return the
0063       // incremented variables as yout[0,...,n-1], which not be a distinct
0064       // array from y. The user supplies the routine RightHandSide(x,y,dydx),
0065       // which returns derivatives dydx at x. The source is routine rk4 from
0066       // NRC p. 712-713 .
0067 
0068     G4int IntegratorOrder() const override { return 4; }
0069 
0070   private:
0071 
0072     void StepWithEst( const G4double  yIn[],
0073                       const G4double  dydx[],
0074                             G4double  h,
0075                             G4double  yOut[],
0076                             G4double& alpha2,
0077                             G4double& beta2,
0078                       const G4double B1[],
0079                             G4double B2[] );
0080       // No longer used. Obsolete.
0081 
0082   private:
0083 
0084     G4double *dydxm, *dydxt, *yt; // scratch space - not state 
0085 };
0086 
0087 #endif