Commit 6d49f996 authored by adelmann's avatar adelmann 🎗

fix start of the element (quad)

parent 2c18fdfb
......@@ -146,8 +146,8 @@ void Multipole::addKT(int i, double t, Vector_t &K) {
bool Multipole::apply(const size_t &i, const double &t, double E[], double B[]) {
Vector_t Ev(0, 0, 0), Bv(0, 0, 0);
const Vector_t Rt(RefPartBunch_m->getX(i) - dx_m, RefPartBunch_m->getY(i) - dy_m , RefPartBunch_m->getZ(i) - startField_m - ds_m);
const Vector_t Rt(RefPartBunch_m->getX(i) - dx_m, RefPartBunch_m->getY(i) - dy_m , RefPartBunch_m->getZ(i) - ds_m);
// before misalignment Vector_t Rt(RefPartBunch_m->getX(i), RefPartBunch_m->getY(i), RefPartBunch_m->getZ(i));
if(apply(Rt, Vector_t(0.0), t, Ev, Bv)) return true;
......@@ -163,8 +163,8 @@ bool Multipole::apply(const size_t &i, const double &t, double E[], double B[])
}
bool Multipole::apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) {
const Vector_t temp(RefPartBunch_m->getX(i) - dx_m, RefPartBunch_m->getY(i) - dy_m , RefPartBunch_m->getZ(i) - startField_m - ds_m);
const Vector_t temp(RefPartBunch_m->getX(i) - dx_m, RefPartBunch_m->getY(i) - dy_m , RefPartBunch_m->getZ(i) - ds_m);
// before misalignment Vector_t temp(RefPartBunch_m->getX(i), RefPartBunch_m->getY(i), RefPartBunch_m->getZ(i));
const Vector_t &R(temp);
......@@ -248,7 +248,7 @@ bool Multipole::apply(const Vector_t &R0, const Vector_t &centroid, const double
const Vector_t R = R0 - Vector_t(dx_m,dy_m,ds_m);
const Vector_t tmpR(R(0) - dx_m, R(1) - dy_m, R(2) - startField_m - ds_m);
const Vector_t tmpR(R(0) - dx_m, R(1) - dy_m, R(2) - ds_m);
if(tmpR(2) > startField_m && tmpR(2) <= endField_m) {
if(max_NormalComponent_m > 0) {
......
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