50 G4int noIntegrationVariables,
54 const G4int numberOfVariables = noIntegrationVariables;
59 ak2 =
new G4double[numberOfVariables];
60 ak3 =
new G4double[numberOfVariables];
61 ak4 =
new G4double[numberOfVariables];
62 ak5 =
new G4double[numberOfVariables];
63 ak6 =
new G4double[numberOfVariables];
64 ak7 =
new G4double[numberOfVariables];
65 ak8 =
new G4double[numberOfVariables];
66 ak9 =
new G4double[numberOfVariables];
67 ak10 =
new G4double[numberOfVariables];
68 ak11 =
new G4double[numberOfVariables];
69 ak12 =
new G4double[numberOfVariables];
70 ak13 =
new G4double[numberOfVariables];
72 const G4int numStateVars =
std::max(noIntegrationVariables, 8);
76 fLastInitialVector =
new G4double[numStateVars] ;
77 fLastFinalVector =
new G4double[numStateVars] ;
79 fLastDyDx =
new G4double[numStateVars];
81 fMidVector =
new G4double[numStateVars];
82 fMidError =
new G4double[numStateVars];
109 delete[] fLastInitialVector;
110 delete[] fLastFinalVector;
164 b71 = 29443841.0/614563906.0 ,
167 b74 = 77736538.0/692538347.0 ,
168 b75 = -28693883.0/1125000000.0 ,
169 b76 = 23124283.0/1800000000.0 ,
171 b81 = 16016141.0/946692911.0 ,
174 b84 = 61564180.0/158732637.0 ,
175 b85 = 22789713.0/633445777.0 ,
176 b86 = 545815736.0/2771057229.0 ,
177 b87 = -180193667.0/1043307555.0 ,
179 b91 = 39632708.0/573591083.0 ,
182 b94 = -433636366.0/683701615.0 ,
183 b95 = -421739975.0/2616292301.0 ,
184 b96 = 100302831.0/723423059.0 ,
185 b97 = 790204164.0/839813087.0 ,
186 b98 = 800635310.0/3783071287.0 ,
188 b101 = 246121993.0/1340847787.0 ,
191 b104 = -37695042795.0/15268766246.0 ,
192 b105 = -309121744.0/1061227803.0 ,
193 b106 = -12992083.0/490766935.0 ,
194 b107 = 6005943493.0/2108947869.0 ,
195 b108 = 393006217.0/1396673457.0 ,
196 b109 = 123872331.0/1001029789.0 ,
198 b111 = -1028468189.0/846180014.0 ,
201 b114 = 8478235783.0/508512852.0 ,
202 b115 = 1311729495.0/1432422823.0 ,
203 b116 = -10304129995.0/1701304382.0 ,
204 b117 = -48777925059.0/3047939560.0 ,
205 b118 = 15336726248.0/1032824649.0 ,
206 b119 = -45442868181.0/3398467696.0 ,
207 b1110 = 3065993473.0/597172653.0 ,
209 b121 = 185892177.0/718116043.0 ,
212 b124 = -3185094517.0/667107341.0 ,
213 b125 = -477755414.0/1098053517.0 ,
214 b126 = -703635378.0/230739211.0 ,
215 b127 = 5731566787.0/1027545527.0 ,
216 b128 = 5232866602.0/850066563.0 ,
217 b129 = -4093664535.0/808688257.0 ,
218 b1210 = 3962137247.0/1805957418.0 ,
219 b1211 = 65686358.0/487910083.0 ,
221 b131 = 403863854.0/491063109.0 ,
224 b134 = -5068492393.0/434740067.0 ,
225 b135 = -411421997.0/543043805.0 ,
226 b136 = 652783627.0/914296604.0 ,
227 b137 = 11173962825.0/925320556.0 ,
228 b138 = -13158990841.0/6184727034.0 ,
229 b139 = 3936647629.0/1978049680.0 ,
230 b1310 = -160528059.0/685178525.0 ,
231 b1311 = 248638103.0/1413531060.0 ,
234 c1 = 14005451.0/335480064.0 ,
239 c6 = -59238493.0/1068277825.0 ,
240 c7 = 181606767.0/758867731.0 ,
241 c8 = 561292985.0/797845732.0 ,
242 c9 = -1041891430.0/1371343529.0 ,
243 c10 = 760417239.0/1151165299.0 ,
244 c11 = 118820643.0/751138087.0 ,
245 c12 = - 528747749.0/2220607170.0 ,
248 c_1 = 13451932.0/455176623.0 ,
253 c_6 = -808719846.0/976000145.0 ,
254 c_7 = 1757004468.0/5645159321.0 ,
255 c_8 = 656045339.0/265891186.0 ,
256 c_9 = -3867574721.0/1518517206.0 ,
257 c_10 = 465885868.0/322736535.0 ,
258 c_11 = 53011238.0/667516719.0 ,
281 yOut[7] = yTemp[7] = yIn[7];
284 for(i=0;i<numberOfVariables;i++)
292 for(i=0;i<numberOfVariables;i++)
294 yTemp[i] = yIn[i] + b21*Step*dydx[i] ;
298 for(i=0;i<numberOfVariables;i++)
300 yTemp[i] = yIn[i] + Step*(b31*dydx[i] + b32*ak2[i]) ;
304 for(i=0;i<numberOfVariables;i++)
306 yTemp[i] = yIn[i] + Step*(b41*dydx[i] + b42*ak2[i] + b43*ak3[i]) ;
310 for(i=0;i<numberOfVariables;i++)
312 yTemp[i] = yIn[i] + Step*(b51*dydx[i] + b52*ak2[i] + b53*ak3[i] +
317 for(i=0;i<numberOfVariables;i++)
319 yTemp[i] = yIn[i] + Step*(b61*dydx[i] + b62*ak2[i] + b63*ak3[i] +
320 b64*ak4[i] + b65*ak5[i]) ;
324 for(i=0;i<numberOfVariables;i++)
326 yTemp[i] = yIn[i] + Step*(b71*dydx[i] + b72*ak2[i] + b73*ak3[i] +
327 b74*ak4[i] + b75*ak5[i] + b76*ak6[i]);
331 for(i=0;i<numberOfVariables;i++)
333 yTemp[i] = yIn[i] + Step*(b81*dydx[i] + b82*ak2[i] + b83*ak3[i] +
334 b84*ak4[i] + b85*ak5[i] + b86*ak6[i] +
339 for(i=0;i<numberOfVariables;i++)
341 yTemp[i] = yIn[i] + Step*(b91*dydx[i] + b92*ak2[i] + b93*ak3[i] +
342 b94*ak4[i] + b95*ak5[i] + b96*ak6[i] +
343 b97*ak7[i] + b98*ak8[i] );
347 for(i=0;i<numberOfVariables;i++)
349 yTemp[i] = yIn[i] + Step*(b101*dydx[i] + b102*ak2[i] + b103*ak3[i] +
350 b104*ak4[i] + b105*ak5[i] + b106*ak6[i] +
351 b107*ak7[i] + b108*ak8[i] + b109*ak9[i]);
355 for(i=0;i<numberOfVariables;i++)
357 yTemp[i] = yIn[i] + Step*(b111*dydx[i] + b112*ak2[i] + b113*ak3[i] +
358 b114*ak4[i] + b115*ak5[i] + b116*ak6[i] +
359 b117*ak7[i] + b118*ak8[i] + b119*ak9[i] +
364 for(i=0;i<numberOfVariables;i++)
366 yTemp[i] = yIn[i] + Step*(b121*dydx[i] + b122*ak2[i] + b123*ak3[i] +
367 b124*ak4[i] + b125*ak5[i] + b126*ak6[i] +
368 b127*ak7[i] + b128*ak8[i] + b129*ak9[i] +
369 b1210*ak10[i] + b1211*ak11[i]);
373 for(i=0;i<numberOfVariables;i++)
375 yTemp[i] = yIn[i] + Step*(b131*dydx[i] + b132*ak2[i] + b133*ak3[i] +
376 b134*ak4[i] + b135*ak5[i] + b136*ak6[i] +
377 b137*ak7[i] + b138*ak8[i] + b139*ak9[i] +
378 b1310*ak10[i] + b1311*ak11[i] + b1312*ak12[i]);
382 for(i=0;i<numberOfVariables;i++)
386 yOut[i] = yIn[i] + Step*(c1*dydx[i] +
389 c7*ak7[i] + c8*ak8[i] +c9*ak9[i] + c10*ak10[i]
390 + c11*ak11[i] + c12*ak12[i] + c13*ak13[i]) ;
395 yErr[i] = Step*(dc1*dydx[i] +
397 + dc6*ak6[i] + dc7*ak7[i] + dc8*ak8[i]
398 + dc9*ak9[i] + dc10*ak10[i] + dc11*ak11[i] + dc12*ak12[i]
401 fLastInitialVector[i] = yIn[i] ;
402 fLastFinalVector[i] = yOut[i];
403 fLastDyDx[i] = dydx[i];
408 fLastStepLength = Step;
423 fLastInitialVector[1], fLastInitialVector[2]);
425 fLastFinalVector[1], fLastFinalVector[2]);
429 fAuxStepper->
Stepper( fLastInitialVector, fLastDyDx, 0.5 * fLastStepLength,
430 fMidVector, fMidError );
432 midPoint =
G4ThreeVector( fMidVector[0], fMidVector[1], fMidVector[2]);
438 if (initialPoint != finalPoint)
441 distChord = distLine;
445 distChord = (midPoint-initialPoint).mag();
CLHEP::Hep3Vector G4ThreeVector
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
G4DormandPrinceRK78(G4EquationOfMotion *EqRhs, G4int numberOfVariables=6, G4bool primary=true)
G4int GetNumberOfVariables() const
G4double DistChord() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void RightHandSide(const double y[], double dydx[])