Commit eff26f3c authored by Christof Metzger-Kraus's avatar Christof Metzger-Kraus
Browse files

fixing typo

parent 2c7e95d6
......@@ -28,7 +28,7 @@ double CavityAutophaser::getPhaseAtMaxEnergy(const Vector_t &R,
const Vector_t &P,
double t,
double dt) {
initialP_m = Vector_t(0, 0, euclidian_norm(P));
initialP_m = Vector_t(0, 0, euclidean_norm(P));
double tErr = (initialR_m(2) - R(2)) * sqrt(dot(P,P) + 1.0) / (P(2) * Physics::c);
double initialEnergy = Util::getEnergy(P, itsReference_m.getM()) * 1e-6;
......
......@@ -165,7 +165,7 @@ void OrbitThreader::integrate(const IndexMap::value_t &activeSet, size_t maxStep
}
if (step % loggingFrequency_m == 0 && Ippl::myNode() == 0) {
logger_m << std::setw(18) << std::setprecision(8) << pathLength_m + std::copysign(euclidian_norm(r_m - oldR), dt_m)
logger_m << std::setw(18) << std::setprecision(8) << pathLength_m + std::copysign(euclidean_norm(r_m - oldR), dt_m)
<< std::setw(18) << std::setprecision(8) << r_m(0)
<< std::setw(18) << std::setprecision(8) << r_m(1)
<< std::setw(18) << std::setprecision(8) << r_m(2)
......@@ -189,7 +189,7 @@ void OrbitThreader::integrate(const IndexMap::value_t &activeSet, size_t maxStep
integrator_m.push(r_m, p_m, dt_m);
r_m *= Physics::c * dt_m;
pathLength_m += std::copysign(euclidian_norm(r_m - oldR), dt_m);
pathLength_m += std::copysign(euclidean_norm(r_m - oldR), dt_m);
++ step;
time_m += dt_m;
......@@ -306,7 +306,7 @@ void OrbitThreader::registerElement(const IndexMap::value_t &elementSet,
Vector_t initialR = itsOpalBeamline_m.transformToLocalCS(*it, R);
Vector_t initialP = itsOpalBeamline_m.rotateToLocalCS(*it, P);
double elementEdge = start - initialR(2) * euclidian_norm(initialP) / initialP(2);
double elementEdge = start - initialR(2) * euclidean_norm(initialP) / initialP(2);
elementPosition ep = {start, pathLength_m, elementEdge};
elementRegistry_m.insert(std::make_pair(name, ep));
......
......@@ -263,7 +263,7 @@ void ParallelTTracker::execute() {
restoreCavityPhases();
} else {
RefPartR_m = Vector_t(0.0);
RefPartP_m = euclidian_norm(itsBunch_m->get_pmean_Distribution()) * Vector_t(0, 0, 1);
RefPartP_m = euclidean_norm(itsBunch_m->get_pmean_Distribution()) * Vector_t(0, 0, 1);
if (itsBunch_m->getTotalNum() > 0) {
if (!itsOpalBeamline_m.containsSource()) {
......@@ -381,7 +381,7 @@ void ParallelTTracker::execute() {
itsBunch_m->incTrackSteps();
double driftPerTimeStep = euclidian_norm(itsBunch_m->getdT() * Physics::c * RefPartP_m / Util::getGamma(RefPartP_m));
double driftPerTimeStep = euclidean_norm(itsBunch_m->getdT() * Physics::c * RefPartP_m / Util::getGamma(RefPartP_m));
if (std::abs(zStop_m.front() - pathLength_m) < 0.5 * driftPerTimeStep)
localTrackSteps_m.front() = step;
}
......@@ -1069,11 +1069,11 @@ void ParallelTTracker::writePhaseSpace(const long long step, bool psDump, bool s
const size_t localNum = itsBunch_m->getLocalNum();
double distToLastStop = zStop_m.back() - pathLength_m;
Vector_t driftPerTimeStep = itsBunch_m->getdT() * Physics::c * RefPartP_m / Util::getGamma(RefPartP_m);
bool driftToCorrectPosition = std::abs(distToLastStop) < 0.5 * euclidian_norm(driftPerTimeStep);
bool driftToCorrectPosition = std::abs(distToLastStop) < 0.5 * euclidean_norm(driftPerTimeStep);
Ppos_t stashedR;
if (driftToCorrectPosition) {
const double tau = distToLastStop / euclidian_norm(driftPerTimeStep) * itsBunch_m->getdT();
const double tau = distToLastStop / euclidean_norm(driftPerTimeStep) * itsBunch_m->getdT();
if (localNum > 0) {
stashedR.create(localNum);
stashedR = itsBunch_m->R;
......@@ -1154,7 +1154,7 @@ void ParallelTTracker::updateReferenceParticle(const BorisPusher &pusher) {
// Vector_t P = referenceToLabCSTrafo_m.rotateTo(RefPartP_m);
// Vector_t lEf = referenceToLabCSTrafo_m.rotateTo(Ef);
// Vector_t lBf = referenceToLabCSTrafo_m.rotateTo(Bf);
// logger_m << std::setw(18) << std::setprecision(8) << pathLength_m + euclidian_norm(RefPartR_m - oldR)
// logger_m << std::setw(18) << std::setprecision(8) << pathLength_m + euclidean_norm(RefPartR_m - oldR)
// << std::setw(18) << std::setprecision(8) << R(0)
// << std::setw(18) << std::setprecision(8) << R(1)
// << std::setw(18) << std::setprecision(8) << R(2)
......@@ -1194,7 +1194,7 @@ void ParallelTTracker::transformBunch(const CoordinateSystemTrafo &trafo) {
void ParallelTTracker::updateRefToLabCSTrafo(const BorisPusher &pusher) {
updateReferenceParticle(pusher);
pathLength_m += euclidian_norm(RefPartR_m);
pathLength_m += euclidean_norm(RefPartR_m);
CoordinateSystemTrafo update(RefPartR_m,
getQuaternion(RefPartP_m, Vector_t(0, 0, 1)));
......@@ -1228,7 +1228,7 @@ void ParallelTTracker::findStartPosition(const BorisPusher &pusher) {
Vector_t oldR = RefPartR_m;
updateReferenceParticle(pusher);
pathLength_m += euclidian_norm(RefPartR_m - oldR);
pathLength_m += euclidean_norm(RefPartR_m - oldR);
if (pathLength_m > zStop_m.front()) {
if (localTrackSteps_m.size() == 0) return;
......@@ -1240,7 +1240,7 @@ void ParallelTTracker::findStartPosition(const BorisPusher &pusher) {
changeDT();
}
double speed = euclidian_norm(RefPartP_m) * Physics::c / sqrt(dot(RefPartP_m, RefPartP_m) + 1);
double speed = euclidean_norm(RefPartP_m) * Physics::c / sqrt(dot(RefPartP_m, RefPartP_m) + 1);
if (std::abs(pathLength_m - zstart_m) <= 0.5 * itsBunch_m->getdT() * speed) {
double tau = (pathLength_m - zstart_m) / speed;
......
......@@ -375,7 +375,7 @@ double Bend::calculateBendAngle() {
pusher_m.push(X, P, deltaT);
X *= cdt;
deltaS += euclidian_norm(X - oldX);
deltaS += euclidean_norm(X - oldX);
}
......@@ -457,7 +457,7 @@ Vector_t Bend::calcCentralField(const Vector_t &R,
//double expFactor = exp(-nOverRho * deltaX);
//double bxBzFactor = expFactor * nOverRho * R(1);
//Vector_t rotationCenter(-designRadius_m, R(1), 0.0);
//double cosangle = dot(R - rotationCenter, Vector_t(1, 0, 0)) / euclidian_norm(R - rotationCenter);
//double cosangle = dot(R - rotationCenter, Vector_t(1, 0, 0)) / euclidean_norm(R - rotationCenter);
//B(0) = -bxBzFactor * cosangle;
//B(1) = expFactor * (1.0 - pow(nOverRho * R(1), 2.0) / 2.0);
......@@ -550,7 +550,7 @@ bool Bend::calculateMapField(const Vector_t &R, Vector_t &B) {
if(inMagnetCentralRegion(R)) {
if (verticallyInside) {
double deltaX = 0.0;//euclidian_norm(R - rotationCenter) - designRadius_m;
double deltaX = 0.0;//euclidean_norm(R - rotationCenter) - designRadius_m;
if (isPositionInEntranceField(R)) {
B = calcEntranceFringeField(R, deltaX);
} else if (isPositionInExitField(R)) {
......@@ -926,7 +926,7 @@ bool Bend::initializeFieldMap(Inform &msg) {
bool Bend::inMagnetCentralRegion(const Vector_t &R) const {
Vector_t rotationCenter(-designRadius_m * cosEntranceAngle_m, R(1), designRadius_m * sinEntranceAngle_m);
double distFromRotCenter = euclidian_norm(R - rotationCenter);
double distFromRotCenter = euclidean_norm(R - rotationCenter);
Vector_t Rprime = getBeginToEnd_local().transformTo(R);
Vector_t Rpprime = computeAngleTrafo_m.transformTo(R);
......@@ -1453,7 +1453,7 @@ std::pair<Vector_t, Vector_t> Bend::getDesignPathSecant(double startsAtDistFromE
for (unsigned int i = 1; i < size; ++ i) {
Vector_t step = refTrajMap_m[i] - refTrajMap_m[i-1];
double stepSize = euclidian_norm(step);
double stepSize = euclidean_norm(step);
if (pathLength + stepSize > startsAtDistFromEdge) {
double diff = startsAtDistFromEdge - pathLength;
tangent = step / stepSize;
......@@ -1467,12 +1467,12 @@ std::pair<Vector_t, Vector_t> Bend::getDesignPathSecant(double startsAtDistFromE
for (unsigned j = i; j < size; ++ j) {
Vector_t position = refTrajMap_m[j];
if (euclidian_norm(position - startPosition) >= length) {
if (euclidean_norm(position - startPosition) >= length) {
step = refTrajMap_m[j-1] - refTrajMap_m[j];
double tau = (dot(startPosition - position, step) - sqrt(std::pow(dot(startPosition - position, step), 2) - dot(step, step) * (dot(startPosition - position, startPosition - position) - std::pow(length, 2)))) / dot(step, step);
tangent = position + tau * step - startPosition;
tangent /= euclidian_norm(tangent);
tangent /= euclidean_norm(tangent);
return std::make_pair(startPosition, tangent);
}
......@@ -1480,11 +1480,11 @@ std::pair<Vector_t, Vector_t> Bend::getDesignPathSecant(double startsAtDistFromE
Vector_t position = refTrajMap_m[size - 1];
Vector_t step = position - refTrajMap_m[size - 2];
step /= euclidian_norm(step);
step /= euclidean_norm(step);
double tau = (dot(startPosition - position, step) + sqrt(std::pow(dot(startPosition - position, step), 2) - dot(step, step) * (dot(startPosition - position, startPosition - position) - std::pow(length, 2)))) / dot(step, step);
tangent = position + tau * step - startPosition;
tangent /= euclidian_norm(tangent);
tangent /= euclidean_norm(tangent);
return std::make_pair(startPosition, tangent);
}
......@@ -1495,7 +1495,7 @@ std::pair<Vector_t, Vector_t> Bend::getDesignPathSecant(double startsAtDistFromE
double diff = startsAtDistFromEdge - pathLength;
unsigned int i = size - 1;
Vector_t step = refTrajMap_m[i] - refTrajMap_m[i-1];
double stepSize = euclidian_norm(step);
double stepSize = euclidean_norm(step);
tangent = step / stepSize;
startPosition = refTrajMap_m[i] + diff * tangent;
tangent = tangent;
......
......@@ -283,7 +283,7 @@ bool Collimator::checkCollimator(PartBunchBase<double, 3> *bunch, const int turn
double r1 = sqrt(rmax(0) * rmax(0) + rmax(1) * rmax(1));
std::pair<Vector_t, double> boundingSphere;
boundingSphere.first = 0.5 * (rmax + rmin);
boundingSphere.second = euclidian_norm(rmax - boundingSphere.first);
boundingSphere.second = euclidean_norm(rmax - boundingSphere.first);
if (rmax(2) >= zstart_m && rmin(2) <= zend_m) {
// if ( r1 > r_start - 10.0 && r1 < r_end + 10.0 ){
......
......@@ -104,7 +104,7 @@ bool Monitor::applyToReferenceParticle(const Vector_t &R,
double frac = (middle - R(2)) / (P(2) * recpgamma);
double time = t + frac * dt;
Vector_t dR = (0.5 + frac) * P * recpgamma;
double ds = euclidian_norm(dR);
double ds = euclidean_norm(dR);
lossDs_m->addReferenceParticle(csTrafoGlobal2Local_m.transformFrom(R + dR),
csTrafoGlobal2Local_m.rotateFrom(P),
time,
......
......@@ -10,8 +10,8 @@ typedef Vektor<double, 3> Vector_t;
/// comment: this should go to AppTypes/Vektor.h
inline
double euclidian_norm(Vector_t a) {
double euclidean_norm(Vector_t a) {
return sqrt(dot(a,a));
}
#endif
#endif
\ No newline at end of file
......@@ -22,7 +22,7 @@ namespace Util {
// y axis
Vector_t tmp = rotation.rotate(Vector_t(0, 0, 1));
tmp(1) = 0.0;
// tmp /= euclidian_norm(tmp);
// tmp /= euclidean_norm(tmp);
double theta = fmod(atan2(tmp(0), tmp(2)) + Physics::two_pi, Physics::two_pi);
Quaternion rotTheta(cos(0.5 * theta), 0, sin(0.5 * theta), 0);
......@@ -31,7 +31,7 @@ namespace Util {
// x axis
tmp = rotation.rotate(Vector_t(0, 0, 1));
tmp(0) = 0.0;
tmp /= euclidian_norm(tmp);
tmp /= euclidean_norm(tmp);
double phi = fmod(atan2(-tmp(1), tmp(2)) + Physics::two_pi, Physics::two_pi);
Quaternion rotPhi(cos(0.5 * phi), sin(0.5 * phi), 0, 0);
......@@ -40,7 +40,7 @@ namespace Util {
// z axis
tmp = rotation.rotate(Vector_t(1, 0, 0));
tmp(2) = 0.0;
tmp /= euclidian_norm(tmp);
tmp /= euclidean_norm(tmp);
double psi = fmod(atan2(tmp(1), tmp(0)) + Physics::two_pi, Physics::two_pi);
return Vector_t(theta, phi, psi);
......
......@@ -258,7 +258,7 @@ void OpalBeamline::compute3DLattice() {
sin(-0.5 * rotationAngleAboutZ) * Vector_t(0, 0, 1));
Vector_t effectiveRotationAxis = rotationAboutZ.rotate(Vector_t(0, -1, 0));
effectiveRotationAxis /= euclidian_norm(effectiveRotationAxis);
effectiveRotationAxis /= euclidean_norm(effectiveRotationAxis);
Quaternion_t rotationAboutAxis(cos(0.5 * bendAngle),
sin(0.5 * bendAngle) * effectiveRotationAxis);
......@@ -272,8 +272,8 @@ void OpalBeamline::compute3DLattice() {
Quaternion_t directionExitHardEdge(cos(0.5 * (0.5 * bendAngle - entranceAngle)),
sin(0.5 * (0.5 * bendAngle - entranceAngle)) * effectiveRotationAxis);
Vector_t exitHardEdge = thisLength * directionExitHardEdge.rotate(Vector_t(0, 0, 1));
double distanceEntryHETruePath = euclidian_norm(truePath.front());
double distanceExitHETruePath = euclidian_norm(truePath.back() - exitHardEdge);
double distanceEntryHETruePath = euclidean_norm(truePath.front());
double distanceExitHETruePath = euclidean_norm(truePath.back() - exitHardEdge);
double pathLengthTruePath = (*it).getEnd() - (*it).getStart();
arcLength = pathLengthTruePath - distanceEntryHETruePath - distanceExitHETruePath;
}
......@@ -328,7 +328,7 @@ void OpalBeamline::compute3DLattice() {
sin(-0.5 * rotationAngleAboutZ) * Vector_t(0, 0, 1));
Vector_t effectiveRotationAxis = rotationAboutZ.rotate(Vector_t(0, -1, 0));
effectiveRotationAxis /= euclidian_norm(effectiveRotationAxis);
effectiveRotationAxis /= euclidean_norm(effectiveRotationAxis);
Quaternion_t rotationAboutAxis(cos(0.5 * bendAngle),
sin(0.5 * bendAngle) * effectiveRotationAxis);
......@@ -343,8 +343,8 @@ void OpalBeamline::compute3DLattice() {
Quaternion_t directionExitHardEdge(cos(0.5 * (0.5 * bendAngle - entranceAngle)),
sin(0.5 * (0.5 * bendAngle - entranceAngle)) * effectiveRotationAxis);
Vector_t exitHardEdge = thisLength * directionExitHardEdge.rotate(Vector_t(0, 0, 1));
double distanceEntryHETruePath = euclidian_norm(truePath.front());
double distanceExitHETruePath = euclidian_norm(truePath.back() - exitHardEdge);
double distanceEntryHETruePath = euclidean_norm(truePath.front());
double distanceExitHETruePath = euclidean_norm(truePath.back() - exitHardEdge);
double pathLengthTruePath = (*it).getEnd() - (*it).getStart();
arcLength = pathLengthTruePath - distanceEntryHETruePath - distanceExitHETruePath;
}
......
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