Commit f87f7972 authored by snuverink_j's avatar snuverink_j
Browse files

small improvements and spelling

parent c888bb8c
......@@ -481,7 +481,7 @@ public:
// Process a sort-list, as described for "calcSortList", to reorder
// the elements in this attribute. All indices in the sort list are
// considered "local", so they should be in the range 0 ... localnum-1.
// The sort-list does not have to have been calcualted by calcSortList,
// The sort-list does not have to have been calculated by calcSortList,
// it could be calculated by some other means, but it does have to
// be in the same format. Note that the routine may need to modify
// the sort-list temporarily, but it will return it in the same state.
......
......@@ -484,7 +484,7 @@ void ParticleAttrib<T>::calcSortList(SortList_t &slist, bool ascending)
// Process a sort-list, as described for "calcSortList", to reorder
// the elements in this attribute. All indices in the sort list are
// considered "local", so they should be in the range 0 ... localnum-1.
// The sort-list does not have to have been calcualted by calcSortList,
// The sort-list does not have to have been calculated by calcSortList,
// it could be calculated by some other means, but it does have to
// be in the same format. Note that the routine may need to modify
// the sort-list temporarily, but it will return it in the same state.
......
......@@ -381,10 +381,7 @@ void ParallelCyclotronTracker::visitRing(const Ring &ring) {
sinRefTheta_m = sin(referenceTheta * Physics::deg2rad);
cosRefTheta_m = cos(referenceTheta * Physics::deg2rad);
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {}; // zero initialise array
buildupFieldList(BcParameter, ElementBase::RING, opalRing_m);
......@@ -583,10 +580,7 @@ void ParallelCyclotronTracker::visitCyclotron(const Cyclotron &cycl) {
// Read in cyclotron field maps (midplane + 3D fields if desired).
elptr->initialise(itsBunch_m, fieldflag, elptr->getBScale());
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {};
BcParameter[0] = 0.001 * elptr->getRmin();
BcParameter[1] = 0.001 * elptr->getRmax();
......@@ -638,9 +632,7 @@ void ParallelCyclotronTracker::visitCCollimator(const CCollimator &coll) {
elptr->initialise(itsBunch_m);
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {};
BcParameter[0] = 0.001 * xstart ;
BcParameter[1] = 0.001 * xend;
......@@ -801,9 +793,7 @@ void ParallelCyclotronTracker::visitProbe(const Probe &prob) {
// initialise, do nothing
elptr->initialise(itsBunch_m);
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {};
BcParameter[0] = 0.001 * xstart ;
BcParameter[1] = 0.001 * xend;
......@@ -934,9 +924,7 @@ void ParallelCyclotronTracker::visitRFCavity(const RFCavity &as) {
// read cavity voltage profile data from file.
elptr->initialise(itsBunch_m, freq_atd, ampl_atd, phase_atd);
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {};
BcParameter[0] = 0.001 * rmin;
BcParameter[1] = 0.001 * rmax;
......@@ -1007,9 +995,7 @@ void ParallelCyclotronTracker::visitSeptum(const Septum &sept) {
// initialise, do nothing
elptr->initialise(itsBunch_m);
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {};
BcParameter[0] = 0.001 * xstart ;
BcParameter[1] = 0.001 * xend;
......@@ -1105,9 +1091,7 @@ void ParallelCyclotronTracker::visitStripper(const Stripper &stripper) {
elptr->initialise(itsBunch_m);
double BcParameter[8];
for(int i = 0; i < 8; i++)
BcParameter[i] = 0.0;
double BcParameter[8] = {};
BcParameter[0] = 0.001 * xstart ;
BcParameter[1] = 0.001 * xend;
......@@ -1244,7 +1228,7 @@ void ParallelCyclotronTracker::execute() {
itsStepper_mp.reset(nullptr);
// continue here and throw exception
default:
throw OpalException("ParallelTTracker::execute",
throw OpalException("ParallelCyclotronTracker::execute",
"Invalid name of TIMEINTEGRATOR in Track command");
}
......@@ -2919,7 +2903,7 @@ std::tuple<double, double, double> ParallelCyclotronTracker::initializeTracking_
<< "* ---------------- NOTE: SEO MODE ONLY WORKS SERIALLY ON SINGLE NODE ------------------ *" << endl;
if(Ippl::getNodes() != 1)
throw OpalException("Error in ParallelCyclotronTracker::execute",
throw OpalException("Error in ParallelCyclotronTracker::initializeTracking_m",
"SEO MODE ONLY WORKS SERIALLY ON SINGLE NODE!");
break;
case MODE::SINGLE:
......@@ -2931,7 +2915,7 @@ std::tuple<double, double, double> ParallelCyclotronTracker::initializeTracking_
<< "* ---------NOTE: SINGLE PARTICLE MODE ONLY WORKS SERIALLY ON A SINGLE NODE ------------ *" << endl;
if(Ippl::getNodes() != 1)
throw OpalException("Error in ParallelCyclotronTracker::execute",
throw OpalException("Error in ParallelCyclotronTracker::initializeTracking_m",
"SINGLE PARTICLE MODE ONLY WORKS SERIALLY ON A SINGLE NODE!");
// For single particle mode open output files
......@@ -3033,7 +3017,7 @@ void ParallelCyclotronTracker::seoMode_m(double& t, const double dt, bool& dumpE
{
// 2 particles: Trigger SEO mode
// (Switch off cavity and calculate betatron osciliation tuning)
// (Switch off cavity and calculate betatron oscillation tuning)
double r_tuning[2], z_tuning[2] ;
IpplTimings::startTimer(IntegrationTimer_m);
......@@ -3417,7 +3401,7 @@ void ParallelCyclotronTracker::computeSpaceChargeFields_m() {
if ((itsBunch_m->weHaveBins()) && BunchCount_m > 1) {
// --- Multibunche mode --- //
// Calcualte gamma for each energy bin
// Calculate gamma for each energy bin
itsBunch_m->calcGammas_cycl();
repartition();
......
......@@ -553,8 +553,6 @@ private:
};
/**
*
*
* @param x
* @param y
*
......@@ -569,8 +567,6 @@ double ParallelCyclotronTracker::calculateAngle(double x, double y) {
}
/**
*
*
* @param x
* @param y
*
......
......@@ -18,15 +18,11 @@
#include <iosfwd>
#include <vector>
// #include "Distribution/Distribution.h"
#include "Structure/LossDataSink.h"
#include "Structure/FieldSolver.h"
#include "Algorithms/ListElem.h"
class Distribution;
// class LossDataSink;
// class FieldSolver;
// class ListElem;
template <class T, int, int> class FMatrix;
template <class T, int> class FVector;
......@@ -447,13 +443,12 @@ public:
protected:
size_t calcMoments(); // Calculates bunch moments using only emitted particles.
/* Calcualtes bunch moments by summing over bins
/* Calculates bunch moments by summing over bins
* (not accurate when any particles have been emitted).
*/
void calcMomentsInitial();
/// angle range [0~2PI) degree
double calculateAngle(double x, double y);
double calculateAngle2(double x, double y);
private:
......
......@@ -2306,34 +2306,10 @@ template <class T, unsigned Dim>
double PartBunchBase<T, Dim>::calculateAngle(double x, double y) {
double thetaXY = atan2(y, x);
// if(x < 0) thetaXY = pi + atan(y / x);
// else if((x > 0) && (y >= 0)) thetaXY = atan(y / x);
// else if((x > 0) && (y < 0)) thetaXY = 2.0 * pi + atan(y / x);
// else if((x == 0) && (y > 0)) thetaXY = pi / 2.0;
// else if((x == 0) && (y < 0)) thetaXY = 3.0 / 2.0 * pi;
return thetaXY >= 0 ? thetaXY : thetaXY + Physics::two_pi;
}
// angle range [-PI~PI) degree
template <class T, unsigned Dim>
double PartBunchBase<T, Dim>::calculateAngle2(double x, double y) {
// double thetaXY = atan2(y, x);
// if(x > 0) thetaXY = atan(y / x);
// else if((x < 0) && (y > 0)) thetaXY = pi + atan(y / x);
// else if((x < 0) && (y <= 0)) thetaXY = -pi + atan(y / x);
// else if((x == 0) && (y > 0)) thetaXY = pi / 2.0;
// else if((x == 0) && (y < 0)) thetaXY = -pi / 2.0;
return atan2(y, x);
}
template <class T, unsigned Dim>
Inform &operator<<(Inform &os, PartBunchBase<T, Dim> &p) {
return p.print(os);
......
......@@ -46,9 +46,6 @@
#include <sstream>
#endif
using std::max;
// Local structures.
// ------------------------------------------------------------------------
......@@ -454,7 +451,7 @@ Twiss::Twiss(int size, const char *name, const char *help):
itsAttr[XCRMS].setReadOnly(true);
itsAttr[YCRMS] = Attributes::makeReal
("YCRMS", "R.m.s. verticla closed orbit in m");
("YCRMS", "R.m.s. vertical closed orbit in m");
itsAttr[YCRMS].setReadOnly(true);
itsAttr[DXMAX] = Attributes::makeReal
......
......@@ -73,7 +73,6 @@ Track::Track(BeamSequence *u, const PartData &ref, const std::vector<double> & d
OpalData::getInstance()->setPartBunch(new PartBunch(&ref));
}
bunch = OpalData::getInstance()->getPartBunch();
slbunch = OpalData::getInstance()->getSLPartBunch();
} else {
if(!OpalData::getInstance()->hasBunchAllocated()) {
......@@ -85,9 +84,8 @@ Track::Track(BeamSequence *u, const PartData &ref, const std::vector<double> & d
OpalData::getInstance()->setPartBunch(new PartBunch(&ref));
}
bunch = OpalData::getInstance()->getPartBunch();
}
bunch = OpalData::getInstance()->getPartBunch();
}
......
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