Commit 42b385ee authored by Daniel Winklehner's avatar Daniel Winklehner
Browse files

Passing meanR and rotation quaternion to PartBunch, added get functionsfor the two -Dw

parent af4f4904
......@@ -1112,6 +1112,9 @@ void PartBunch::computeSelfFields_cycl(double gamma) {
void PartBunch::computeSelfFields_cycl(double gamma, Vector_t const meanR, Vektor<double, 4> const quaternion) {
IpplTimings::startTimer(selfFieldTimer_m);
globalMeanR = meanR;
globalToLocalQuaternion = quaternion;
/// set initial charge density to zero.
rho_m = 0.0;
......@@ -1119,7 +1122,6 @@ void PartBunch::computeSelfFields_cycl(double gamma, Vector_t const meanR, Vekto
eg_m = Vector_t(0.0);
if(fs_m->hasValidSolver()) {
/// scatter particles charge onto grid.
this->Q.scatter(this->rho_m, this->R, IntrplCIC_t());
......@@ -1166,7 +1168,6 @@ void PartBunch::computeSelfFields_cycl(double gamma, Vector_t const meanR, Vekto
*gmsg << "Field along z axis E = " << eg_m[m2][m2][i] << " Pot = " << rho_m[m2][m2][i] << endl;
// end debug
*/
/// interpolate electric field at particle positions.
Ef.gather(eg_m, this->R, IntrplCIC_t());
......
......@@ -104,6 +104,8 @@ public:
void do_binaryRepart();
/// per default the MT value of the field solver is used
void set_nBinsLineDensity(int n);
......@@ -400,6 +402,9 @@ public:
inline void setNumBunch(int n);
inline int getNumBunch() const;
inline Vector_t getGlobalMeanR() {return globalMeanR;}
inline Vektor<double, 4> getGlobalToLocalQuaternion() {return globalToLocalQuaternion;}
void setSteptoLastInj(int n);
int getSteptoLastInj();
......@@ -553,6 +558,9 @@ private:
/// energy spread of the beam in keV
double dE_m;
Vektor<double, 4> globalToLocalQuaternion;
Vector_t globalMeanR;
/// maximal extend of particles
Vector_t rmax_m;
/// minimal extend of particles
......
......@@ -2042,7 +2042,6 @@ void ParallelCyclotronTracker::Tracker_RK4() {
globalToLocal(itsBunch->R, quaternionToYAxis, meanR);
itsBunch->R /= Vector_t(1000.0); // mm --> m
// // in global Cartesian frame, calculate the direction of longitudinal angle of bunch
// double meanPhi = calculateAngle(meanP(0), meanP(1)) - 0.5 * pi;
......@@ -2081,7 +2080,7 @@ void ParallelCyclotronTracker::Tracker_RK4() {
repartition();
itsBunch->computeSelfFields_cycl(temp_meangamma, meanR, quaternionToYAxis);
itsBunch->computeSelfFields_cycl(temp_meangamma, 0.001 * meanR, quaternionToYAxis);
IpplTimings::startTimer(TransformTimer_m);
......@@ -2199,7 +2198,6 @@ void ParallelCyclotronTracker::Tracker_RK4() {
rold_m[j] = variable_m[j]; // used for gap cross checking
pold_m[j] = variable_m[j+3]; // used for gap cross
}
// integrate for one step in the lab Cartesian frame (absolute value).
// IpplTimings::startTimer(IntegrationTimer_m);
flagNoDeletion = rk4(variable_m, t, dt, i);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment