CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
CMSTDormandPrince45< T_Equation, N > Class Template Reference

#include <CMSTDormandPrince45.h>

Inheritance diagram for CMSTDormandPrince45< T_Equation, N >:

Public Member Functions

 CMSTDormandPrince45 (T_Equation *equation)
 
 CMSTDormandPrince45 (T_Equation *equation, G4int numVar)
 
G4double DistChord () const final
 
T_Equation * GetSpecificEquation ()
 
const field_utils::ShortState< N > & GetYOut () const
 
G4int IntegratorOrder () const override
 
void Interpolate (G4double tau, G4double yOut[]) const
 
void Interpolate4thOrder (G4double yOut[], G4double tau) const
 
void Interpolate5thOrder (G4double yOut[], G4double tau) const
 
void RightHandSideInl (const G4double y[], G4double inv_momentum_magnitude, G4double dydx[])
 
void SetupInterpolation ()
 
void SetupInterpolation5thOrder ()
 
void Stepper (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[]) final
 
void Stepper (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[], G4double dydxOutput[])
 
void StepWithError (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[])
 
void StepWithFinalDerivate (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[], G4double dydxOutput[])
 

Static Public Attributes

static constexpr int N8 = N > 8 ? N : 8
 

Private Attributes

field_utils::ShortState< Nak2
 
field_utils::ShortState< Nak3
 
field_utils::ShortState< Nak4
 
field_utils::ShortState< Nak5
 
field_utils::ShortState< Nak6
 
field_utils::ShortState< Nak7
 
field_utils::ShortState< Nak8
 
field_utils::ShortState< Nak9
 
field_utils::ShortState< NfdydxIn
 
T_Equation * fEquation_Rhs
 
G4double fLastStepLength = -1.0
 
field_utils::ShortState< N8fyIn
 
field_utils::ShortState< NfyOut
 

Detailed Description

template<class T_Equation, unsigned int N = 6>
class CMSTDormandPrince45< T_Equation, N >

Definition at line 27 of file CMSTDormandPrince45.h.

Constructor & Destructor Documentation

◆ CMSTDormandPrince45() [1/2]

template<class T_Equation , unsigned int N>
CMSTDormandPrince45< T_Equation, N >::CMSTDormandPrince45 ( T_Equation *  equation)

Definition at line 129 of file CMSTDormandPrince45.h.

130  : G4MagIntegratorStepper(dynamic_cast<G4EquationOfMotion*>(equation), N), fEquation_Rhs(equation) {
131  // assert( dynamic_cast<G4EquationOfMotion*>(equation) != nullptr );
132  if (dynamic_cast<G4EquationOfMotion*>(equation) == nullptr) {
133  G4Exception("G4TDormandPrince745CMS: constructor",
134  "GeomField0001",
135  FatalException,
136  "T_Equation is not an G4EquationOfMotion.");
137  }
138 
139  /***
140  assert( equation->GetNumberOfVariables == N );
141  if( equation->GetNumberOfVariables != N ){
142  G4ExceptionDescription msg;
143  msg << "Equation has an incompatible number of variables." ;
144  msg << " template N = " << N << " equation-Nvar= "
145  << equation->GetNumberOfVariables;
146  G4Exception("G4TCashKarpRKF45: constructor", "GeomField0001",
147  FatalException, msg );
148  } ****/
149 }
#define N
Definition: blowfish.cc:9

◆ CMSTDormandPrince45() [2/2]

template<class T_Equation , unsigned int N>
CMSTDormandPrince45< T_Equation, N >::CMSTDormandPrince45 ( T_Equation *  equation,
G4int  numVar 
)

Definition at line 152 of file CMSTDormandPrince45.h.

References cms::cuda::assert(), mps_check::msg, and N.

154  if (numVar != G4int(N)) {
155  G4ExceptionDescription msg;
156  msg << "Equation has an incompatible number of variables.";
157  msg << " template N = " << N << " argument numVar = " << numVar;
158  // << " equation-Nvar= " << equation->GetNumberOfVariables(); // --> Expected later
159  G4Exception("G4TCashKarpRKF45CMS: constructor", "GeomField0001", FatalErrorInArgument, msg);
160  }
161  assert(numVar == N);
162 }
assert(be >=bs)
#define N
Definition: blowfish.cc:9
tuple msg
Definition: mps_check.py:286

