54 G4int noIntegrationVariables,
59 const G4int numberOfVariables = noIntegrationVariables;
64 ak2 =
new G4double[numberOfVariables];
65 ak3 =
new G4double[numberOfVariables];
66 ak4 =
new G4double[numberOfVariables];
67 ak5 =
new G4double[numberOfVariables];
68 ak6 =
new G4double[numberOfVariables];
70 yTemp =
new G4double[numberOfVariables] ;
71 yIn =
new G4double[numberOfVariables] ;
73 fLastInitialVector =
new G4double[numberOfVariables] ;
74 fLastFinalVector =
new G4double[numberOfVariables] ;
75 fLastDyDx =
new G4double[numberOfVariables];
77 fMidVector =
new G4double[numberOfVariables];
78 fMidError =
new G4double[numberOfVariables];
100 delete[] fLastInitialVector;
101 delete[] fLastFinalVector;
134 b41 = 3043.0/3528.0 ,
135 b42 = -3757.0/1176.0 ,
138 b51 = 17617.0/11662.0 ,
139 b52 = -4023.0/686.0 ,
140 b53 = 9372.0/1715.0 ,
151 dc1 = 363.0/2975.0 - b61 ,
153 dc3 = 981.0/1750.0 - b63,
154 dc4 = 2709.0/4250.0 - b64 ,
155 dc5 = -3.0/10.0 - b65 ,
162 yOut[7] = yTemp[7] = yIn[7];
165 for(i=0;i<numberOfVariables;i++)
175 for(i=0;i<numberOfVariables;i++)
177 yTemp[i] = yIn[i] + b21*Step*DyDx[i] ;
181 for(i=0;i<numberOfVariables;i++)
183 yTemp[i] = yIn[i] + Step*(b31*DyDx[i] + b32*ak2[i]) ;
187 for(i=0;i<numberOfVariables;i++)
189 yTemp[i] = yIn[i] + Step*(b41*DyDx[i] + b42*ak2[i] + b43*ak3[i]) ;
193 for(i=0;i<numberOfVariables;i++)
195 yTemp[i] = yIn[i] + Step*(b51*DyDx[i] + b52*ak2[i] + b53*ak3[i] +
200 for(i=0;i<numberOfVariables;i++)
202 yOut[i] = yIn[i] + Step*(b61*DyDx[i] + b62*ak2[i] + b63*ak3[i] +
203 b64*ak4[i] + b65*ak5[i]) ;
209 for(i=0;i<numberOfVariables;i++)
212 yErr[i] = Step*(dc1*DyDx[i] + dc2*ak2[i] + dc3*ak3[i] + dc4*ak4[i] +
213 dc5*ak5[i] + dc6*ak6[i] ) ;
217 fLastInitialVector[i] = yIn[i] ;
218 fLastFinalVector[i] = yOut[i];
219 fLastDyDx[i] = DyDx[i];
224 fLastStepLength = Step;
240 fLastInitialVector[1], fLastInitialVector[2]);
242 fLastFinalVector[1], fLastFinalVector[2]);
246 fAuxStepper->
Stepper( fLastInitialVector, fLastDyDx, 0.5 * fLastStepLength,
247 fMidVector, fMidError );
249 midPoint =
G4ThreeVector( fMidVector[0], fMidVector[1], fMidVector[2]);
255 if (initialPoint != finalPoint)
258 distChord = distLine;
262 distChord = (midPoint-initialPoint).mag();
281 Interpolate( fLastInitialVector, fLastDyDx, fLastStepLength, yOut, tau );
291 bf1, bf2, bf3, bf4, bf5, bf6;
296 for(
int i=0;i<numberOfVariables;i++)
306 bf1 = -(162.0*tau_3 - 504.0*tau_2 + 551.0*tau - 238.0)/238.0 ,
308 bf3 = 27.0*tau*(27.0*tau_2 - 70.0*tau + 51.0 )/385.0 ,
309 bf4 = -27*tau*(27.0*tau_2 - 50.0*tau + 21.0)/85.0 ,
310 bf5 = 7.0*tau*(2232.0*tau_2 - 4166.0*tau + 1785.0 )/3278.0 ,
311 bf6 = tau*(tau - 1.0)*(387.0*tau - 238.0)/149.0 ;
313 for(
int i=0; i<numberOfVariables; i++){
314 yOut[i] = yIn[i] + Step*tau*(bf1*dydx[i] + bf2*ak2[i] + bf3*ak3[i] +
315 bf4*ak4[i] + bf5*ak5[i] + bf6*ak6[i] ) ;
void SetupInterpolate(const G4double yInput[], const G4double dydx[], const G4double Step)
CLHEP::Hep3Vector G4ThreeVector
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
G4double DistChord() const
void Interpolate(const G4double yInput[], const G4double dydx[], const G4double Step, G4double yOut[], G4double tau)
G4int GetNumberOfVariables() const
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
void RightHandSide(const double y[], double dydx[])
G4DoLoMcPriRK34(G4EquationOfMotion *EqRhs, G4int numberOfVariables=6, G4bool primary=true)
void SetupInterpolation()