41template <
class T_Equation,
unsigned int N>
55 fEquation_Rhs->T_Equation::RightHandSide(y, dydx);
81 T_Equation* fEquation_Rhs;
84template <
class T_Equation,
unsigned int N >
88 EqRhs, numberOfVariables > 8 ? numberOfVariables : 8 )
89 , fEquation_Rhs(EqRhs)
94 G4Exception(
"G4TClassicalRK4: constructor",
"GeomField0001",
99template <
class T_Equation,
unsigned int N >
113 G4double hh = h * 0.5, h6 = h / 6.0;
121 for(
unsigned int i = 0; i < N; ++i)
123 yt[i] = yIn[i] + hh * dydx[i];
125 this->RightHandSideInl(yt, dydxt);
127 for(
unsigned int i = 0; i < N; ++i)
129 yt[i] = yIn[i] + hh * dydxt[i];
131 this->RightHandSideInl(yt, dydxm);
133 for(
unsigned int i = 0; i < N; ++i)
135 yt[i] = yIn[i] + h * dydxm[i];
136 dydxm[i] += dydxt[i];
138 this->RightHandSideInl(yt, dydxt);
140 for(
unsigned int i = 0; i < N; ++i)
142 yOut[i] = yIn[i] + h6 * (dydx[i] + dydxt[i] +
147 this->NormalisePolarizationVector(yOut);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4TClassicalRK4(T_Equation *EqRhs, G4int numberOfVariables=8)
virtual ~G4TClassicalRK4()
void DumbStepper(const G4double yIn[], const G4double dydx[], G4double h, G4double yOut[])
static constexpr G4double IntegratorCorrection
void RightHandSideInl(G4double y[], G4double dydx[])
G4TClassicalRK4 & operator=(const G4TClassicalRK4 &)=delete
G4TClassicalRK4(const G4TClassicalRK4 &)=delete
G4int IntegratorOrder() const