Member Function Documentation

◆ DistChord()

template<class T_Equation , unsigned int N>
G4double CMSTDormandPrince45< T_Equation, N >::DistChord ( ) const
final

Definition at line 278 of file CMSTDormandPrince45.h.

References mps_fire::end, hcalSimParameters_cfi::hf1, mps_fire::i, and PixelTestBeamValidation_cfi::Position.

278  {
279  // Coefficients were taken from Some Practical Runge-Kutta Formulas
280  // by Lawrence F. Shampine, page 149, c*
281  //
282  const G4double hf1 = 6025192743.0 / 30085553152.0, hf3 = 51252292925.0 / 65400821598.0,
283  hf4 = -2691868925.0 / 45128329728.0, hf5 = 187940372067.0 / 1594534317056.0,
284  hf6 = -1776094331.0 / 19743644256.0, hf7 = 11237099.0 / 235043384.0;
285 
286  G4ThreeVector mid;
287 
288  for (unsigned int i = 0; i < 3; ++i) {
289  mid[i] =
290  fyIn[i] + 0.5 * fLastStepLength *
291  (hf1 * fdydxIn[i] + hf3 * ak3[i] + hf4 * ak4[i] + hf5 * ak5[i] + hf6 * ak6[i] + hf7 * ak7[i]);
292  }
293 
294  const G4ThreeVector begin = makeVector(fyIn, field_utils::Value3D::Position);
295  const G4ThreeVector end = makeVector(fyOut, field_utils::Value3D::Position);
296 
297  return G4LineSection::Distline(mid, begin, end);
298 }
field_utils::ShortState< N > ak7
field_utils::ShortState< N > ak3
field_utils::ShortState< N > fyOut
field_utils::ShortState< N > ak5
field_utils::ShortState< N > ak4
field_utils::ShortState< N > fdydxIn
field_utils::ShortState< N8 > fyIn
field_utils::ShortState< N > ak6

◆ GetSpecificEquation()

template<class T_Equation , unsigned int N = 6>
T_Equation* CMSTDormandPrince45< T_Equation, N >::GetSpecificEquation ( )
inline

Definition at line 75 of file CMSTDormandPrince45.h.

References CMSTDormandPrince45< T_Equation, N >::fEquation_Rhs.

75 { return fEquation_Rhs; }

◆ GetYOut()

template<class T_Equation , unsigned int N = 6>
const field_utils::ShortState<N>& CMSTDormandPrince45< T_Equation, N >::GetYOut ( ) const
inline

Definition at line 54 of file CMSTDormandPrince45.h.

References CMSTDormandPrince45< T_Equation, N >::fyOut.

54 { return fyOut; }
field_utils::ShortState< N > fyOut

◆ IntegratorOrder()

template<class T_Equation , unsigned int N = 6>
G4int CMSTDormandPrince45< T_Equation, N >::IntegratorOrder ( ) const
inlineoverride

Definition at line 52 of file CMSTDormandPrince45.h.

52 { return 4; }

◆ Interpolate()

template<class T_Equation , unsigned int N = 6>
void CMSTDormandPrince45< T_Equation, N >::Interpolate ( G4double  tau,
G4double  yOut[] 
) const
inline

Definition at line 47 of file CMSTDormandPrince45.h.

References CMSTDormandPrince45< T_Equation, N >::Interpolate4thOrder(), and metsig::tau.

47 { Interpolate4thOrder(yOut, tau); }
void Interpolate4thOrder(G4double yOut[], G4double tau) const

◆ Interpolate4thOrder()

template<class T_Equation , unsigned int N>
void CMSTDormandPrince45< T_Equation, N >::Interpolate4thOrder ( G4double  yOut[],
G4double  tau 
) const

Definition at line 306 of file CMSTDormandPrince45.h.

References mps_fire::i, N, metsig::tau, jetsAK8_cff::tau2, jetsAK8_cff::tau3, and jetsAK8_cff::tau4.

Referenced by CMSTDormandPrince45< T_Equation, N >::Interpolate().

