Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
src
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
71
Issues
71
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OPAL
src
Commits
91c6d77b
Commit
91c6d77b
authored
Sep 25, 2020
by
snuverink_j
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup unused code, some from
#62
parent
cb4eaa54
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
44 additions
and
292 deletions
+44
-292
ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp
ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp
+0
-4
ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp
ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp
+0
-4
ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp
ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp
+1
-17
ippl/test/FFT/SeaborgRes/TestFFT.cpp
ippl/test/FFT/SeaborgRes/TestFFT.cpp
+0
-4
ippl/test/FFT/TestFFT-XT3.cpp
ippl/test/FFT/TestFFT-XT3.cpp
+0
-4
ippl/test/FFT/TestRCMIC.cpp
ippl/test/FFT/TestRCMIC.cpp
+2
-5
ippl/test/PwrSpec/PwrSpec.cpp
ippl/test/PwrSpec/PwrSpec.cpp
+1
-1
ippl/test/particle/PIC3d.cpp
ippl/test/particle/PIC3d.cpp
+1
-1
ippl/test/toyfdtf/ipplToyFDTD2.cpp
ippl/test/toyfdtf/ipplToyFDTD2.cpp
+0
-2
src/AbstractObjects/OpalData.h
src/AbstractObjects/OpalData.h
+0
-3
src/Algorithms/ParallelCyclotronTracker.cpp
src/Algorithms/ParallelCyclotronTracker.cpp
+2
-2
src/Algorithms/lomb.cpp
src/Algorithms/lomb.cpp
+0
-5
src/Amr/AmrYtWriter.cpp
src/Amr/AmrYtWriter.cpp
+1
-1
src/Amr/AmrYtWriter.h
src/Amr/AmrYtWriter.h
+1
-1
src/Classic/AbsBeamline/RFCavity.cpp
src/Classic/AbsBeamline/RFCavity.cpp
+4
-3
src/Classic/AbsBeamline/TravelingWave.cpp
src/Classic/AbsBeamline/TravelingWave.cpp
+0
-1
src/Classic/Algorithms/PartBunch.cpp
src/Classic/Algorithms/PartBunch.cpp
+1
-33
src/Classic/Fields/Fieldmap.cpp
src/Classic/Fields/Fieldmap.cpp
+4
-0
src/Classic/Fields/Interpolation/MMatrix.cpp
src/Classic/Fields/Interpolation/MMatrix.cpp
+0
-11
src/Classic/Fields/Interpolation/MMatrix.h
src/Classic/Fields/Interpolation/MMatrix.h
+1
-8
src/Classic/Fields/Interpolation/MVector.cpp
src/Classic/Fields/Interpolation/MVector.cpp
+0
-5
src/Classic/Fields/Interpolation/MVector.h
src/Classic/Fields/Interpolation/MVector.h
+0
-9
src/Classic/Fields/SectorField.h
src/Classic/Fields/SectorField.h
+2
-2
src/Classic/Fields/SectorMagneticFieldMap.cpp
src/Classic/Fields/SectorMagneticFieldMap.cpp
+5
-3
src/Classic/Fields/SectorMagneticFieldMap.h
src/Classic/Fields/SectorMagneticFieldMap.h
+2
-2
src/Classic/FixedAlgebra/FTpsData.h
src/Classic/FixedAlgebra/FTpsData.h
+0
-2
src/Distribution/Distribution.cpp
src/Distribution/Distribution.cpp
+7
-7
src/Elements/OpalCavity.cpp
src/Elements/OpalCavity.cpp
+1
-12
src/Elements/OpalCavity.h
src/Elements/OpalCavity.h
+0
-5
src/Elements/OpalQuadrupole.cpp
src/Elements/OpalQuadrupole.cpp
+2
-4
src/Elements/OpalTravelingWave.cpp
src/Elements/OpalTravelingWave.cpp
+1
-14
src/Elements/OpalTravelingWave.h
src/Elements/OpalTravelingWave.h
+0
-6
src/Expressions/Expressions.cpp
src/Expressions/Expressions.cpp
+1
-1
src/Main.cpp
src/Main.cpp
+0
-2
src/Solvers/BoxCornerDomain.h
src/Solvers/BoxCornerDomain.h
+0
-5
src/Structure/Beam.cpp
src/Structure/Beam.cpp
+1
-39
src/Structure/Beam.h
src/Structure/Beam.h
+0
-18
src/Structure/BoundaryGeometry.cpp
src/Structure/BoundaryGeometry.cpp
+0
-12
src/Structure/BoundaryGeometry.h
src/Structure/BoundaryGeometry.h
+0
-25
src/Structure/ElementPositionWriter.h
src/Structure/ElementPositionWriter.h
+1
-1
src/Structure/FieldSolver.cpp
src/Structure/FieldSolver.cpp
+0
-1
src/Structure/MemoryProfiler.h
src/Structure/MemoryProfiler.h
+0
-1
src/Track/TrackCmd.cpp
src/Track/TrackCmd.cpp
+0
-2
tests/classic_src/AbsBeamline/MultipoleTTest.cpp
tests/classic_src/AbsBeamline/MultipoleTTest.cpp
+2
-3
tools/opal2sdds/main.cpp
tools/opal2sdds/main.cpp
+0
-1
No files found.
ippl/test/FFT/SeaborgRes/TestFFT-PPP.cpp
View file @
91c6d77b
...
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
...
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform
msg
(
"Configure "
);
Inform
msg
(
"Configure "
);
Inform
errmsg
(
"Error "
);
Inform
errmsg
(
"Error "
);
string
bc_str
;
string
interPol_str
;
string
dist_str
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
string
s
(
argv
[
i
]);
string
s
(
argv
[
i
]);
if
(
s
==
"-grid"
)
{
if
(
s
==
"-grid"
)
{
...
...
ippl/test/FFT/SeaborgRes/TestFFT-SPP.cpp
View file @
91c6d77b
...
@@ -24,10 +24,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
...
@@ -24,10 +24,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform
msg
(
"Configure "
);
Inform
msg
(
"Configure "
);
Inform
errmsg
(
"Error "
);
Inform
errmsg
(
"Error "
);
string
bc_str
;
string
interPol_str
;
string
dist_str
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
string
s
(
argv
[
i
]);
string
s
(
argv
[
i
]);
if
(
s
==
"-grid"
)
{
if
(
s
==
"-grid"
)
{
...
...
ippl/test/FFT/SeaborgRes/TestFFT-SSP.cpp
View file @
91c6d77b
...
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
...
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform
msg
(
"Configure "
);
Inform
msg
(
"Configure "
);
Inform
errmsg
(
"Error "
);
Inform
errmsg
(
"Error "
);
string
bc_str
;
string
interPol_str
;
string
dist_str
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
string
s
(
argv
[
i
]);
string
s
(
argv
[
i
]);
if
(
s
==
"-grid"
)
{
if
(
s
==
"-grid"
)
{
...
@@ -247,16 +243,4 @@ int main(int argc, char *argv[])
...
@@ -247,16 +243,4 @@ int main(int argc, char *argv[])
testmsg
<<
" nx= "
<<
nx
<<
" ny= "
<<
ny
<<
" nz= "
<<
nz
;
testmsg
<<
" nx= "
<<
nx
<<
" ny= "
<<
ny
<<
" nz= "
<<
nz
;
testmsg
<<
" ||d||= "
<<
fabs
(
realDiff
)
<<
endl
;
testmsg
<<
" ||d||= "
<<
fabs
(
realDiff
)
<<
endl
;
return
0
;
return
0
;
}
}
\ No newline at end of file
/***************************************************************************
* $RCSfile: TestFFT-SSP.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:36 $
***************************************************************************/
/***************************************************************************
* $RCSfile: addheaderfooter,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $
* IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $
***************************************************************************/
ippl/test/FFT/SeaborgRes/TestFFT.cpp
View file @
91c6d77b
...
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
...
@@ -49,10 +49,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform
msg
(
"Configure "
);
Inform
msg
(
"Configure "
);
Inform
errmsg
(
"Error "
);
Inform
errmsg
(
"Error "
);
string
bc_str
;
string
interPol_str
;
string
dist_str
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
string
s
(
argv
[
i
]);
string
s
(
argv
[
i
]);
if
(
s
==
"-grid"
)
{
if
(
s
==
"-grid"
)
{
...
...
ippl/test/FFT/TestFFT-XT3.cpp
View file @
91c6d77b
...
@@ -51,10 +51,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
...
@@ -51,10 +51,6 @@ bool Configure(int argc, char *argv[], InterPolT *interPol,
Inform
msg
(
"Configure "
);
Inform
msg
(
"Configure "
);
Inform
errmsg
(
"Error "
);
Inform
errmsg
(
"Error "
);
string
bc_str
;
string
interPol_str
;
string
dist_str
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
string
s
(
argv
[
i
]);
string
s
(
argv
[
i
]);
if
(
s
==
"-grid"
)
{
if
(
s
==
"-grid"
)
{
...
...
ippl/test/FFT/TestRCMIC.cpp
View file @
91c6d77b
...
@@ -26,9 +26,6 @@ bool Configure(int argc, char *argv[],
...
@@ -26,9 +26,6 @@ bool Configure(int argc, char *argv[],
Inform
msg
(
"Configure "
);
Inform
msg
(
"Configure "
);
Inform
errmsg
(
"Error "
);
Inform
errmsg
(
"Error "
);
string
bc_str
;
string
dist_str
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
string
s
(
argv
[
i
]);
string
s
(
argv
[
i
]);
if
(
s
==
"-grid"
)
{
if
(
s
==
"-grid"
)
{
...
@@ -167,8 +164,8 @@ int main(int argc, char *argv[])
...
@@ -167,8 +164,8 @@ int main(int argc, char *argv[])
BareField
<
double
,
D
>
RFieldSPStan_save
(
layoutSPStan
);
BareField
<
double
,
D
>
RFieldSPStan_save
(
layoutSPStan
);
BareField
<
std
::
complex
<
double
>
,
D
>
CFieldSPStan0h
(
layoutSPStan0h
);
BareField
<
std
::
complex
<
double
>
,
D
>
CFieldSPStan0h
(
layoutSPStan0h
);
INFOMSG
(
"RFieldSPStan layout= "
<<
layoutSPStan
<<
endl
;
);
INFOMSG
(
"RFieldSPStan layout= "
<<
layoutSPStan
<<
endl
);
INFOMSG
(
"CFieldSPStan0h layout= "
<<
layoutSPStan0h
<<
endl
;
);
INFOMSG
(
"CFieldSPStan0h layout= "
<<
layoutSPStan0h
<<
endl
);
// For calling FieldDebug functions from debugger, set up output format:
// For calling FieldDebug functions from debugger, set up output format:
setFormat
(
4
,
3
);
setFormat
(
4
,
3
);
...
...
ippl/test/PwrSpec/PwrSpec.cpp
View file @
91c6d77b
...
@@ -195,7 +195,7 @@ void PwrSpec<T,Dim>::CICforward(ChargedParticles<T,Dim> *univ)
...
@@ -195,7 +195,7 @@ void PwrSpec<T,Dim>::CICforward(ChargedParticles<T,Dim> *univ)
rho_m
[
gDomainL_m
]
=
rhocic_m
[
gDomainL_m
];
rho_m
[
gDomainL_m
]
=
rhocic_m
[
gDomainL_m
];
INFOMSG
(
"rhocic_m= "
<<
sum
(
rhocic_m
)
<<
" sum(M)= "
<<
sum
(
univ
->
M
)
<<
" rho_m= "
<<
sum
(
rho_m
)
<<
endl
;
);
INFOMSG
(
"rhocic_m= "
<<
sum
(
rhocic_m
)
<<
" sum(M)= "
<<
sum
(
univ
->
M
)
<<
" rho_m= "
<<
sum
(
rho_m
)
<<
endl
);
}
}
/***************************************************************************
/***************************************************************************
...
...
ippl/test/particle/PIC3d.cpp
View file @
91c6d77b
...
@@ -474,7 +474,7 @@ public:
...
@@ -474,7 +474,7 @@ public:
smsg
->
put
(
tmp
[
i
]);
smsg
->
put
(
tmp
[
i
]);
bool
res
=
Ippl
::
Comm
->
send
(
smsg
,
0
,
tag
);
bool
res
=
Ippl
::
Comm
->
send
(
smsg
,
0
,
tag
);
if
(
!
res
)
if
(
!
res
)
ERRORMSG
(
"Ippl::Comm->send(smsg, 0, tag) failed "
<<
endl
;
);
ERRORMSG
(
"Ippl::Comm->send(smsg, 0, tag) failed "
<<
endl
);
}
}
}
}
...
...
ippl/test/toyfdtf/ipplToyFDTD2.cpp
View file @
91c6d77b
...
@@ -211,8 +211,6 @@ int main(int argc, char *argv[]){
...
@@ -211,8 +211,6 @@ int main(int argc, char *argv[]){
Inform
msg
(
argv
[
0
]);
Inform
msg
(
argv
[
0
]);
Inform
msg2all
(
argv
[
0
],
INFORM_ALL_NODES
);
Inform
msg2all
(
argv
[
0
],
INFORM_ALL_NODES
);
// variable declarations
int
i
,
j
,
k
;
// indices of the 3D array of cells
// indices of the 3D array of cells
int
nx
,
ny
,
nz
;
int
nx
,
ny
,
nz
;
// total number of cells along the x, y, and z axes, respectively
// total number of cells along the x, y, and z axes, respectively
...
...
src/AbstractObjects/OpalData.h
View file @
91c6d77b
...
@@ -38,9 +38,6 @@ class BoundaryGeometry;
...
@@ -38,9 +38,6 @@ class BoundaryGeometry;
// store element name, max phase
// store element name, max phase
typedef
std
::
pair
<
std
::
string
,
double
>
MaxPhasesT
;
typedef
std
::
pair
<
std
::
string
,
double
>
MaxPhasesT
;
typedef
std
::
map
<
double
,
double
>
energyEvolution_t
;
typedef
std
::
map
<
double
,
double
>
energyEvolution_t
;
typedef
energyEvolution_t
::
value_type
energyEvData_t
;
// Class OpalData
// Class OpalData
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
...
...
src/Algorithms/ParallelCyclotronTracker.cpp
View file @
91c6d77b
...
@@ -899,7 +899,7 @@ void ParallelCyclotronTracker::visitRFCavity(const RFCavity &as) {
...
@@ -899,7 +899,7 @@ void ParallelCyclotronTracker::visitRFCavity(const RFCavity &as) {
RFCavity
*
elptr
=
dynamic_cast
<
RFCavity
*>
(
as
.
clone
());
RFCavity
*
elptr
=
dynamic_cast
<
RFCavity
*>
(
as
.
clone
());
myElements
.
push_back
(
elptr
);
myElements
.
push_back
(
elptr
);
if
((
elptr
->
getComponentType
()
!=
"SINGLEGAP"
)
&&
(
elptr
->
getComponentType
()
!=
"DOUBLEGAP"
)
)
{
if
(
elptr
->
getComponentType
()
!=
"SINGLEGAP"
)
{
*
gmsg
<<
(
elptr
->
getComponentType
())
<<
endl
;
*
gmsg
<<
(
elptr
->
getComponentType
())
<<
endl
;
throw
OpalException
(
"ParallelCyclotronTracker::visitRFCavity"
,
throw
OpalException
(
"ParallelCyclotronTracker::visitRFCavity"
,
"The ParallelCyclotronTracker can only play with cyclotron type RF system currently ..."
);
"The ParallelCyclotronTracker can only play with cyclotron type RF system currently ..."
);
...
@@ -1633,7 +1633,7 @@ double ParallelCyclotronTracker::getHarmonicNumber() const {
...
@@ -1633,7 +1633,7 @@ double ParallelCyclotronTracker::getHarmonicNumber() const {
return
elcycl
->
getCyclHarm
();
return
elcycl
->
getCyclHarm
();
throw
OpalException
(
"ParallelCyclotronTracker::getHarmonicNumber()"
,
throw
OpalException
(
"ParallelCyclotronTracker::getHarmonicNumber()"
,
std
::
string
(
"The first item in the FieldDimensions list does not "
)
std
::
string
(
"The first item in the FieldDimensions list does not "
)
+
std
::
string
(
"seem to be a
n
Ring or a Cyclotron element"
));
+
std
::
string
(
"seem to be a Ring or a Cyclotron element"
));
}
}
...
...
src/Algorithms/lomb.cpp
View file @
91c6d77b
...
@@ -52,8 +52,6 @@ int LOMB_class::period(std::vector<LOMB_TYPE> *indata, std::vector<LOMB_TYPE> *o
...
@@ -52,8 +52,6 @@ int LOMB_class::period(std::vector<LOMB_TYPE> *indata, std::vector<LOMB_TYPE> *o
LOMB_TYPE
pt
;
LOMB_TYPE
pt
;
CI_lt
p
,
q
;
CI_lt
p
,
q
;
CI_vd
ai
;
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
wi
.
erase
(
wi
.
begin
(),
wi
.
end
());
wi
.
erase
(
wi
.
begin
(),
wi
.
end
());
...
@@ -266,10 +264,7 @@ int LOMB_class::moment(std::vector<LOMB_TYPE> *indata, double *ave, double *adev
...
@@ -266,10 +264,7 @@ int LOMB_class::moment(std::vector<LOMB_TYPE> *indata, double *ave, double *adev
int
n
;
int
n
;
double
pnr
,
s
,
ep
;
double
pnr
,
s
,
ep
;
std
::
vector
<
double
>
xvec
;
CI_lt
p
,
q
;
CI_lt
p
,
q
;
CI_vd
xp
;
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
p
=
indata
->
begin
();
p
=
indata
->
begin
();
...
...
src/Amr/AmrYtWriter.cpp
View file @
91c6d77b
...
@@ -496,9 +496,9 @@ void AmrYtWriter::writeBunch(const AmrPartBunch* bunch_p,
...
@@ -496,9 +496,9 @@ void AmrYtWriter::writeBunch(const AmrPartBunch* bunch_p,
std
::
string
filePrefix
(
LevelDir
);
std
::
string
filePrefix
(
LevelDir
);
filePrefix
+=
'/'
;
filePrefix
+=
'/'
;
filePrefix
+=
"DATA_"
;
filePrefix
+=
"DATA_"
;
bool
groupSets
(
false
),
setBuf
(
true
);
if
(
gotsome
)
{
if
(
gotsome
)
{
bool
groupSets
(
false
),
setBuf
(
true
);
for
(
amrex
::
NFilesIter
nfi
(
nOutFiles
,
filePrefix
,
groupSets
,
setBuf
);
nfi
.
ReadyToWrite
();
++
nfi
)
{
for
(
amrex
::
NFilesIter
nfi
(
nOutFiles
,
filePrefix
,
groupSets
,
setBuf
);
nfi
.
ReadyToWrite
();
++
nfi
)
{
std
::
ofstream
&
myStream
=
(
std
::
ofstream
&
)
nfi
.
Stream
();
std
::
ofstream
&
myStream
=
(
std
::
ofstream
&
)
nfi
.
Stream
();
//
//
...
...
src/Amr/AmrYtWriter.h
View file @
91c6d77b
...
@@ -39,7 +39,7 @@ public:
...
@@ -39,7 +39,7 @@ public:
* @param step we write
* @param step we write
* @param bin energy bin we write (multi-bunch simulation)
* @param bin energy bin we write (multi-bunch simulation)
*/
*/
AmrYtWriter
(
int
step
,
int
bin
=
0
);
explicit
AmrYtWriter
(
int
step
,
int
bin
=
0
);
/*!
/*!
* Write yt files to the simulation subdirectory
* Write yt files to the simulation subdirectory
...
...
src/Classic/AbsBeamline/RFCavity.cpp
View file @
91c6d77b
...
@@ -534,7 +534,7 @@ double RFCavity::getAutoPhaseEstimateFallback(double E0, double t0, double q, do
...
@@ -534,7 +534,7 @@ double RFCavity::getAutoPhaseEstimateFallback(double E0, double t0, double q, do
}
}
double
RFCavity
::
getAutoPhaseEstimate
(
const
double
&
E0
,
const
double
&
t0
,
const
double
&
q
,
const
double
&
mass
)
{
double
RFCavity
::
getAutoPhaseEstimate
(
const
double
&
E0
,
const
double
&
t0
,
const
double
&
q
,
const
double
&
mass
)
{
std
::
vector
<
double
>
t
,
E
,
t2
,
E2
;
std
::
vector
<
double
>
t
,
E
,
t2
,
E2
;
std
::
vector
<
double
>
F
;
std
::
vector
<
double
>
F
;
std
::
vector
<
std
::
pair
<
double
,
double
>
>
G
;
std
::
vector
<
std
::
pair
<
double
,
double
>
>
G
;
gsl_spline
*
onAxisInterpolants
;
gsl_spline
*
onAxisInterpolants
;
...
@@ -543,6 +543,7 @@ double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const
...
@@ -543,6 +543,7 @@ double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const
double
phi
=
0.0
,
tmp_phi
,
dphi
=
0.5
*
Physics
::
pi
/
180.
;
double
phi
=
0.0
,
tmp_phi
,
dphi
=
0.5
*
Physics
::
pi
/
180.
;
double
dz
=
1.0
,
length
=
0.0
;
double
dz
=
1.0
,
length
=
0.0
;
fieldmap_m
->
getOnaxisEz
(
G
);
fieldmap_m
->
getOnaxisEz
(
G
);
if
(
G
.
size
()
==
0
)
return
0.0
;
double
begin
=
(
G
.
front
()).
first
;
double
begin
=
(
G
.
front
()).
first
;
double
end
=
(
G
.
back
()).
first
;
double
end
=
(
G
.
back
()).
first
;
std
::
unique_ptr
<
double
[]
>
zvals
(
new
double
[
G
.
size
()]);
std
::
unique_ptr
<
double
[]
>
zvals
(
new
double
[
G
.
size
()]);
...
@@ -628,9 +629,9 @@ double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const
...
@@ -628,9 +629,9 @@ double RFCavity::getAutoPhaseEstimate(const double &E0, const double &t0, const
t
[
i
]
=
t
[
i
-
1
]
+
getdT
(
i
,
E
,
dz
,
mass
);
t
[
i
]
=
t
[
i
-
1
]
+
getdT
(
i
,
E
,
dz
,
mass
);
t2
[
i
]
=
t2
[
i
-
1
]
+
getdT
(
i
,
E2
,
dz
,
mass
);
t2
[
i
]
=
t2
[
i
-
1
]
+
getdT
(
i
,
E2
,
dz
,
mass
);
E
[
i
]
=
E
[
i
-
1
];
E
[
i
]
=
E
[
i
-
1
];
E2
[
i
]
=
E2
[
i
-
1
];
E2
[
i
]
=
E2
[
i
-
1
];
E
[
i
]
+=
q
*
scale_m
*
getdE
(
i
,
t
,
dz
,
phi
,
frequency_m
,
F
)
;
E
[
i
]
+=
q
*
scale_m
*
getdE
(
i
,
t
,
dz
,
phi
,
frequency_m
,
F
)
;
E2
[
i
]
+=
q
*
scale_m
*
getdE
(
i
,
t2
,
dz
,
phi
+
dphi
,
frequency_m
,
F
);
E2
[
i
]
+=
q
*
scale_m
*
getdE
(
i
,
t2
,
dz
,
phi
+
dphi
,
frequency_m
,
F
);
}
}
...
...
src/Classic/AbsBeamline/TravelingWave.cpp
View file @
91c6d77b
...
@@ -199,7 +199,6 @@ void TravelingWave::initialise(PartBunchBase<double, 3> *bunch, double &startFie
...
@@ -199,7 +199,6 @@ void TravelingWave::initialise(PartBunchBase<double, 3> *bunch, double &startFie
}
}
Inform
msg
(
"TravelingWave "
,
*
gmsg
);
Inform
msg
(
"TravelingWave "
,
*
gmsg
);
std
::
stringstream
errormsg
;
RefPartBunch_m
=
bunch
;
RefPartBunch_m
=
bunch
;
double
zBegin
=
0.0
,
zEnd
=
0.0
;
double
zBegin
=
0.0
,
zEnd
=
0.0
;
...
...
src/Classic/Algorithms/PartBunch.cpp
View file @
91c6d77b
...
@@ -345,7 +345,7 @@ void PartBunch::resizeMesh() {
...
@@ -345,7 +345,7 @@ void PartBunch::resizeMesh() {
R
[
n
](
1
)
<
ymin
||
R
[
n
](
1
)
>
ymax
)
{
R
[
n
](
1
)
<
ymin
||
R
[
n
](
1
)
>
ymax
)
{
// delete the particle
// delete the particle
INFOMSG
(
level2
<<
"destroyed particle with id="
<<
ID
[
n
]
<<
endl
;
);
INFOMSG
(
level2
<<
"destroyed particle with id="
<<
ID
[
n
]
<<
endl
);
destroy
(
1
,
n
);
destroy
(
1
,
n
);
}
}
...
@@ -831,38 +831,6 @@ void PartBunch::updateFields(const Vector_t& /*hr*/, const Vector_t& origin) {
...
@@ -831,38 +831,6 @@ void PartBunch::updateFields(const Vector_t& /*hr*/, const Vector_t& origin) {
vbc_m
);
vbc_m
);
}
}
/**
* Here we emit particles from the cathode. All particles in a new simulation (not a restart) initially reside in the bin
container "pbin_m" and are not part of the beam bunch (so they cannot "see" fields, space charge etc.). In pbin_m, particles
are sorted into the bins of a time histogram that describes the longitudinal time distribution of the beam, where the number
of bins is given by \f$NBIN \times SBIN\f$. \f$NBIN\f$ and \f$SBIN\f$ are parameters given when defining the initial beam
distribution. During emission, the time step of the simulation is set so that an integral number of these bins are emitted each step.
Once all of the particles have been emitted, the simulation time step is reset to the value defined in the input file.
A typical integration time step, \f$\Delta t\f$, is broken down into 3 sub-steps:
1) Drift particles for \f$\frac{\Delta t}{2}\f$.
2) Calculate fields and advance momentum.
3) Drift particles for \f$\frac{\Delta t}{2}\f$ at the new momentum to complete the
full time step.
The difficulty for emission is that at the cathode position there is a step function discontinuity in the fields. If we
apply the typical integration time step across this boundary, we get an artificial numerical bunching of the beam, especially
at very high accelerating fields. This function takes the cathode position boundary into account in order to achieve
smoother particle emission.
During an emission step, an integral number of time bins from the distribution histogram are emitted. However, each particle
contained in those time bins will actually be emitted from the cathode at a different time, so will only spend some fraction
of the total time step, \f$\Delta t_{full-timestep}\f$, in the simulation. The trick to emission is to give each particle
a unique time step, \f$Delta t_{temp}\f$, that is equal to the actual time during the emission step that the particle
exists in the simulation. For the next integration time step, the particle's time step is set back to the global time step,
\f$\Delta t_{full-timestep}\f$.
*/
inline
inline
PartBunch
::
VectorPair_t
PartBunch
::
getEExtrema
()
{
PartBunch
::
VectorPair_t
PartBunch
::
getEExtrema
()
{
const
Vector_t
maxE
=
max
(
eg_m
);
const
Vector_t
maxE
=
max
(
eg_m
);
...
...
src/Classic/Fields/Fieldmap.cpp
View file @
91c6d77b
...
@@ -290,6 +290,10 @@ MapType Fieldmap::readHeader(std::string Filename) {
...
@@ -290,6 +290,10 @@ MapType Fieldmap::readHeader(std::string Filename) {
if
(
Filename
==
"1DPROFILE1-DEFAULT"
)
if
(
Filename
==
"1DPROFILE1-DEFAULT"
)
return
T1DProfile1
;
return
T1DProfile1
;
if
(
Filename
.
empty
())
throw
GeneralClassicException
(
"Fieldmap::readHeader()"
,
"No field map file specified"
);
if
(
!
fs
::
exists
(
Filename
))
if
(
!
fs
::
exists
(
Filename
))
throw
GeneralClassicException
(
"Fieldmap::readHeader()"
,
throw
GeneralClassicException
(
"Fieldmap::readHeader()"
,
"File
\"
"
+
Filename
+
"
\"
doesn't exist"
);
"File
\"
"
+
Filename
+
"
\"
doesn't exist"
);
...
...
src/Classic/Fields/Interpolation/MMatrix.cpp
View file @
91c6d77b
...
@@ -374,17 +374,6 @@ template <class Tmplt> std::istream& operator>>(std::istream& in, MMatrix<Tmplt>
...
@@ -374,17 +374,6 @@ template <class Tmplt> std::istream& operator>>(std::istream& in, MMatrix<Tmplt>
///////////////// INTERFACES
///////////////// INTERFACES
const
gsl_matrix
*
MMatrix_to_gsl
(
const
MMatrix
<
double
>&
m
)
{
if
(
m
.
_matrix
==
NULL
)
throw
(
GeneralClassicException
(
"MMatrix_to_gsl"
,
"Attempt to reference uninitialised matrix"
));
return
(
gsl_matrix
*
)
m
.
_matrix
;
}
const
gsl_matrix_complex
*
MMatrix_to_gsl
(
const
MMatrix
<
m_complex
>&
m
)
{
if
(
m
.
_matrix
==
NULL
)
throw
(
GeneralClassicException
(
"MMatrix_to_gsl"
,
"Attempt to reference uninitialised matrix"
));
return
(
gsl_matrix_complex
*
)
m
.
_matrix
;
}
MMatrix
<
double
>
re
(
MMatrix
<
m_complex
>
mc
)
MMatrix
<
double
>
re
(
MMatrix
<
m_complex
>
mc
)
{
{
...
...
src/Classic/Fields/Interpolation/MMatrix.h
View file @
91c6d77b
...
@@ -172,10 +172,7 @@ public:
...
@@ -172,10 +172,7 @@ public:
friend
MMatrix
<
m_complex
>&
operator
+=
(
MMatrix
<
m_complex
>&
m1
,
const
MMatrix
<
m_complex
>&
m2
);
friend
MMatrix
<
m_complex
>&
operator
+=
(
MMatrix
<
m_complex
>&
m1
,
const
MMatrix
<
m_complex
>&
m2
);
friend
MMatrix
<
double
>&
operator
+=
(
MMatrix
<
double
>&
m1
,
const
MMatrix
<
double
>&
m2
);
friend
MMatrix
<
double
>&
operator
+=
(
MMatrix
<
double
>&
m1
,
const
MMatrix
<
double
>&
m2
);
template
<
class
Tmplt2
>
friend
MMatrix
<
Tmplt2
>
operator
+
(
MMatrix
<
Tmplt2
>
m1
,
const
MMatrix
<
Tmplt2
>
m2
);
template
<
class
Tmplt2
>
friend
MMatrix
<
Tmplt2
>
operator
+
(
MMatrix
<
Tmplt2
>
m1
,
const
MMatrix
<
Tmplt2
>
m2
);
friend
const
gsl_matrix
*
MMatrix_to_gsl
(
const
MMatrix
<
double
>&
m
);
friend
const
gsl_matrix_complex
*
MMatrix_to_gsl
(
const
MMatrix
<
gsl_complex
>&
m
);
friend
class
MMatrix
<
double
>
;
//To do the eigenvector problem, MMatrix<double> needs to see MMatrix<complex>'s _matrix
friend
class
MMatrix
<
double
>
;
//To do the eigenvector problem, MMatrix<double> needs to see MMatrix<complex>'s _matrix
...
@@ -233,10 +230,6 @@ MMatrix<double> im(MMatrix<m_complex> m);
...
@@ -233,10 +230,6 @@ MMatrix<double> im(MMatrix<m_complex> m);
MMatrix
<
m_complex
>
complex
(
MMatrix
<
double
>
real
);
MMatrix
<
m_complex
>
complex
(
MMatrix
<
double
>
real
);
MMatrix
<
m_complex
>
complex
(
MMatrix
<
double
>
real
,
MMatrix
<
double
>
imaginary
);
MMatrix
<
m_complex
>
complex
(
MMatrix
<
double
>
real
,
MMatrix
<
double
>
imaginary
);
//return pointer to gsl_matrix objects that store matrix data in m
const
gsl_matrix
*
MMatrix_to_gsl
(
const
MMatrix
<
double
>&
m
);
const
gsl_matrix_complex
*
MMatrix_to_gsl
(
const
MMatrix
<
gsl_complex
>&
m
);
//////////////////////////// MMatrix declaration end ///////////////
//////////////////////////// MMatrix declaration end ///////////////
...
...
src/Classic/Fields/Interpolation/MVector.cpp
View file @
91c6d77b
...
@@ -188,11 +188,6 @@ template <class Tmplt> std::istream& operator>>(std::istream& in, MVector<Tmplt>
...
@@ -188,11 +188,6 @@ template <class Tmplt> std::istream& operator>>(std::istream& in, MVector<Tmplt>
return
in
;
return
in
;
}
}
const
gsl_vector
*
MVector_to_gsl
(
const
MVector
<
double
>&
vd
)
{
return
vd
.
get_vector
(
vd
);}
const
gsl_vector_complex
*
MVector_to_gsl
(
const
MVector
<
gsl_complex
>&
vc
)
{
return
vc
.
get_vector
(
vc
);}
template
<
class
Tmplt
>
template
<
class
Tmplt
>
MVector
<
Tmplt
>
MVector
<
Tmplt
>::
sub
(
size_t
n1
,
size_t
n2
)
const
MVector
<
Tmplt
>
MVector
<
Tmplt
>::
sub
(
size_t
n1
,
size_t
n2
)
const
{
{
...
...
src/Classic/Fields/Interpolation/MVector.h
View file @
91c6d77b
...
@@ -150,11 +150,6 @@ public:
...
@@ -150,11 +150,6 @@ public:
friend
class
MMatrix
<
Tmplt
>
;
friend
class
MMatrix
<
Tmplt
>
;
friend
class
MMatrix
<
double
>
;
friend
class
MMatrix
<
double
>
;
// friend gsl_vector* MVectorToGSL(MVector<double>& );
// friend gsl_vector_complex* MVectorToGSL(MVector<gsl_complex>&);
friend
const
gsl_vector
*
MVector_to_gsl
(
const
MVector
<
double
>&
);
friend
const
gsl_vector_complex
*
MVector_to_gsl
(
const
MVector
<
gsl_complex
>&
);
private:
private:
void
build_vector
(
size_t
size
);
//copy from data and put it in the vector
void
build_vector
(
size_t
size
);
//copy from data and put it in the vector
void
build_vector
(
const
Tmplt
*
data_start
,
const
Tmplt
*
data_end
);
//copy from data and put it in the vector
void
build_vector
(
const
Tmplt
*
data_start
,
const
Tmplt
*
data_end
);
//copy from data and put it in the vector
...
@@ -204,10 +199,6 @@ MVector<m_complex> complex(MVector<double> real, MVector<double> imaginary);
...
@@ -204,10 +199,6 @@ MVector<m_complex> complex(MVector<double> real, MVector<double> imaginary);
MVector
<
double
>
re
(
MVector
<
m_complex
>
mv
);
MVector
<
double
>
re
(
MVector
<
m_complex
>
mv
);
MVector
<
double
>
im
(
MVector
<
m_complex
>
mv
);
MVector
<
double
>
im
(
MVector
<
m_complex
>
mv
);
//Interface to gsl
const
gsl_vector
*
MVector_to_gsl
(
const
MVector
<
double
>&
vd
);
const
gsl_vector_complex
*
MVector_to_gsl
(
const
MVector
<
gsl_complex
>&
vc
);
///////////////// MVector End ///////////////// Nb: some inlined functions below...
///////////////// MVector End ///////////////// Nb: some inlined functions below...
//////////////////////////// MVector Inlined Functions //////////////
//////////////////////////// MVector Inlined Functions //////////////
...
...
src/Classic/Fields/SectorField.h
View file @
91c6d77b
...
@@ -79,8 +79,8 @@ class SectorField {
...
@@ -79,8 +79,8 @@ class SectorField {
* Overwrites any existing data
* Overwrites any existing data
* \returns true if any field value is non-zero
* \returns true if any field value is non-zero
*/
*/
virtual
bool
getFieldstrengthPolar
/* virtual bool getFieldstrengthPolar */
(
const
Vector_t
&
R_p
,
Vector_t
&
E_p
,
Vector_t
&
B_p
)
const
=
0
;
/* (const Vector_t &R_p, Vector_t &E_p, Vector_t &B_p) const = 0; */
/** Return the field value in cartesian coordinates
/** Return the field value in cartesian coordinates
*
*
...
...
src/Classic/Fields/SectorMagneticFieldMap.cpp
View file @
91c6d77b
...
@@ -189,8 +189,9 @@ std::string SectorMagneticFieldMap::SymmetryToString
...
@@ -189,8 +189,9 @@ std::string SectorMagneticFieldMap::SymmetryToString
));
));
}
}
bool
SectorMagneticFieldMap
::
getFieldstrengthPolar
(
/*
const
Vector_t
&
R_p
,
Vector_t
&
/*E_p*/
,
Vector_t
&
B_p
)
const
{
bool SectorMagneticFieldMap::getFieldstrengthPolar
(const Vector_t &R_p, Vector_t &, Vector_t &B_p) const {
// vector_t::operator[i] const returns by value, not by const reference
// vector_t::operator[i] const returns by value, not by const reference
// so we need to make an array here
// so we need to make an array here
double R_temp[3] = {R_p[0], R_p[1], R_p[2]};
double R_temp[3] = {R_p[0], R_p[1], R_p[2]};
...
@@ -202,13 +203,14 @@ bool SectorMagneticFieldMap::getFieldstrengthPolar (
...
@@ -202,13 +203,14 @@ bool SectorMagneticFieldMap::getFieldstrengthPolar (
SectorField::convertToPolar(R_temp, &(B_p[0]));
SectorField::convertToPolar(R_temp, &(B_p[0]));
return false;
return false;
}
}
*/
bool
SectorMagneticFieldMap
::
getFieldstrength
(
bool
SectorMagneticFieldMap
::
getFieldstrength
(
const
Vector_t
&
R_c
,
Vector_t
&
/*E_c*/
,
Vector_t
&
B_c
)
const
{
const
Vector_t
&
R_c
,
Vector_t
&
/*E_c*/
,
Vector_t
&
B_c
)
const
{
// coordinate transform; field is in the x-z plane but OPAL-CYCL assumes
// coordinate transform; field is in the x-z plane but OPAL-CYCL assumes
// x-y plane; rotate to the start of the bend and into polar coordinates;
// x-y plane; rotate to the start of the bend and into polar coordinates;
// apply mirror symmetry about the midplane
// apply mirror symmetry about the midplane
double
radius
=
(
getPolarBoundingBoxMin
()[
0
]
+
getPolarBoundingBoxMax
()[
0
])
/
2
;
double
radius
=
(
getPolarBoundingBoxMin
()[
0
]
+
getPolarBoundingBoxMax
()[
0
])
/
2
;
double
midplane
=
(
getPolarBoundingBoxMin
()[
1
]
+
getPolarBoundingBoxMax
()[
1
])
/
2
;
double
midplane
=
(
getPolarBoundingBoxMin
()[
1
]
+
getPolarBoundingBoxMax
()[
1
])
/
2
;
double
R_temp
[
3
]
=
{
R_c
(
0
)
+
radius
,
R_c
(
1
),
R_c
(
2
)};
double
R_temp
[
3
]
=
{
R_c
(
0
)
+
radius
,
R_c
(
1
),
R_c
(
2
)};
double
B_temp
[
3
]
=
{
0.
,
0.
,
0.
};
double
B_temp
[
3
]
=
{
0.
,
0.
,
0.
};
...
...
src/Classic/Fields/SectorMagneticFieldMap.h
View file @
91c6d77b
...
@@ -114,8 +114,8 @@ class SectorMagneticFieldMap : public SectorField {
...
@@ -114,8 +114,8 @@ class SectorMagneticFieldMap : public SectorField {
* Overwrites any existing data
* Overwrites any existing data
* \returns false if R_p is inside the bounding box
* \returns false if R_p is inside the bounding box
*/
*/
bool
getFieldstrengthPolar
/* bool getFieldstrengthPolar */
(
const
Vector_t
&
R_p
,
Vector_t
&
E_p
,
Vector_t
&
B_p
)
const
;
/* (const Vector_t &R_p, Vector_t &E_p, Vector_t &B_p) const; */
/** Get the field value in cartesian coordinates
/** Get the field value in cartesian coordinates
*
*
...
...
src/Classic/FixedAlgebra/FTpsData.h
View file @
91c6d77b
...
@@ -25,8 +25,6 @@
...
@@ -25,8 +25,6 @@
#include "FixedAlgebra/FArray1D.h"
#include "FixedAlgebra/FArray1D.h"
#include "FixedAlgebra/FMonomial.h"
#include "FixedAlgebra/FMonomial.h"
#define DEBUG_FTpsData_H
// Template class FTpsData<N>
// Template class FTpsData<N>
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
/// Internal utility class for FTps<T,N> class.
/// Internal utility class for FTps<T,N> class.
...
...
src/Distribution/Distribution.cpp
View file @
91c6d77b
...
@@ -304,7 +304,7 @@ void Distribution::create(size_t &numberOfParticles, double massIneV, double cha
...
@@ -304,7 +304,7 @@ void Distribution::create(size_t &numberOfParticles, double massIneV, double cha
createDistributionMultiGauss
(
numberOfLocalParticles
,
massIneV
);
createDistributionMultiGauss
(
numberOfLocalParticles
,
massIneV
);
break
;
break
;
default:
default:
INFOMSG
(
"Distribution unknown."
<<
endl
;
);
INFOMSG
(
"Distribution unknown."
<<
endl
);
break
;
break
;
}
}
...
@@ -1194,15 +1194,15 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles,
...
@@ -1194,15 +1194,15 @@ void Distribution::createMatchedGaussDistribution(size_t numberOfParticles,
int
Nsectors
=
(
int
)
Attributes
::
getReal
(
itsAttr
[
Attrib
::
Distribution
::
NSECTORS
]);
int
Nsectors
=
(
int
)
Attributes
::
getReal
(
itsAttr
[
Attrib
::
Distribution
::
NSECTORS
]);
if
(
Nint
<
0
)
if
(
Nint
<
0
)
throw
OpalException
(
"Distribution::
C
reateMatchedGaussDistribution()"
,
throw
OpalException
(
"Distribution::
c
reateMatchedGaussDistribution()"
,
"Negative number of integration steps"
);
"Negative number of integration steps"
);
if
(
Nsectors
<
0
)
if
(
Nsectors
<
0
)
throw
OpalException
(
"Distribution::
C
reateMatchedGaussDistribution()"
,
throw
OpalException
(
"Distribution::
c
reateMatchedGaussDistribution()"
,
"Negative number of sectors"
);
"Negative number of sectors"
);
if
(
Nsectors
>
1
&&
full
==
false
)
if
(
Nsectors
>
1
&&
full
==
false
)
throw
OpalException
(
"Distribution::
C
reateMatchedGaussDistribution()"
,