38 gradB[0] = (B[0]*B_dB[1] + B[1]*B_dB[5] + B[2]*B_dB[9]) / normB;
39 gradB[1] = (B[0]*B_dB[2] + B[1]*B_dB[6] + B[2]*B_dB[10])
41 gradB[2] = (B[0]*B_dB[3] + B[1]*B_dB[7] + B[2]*B_dB[11]) / normB;
47 curlB[0] = B_dB[10] / y[0] - B_dB[7];
48 curlB[1] = B_dB[3] - B_dB[9];
49 curlB[2] = (B[1] - B_dB[2]) / y[0] + B_dB[5];
52 Bstar[0] = B[0] + (y[3] / charge)
53 * (curlB[0] / normB - gradBcrossB[0] / (normB*normB));
54 Bstar[1] = B[1] + (y[3] / charge)
55 * (curlB[1] / normB - gradBcrossB[1] / (normB*normB));
56 Bstar[2] = B[2] + (y[3] / charge)
57 * (curlB[2] / normB - gradBcrossB[2] / (normB*normB));
60 Estar[0] = E[0] - y[4] * gradB[0] / ( charge * gamma );
61 Estar[1] = E[1] - y[4] * gradB[1] / ( charge * gamma );
62 Estar[2] = E[2] - y[4] * gradB[2] / ( charge * gamma );
65 Bhat[0] = B[0] / normB;
66 Bhat[1] = B[1] / normB;
67 Bhat[2] = B[2] / normB;
71 real EstarcrossBhat[3];
74 ydot[0] = ( y[3] * Bstar[0] / ( gamma * mass )
75 + EstarcrossBhat[0] ) / BhatDotBstar;
76 ydot[1] = ( y[3] * Bstar[1] / ( gamma * mass )
77 + EstarcrossBhat[1] ) / ( y[0]*BhatDotBstar );
78 ydot[2] = ( y[3] * Bstar[2] / ( gamma * mass )
79 + EstarcrossBhat[2] ) / BhatDotBstar;
80 ydot[3] = charge *
math_dot(Bstar,Estar) / BhatDotBstar;
82 ydot[5] = charge * normB / ( gamma * mass );
static DECLARE_TARGET_SIMD void step_gceom(real *ydot, real *y, real mass, real charge, real *B_dB, real *E)
Calculate guiding center equations of motion for a single particle.