306  {
307  // const G4int numberOfVariables = GetNumberOfVariables();
308 
309  const G4double tau2 = tau * tau, tau3 = tau * tau2, tau4 = tau2 * tau2;
310 
311  const G4double bf1 =
312  1.0 / 11282082432.0 *
313  (157015080.0 * tau4 - 13107642775.0 * tau3 + 34969693132.0 * tau2 - 32272833064.0 * tau + 11282082432.0);
314 
315  const G4double bf3 =
316  -100.0 / 32700410799.0 * tau * (15701508.0 * tau3 - 914128567.0 * tau2 + 2074956840.0 * tau - 1323431896.0);
317 
318  const G4double bf4 =
319  25.0 / 5641041216.0 * tau * (94209048.0 * tau3 - 1518414297.0 * tau2 + 2460397220.0 * tau - 889289856.0);
320 
321  const G4double bf5 =
322  -2187.0 / 199316789632.0 * tau * (52338360.0 * tau3 - 451824525.0 * tau2 + 687873124.0 * tau - 259006536.0);
323 
324  const G4double bf6 =
325  11.0 / 2467955532.0 * tau * (106151040.0 * tau3 - 661884105.0 * tau2 + 946554244.0 * tau - 361440756.0);
326 
327  const G4double bf7 = 1.0 / 29380423.0 * tau * (1.0 - tau) * (8293050.0 * tau2 - 82437520.0 * tau + 44764047.0);
328 
329  for (unsigned int i = 0; i < N; ++i) {
330  yOut[i] =
331  fyIn[i] + fLastStepLength * tau *
332  (bf1 * fdydxIn[i] + bf3 * ak3[i] + bf4 * ak4[i] + bf5 * ak5[i] + bf6 * ak6[i] + bf7 * ak7[i]);
333  }
334 }
field_utils::ShortState< N > ak7
field_utils::ShortState< N > ak3
field_utils::ShortState< N > ak5
field_utils::ShortState< N > ak4
#define N
Definition: blowfish.cc:9
field_utils::ShortState< N > fdydxIn
field_utils::ShortState< N8 > fyIn
field_utils::ShortState< N > ak6

◆ Interpolate5thOrder()

template<class T_Equation , unsigned int N>
void CMSTDormandPrince45< T_Equation, N >::Interpolate5thOrder ( G4double  yOut[],
G4double  tau 
) const

Definition at line 377 of file CMSTDormandPrince45.h.

References b, mps_fire::i, dqmiolumiharvest::j, N, and metsig::tau.

