24 Arguments& ... args)
const
35 this->
copyTo(bunch->
R[i], bunch->
P[i], &x[0]);
44 bool outOfBound =
derivate_m(bunch, x, t, deriv1 , i, args ...);
50 const double half_dt = 0.5 * dt;
51 const double t_half = t + half_dt;
53 for(
int j = 0; j < 6; ++j)
54 xtemp[j] = x[j] + half_dt * deriv1[j];
56 outOfBound =
derivate_m(bunch, xtemp, t_half, deriv2 , i, args ...);
62 for (
int j = 0; j < 6; ++j) {
63 xtemp[j] = x[j] + half_dt * deriv2[j];
66 outOfBound =
derivate_m(bunch, xtemp, t_half, deriv3 , i, args ...);
72 double t_full = t + dt;
73 for (
int j = 0; j < 6; ++j) {
74 xtemp[j] = x[j] + dt * deriv3[j];
77 outOfBound =
derivate_m(bunch, xtemp, t_full, deriv4 , i, args ...);
83 for (
int j = 0; j < 6; ++j) {
84 x[j] += dt / 6.*(deriv1[j] + deriv4[j] + 2.*(deriv2[j] + deriv3[j]));
86 this->
copyFrom(bunch->
R[i], bunch->
P[i], &x[0]);
98 Arguments& ... args)
const
103 Vector_t externalE, externalB, tempR;
105 externalB =
Vector_t(0.0, 0.0, 0.0);
106 externalE =
Vector_t(0.0, 0.0, 0.0);
108 for (
int j = 0; j < 3; ++j) {
113 bool outOfBound = this->
fieldfunc_m(t, i, externalE, externalB, args ...);
117 double tempgamma = std::sqrt(1 + (y[3] * y[3] + y[4] * y[4] + y[5] * y[5]));
123 yp[3] = (externalE(0) /
Physics::c + (externalB(2) * y[4] - externalB(1) * y[5]) / tempgamma) * qtom;
124 yp[4] = (externalE(1) /
Physics::c - (externalB(2) * y[3] - externalB(0) * y[5]) / tempgamma) * qtom;
125 yp[5] = (externalE(2) /
Physics::c + (externalB(1) * y[3] - externalB(0) * y[4]) / tempgamma) * qtom;
bool derivate_m(PartBunchBase< double, 3 > *bunch, double *y, const double &t, double *yp, const size_t &i, Arguments &... args) const
bool doAdvance_m(PartBunchBase< double, 3 > *bunch, const size_t &i, const double &t, const double dt, Arguments &... args) const