247{
252
253 const G4int coeffs = method->order() + 1;
262
264
265 this->save_substep(0, length);
266
267 this->update_time();
270
272 cf0 = index * coeffs;
273 elapsed = t - tx[index];
274 method->advance_time_x(cf0, elapsed);
275 tx[index] = t;
276 lqu[index] = dQRel[index] * std::fabs(x[cf0]);
277 if (lqu[index] < dQMin[index]) {
278 lqu[index] = dQMin[index];
279 }
280 method->update_quantized_state(index);
281 tq[index] = t;
282 method->next_time(index, t);
283 for (
G4int i = 0; i < 3; i++) {
284 G4int j = SD[index][i];
285 elapsed = t - tx[j];
286 infCf0 = j * coeffs;
287 if (elapsed > 0) {
288 x[infCf0] = method->evaluate_x_poly(infCf0, elapsed, x);
289 tx[j] = t;
290 }
291 }
292
293 this->update_field();
294 this->recompute_derivatives(index);
295 method->recompute_next_times(SD[index], t);
296
297 if (t > prev_time) {
298 length += fVelocity * (t - prev_time);
299 if (length <= max_length) { this->save_substep(t, length); }
300 else { break; }
301 }
302
303 this->update_time();
304 prev_time = t;
307 }
308
310 max_length = length;
311 }
312
314 t = substep->start_time + (max_length - substep->len) / fVelocity;
315
316 this->get_state_from_poly(substep->x, substep->tx, t, yOut);
317
318 velocity_to_momentum(yOut);
319
321 for (
G4int i = 0; i < numberOfVariables; ++i) {
322
323 fyIn[i] = yInput[i];
324 fyOut[i] = yOut[i];
325 }
326
327 fLastStepLength = max_length;
328}
#define LAST_SUBSTEP_STRUCT(sim)
G4int GetNumberOfVariables() const
double tx[Qss_misc::VAR_IDX_END]
double tq[Qss_misc::VAR_IDX_END]
double x[Qss_misc::VAR_IDX_END *(Qss_misc::MAX_QSS_STEPPER_ORDER+1)]
double lqu[Qss_misc::VAR_IDX_END]