377  {
378  // Define the coefficients for the polynomials
379  //
380  G4double bi[10][5];
381 
382  // COEFFICIENTS OF bi[1]
383  bi[1][0] = 1.0, bi[1][1] = -38039.0 / 7040.0, bi[1][2] = 125923.0 / 10560.0, bi[1][3] = -19683.0 / 1760.0,
384  bi[1][4] = 3303.0 / 880.0,
385  // --------------------------------------------------------
386  //
387  // COEFFICIENTS OF bi[2]
388  bi[2][0] = 0.0, bi[2][1] = 0.0, bi[2][2] = 0.0, bi[2][3] = 0.0, bi[2][4] = 0.0,
389  // --------------------------------------------------------
390  //
391  // COEFFICIENTS OF bi[3]
392  bi[3][0] = 0.0, bi[3][1] = -12500.0 / 4081.0, bi[3][2] = 205000.0 / 12243.0, bi[3][3] = -90000.0 / 4081.0,
393  bi[3][4] = 36000.0 / 4081.0,
394  // --------------------------------------------------------
395  //
396  // COEFFICIENTS OF bi[4]
397  bi[4][0] = 0.0, bi[4][1] = -3125.0 / 704.0, bi[4][2] = 25625.0 / 1056.0, bi[4][3] = -5625.0 / 176.0,
398  bi[4][4] = 1125.0 / 88.0,
399  // --------------------------------------------------------
400  //
401  // COEFFICIENTS OF bi[5]
402  bi[5][0] = 0.0, bi[5][1] = 164025.0 / 74624.0, bi[5][2] = -448335.0 / 37312.0, bi[5][3] = 295245.0 / 18656.0,
403  bi[5][4] = -59049.0 / 9328.0,
404  // --------------------------------------------------------
405  //
406  // COEFFICIENTS OF bi[6]
407  bi[6][0] = 0.0, bi[6][1] = -25.0 / 28.0, bi[6][2] = 205.0 / 42.0, bi[6][3] = -45.0 / 7.0, bi[6][4] = 18.0 / 7.0,
408  // --------------------------------------------------------
409  //
410  // COEFFICIENTS OF bi[7]
411  bi[7][0] = 0.0, bi[7][1] = -2.0 / 11.0, bi[7][2] = 73.0 / 55.0, bi[7][3] = -171.0 / 55.0, bi[7][4] = 108.0 / 55.0,
412  // --------------------------------------------------------
413  //
414  // COEFFICIENTS OF bi[8]
415  bi[8][0] = 0.0, bi[8][1] = 189.0 / 22.0, bi[8][2] = -1593.0 / 55.0, bi[8][3] = 3537.0 / 110.0,
416  bi[8][4] = -648.0 / 55.0,
417  // --------------------------------------------------------
418  //
419  // COEFFICIENTS OF bi[9]
420  bi[9][0] = 0.0, bi[9][1] = 351.0 / 110.0, bi[9][2] = -999.0 / 55.0, bi[9][3] = 2943.0 / 110.0,
421  bi[9][4] = -648.0 / 55.0;
422  // --------------------------------------------------------
423 
424  // Calculating the polynomials
425 
426  G4double b[10];
427  std::memset(b, 0.0, sizeof(b));
428 
429  G4double tauPower = 1.0;
430  for (G4int j = 0; j <= 4; ++j) {
431  for (G4int iStage = 1; iStage <= 9; ++iStage) {
432  b[iStage] += bi[iStage][j] * tauPower;
433  }
434  tauPower *= tau;
435  }
436 
437  // const G4int numberOfVariables = GetNumberOfVariables();
438  const G4double stepLen = fLastStepLength * tau;
439  for (G4int i = 0; i < N; ++i) {
440  yOut[i] = fyIn[i] + stepLen * (b[1] * fdydxIn[i] + b[2] * ak2[i] + b[3] * ak3[i] + b[4] * ak4[i] + b[5] * ak5[i] +
441  b[6] * ak6[i] + b[7] * ak7[i] + b[8] * ak8[i] + b[9] * ak9[i]);
442  }
443 }
field_utils::ShortState< N > ak7
field_utils::ShortState< N > ak3
field_utils::ShortState< N > ak9
field_utils::ShortState< N > ak5
field_utils::ShortState< N > ak8
field_utils::ShortState< N > ak4
#define N
Definition: blowfish.cc:9
double b
Definition: hdecay.h:120
field_utils::ShortState< N > fdydxIn
field_utils::ShortState< N8 > fyIn
field_utils::ShortState< N > ak2
field_utils::ShortState< N > ak6

◆ RightHandSideInl()

template<class T_Equation , unsigned int N = 6>
void CMSTDormandPrince45< T_Equation, N >::RightHandSideInl ( const G4double  y[],
G4double  inv_momentum_magnitude,
G4double  dydx[] 
)
inline

Definition at line 62 of file CMSTDormandPrince45.h.

References CMSTDormandPrince45< T_Equation, N >::fEquation_Rhs, and y.

62  {
63  fEquation_Rhs->T_Equation::TRightHandSide(y, inv_momentum_magnitude, dydx);
64  }

◆ SetupInterpolation()

template<class T_Equation , unsigned int N = 6>
void CMSTDormandPrince45< T_Equation, N >::SetupInterpolation ( )
inline

Definition at line 45 of file CMSTDormandPrince45.h.

45 {}

◆ SetupInterpolation5thOrder()

template<class T_Equation , unsigned int N>
void CMSTDormandPrince45< T_Equation, N >::SetupInterpolation5thOrder ( )

Definition at line 344 of file CMSTDormandPrince45.h.

References mps_fire::i, N, and mathSSE::sqrt().

