80{
81
82
83
84
85
86 if(hstep == 0)
87 {
88 std::ostringstream message;
89 message << "Proposed step is zero; hstep = " << hstep << " !";
92 return true;
93 }
94 if(hstep < 0)
95 {
96 std::ostringstream message;
97 message <<
"Invalid run condition." <<
G4endl
98 <<
"Proposed step is negative; hstep = " << hstep <<
G4endl
99 << "Requested step cannot be negative! Aborting event.";
102 return false;
103 }
104
105 if( hinitial == 0.0 ) { hinitial = hstep; }
106 if( hinitial < 0.0 ) { hinitial = std::fabs( hinitial ); }
107
109
110
111
112
113
114
116
119 const G4int nvar= GetNumberOfVariables();
120
121
122
123 std::memcpy(yOut + nvar,
124 yCurrent + nvar,
126
128 const G4double endCurveLength = curveLength + hstep;
129
130
131
132
133
134
135
136
138 std::max(
epsilon * hstep, fSmallestFraction * curveLength);
139
141
142 for (
G4int nstp = 0; nstp < fMaxNoSteps; ++nstp)
143 {
145
147
148
149
152 CheckStep(EndPos, StartPos, hdid);
153
154
155 if (curveLength >= endCurveLength || htry < hThreshold)
156 {
157 break;
158 }
159
160 htry = std::max(hnext, fMinimumStep);
161 if (curveLength + htry > endCurveLength)
162 {
163 htry = endCurveLength - curveLength;
164 }
165 }
166
167
170
171 return true;
172}
G4double epsilon(G4double density, G4double temperature)
void OneGoodStep(G4double yCurrentState[], G4double &curveLength, G4double htry, G4double epsilon_rel, G4double restMass, G4double charge, G4double &hdid, G4double &hnext)
G4double GetCurveLength() const
G4double GetCharge() const
void SetCurveLength(G4double nCurve_s)
G4double GetRestMass() const
void DumpToArray(G4double valArr[ncompSVEC]) const
void LoadFromArray(const G4double valArr[ncompSVEC], G4int noVarsIntegrated)
G4ThreeVector makeVector(const ArrayType &array, Value3D value)