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
692b53ad
Commit
692b53ad
authored
May 02, 2019
by
kraus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace all tabs with 4 spaces
parent
6d4ff07f
Changes
65
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
1382 additions
and
1405 deletions
+1382
-1405
src/AbstractObjects/OpalData.cpp
src/AbstractObjects/OpalData.cpp
+6
-6
src/Algorithms/CavityAutophaser.cpp
src/Algorithms/CavityAutophaser.cpp
+2
-2
src/Algorithms/CavityAutophaser.h
src/Algorithms/CavityAutophaser.h
+2
-2
src/Algorithms/Ctunes.cpp
src/Algorithms/Ctunes.cpp
+4
-4
src/Algorithms/ParallelSliceTracker.cpp
src/Algorithms/ParallelSliceTracker.cpp
+3
-3
src/Algorithms/ParallelTTracker.cpp
src/Algorithms/ParallelTTracker.cpp
+2
-2
src/Algorithms/bet/EnvelopeBunch.cpp
src/Algorithms/bet/EnvelopeBunch.cpp
+5
-5
src/Algorithms/bet/error.C
src/Algorithms/bet/error.C
+42
-43
src/Algorithms/bet/profile.cpp
src/Algorithms/bet/profile.cpp
+2
-3
src/Amr/BoxLibLayout.hpp
src/Amr/BoxLibLayout.hpp
+86
-86
src/BasicActions/Option.cpp
src/BasicActions/Option.cpp
+3
-3
src/Classic/AbsBeamline/Bend.cpp
src/Classic/AbsBeamline/Bend.cpp
+7
-7
src/Classic/AbsBeamline/CyclotronValley.cpp
src/Classic/AbsBeamline/CyclotronValley.cpp
+2
-2
src/Classic/AbsBeamline/MultipoleT.h
src/Classic/AbsBeamline/MultipoleT.h
+21
-21
src/Classic/AbsBeamline/Offset.cpp
src/Classic/AbsBeamline/Offset.cpp
+3
-3
src/Classic/AbsBeamline/RFCavity.cpp
src/Classic/AbsBeamline/RFCavity.cpp
+6
-6
src/Classic/AbsBeamline/RFCavity.h
src/Classic/AbsBeamline/RFCavity.h
+2
-2
src/Classic/AbsBeamline/TravelingWave.cpp
src/Classic/AbsBeamline/TravelingWave.cpp
+10
-10
src/Classic/Algebra/ComplexEigen.cpp
src/Classic/Algebra/ComplexEigen.cpp
+7
-7
src/Classic/Algorithms/PartBunch.cpp
src/Classic/Algorithms/PartBunch.cpp
+5
-5
src/Classic/Algorithms/PartBunchBase.hpp
src/Classic/Algorithms/PartBunchBase.hpp
+6
-6
src/Classic/BeamlineCore/CyclotronValleyRep.cpp
src/Classic/BeamlineCore/CyclotronValleyRep.cpp
+2
-2
src/Classic/BeamlineCore/DegraderRep.cpp
src/Classic/BeamlineCore/DegraderRep.cpp
+2
-2
src/Classic/BeamlineCore/ParallelPlateRep.cpp
src/Classic/BeamlineCore/ParallelPlateRep.cpp
+2
-2
src/Classic/Fields/Fieldmap.cpp
src/Classic/Fields/Fieldmap.cpp
+7
-7
src/Classic/Fields/Fieldmap.hpp
src/Classic/Fields/Fieldmap.hpp
+17
-17
src/Classic/Solvers/CSRIGFWakeFunction.cpp
src/Classic/Solvers/CSRIGFWakeFunction.cpp
+3
-3
src/Classic/Solvers/CSRWakeFunction.cpp
src/Classic/Solvers/CSRWakeFunction.cpp
+2
-2
src/Classic/Structure/LossDataSink.cpp
src/Classic/Structure/LossDataSink.cpp
+11
-11
src/Distribution/Distribution.h
src/Distribution/Distribution.h
+2
-2
src/Distribution/SigmaGenerator.h
src/Distribution/SigmaGenerator.h
+95
-95
src/Distribution/rdm.h
src/Distribution/rdm.h
+30
-30
src/Elements/OpalBeamline.cpp
src/Elements/OpalBeamline.cpp
+1
-1
src/Elements/OpalBend.h
src/Elements/OpalBend.h
+3
-3
src/Elements/OpalCavity.cpp
src/Elements/OpalCavity.cpp
+1
-1
src/Elements/OpalCavity.h
src/Elements/OpalCavity.h
+4
-4
src/Elements/OpalCyclotron.cpp
src/Elements/OpalCyclotron.cpp
+4
-4
src/Elements/OpalDrift.cpp
src/Elements/OpalDrift.cpp
+3
-3
src/Elements/OpalDrift.h
src/Elements/OpalDrift.h
+4
-5
src/Elements/OpalMultipoleT.h
src/Elements/OpalMultipoleT.h
+12
-17
src/Elements/OpalMultipoleTCurvedConstRadius.cpp
src/Elements/OpalMultipoleTCurvedConstRadius.cpp
+20
-20
src/Elements/OpalMultipoleTCurvedConstRadius.h
src/Elements/OpalMultipoleTCurvedConstRadius.h
+11
-16
src/Elements/OpalMultipoleTCurvedVarRadius.cpp
src/Elements/OpalMultipoleTCurvedVarRadius.cpp
+20
-20
src/Elements/OpalMultipoleTCurvedVarRadius.h
src/Elements/OpalMultipoleTCurvedVarRadius.h
+11
-16
src/Elements/OpalMultipoleTStraight.cpp
src/Elements/OpalMultipoleTStraight.cpp
+19
-19
src/Elements/OpalMultipoleTStraight.h
src/Elements/OpalMultipoleTStraight.h
+10
-15
src/Elements/OpalQuadrupole.h
src/Elements/OpalQuadrupole.h
+2
-2
src/Match/Match.cpp
src/Match/Match.cpp
+5
-5
src/OpalParser/OpalParser.cpp
src/OpalParser/OpalParser.cpp
+7
-7
src/Solvers/AMR_MG/AmrMultiGrid.cpp
src/Solvers/AMR_MG/AmrMultiGrid.cpp
+292
-292
src/Solvers/ArbitraryDomain.cpp
src/Solvers/ArbitraryDomain.cpp
+39
-39
src/Solvers/BoxCornerDomain.cpp
src/Solvers/BoxCornerDomain.cpp
+3
-3
src/Solvers/BoxCornerDomain.h
src/Solvers/BoxCornerDomain.h
+8
-8
src/Solvers/BoxLibSolvers/FMGPoissonSolver.cpp
src/Solvers/BoxLibSolvers/FMGPoissonSolver.cpp
+52
-52
src/Solvers/EllipticDomain.cpp
src/Solvers/EllipticDomain.cpp
+32
-32
src/Solvers/FFTPoissonSolver.cpp
src/Solvers/FFTPoissonSolver.cpp
+26
-26
src/Solvers/MGPoissonSolver.cpp
src/Solvers/MGPoissonSolver.cpp
+13
-13
src/Structure/BoundaryGeometry.cpp
src/Structure/BoundaryGeometry.cpp
+25
-25
src/Structure/DataSink.cpp
src/Structure/DataSink.cpp
+5
-5
src/Structure/DataSink.h
src/Structure/DataSink.h
+7
-7
src/Structure/FieldSolver.cpp
src/Structure/FieldSolver.cpp
+3
-3
src/Structure/H5PartWrapper.cpp
src/Structure/H5PartWrapper.cpp
+6
-6
src/Structure/ParticleMatterInteraction.cpp
src/Structure/ParticleMatterInteraction.cpp
+2
-2
src/Structure/SecondaryEmissionPhysics.cpp
src/Structure/SecondaryEmissionPhysics.cpp
+330
-330
src/ValueDefinitions/RealConstant.cpp
src/ValueDefinitions/RealConstant.cpp
+3
-3
No files found.
src/AbstractObjects/OpalData.cpp
View file @
692b53ad
...
...
@@ -458,27 +458,27 @@ energyEvolution_t::iterator OpalData::getLastEnergyData() {
// Mesh_t* OpalData::getMesh() {
//
return p->mesh_m;
//
return p->mesh_m;
// }
// FieldLayout_t* OpalData::getFieldLayout() {
//
return p->FL_m;
//
return p->FL_m;
// }
// Layout_t* OpalData::getLayout() {
//
return p->PL_m;
//
return p->PL_m;
// }
// void OpalData::setMesh(Mesh_t *mesh) {
//
p->mesh_m = mesh;
//
p->mesh_m = mesh;
// }
// void OpalData::setFieldLayout(FieldLayout_t *fieldlayout) {
//
p->FL_m = fieldlayout;
//
p->FL_m = fieldlayout;
// }
// void OpalData::setLayout(Layout_t *layout) {
//
p->PL_m = layout;
//
p->PL_m = layout;
// }
void
OpalData
::
setGlobalPhaseShift
(
double
shift
)
{
...
...
src/Algorithms/CavityAutophaser.cpp
View file @
692b53ad
...
...
@@ -266,7 +266,7 @@ double CavityAutophaser::track(Vector_t R,
double
t
,
const
double
dt
,
const
double
phase
,
std
::
ofstream
*
out
)
const
{
std
::
ofstream
*
out
)
const
{
const
Vector_t
&
refP
=
initialP_m
;
RFCavity
*
rfc
=
static_cast
<
RFCavity
*>
(
itsCavity_m
.
get
());
...
...
@@ -278,7 +278,7 @@ double CavityAutophaser::track(Vector_t R,
dt
,
itsReference_m
.
getQ
(),
itsReference_m
.
getM
()
*
1e-6
,
out
);
out
);
rfc
->
setPhasem
(
initialPhase
);
double
finalKineticEnergy
=
Util
::
getEnergy
(
Vector_t
(
0.0
,
0.0
,
pe
.
first
),
itsReference_m
.
getM
()
*
1e-6
);
...
...
src/Algorithms/CavityAutophaser.h
View file @
692b53ad
...
...
@@ -27,7 +27,7 @@ private:
double
t
,
const
double
dt
,
const
double
phase
,
std
::
ofstream
*
out
=
NULL
)
const
;
std
::
ofstream
*
out
=
NULL
)
const
;
double
getEnergyMeV
(
const
Vector_t
&
P
);
double
getMomentum
(
double
kineticEnergyMeV
);
...
...
@@ -49,4 +49,4 @@ double CavityAutophaser::getMomentum(double kineticEnergyMeV) {
return
sqrt
(
std
::
pow
(
kineticEnergyMeV
/
(
itsReference_m
.
getM
()
*
1e-6
)
+
1
,
2
)
-
1
);
}
#endif
#endif
\ No newline at end of file
src/Algorithms/Ctunes.cpp
View file @
692b53ad
...
...
@@ -126,7 +126,7 @@ int TUNE_class::lombAnalysis(std::vector<double> &x, std::vector<double> &y, int
if
(
pairy
[
pairc
]
>
4.
)
{
memset
(
mess
,
'\0'
,
sizeof
(
mess
));
sprintf
(
mess
,
"%12.8f %8.2f %8.3f %d"
,
pairx
[
pairc
]
*
Norm
,
pairy
[
pairc
],
probi
,
i
);
*
gmsg
<<
"* "
<<
mess
<<
endl
;
*
gmsg
<<
"* "
<<
mess
<<
endl
;
}
}
pairc
++
;
...
...
@@ -188,7 +188,7 @@ int TUNE_class::lombAnalysis(double *x, double *y, int Ndat, int nhis)
if
(
datcnt
>
(
q
-
p
-
10
))
{
memset
(
mess
,
'\0'
,
sizeof
(
mess
));
sprintf
(
mess
,
"Just found %d data points that are == 0!"
,
datcnt
);
*
gmsg
<<
"* "
<<
mess
<<
endl
;
*
gmsg
<<
"* "
<<
mess
<<
endl
;
return
(
-
1
);
}
...
...
@@ -205,7 +205,7 @@ int TUNE_class::lombAnalysis(double *x, double *y, int Ndat, int nhis)
if
(
stat
!=
0
)
{
memset
(
mess
,
'\0'
,
sizeof
(
mess
));
sprintf
(
mess
,
"@C3ERROR: Lomb analysis failed!"
);
*
gmsg
<<
"* "
<<
mess
<<
endl
;
*
gmsg
<<
"* "
<<
mess
<<
endl
;
delete
la
;
la
=
NULL
;
...
...
@@ -245,7 +245,7 @@ int TUNE_class::lombAnalysis(double *x, double *y, int Ndat, int nhis)
memset
(
mess
,
'\0'
,
sizeof
(
mess
));
sprintf
(
mess
,
"%12.8f %8.2f %8.3f %d"
,
pairx
[
pairc
],
pairy
[
pairc
],
probi
,
i
);
*
gmsg
<<
"* "
<<
mess
<<
endl
;
*
gmsg
<<
"* "
<<
mess
<<
endl
;
}
}
pairc
++
;
...
...
src/Algorithms/ParallelSliceTracker.cpp
View file @
692b53ad
...
...
@@ -154,10 +154,10 @@ void ParallelSliceTracker::printRFPhases() {
if
(
element
->
getType
()
==
ElementBase
::
TRAVELINGWAVE
)
{
phase
=
static_cast
<
TravelingWave
*>
(
element
.
get
())
->
getPhasem
();
frequency
=
static_cast
<
TravelingWave
*>
(
element
.
get
())
->
getFrequencym
();
frequency
=
static_cast
<
TravelingWave
*>
(
element
.
get
())
->
getFrequencym
();
}
else
{
phase
=
static_cast
<
RFCavity
*>
(
element
.
get
())
->
getPhasem
();
frequency
=
static_cast
<
RFCavity
*>
(
element
.
get
())
->
getFrequencym
();
frequency
=
static_cast
<
RFCavity
*>
(
element
.
get
())
->
getFrequencym
();
}
msg
<<
(
it
==
cl
.
begin
()
?
""
:
"
\n
"
)
...
...
@@ -167,7 +167,7 @@ void ParallelSliceTracker::printRFPhases() {
}
msg
<<
"-------------------------------------------------------------------------------------
\n
"
<<
endl
;
<<
endl
;
}
void
ParallelSliceTracker
::
applyEntranceFringe
(
double
angle
,
double
curve
,
...
...
src/Algorithms/ParallelTTracker.cpp
View file @
692b53ad
...
...
@@ -1023,7 +1023,7 @@ void ParallelTTracker::writePhaseSpace(const long long step, bool psDump, bool s
if
(
statDump
)
{
std
::
vector
<
std
::
pair
<
std
::
string
,
unsigned
int
>
>
collimatorLosses
;
FieldList
collimators
=
itsOpalBeamline_m
.
getElementByType
(
ElementBase
::
CCOLLIMATOR
);
if
(
collimators
.
size
()
!=
0
)
{
if
(
collimators
.
size
()
!=
0
)
{
for
(
FieldList
::
iterator
it
=
collimators
.
begin
();
it
!=
collimators
.
end
();
++
it
)
{
FlexibleCollimator
*
coll
=
static_cast
<
FlexibleCollimator
*>
(
it
->
getElement
().
get
());
std
::
string
name
=
coll
->
getName
();
...
...
@@ -1044,7 +1044,7 @@ void ParallelTTracker::writePhaseSpace(const long long step, bool psDump, bool s
for
(
size_t
i
=
0
;
i
<
collimatorLosses
.
size
();
++
i
){
collimatorLosses
[
i
].
second
=
bareLosses
[
i
];
}
}
}
// Write statistical data.
itsDataSink_m
->
writeStatData
(
itsBunch_m
,
FDext
,
collimatorLosses
);
...
...
src/Algorithms/bet/EnvelopeBunch.cpp
View file @
692b53ad
...
...
@@ -577,7 +577,7 @@ void EnvelopeBunch::setBinnedLShape(EnvelopeBunchShape shape, double z0, double
case
bsRect
:
bunch_width
=
Physics
::
c
*
emission_time_s
*
slices_m
[
0
]
->
p
[
SLI_beta
];
// std::cout << "bunch_width = " << bunch_width << " SLI_beta= " << slices_m[0]->p[SLI_beta] << std::endl;
// std::cout << "bunch_width = " << bunch_width << " SLI_beta= " << slices_m[0]->p[SLI_beta] << std::endl;
for
(
int
i
=
0
;
i
<
numMySlices_m
;
i
++
)
{
slices_m
[
i
]
->
p
[
SLI_z
]
=
-
(((
numSlices_m
-
1
)
-
(
mySliceStartOffset_m
+
i
))
*
bunch_width
)
/
numSlices_m
;
}
...
...
@@ -634,10 +634,10 @@ void EnvelopeBunch::setBinnedLShape(EnvelopeBunchShape shape, double z0, double
/*
for(unsigned int i = 0; i < bins_m.size(); i++) {
if(bins_m[i].size() > 0) {
std::cout << Ippl::Comm->myNode() << ": Bin " << i << ": ";
for(unsigned int j = 0; j < bins_m[i].size(); j++)
std::cout << " " << mySliceStartOffset_m + bins_m[i][j] << "(" << slices_m[j]->p[SLI_z] << ")";
std::cout << std::endl;
std::cout << Ippl::Comm->myNode() << ": Bin " << i << ": ";
for(unsigned int j = 0; j < bins_m[i].size(); j++)
std::cout << " " << mySliceStartOffset_m + bins_m[i][j] << "(" << slices_m[j]->p[SLI_z] << ")";
std::cout << std::endl;
}
}
*/
...
...
src/Algorithms/bet/error.C
View file @
692b53ad
...
...
@@ -29,18 +29,18 @@
#include "error.h"
#include "libprf/prf.h"
static
int
static
int
firstTime
=
1
,
reportLevel
=
0
,
// verbosity level
nodeID
=
0
;
// required to be MPI compatible
static
char
*
fName
=
NULL
;
*
fName
=
NULL
;
void
initErrorMsg
(
int
level
,
const
char
*
fbase
)
{
stdprf
();
/* set standard functions */
extprf
();
/* set extended standard functions */
fltprf
();
/* set floating standard functions */
stdprf
();
/* set standard functions */
extprf
();
/* set extended standard functions */
fltprf
();
/* set floating standard functions */
reportLevel
=
level
;
...
...
@@ -60,7 +60,7 @@ void initErrorFilename(const char *fbase) {
if
(
fName
)
{
free
(
fName
);
}
fName
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
strlen
(
fbase
)
+
10
));
if
(
fName
)
{
#ifdef USE_MPI
...
...
@@ -69,14 +69,14 @@ void initErrorFilename(const char *fbase) {
#else
sprintf
(
fName
,
"%s.msg"
,
fbase
);
#endif
sprintf
(
cmd
,
"rm -f %s"
,
fName
);
system
(
cmd
);
free
(
cmd
);
firstTime
=
1
;
}
else
{
fprintf
(
stderr
,
"ERROR in initErrorFilename: %s (%s)
\n
"
,
"Insufficient memory to allocate filename"
,
fbase
);
"Insufficient memory to allocate filename"
,
fbase
);
}
}
}
/* initErrorFileName() */
...
...
@@ -86,15 +86,15 @@ void setReportLevel(int level) {
}
void
writeError
(
ErrorMode
m
,
ErrorType
t
,
const
char
*
fmt
,
...)
{
if
((
m
==
errModeAll
)
||
((
m
==
errModeMaster
)
&&
(
nodeID
==
0
))
||
if
((
m
==
errModeAll
)
||
((
m
==
errModeMaster
)
&&
(
nodeID
==
0
))
||
((
m
==
errModeSlave
)
&&
(
nodeID
>
0
)))
{
va_list
ap
;
char
str
[
4096
],
mpiStr
[
20
];
va_start
(
ap
,
fmt
);
switch
(
t
)
{
case
errMessage
:
sprf
(
str
,
"MSG:.. "
);
break
;
case
errWarning
:
sprf
(
str
,
"WAR:.. "
);
break
;
...
...
@@ -109,23 +109,23 @@ void writeError(ErrorMode m,ErrorType t,const char* fmt, ...) {
sprfv
(
str
,
fmt
,
&
ap
);
va_end
(
ap
);
fprintf
(
stderr
,
"%s
\n
"
,
str
);
fflush
(
stderr
);
if
(
fName
)
{
FILE
*
ofp
=
fopen
(
fName
,(
firstTime
==
1
?
"w"
:
"a"
));
if
(
ofp
)
{
fprintf
(
ofp
,
"%s
\n
"
,
str
);
fclose
(
ofp
);
}
else
if
(
firstTime
==
1
)
{
int
myerr
=
errno
;
fprintf
(
stderr
,
"writeError cannot open %s (%d)
\n
%s
\n
"
,
fName
,
myerr
,
strerror
(
myerr
));
}
firstTime
=
0
;
FILE
*
ofp
=
fopen
(
fName
,(
firstTime
==
1
?
"w"
:
"a"
));
if
(
ofp
)
{
fprintf
(
ofp
,
"%s
\n
"
,
str
);
fclose
(
ofp
);
}
else
if
(
firstTime
==
1
)
{
int
myerr
=
errno
;
fprintf
(
stderr
,
"writeError cannot open %s (%d)
\n
%s
\n
"
,
fName
,
myerr
,
strerror
(
myerr
));
}
firstTime
=
0
;
}
}
if
(
t
==
errFatal
)
{
...
...
@@ -138,23 +138,23 @@ void writeError(ErrorMode m,ErrorType t,const char* fmt, ...) {
}
void
writeError
(
int
level
,
ErrorMode
m
,
ErrorType
t
,
const
char
*
fmt
,
...)
{
if
((
m
==
errModeAll
)
||
((
m
==
errModeMaster
)
&&
(
nodeID
==
0
))
||
if
((
m
==
errModeAll
)
||
((
m
==
errModeMaster
)
&&
(
nodeID
==
0
))
||
((
m
==
errModeSlave
)
&&
(
nodeID
>
0
)))
{
if
((
level
<=
reportLevel
)
||
(
t
==
errFatal
))
{
va_list
ap
;
char
str
[
4096
],
mpiStr
[
20
];
va_start
(
ap
,
fmt
);
switch
(
t
)
{
case
errMessage
:
sprf
(
str
,
"MSG:.. "
);
break
;
case
errWarning
:
sprf
(
str
,
"WAR:.. "
);
break
;
case
errGeneral
:
sprf
(
str
,
"ERR:.. "
);
break
;
case
errFatal
:
sprf
(
str
,
"FATAL: "
);
break
;
}
#ifdef USE_MPI
sprintf
(
mpiStr
,
"%2d "
,
mpi_rank
);
sprf
(
str
,
mpiStr
);
...
...
@@ -167,18 +167,18 @@ void writeError(int level,ErrorMode m,ErrorType t,const char* fmt, ...) {
fflush
(
stderr
);
if
(
fName
)
{
FILE
*
ofp
=
fopen
(
fName
,(
firstTime
==
1
?
"w"
:
"a"
));
if
(
ofp
)
{
fprintf
(
ofp
,
"%s
\n
"
,
str
);
fclose
(
ofp
);
}
else
if
(
firstTime
==
1
)
{
int
myerr
=
errno
;
fprintf
(
stderr
,
"writeError cannot open %s (%d)
\n
%s
\n
"
,
fName
,
myerr
,
strerror
(
myerr
));
}
firstTime
=
0
;
FILE
*
ofp
=
fopen
(
fName
,(
firstTime
==
1
?
"w"
:
"a"
));
if
(
ofp
)
{
fprintf
(
ofp
,
"%s
\n
"
,
str
);
fclose
(
ofp
);
}
else
if
(
firstTime
==
1
)
{
int
myerr
=
errno
;
fprintf
(
stderr
,
"writeError cannot open %s (%d)
\n
%s
\n
"
,
fName
,
myerr
,
strerror
(
myerr
));
}
firstTime
=
0
;
}
}
}
...
...
@@ -189,5 +189,4 @@ void writeError(int level,ErrorMode m,ErrorType t,const char* fmt, ...) {
#endif
exit
(
1
);
}
}
}
\ No newline at end of file
src/Algorithms/bet/profile.cpp
View file @
692b53ad
...
...
@@ -93,7 +93,7 @@ Profile::Profile(char *fname, double eps) {
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
res
=
fscanf
(
f
,
"%lf %lf"
,
&
x
[
i
],
&
y
[
i
]);
if
(
res
!=
0
)
ERRORMSG
(
"fscanf in profile.cpp has res!=0"
<<
endl
);
ERRORMSG
(
"fscanf in profile.cpp has res!=0"
<<
endl
);
}
fclose
(
f
);
...
...
@@ -294,5 +294,4 @@ double Profile::Labs() {
cProfile
=
this
;
return
(((
x
==
NULL
)
||
(
x
[
n
-
1
]
==
x
[
0
])
||
(
ym
==
0.0
))
?
0.0
:
fabs
(
qromb
(
f3
,
x
[
0
],
x
[
n
-
1
])
/
ym
));
}
}
\ No newline at end of file
src/Amr/BoxLibLayout.hpp
View file @
692b53ad
This diff is collapsed.
Click to expand it.
src/BasicActions/Option.cpp
View file @
692b53ad
...
...
@@ -258,7 +258,7 @@ Option::Option():
"The frequency to dump grid "
"and particle data "
"(default: 10)"
,
amrYtDumpFreq
);
itsAttr
[
AMR_REGRID_FREQ
]
=
Attributes
::
makeReal
(
"AMR_REGRID_FREQ"
,
"The frequency to perform a regrid "
"in multi-bunch mode (default: 10)"
,
...
...
@@ -382,9 +382,9 @@ void Option::execute() {
/// not for the distributions
if
(
itsAttr
[
SEED
])
{
seed
=
int
(
Attributes
::
getReal
(
itsAttr
[
SEED
]));
if
(
seed
==
-
1
)
if
(
seed
==
-
1
)
rangen
.
init55
(
time
(
0
));
else
else
rangen
.
init55
(
seed
);
}
...
...
src/Classic/AbsBeamline/Bend.cpp
View file @
692b53ad
...
...
@@ -113,7 +113,7 @@ Bend::Bend(const Bend &right):
sinEntranceAngle_m
(
right
.
sinEntranceAngle_m
),
tanEntranceAngle_m
(
right
.
tanEntranceAngle_m
),
tanExitAngle_m
(
right
.
tanExitAngle_m
),
nSlices_m
(
right
.
nSlices_m
){
nSlices_m
(
right
.
nSlices_m
){
setElType
(
isDipole
);
...
...
@@ -154,7 +154,7 @@ Bend::Bend(const std::string &name):
sinEntranceAngle_m
(
0.0
),
tanEntranceAngle_m
(
0.0
),
tanExitAngle_m
(
0.0
),
nSlices_m
(
1
){
nSlices_m
(
1
){
setElType
(
isDipole
);
...
...
@@ -475,11 +475,11 @@ Vector_t Bend::calcEntranceFringeField(const Vector_t &R,
// B(1) = (engeFunc *
// (1.0 - 0.5 * engeFuncSecDerivNorm * pow(Rprime(1), 2.0)));
// (1.0 - 0.5 * engeFuncSecDerivNorm * pow(Rprime(1), 2.0)));
B
(
1
)
=
(
engeFunc
-
0.5
*
engeFuncSecDeriv
*
pow
(
Rprime
(
1
),
2.0
));
B
(
1
)
=
(
engeFunc
-
0.5
*
engeFuncSecDeriv
*
pow
(
Rprime
(
1
),
2.0
));
B
(
2
)
=
engeFuncDeriv
*
Rprime
(
1
);
B
(
2
)
=
engeFuncDeriv
*
Rprime
(
1
);
}
return
toEntranceRegion
.
rotateFrom
(
B
);
...
...
@@ -514,7 +514,7 @@ Vector_t Bend::calcExitFringeField(const Vector_t &R,
//B(1) = (engeFunc *
// (1.0 - 0.5 * engeFuncSecDerivNorm * pow(Rprime(1), 2.0)));
B
(
1
)
=
(
engeFunc
-
0.5
*
engeFuncSecDeriv
*
pow
(
Rprime
(
1
),
2.0
));
B
(
1
)
=
(
engeFunc
-
0.5
*
engeFuncSecDeriv
*
pow
(
Rprime
(
1
),
2.0
));
B
(
2
)
=
engeFuncDeriv
*
Rprime
(
1
);
}
...
...
@@ -859,7 +859,7 @@ bool Bend::findIdealBendParameters(double chordLength) {
}
designRadius_m
=
chordLength
/
(
2.0
*
std
::
sin
(
angle_m
/
2.0
));
fieldAmplitude_m
=
((
refCharge
/
std
::
abs
(
refCharge
))
*
fieldAmplitude_m
=
((
refCharge
/
std
::
abs
(
refCharge
))
*
refBetaGamma
*
refMass
/
(
Physics
::
c
*
designRadius_m
));
reinitialize
=
true
;
...
...
src/Classic/AbsBeamline/CyclotronValley.cpp
View file @
692b53ad
...
...
@@ -118,7 +118,7 @@ bool CyclotronValley::applyToReferenceParticle(const Vector_t &tmpR, const Vecto
Vector_t
tmpE
(
0.0
,
0.0
,
0.0
),
tmpB
(
0.0
,
0.0
,
0.0
);
if
(
!
fieldmap_m
->
getFieldstrength
(
tmpR
,
tmpE
,
tmpB
))
{
B
+=
scale_m
*
tmpB
;
B
+=
scale_m
*
tmpB
;
return
false
;
}
return
true
;
...
...
@@ -179,4 +179,4 @@ void CyclotronValley::getDimensions(double &zBegin, double &zEnd) const {
ElementBase
::
ElementType
CyclotronValley
::
getType
()
const
{
return
CYCLOTRONVALLEY
;
}
}
\ No newline at end of file
src/Classic/AbsBeamline/MultipoleT.h
View file @
692b53ad
...
...
@@ -32,7 +32,7 @@
/** ---------------------------------------------------------------------
*
* MultipoleT defines a straight or curved combined function magnet (up
* MultipoleT defines a straight or curved combined function magnet (up
* to arbitrary multipole component) with Fringe Fields
*
* ---------------------------------------------------------------------
...
...
@@ -47,29 +47,29 @@
* ... @f] \n
* (x,z,s) -> Frenet-Serret local coordinates along the magnet \n
* z -> vertical component \n
* assume mid-plane symmetry \n
* assume mid-plane symmetry \n
* set field on mid-plane -> @f$ B_z = f_0(x,s) = T(x) \cdot S(s) @f$ \n
* T(x) -> transverse profile; this is a polynomial describing
* the field expansion on the mid-plane inside the magnet
* (not in the fringe field);
* 1st term is the dipole strength, 2nd term is the
* 1st term is the dipole strength, 2nd term is the
* quadrupole gradient * x, etc. \n
* -> when setting the magnet, one gives the multipole
* coefficients of this polynomial (i.e. dipole strength,
* coefficients of this polynomial (i.e. dipole strength,
* quadrupole gradient, etc.) \n
* \n
* ------------- example ----------------------------------------------- \n
* Setting a combined function magnet with dipole, quadrupole and
* Setting a combined function magnet with dipole, quadrupole and
* sextupole components: \n
* @f$ T(x) = B_0 + B_1 \cdot x + B_2 \cdot x^2 @f$\n
* user gives @f$ B_0, B_1, B_2 @f$ \n
* ------------- example end ------------------------------------------- \n
* \n
* S(s) -> fringe field \n
* recursion -> @f$ f_n (x,s) = (-1)^n \cdot \sum_{i=0}^{n} C_n^i
* recursion -> @f$ f_n (x,s) = (-1)^n \cdot \sum_{i=0}^{n} C_n^i
* \cdot T^{(2i)} \cdot S^{(2n-2i)} @f$ \n
* for curved magnets the above recursion is more complicated \n
* @f$ C_n^i @f$ -> binomial coeff;
* @f$ C_n^i @f$ -> binomial coeff;
* @f$ T^{(n)} @f$ -> n-th derivative
*
* ---------------------------------------------------------------------
...
...
@@ -87,14 +87,14 @@
#include <vector>
class
MultipoleT
:
public
Component
{
public:
public:
/** Constructor
* \param name -> User-defined name
*/
explicit
MultipoleT
(
const
std
::
string
&
name
);
/** Copy constructor */
MultipoleT
(
const
MultipoleT
&
right
);
/** Destructor */
/** Destructor */
~
MultipoleT
();
/** Inheritable copy constructor */
ElementBase
*
clone
()
const
override
;
...
...
@@ -166,7 +166,7 @@ public:
/** Get the maximum order in the given transverse profile */
std
::
size_t
getTransMaxOrder
()
const
;
/** Set the maximum order in the given transverse profile
* \param transMaxOrder -> Highest power of x in field expansion
* \param transMaxOrder -> Highest power of x in field expansion
*/
void
setTransMaxOrder
(
std
::
size_t
transMaxOrder
);
/** Set transverse profile T(x)
...
...
@@ -183,15 +183,15 @@ public:
std
::
vector
<
double
>
getTransProfile
()
const
;
/** Set fringe field model \n
* Tanh model used here \n
* @f[ 1/2 * \left [tanh \left( \frac{s + s_0}{\lambda_{left}} \right)
* - tanh \left( \frac{s - s_0}{\lambda_{right}} \right) \right] @f]
* @f[ 1/2 * \left [tanh \left( \frac{s + s_0}{\lambda_{left}} \right)
* - tanh \left( \frac{s - s_0}{\lambda_{right}} \right) \right] @f]
* \param s0 -> Centre field length
* \param \lambda_{left} -> Left end field length
* \param \lambda_{right} -> Right end field length
*/
bool
setFringeField
(
double
s0
,
double
lambda_left
,
double
lambda_right
);
/** Return vector of 2 doubles
* [left fringe length, right fringelength]
* [left fringe length, right fringelength]
*/
std
::
vector
<
double
>
getFringeLength
()
const
;
/** Set the bending angle of the magnet */
...
...
@@ -204,7 +204,7 @@ public:
void
setEntranceAngle
(
double
entranceAngle
);
/** Get the entrance angle */
double
getEntranceAngle
()
const
;
/** Get the bending radius \n
/** Get the bending radius \n
* Not used, when needed radius is found from length_m / angle_m
*/
double
getBendRadius
()
const
;
...
...
@@ -260,7 +260,7 @@ private:
std
::
vector
<
polynomial
::
RecursionRelationTwo
>
recursion_VarRadius_m
;
std
::
vector
<
polynomial
::
RecursionRelation
>
recursion_ConstRadius_m
;
/** Highest power in given mid-plane field */
std
::
size_t
transMaxOrder_m
=
0
;
std
::
size_t
transMaxOrder_m
=
0
;
/** List of transverse profile coefficients */
std
::
vector
<
double
>
transProfile_m
;
/** Geometry */
...
...
@@ -367,7 +367,7 @@ inline
double
MultipoleT
::
getEntranceAngle
()
const
{
return
entranceAngle_m
;
}
inline
inline
double
MultipoleT
::
getTransProfile
(
int
n
)
const
{
return
transProfile_m
[
n
];
}
...
...
@@ -375,7 +375,7 @@ inline
std
::
vector
<
double
>
MultipoleT
::
getTransProfile
()
const
{
return
transProfile_m
;
}
inline
inline
double
MultipoleT
::
getDipoleConstant
()
const
{
return
transProfile_m
[
0
];
}
...
...
@@ -397,16 +397,16 @@ inline
std
::
size_t
MultipoleT
::
getTransMaxOrder
()
const
{
return
transMaxOrder_m
;
}
inline
inline
void
MultipoleT
::
setTransMaxOrder
(
std
::
size_t
transMaxOrder
)
{
transMaxOrder_m
=
transMaxOrder
;
transProfile_m
.
resize
(
transMaxOrder
+
1
,
0.
);
transProfile_m
.
resize
(
transMaxOrder
+
1
,
0.
);
}
inline
double
MultipoleT
::
getRotation
()
const
{
return
rotation_m
;
}
inline
inline
void
MultipoleT
::
setRotation
(
double
rot
)
{
rotation_m
=
rot
;
}
...
...
@@ -435,4 +435,4 @@ inline
boundingBoxLength_m
=
boundingBoxLength
;
}
#endif
#endif
\ No newline at end of file
src/Classic/AbsBeamline/Offset.cpp
View file @
692b53ad
...
...
@@ -208,11 +208,11 @@ bool operator==(const Offset& off1, const Offset& off2) {
}
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
(
fabs
(
off1
.
getEndPosition
()(
i
)
-
off2
.
getEndPosition
()(
i
))
>
tol
)
||
(
fabs
(
off1
.
getEndDirection
()(
i
)
-
off2
.
getEndDirection
()(
i
))
>
tol
))
(
fabs
(
off1
.
getEndDirection
()(
i
)
-
off2
.
getEndDirection
()(
i
))
>
tol
))
return
false
;
}
if
(
(
!
off1
.
isGeometryAllocated
()
&&
off2
.
isGeometryAllocated
())
||
(
!
off2
.
isGeometryAllocated
()
&&
off1
.
isGeometryAllocated
()))
(
!
off2
.
isGeometryAllocated
()
&&
off1
.
isGeometryAllocated
()))
return
false
;
Euclid3D
transform1
=
off1
.
getGeometry
().
getTotalTransform
();
Euclid3D
transform2
=
off2
.
getGeometry
().
getTotalTransform
();
...
...
@@ -306,4 +306,4 @@ Offset Offset::globalCartesianOffset(std::string name,
off
.
setEndDirection
(
end_direction
);
off
.
setIsLocal
(
false
);
return
off
;
}
}
\ No newline at end of file
src/Classic/AbsBeamline/RFCavity.cpp
View file @
692b53ad
...
...
@@ -794,7 +794,7 @@ pair<double, double> RFCavity::trackOnAxisParticle(const double &p0,
const
double
&
dt
,
const
double
&
q
,
const
double
&
mass
,
std
::
ofstream
*
out
)
{
std
::
ofstream
*
out
)
{
Vector_t
p
(
0
,
0
,
p0
);
double
t
=
t0
;
BorisPusher
integrator
(
*
RefPartBunch_m
->
getReference
());
...
...
@@ -807,8 +807,8 @@ pair<double, double> RFCavity::trackOnAxisParticle(const double &p0,
Vector_t
Ef
(
0.0
),
Bf
(
0.0
);
if
(
out
)
*
out
<<
std
::
setw
(
18
)
<<
z
[
2
]
<<
std
::
setw
(
18
)
<<
Util
::
getEnergy
(
p
,
mass
)
<<
std
::
endl
;
<<
std
::
setw
(
18
)
<<
Util
::
getEnergy
(
p
,
mass
)
<<
std
::
endl
;
while
(
z
(
2
)
+
dz
<
zend
&&
z
(
2
)
+
dz
>
zbegin
)
{
z
/=
cdt
;
integrator
.
push
(
z
,
p
,
dt
);
...
...
@@ -827,9 +827,9 @@ pair<double, double> RFCavity::trackOnAxisParticle(const double &p0,
z
*=
cdt
;
t
+=
dt
;
if
(
out
)
*
out
<<
std
::
setw
(
18
)
<<
z
[
2
]
<<
std
::
setw
(
18
)
<<
Util
::
getEnergy
(
p
,
mass
)
<<
std
::
endl
;
if
(
out
)
*
out
<<
std
::
setw
(
18
)
<<
z
[
2
]
<<
std
::
setw
(
18
)
<<
Util
::
getEnergy
(
p
,
mass
)
<<
std
::
endl
;
}
const
double
beta
=
sqrt
(
1.
-
1
/
(
dot
(
p
,
p
)
+
1.
));
...
...
src/Classic/AbsBeamline/RFCavity.h
View file @
692b53ad
...
...
@@ -104,7 +104,7 @@ public:
const
double
&
dt
,
const
double
&
q
,
const
double
&
mass
,
std
::
ofstream
*
out
=
NULL
);
std
::
ofstream
*
out
=
NULL
);
virtual
void
addKR
(
int
i
,
double
t
,
Vector_t
&
K
)
override
;
...
...
@@ -524,4 +524,4 @@ CoordinateSystemTrafo RFCavity::getEdgeToEnd() const
}
#endif // CLASSIC_RFCavity_HH
#endif // CLASSIC_RFCavity_HH
\ No newline at end of file
src/Classic/AbsBeamline/TravelingWave.cpp
View file @
692b53ad
...
...
@@ -578,11 +578,11 @@ double TravelingWave::getAutoPhaseEstimate(const double &E0, const double &t0, c
}