344  {
345  // Coefficients for the additional stages
346  //
347  const G4double b81 = 6245.0 / 62208.0, b82 = 0.0, b83 = 8875.0 / 103032.0, b84 = -125.0 / 1728.0,
348  b85 = 801.0 / 13568.0, b86 = -13519.0 / 368064.0, b87 = 11105.0 / 368064.0,
349 
350  b91 = 632855.0 / 4478976.0, b92 = 0.0, b93 = 4146875.0 / 6491016.0, b94 = 5490625.0 / 14183424.0,
351  b95 = -15975.0 / 108544.0, b96 = 8295925.0 / 220286304.0, b97 = -1779595.0 / 62938944.0,
352  b98 = -805.0 / 4104.0;
353 
354  // const G4int numberOfVariables = GetNumberOfVariables();
355  field_utils::ShortState<N> yTemp;
356 
357  // Evaluate the extra stages
358  //
359  for (unsigned int i = 0; i < N; ++i) {
360  yTemp[i] = fyIn[i] + fLastStepLength * (b81 * fdydxIn[i] + b82 * ak2[i] + b83 * ak3[i] + b84 * ak4[i] +
361  b85 * ak5[i] + b86 * ak6[i] + b87 * ak7[i]);
362  }
363  G4double momentum_mag_square = yTemp[3] * yTemp[3] + yTemp[4] * yTemp[4] + yTemp[5] * yTemp[5];
364  G4double inv_momentum_magnitude = 1.0 / std::sqrt(momentum_mag_square);
365  RightHandSideInl(yTemp, inv_momentum_magnitude, ak8); // 8th Stage
366 
367  for (unsigned int i = 0; i < N; ++i) {
368  yTemp[i] = fyIn[i] + fLastStepLength * (b91 * fdydxIn[i] + b92 * ak2[i] + b93 * ak3[i] + b94 * ak4[i] +
369  b95 * ak5[i] + b96 * ak6[i] + b97 * ak7[i] + b98 * ak8[i]);
370  }
371  RightHandSideInl(yTemp, inv_momentum_magnitude, ak9); // 9th Stage
372 }
field_utils::ShortState< N > ak7
field_utils::ShortState< N > ak3
void RightHandSideInl(const G4double y[], G4double inv_momentum_magnitude, G4double dydx[])
field_utils::ShortState< N > ak9
field_utils::ShortState< N > ak5
T sqrt(T t)
Definition: SSEVec.h:19
field_utils::ShortState< N > ak8
field_utils::ShortState< N > ak4
#define N
Definition: blowfish.cc:9
field_utils::ShortState< N > fdydxIn
field_utils::ShortState< N8 > fyIn
field_utils::ShortState< N > ak2
field_utils::ShortState< N > ak6

◆ Stepper() [1/2]

template<class T_Equation , unsigned int N>
void CMSTDormandPrince45< T_Equation, N >::Stepper ( const G4double  yInput[],
const G4double  dydx[],
G4double  hstep,
G4double  yOutput[],
G4double  yError[] 
)
inlinefinal

Definition at line 269 of file CMSTDormandPrince45.h.

References cms::cuda::assert().

270  {
271  assert(yOutput != yInput);
272  assert(yError != yInput);
273 
274  StepWithError(yInput, dydx, Step, yOutput, yError);
275 }
assert(be >=bs)
void StepWithError(const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[])

◆ Stepper() [2/2]

template<class T_Equation , unsigned int N = 6>
void CMSTDormandPrince45< T_Equation, N >::Stepper ( const G4double  yInput[],
const G4double  dydx[],
G4double  hstep,
G4double  yOutput[],
G4double  yError[],
G4double  dydxOutput[] 
)
inline

Definition at line 66 of file CMSTDormandPrince45.h.

References CMSTDormandPrince45< T_Equation, N >::StepWithFinalDerivate().

71  {
72  StepWithFinalDerivate(yInput, dydx, hstep, yOutput, yError, dydxOutput);
73  }
void StepWithFinalDerivate(const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[], G4double dydxOutput[])

◆ StepWithError()

template<class T_Equation , unsigned int N>
void CMSTDormandPrince45< T_Equation, N >::StepWithError ( const G4double  yInput[],
const G4double  dydx[],
G4double  hstep,
G4double  yOutput[],
G4double  yError[] 
)
inline

