File indexing completed on 2025-01-18 09:58:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4DORMAND_PRINCE_RK56_HH
0036 #define G4DORMAND_PRINCE_RK56_HH
0037
0038 #include "G4MagIntegratorStepper.hh"
0039
0040 class G4DormandPrinceRK56 : public G4MagIntegratorStepper
0041 {
0042 public:
0043
0044 G4DormandPrinceRK56( G4EquationOfMotion* EqRhs,
0045 G4int numberOfVariables = 6,
0046 G4bool primary = true ) ;
0047
0048 ~G4DormandPrinceRK56() override ;
0049
0050 G4DormandPrinceRK56(const G4DormandPrinceRK56&) = delete;
0051 G4DormandPrinceRK56& operator=(const G4DormandPrinceRK56&) = delete;
0052
0053 void Stepper( const G4double y[],
0054 const G4double dydx[],
0055 G4double h,
0056 G4double yout[],
0057 G4double yerr[] ) override ;
0058
0059 G4double DistChord() const override;
0060 G4int IntegratorOrder() const override { return 5; }
0061
0062 void SetupInterpolate_low( const G4double yInput[],
0063 const G4double dydx[],
0064 const G4double Step );
0065
0066
0067 void Interpolate_low( const G4double yInput[],
0068 const G4double dydx[],
0069 const G4double Step,
0070 G4double yOut[],
0071 G4double tau );
0072
0073
0074 inline void SetupInterpolation()
0075 {
0076 SetupInterpolate( fLastInitialVector, fLastDyDx, fLastStepLength);
0077 }
0078
0079 inline void SetupInterpolate( const G4double yInput[],
0080 const G4double dydx[],
0081 const G4double Step )
0082 {
0083 SetupInterpolate_low( yInput, dydx, Step);
0084 }
0085
0086 inline void Interpolate( const G4double yInput[],
0087 const G4double dydx[],
0088 const G4double Step,
0089 G4double yOut[],
0090 G4double tau )
0091 {
0092 Interpolate_low( yInput, dydx, Step, yOut, tau);
0093 }
0094
0095
0096 inline void Interpolate( G4double tau, G4double yOut[])
0097 {
0098 Interpolate( fLastInitialVector, fLastDyDx, fLastStepLength, yOut, tau );
0099 }
0100
0101 void SetupInterpolate_high( const G4double yInput[],
0102 const G4double dydx[],
0103 const G4double Step );
0104
0105 void Interpolate_high( const G4double yInput[],
0106 const G4double dydx[],
0107 const G4double Step,
0108 G4double yOut[],
0109 G4double tau );
0110
0111
0112 private:
0113
0114 G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *ak8, *ak9;
0115
0116 G4double *ak10_low, *ak10, *ak11, * ak12;
0117
0118 G4double *yTemp, *yIn;
0119
0120 G4double fLastStepLength = -1.0;
0121 G4double *fLastInitialVector, *fLastFinalVector,
0122 *fLastDyDx, *fMidVector, *fMidError;
0123
0124
0125 G4DormandPrinceRK56* fAuxStepper = nullptr;
0126 };
0127
0128 #endif