36#ifndef G4TCLASSICALRK4_HH
37#define G4TCLASSICALRK4_HH
48template <
class T_Equation,
unsigned int N>
64 fEquation_Rhs->T_Equation::RightHandSide(y, dydx);
84 T_Equation* fEquation_Rhs;
87template <
class T_Equation,
unsigned int N >
91 EqRhs, numberOfVariables > 8 ? numberOfVariables : 8 )
92 , fEquation_Rhs(EqRhs)
97 G4Exception(
"G4TClassicalRK4: constructor",
"GeomField0001",
102template <
class T_Equation,
unsigned int N >
116 G4double hh = h * 0.5, h6 = h / 6.0;
124 for(
unsigned int i = 0; i <
N; ++i)
126 yt[i] = yIn[i] + hh * dydx[i];
130 for(
unsigned int i = 0; i <
N; ++i)
132 yt[i] = yIn[i] + hh * dydxt[i];
136 for(
unsigned int i = 0; i <
N; ++i)
138 yt[i] = yIn[i] + h * dydxm[i];
139 dydxm[i] += dydxt[i];
143 for(
unsigned int i = 0; i <
N; ++i)
145 yOut[i] = yIn[i] + h6 * (dydx[i] + dydxt[i] +
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4EquationOfMotion is the abstract base class for the right hand size of the equation of motion of a ...
void NormalisePolarizationVector(G4double vec[12])
G4TClassicalRK4(T_Equation *EqRhs, G4int numberOfVariables=8)
~G4TClassicalRK4() override=default
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
G4TMagErrorStepper(T_Equation *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)