Definition at line 182 of file CMSTDormandPrince45.h.

References b64, MillePedeFileConverter_cfg::e, mps_fire::i, N, and mathSSE::sqrt().

183  {
184  // The parameters of the Butcher tableu
185  //
186  constexpr G4double b21 = 0.2, b31 = 3.0 / 40.0, b32 = 9.0 / 40.0, b41 = 44.0 / 45.0, b42 = -56.0 / 15.0,
187  b43 = 32.0 / 9.0,
188 
189  b51 = 19372.0 / 6561.0, b52 = -25360.0 / 2187.0, b53 = 64448.0 / 6561.0, b54 = -212.0 / 729.0,
190 
191  b61 = 9017.0 / 3168.0, b62 = -355.0 / 33.0, b63 = 46732.0 / 5247.0, b64 = 49.0 / 176.0,
192  b65 = -5103.0 / 18656.0,
193 
194  b71 = 35.0 / 384.0, b72 = 0., b73 = 500.0 / 1113.0, b74 = 125.0 / 192.0, b75 = -2187.0 / 6784.0,
195  b76 = 11.0 / 84.0,
196 
197  //Sum of columns, sum(bij) = ei
198  // e1 = 0. ,
199  // e2 = 1.0/5.0 ,
200  // e3 = 3.0/10.0 ,
201  // e4 = 4.0/5.0 ,
202  // e5 = 8.0/9.0 ,
203  // e6 = 1.0 ,
204  // e7 = 1.0 ,
205 
206  // Difference between the higher and the lower order method coeff. :
207  // b7j are the coefficients of higher order
208 
209  dc1 = -(b71 - 5179.0 / 57600.0), dc2 = -(b72 - .0), dc3 = -(b73 - 7571.0 / 16695.0), dc4 = -(b74 - 393.0 / 640.0),
210  dc5 = -(b75 + 92097.0 / 339200.0), dc6 = -(b76 - 187.0 / 2100.0), dc7 = -(-1.0 / 40.0);
211 
212  // const G4int numberOfVariables = GetNumberOfVariables();
213  // The number of variables to be integrated over
214  field_utils::ShortState<N8> yTemp;
215 
216  yOut[7] = yTemp[7] = fyIn[7] = yInput[7]; // Pass along the time - used in RightHandSide
217 
218  // Saving yInput because yInput and yOut can be aliases for same array
219  //
220  for (unsigned int i = 0; i < N; ++i) {
221  fyIn[i] = yInput[i];
222  yTemp[i] = yInput[i] + b21 * hstep * dydx[i];
223  }
224  G4double momentum_mag_square = yTemp[3] * yTemp[3] + yTemp[4] * yTemp[4] + yTemp[5] * yTemp[5];
225  G4double inv_momentum_magnitude = 1.0 / std::sqrt(momentum_mag_square);
226  RightHandSideInl(yTemp, inv_momentum_magnitude, ak2); // 2nd stage
227 
228  for (unsigned int i = 0; i < N; ++i) {
229  yTemp[i] = fyIn[i] + hstep * (b31 * dydx[i] + b32 * ak2[i]);
230  }
231  RightHandSideInl(yTemp, inv_momentum_magnitude, ak3); // 3rd stage
232 
233  for (unsigned int i = 0; i < N; ++i) {
234  yTemp[i] = fyIn[i] + hstep * (b41 * dydx[i] + b42 * ak2[i] + b43 * ak3[i]);
235  }
236  RightHandSideInl(yTemp, inv_momentum_magnitude, ak4); // 4th stage
237 
238  for (unsigned int i = 0; i < N; ++i) {
239  yTemp[i] = fyIn[i] + hstep * (b51 * dydx[i] + b52 * ak2[i] + b53 * ak3[i] + b54 * ak4[i]);
240  }
241  RightHandSideInl(yTemp, inv_momentum_magnitude, ak5); // 5th stage
242 
243  for (unsigned int i = 0; i < N; ++i) {
244  yTemp[i] = fyIn[i] + hstep * (b61 * dydx[i] + b62 * ak2[i] + b63 * ak3[i] + b64 * ak4[i] + b65 * ak5[i]);
245  }
246  RightHandSideInl(yTemp, inv_momentum_magnitude, ak6); // 6th stage
247 
248  for (unsigned int i = 0; i < N; ++i) {
249  yOut[i] =
250  fyIn[i] + hstep * (b71 * dydx[i] + b72 * ak2[i] + b73 * ak3[i] + b74 * ak4[i] + b75 * ak5[i] + b76 * ak6[i]);
251  }
252  RightHandSideInl(yOut, inv_momentum_magnitude, ak7); // 7th and Final stage
253 
254  for (unsigned int i = 0; i < N; ++i) {
255  yErr[i] = hstep * (dc1 * dydx[i] + dc2 * ak2[i] + dc3 * ak3[i] + dc4 * ak4[i] + dc5 * ak5[i] + dc6 * ak6[i] +
256  dc7 * ak7[i]) +
257  1.5e-18;
258 
259  // Store Input and Final values, for possible use in calculating chord
260  //
261  fyOut[i] = yOut[i];
262  fdydxIn[i] = dydx[i];
263  }
264 
265  fLastStepLength = hstep;
266 }
static const signed char b64[0x100]
Definition: base64.cc:208
field_utils::ShortState< N > ak7
field_utils::ShortState< N > ak3
field_utils::ShortState< N > fyOut
void RightHandSideInl(const G4double y[], G4double inv_momentum_magnitude, G4double dydx[])
field_utils::ShortState< N > ak5
T sqrt(T t)
Definition: SSEVec.h:19
field_utils::ShortState< N > ak4
#define N
Definition: blowfish.cc:9
field_utils::ShortState< N > fdydxIn
field_utils::ShortState< N8 > fyIn
field_utils::ShortState< N > ak2
field_utils::ShortState< N > ak6

