Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
f87f7972
Commit
f87f7972
authored
Jul 09, 2018
by
snuverink_j
Browse files
small improvements and spelling
parent
c888bb8c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
73 deletions
+19
-73
ippl/src/Particle/ParticleAttrib.h
ippl/src/Particle/ParticleAttrib.h
+1
-1
ippl/src/Particle/ParticleAttrib.hpp
ippl/src/Particle/ParticleAttrib.hpp
+1
-1
src/Algorithms/ParallelCyclotronTracker.cpp
src/Algorithms/ParallelCyclotronTracker.cpp
+12
-28
src/Algorithms/ParallelCyclotronTracker.h
src/Algorithms/ParallelCyclotronTracker.h
+0
-4
src/Classic/Algorithms/PartBunchBase.h
src/Classic/Algorithms/PartBunchBase.h
+3
-8
src/Classic/Algorithms/PartBunchBase.hpp
src/Classic/Algorithms/PartBunchBase.hpp
+0
-24
src/Tables/Twiss.cpp
src/Tables/Twiss.cpp
+1
-4
src/Track/Track.cpp
src/Track/Track.cpp
+1
-3
No files found.
ippl/src/Particle/ParticleAttrib.h
View file @
f87f7972
...
...
@@ -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 calcu
a
lted by calcSortList,
// The sort-list does not have to have been calcul
a
ted 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.
...
...
ippl/src/Particle/ParticleAttrib.hpp
View file @
f87f7972
...
...
@@ -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 calcu
a
lted by calcSortList,
// The sort-list does not have to have been calcul
a
ted 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.
...
...
src/Algorithms/ParallelCyclotronTracker.cpp
View file @
f87f7972
...
...
@@ -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
(
"Parallel
T
Tracker::execute"
,
throw
OpalException
(
"Parallel
Cyclotron
Tracker::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 oscil
i
ation tuning)
// (Switch off cavity and calculate betatron oscil
l
ation 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 --- //
// Calcu
a
lte gamma for each energy bin
// Calcul
a
te gamma for each energy bin
itsBunch_m
->
calcGammas_cycl
();
repartition
();
...
...
src/Algorithms/ParallelCyclotronTracker.h
View file @
f87f7972
...
...
@@ -553,8 +553,6 @@ private:
};
/**
*
*
* @param x
* @param y
*
...
...
@@ -569,8 +567,6 @@ double ParallelCyclotronTracker::calculateAngle(double x, double y) {
}
/**
*
*
* @param x
* @param y
*
...
...
src/Classic/Algorithms/PartBunchBase.h
View file @
f87f7972
...
...
@@ -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.
/* Calcu
a
ltes bunch moments by summing over bins
/* Calcul
a
tes 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:
...
...
src/Classic/Algorithms/PartBunchBase.hpp
View file @
f87f7972
...
...
@@ -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
);
...
...
src/Tables/Twiss.cpp
View file @
f87f7972
...
...
@@ -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. vertic
l
a closed orbit in m"
);
(
"YCRMS"
,
"R.m.s. vertica
l
closed orbit in m"
);
itsAttr
[
YCRMS
].
setReadOnly
(
true
);
itsAttr
[
DXMAX
]
=
Attributes
::
makeReal
...
...
src/Track/Track.cpp
View file @
f87f7972
...
...
@@ -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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment