44 : fEquation(equation), fnvar(nvar)
50 "Invalid number of variables; must be greater than zero!");
77 G4double velocity_mag = momentum_mag*(c_l)/(std::sqrt(
sqr(momentum_mag) +
sqr(restMass)));
82 hstep /= velocity_mag*CLHEP::m;
85 for(
G4int i = 0; i <3; i++ )
88 pos += hstep*velocity[i];
89 yOut[i] = pos*CLHEP::m;
101 G4double gamma = std::sqrt(
sqr(momentum_mag) +
sqr(restMass))/restMass;
103 G4double mass = (restMass/c_squared)/CLHEP::kg;
107 G4double velocity_mag = momentum_mag*(c_l)/(std::sqrt(
sqr(momentum_mag) +
sqr(restMass)));
112 hstep /= velocity_mag*CLHEP::m;
116 G4double fieldValue[6] ={0,0,0,0,0,0};
123 for(
G4int i = 0; i < 3; i++)
125 E[i] = fieldValue[i+3]/CLHEP::volt*CLHEP::meter;
126 B[i] = fieldValue[i]/CLHEP::tesla;
130 G4double qd = hstep*(charge/(2*mass*gamma));
133 G4double h_l = h[0]*h[0] + h[1]*h[1] + h[2]*h[2];
139 G4double momen_mag = (restMass*v_mag)/(std::sqrt(c_l*c_l - v_mag*v_mag));
143 for(
int i = 3; i < 6; i++)
145 yOut[i] = momen[i-3];
153 std::memcpy(dst, src,
sizeof(
G4double) * fnvar);
179 DoStep(restMass, charge, yIn, yOutAlt, hstep );
182 DoStep(restMass, charge, yIn, yMid, halfStep );
183 DoStep(restMass, charge, yMid, yOut, halfStep );
185 for(
G4int i= 0; i<fnvar; i++ )
187 yErr[i] = yOutAlt[i] - yOut[i];
G4double B(G4double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
Hep3Vector cross(const Hep3Vector &) const
void UpdateVelocity(const G4double restMass, const G4double charge, const G4double yIn[], G4double yOut[], G4double hstep) const
void DoStep(G4double restMass, G4double charge, const G4double yIn[], G4double yOut[], G4double hstep) const
void UpdatePosition(const G4double restMass, const G4double charge, const G4double yIn[], G4double yOut[], G4double hstep) const
void StepWithErrorEstimate(const G4double yIn[], G4double restMass, G4double charge, G4double hstep, G4double yOut[], G4double yErr[]) const
void StepWithMidAndErrorEstimate(const G4double yIn[], G4double restMass, G4double charge, G4double hstep, G4double yMid[], G4double yOut[], G4double yErr[]) const
void EvaluateRhsReturnB(const G4double y[], G4double dydx[], G4double Field[]) const