◆ StepWithFinalDerivate()

template<class T_Equation , unsigned int N>
void CMSTDormandPrince45< T_Equation, N >::StepWithFinalDerivate ( const G4double  yInput[],
const G4double  dydx[],
G4double  hstep,
G4double  yOutput[],
G4double  yError[],
G4double  dydxOutput[] 
)
inline

Definition at line 165 of file CMSTDormandPrince45.h.

References filterCSVwithJSON::copy, and N.

Referenced by CMSTDormandPrince45< T_Equation, N >::Stepper().

170  {
171  StepWithError(yInput, dydx, hstep, yOutput, yError);
172  field_utils::copy(dydxOutput, ak7, N);
173 }
field_utils::ShortState< N > ak7
void StepWithError(const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[])
#define N
Definition: blowfish.cc:9

Member Data Documentation

◆ ak2

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak2
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak3

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak3
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak4

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak4
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak5

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak5
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak6

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak6
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak7

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak7
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak8

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak8
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ ak9

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::ak9
private

Definition at line 80 of file CMSTDormandPrince45.h.

◆ fdydxIn

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::fdydxIn
private

Definition at line 82 of file CMSTDormandPrince45.h.

◆ fEquation_Rhs

template<class T_Equation , unsigned int N = 6>
T_Equation* CMSTDormandPrince45< T_Equation, N >::fEquation_Rhs
private

◆ fLastStepLength

template<class T_Equation , unsigned int N = 6>
G4double CMSTDormandPrince45< T_Equation, N >::fLastStepLength = -1.0
private

Definition at line 88 of file CMSTDormandPrince45.h.

◆ fyIn

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N8> CMSTDormandPrince45< T_Equation, N >::fyIn
private

Definition at line 81 of file CMSTDormandPrince45.h.

◆ fyOut

template<class T_Equation , unsigned int N = 6>
field_utils::ShortState<N> CMSTDormandPrince45< T_Equation, N >::fyOut
private

Definition at line 82 of file CMSTDormandPrince45.h.

Referenced by CMSTDormandPrince45< T_Equation, N >::GetYOut().

◆ N8

template<class T_Equation , unsigned int N = 6>
constexpr int CMSTDormandPrince45< T_Equation, N >::N8 = N > 8 ? N : 8
static

Definition at line 77 of file CMSTDormandPrince45.h.