21 PartBunch_t* bunch,
const size_t& i,
const double& t,
const double dt,
22 Arguments&... args)
const {
42 bool outOfBound =
derivate_m(bunch, x, t, deriv1, i, args...);
47 const double half_dt = 0.5 * dt;
48 const double t_half = t + half_dt;
50 for (
int j = 0; j < 6; ++j)
51 xtemp[j] = x[j] + half_dt * deriv1[j];
53 outOfBound =
derivate_m(bunch, xtemp, t_half, deriv2, i, args...);
58 for (
int j = 0; j < 6; ++j)
59 xtemp[j] = x[j] + half_dt * deriv2[j];
61 outOfBound =
derivate_m(bunch, xtemp, t_half, deriv3, i, args...);
66 double t_full = t + dt;
67 for (
int j = 0; j < 6; ++j)
68 xtemp[j] = x[j] + dt * deriv3[j];
70 outOfBound =
derivate_m(bunch, xtemp, t_full, deriv4, i, args...);
75 for (
int j = 0; j < 6; ++j)
76 x[j] += dt / 6. * (deriv1[j] + deriv4[j] + 2. * (deriv2[j] + deriv3[j]));
85 PartBunch_t* bunch,
double* y,
const double& t,
double* yp,
const size_t& i,
86 Arguments&... args)
const {
95 for (
int j = 0; j < 3; ++j)
100 bool outOfBound = this->
fieldfunc_m(t, i, externalE, externalB, args...);
104 double tempgamma = sqrt(1 + (y[3] * y[3] + y[4] * y[4] + y[5] * y[5]));
106 yp[0] =
c_mtns / tempgamma * y[3];
107 yp[1] =
c_mtns / tempgamma * y[4];
108 yp[2] =
c_mtns / tempgamma * y[5];
116 yp[3] = (externalE(0) /
Physics::c + (externalB(2) * y[4] - externalB(1) * y[5]) / tempgamma)
118 yp[4] = (externalE(1) /
Physics::c - (externalB(2) * y[3] - externalB(0) * y[5]) / tempgamma)
120 yp[5] = (externalE(2) /
Physics::c + (externalB(1) * y[3] - externalB(0) * y[4]) / tempgamma)
bool derivate_m(PartBunch_t *bunch, double *y, const double &t, double *yp, const size_t &i, Arguments &... args) const
bool doAdvance_m(PartBunch_t *bunch, const size_t &i, const double &t, const double dt, Arguments &... args) const