44 if( numStateVariables < 8 )
46 std::ostringstream message;
47 message <<
"The number of State variables at least 8 " <<
G4endl
48 <<
"Instead it is - numStateVariables= " << numStateVariables;
49 G4Exception(
"G4ConstRK4::G4ConstRK4()",
"GeomField0002",
62 Field[0]=0.; Field[1]=0.; Field[2]=0.;
98 yt[5] = yIn[5] + hh*dydx[5] ;
99 yt[4] = yIn[4] + hh*dydx[4] ;
100 yt[3] = yIn[3] + hh*dydx[3] ;
101 yt[2] = yIn[2] + hh*dydx[2] ;
102 yt[1] = yIn[1] + hh*dydx[1] ;
103 yt[0] = yIn[0] + hh*dydx[0] ;
107 yt[5] = yIn[5] + hh*dydxt[5] ;
108 yt[4] = yIn[4] + hh*dydxt[4] ;
109 yt[3] = yIn[3] + hh*dydxt[3] ;
110 yt[2] = yIn[2] + hh*dydxt[2] ;
111 yt[1] = yIn[1] + hh*dydxt[1] ;
112 yt[0] = yIn[0] + hh*dydxt[0] ;
117 yt[5] = yIn[5] + h*dydxm[5] ;
118 dydxm[5] += dydxt[5] ;
119 yt[4] = yIn[4] + h*dydxm[4] ;
120 dydxm[4] += dydxt[4] ;
121 yt[3] = yIn[3] + h*dydxm[3] ;
122 dydxm[3] += dydxt[3] ;
123 yt[2] = yIn[2] + h*dydxm[2] ;
124 dydxm[2] += dydxt[2] ;
125 yt[1] = yIn[1] + h*dydxm[1] ;
126 dydxm[1] += dydxt[1] ;
127 yt[0] = yIn[0] + h*dydxm[0] ;
128 dydxm[0] += dydxt[0] ;
132 yOut[5] = yIn[5]+h6*(dydx[5]+dydxt[5]+2.0*dydxm[5]);
133 yOut[4] = yIn[4]+h6*(dydx[4]+dydxt[4]+2.0*dydxm[4]);
134 yOut[3] = yIn[3]+h6*(dydx[3]+dydxt[3]+2.0*dydxm[3]);
135 yOut[2] = yIn[2]+h6*(dydx[2]+dydxt[2]+2.0*dydxm[2]);
136 yOut[1] = yIn[1]+h6*(dydx[1]+dydxt[1]+2.0*dydxm[1]);
137 yOut[0] = yIn[0]+h6*(dydx[0]+dydxt[0]+2.0*dydxm[0]);
152 const G4int nvar = 6;
161 for (i=0; i<maxvar; ++i) { yInitial[i]= yInput[i]; }
164 for (i=nvar; i<maxvar; ++i) { yOutput[i]= yInput[i]; }
167 yMiddle[7] = yInput[7];
168 yOneStep[7] = yInput[7];
183 fMidPoint =
G4ThreeVector( yMiddle[0], yMiddle[1], yMiddle[2]);
188 for(i=0; i<nvar; ++i)
190 yError [i] = yOutput[i] - yOneStep[i] ;
191 yOutput[i] += yError[i]*correction ;
196 fInitialPoint =
G4ThreeVector( yInitial[0], yInitial[1], yInitial[2]);
197 fFinalPoint =
G4ThreeVector( yOutput[0], yOutput[1], yOutput[2]);
215 if (fInitialPoint != fFinalPoint)
220 distChord = distLine;
224 distChord = (fMidPoint-fInitialPoint).mag();
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
void DumbStepper(const G4double yIn[], const G4double dydx[], G4double h, G4double yOut[])
G4int IntegratorOrder() const
void RightHandSideConst(const G4double y[], G4double dydx[]) const
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
G4ConstRK4(G4Mag_EqRhs *EquationMotion, G4int numberOfStateVariables=8)
void GetConstField(const G4double y[], G4double Field[])
G4double DistChord() const
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
G4int GetNumberOfStateVariables() const