Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ext-edelen_a
src
Commits
2bf2fb40
Commit
2bf2fb40
authored
Oct 18, 2018
by
snuverink_j
Browse files
some spelling and cleaning
parent
9aa76f0f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
34 deletions
+28
-34
src/BasicActions/Option.cpp
src/BasicActions/Option.cpp
+1
-1
src/Classic/AbsBeamline/CCollimator.cpp
src/Classic/AbsBeamline/CCollimator.cpp
+6
-6
src/Classic/Solvers/CollimatorPhysics.cpp
src/Classic/Solvers/CollimatorPhysics.cpp
+13
-15
src/Classic/Solvers/CollimatorPhysics.hh
src/Classic/Solvers/CollimatorPhysics.hh
+4
-7
src/Classic/Solvers/ParticleMatterInteractionHandler.hh
src/Classic/Solvers/ParticleMatterInteractionHandler.hh
+1
-1
src/Elements/OpalECollimator.cpp
src/Elements/OpalECollimator.cpp
+1
-1
src/Elements/OpalRCollimator.cpp
src/Elements/OpalRCollimator.cpp
+2
-3
No files found.
src/BasicActions/Option.cpp
View file @
2bf2fb40
...
...
@@ -227,7 +227,7 @@ Option::Option():
(
"BOUNDPDESTROYFQ"
,
"The frequency to do boundp_destroy to delete lost particles. Default 10"
,
10.0
);
itsAttr
[
BEAMHALOBOUNDARY
]
=
Attributes
::
makeReal
(
"BEAMHALOBOUNDARY"
,
"Defines in t
h
erms of sigma where the halo starts. Default 0.0"
,
0.0
);
(
"BEAMHALOBOUNDARY"
,
"Defines in terms of sigma where the halo starts. Default 0.0"
,
0.0
);
itsAttr
[
IDEALIZED
]
=
Attributes
::
makeBool
(
"IDEALIZED"
,
"Using the hard edge model for the calculation of path length. Default: false"
,
false
);
...
...
src/Classic/AbsBeamline/CCollimator.cpp
View file @
2bf2fb40
...
...
@@ -108,7 +108,7 @@ bool CCollimator::checkCollimator(Vector_t r, Vector_t rmin, Vector_t rmax) {
}
// rectangle collimators in cyclotron cy
c
lindral coordinates
// rectangle collimators in cyclotron cylindr
ic
al coordinates
// without particlematterinteraction, the particle hitting collimator is deleted directly
bool
CCollimator
::
checkCollimator
(
PartBunchBase
<
double
,
3
>
*
bunch
,
const
int
turnnumber
,
const
double
t
,
const
double
tstep
)
{
...
...
@@ -132,12 +132,12 @@ bool CCollimator::checkCollimator(PartBunchBase<double, 3> *bunch, const int tur
for
(
unsigned
int
i
=
0
;
i
<
tempnum
;
++
i
)
{
if
(
bunch
->
PType
[
i
]
==
ParticleType
::
REGULAR
&&
bunch
->
R
[
i
](
2
)
<
zend_m
&&
bunch
->
R
[
i
](
2
)
>
zstart_m
)
{
pflag
=
checkPoint
(
bunch
->
R
[
i
](
0
),
bunch
->
R
[
i
](
1
));
/// bunch->Bin[i] != -1 makes sure the part
c
ile is not stored in more than one collimator
/// bunch->Bin[i] != -1 makes sure the parti
c
le is not stored in more than one collimator
if
((
pflag
!=
0
)
&&
(
bunch
->
Bin
[
i
]
!=
-
1
))
{
if
(
!
parmatint_m
)
lossDs_m
->
addParticle
(
bunch
->
R
[
i
],
bunch
->
P
[
i
],
bunch
->
ID
[
i
]);
bunch
->
Bin
[
i
]
=
-
1
;
flagNeedUpdate
=
true
;
if
(
!
parmatint_m
)
lossDs_m
->
addParticle
(
bunch
->
R
[
i
],
bunch
->
P
[
i
],
bunch
->
ID
[
i
]);
bunch
->
Bin
[
i
]
=
-
1
;
flagNeedUpdate
=
true
;
}
}
}
...
...
src/Classic/Solvers/CollimatorPhysics.cpp
View file @
2bf2fb40
...
...
@@ -92,8 +92,6 @@ namespace {
CollimatorPhysics
::
CollimatorPhysics
(
const
std
::
string
&
name
,
ElementBase
*
element
,
std
::
string
&
material
)
:
ParticleMatterInteractionHandler
(
name
,
element
),
// :FIXME: unused
//allParticlesIn_m(false),
T_m
(
0.0
),
dT_m
(
0.0
),
material_m
(
material
),
...
...
@@ -197,6 +195,7 @@ void CollimatorPhysics::doPhysics(PartBunchBase<double, 3> *bunch) {
double
Eng
=
(
sqrt
(
1.0
+
dot
(
P
,
P
))
-
1
)
*
m_p
;
if
(
locParts_m
[
i
].
label
!=
-
1
)
{
if
(
tester
->
checkHit
(
R
,
P
,
dT_m
))
{
bool
pdead
=
EnergyLoss
(
Eng
,
dT_m
);
if
(
!
pdead
)
{
...
...
@@ -210,7 +209,7 @@ void CollimatorPhysics::doPhysics(PartBunchBase<double, 3> *bunch) {
// INFOMSG("final energy: " << (sqrt(1.0 + dot(P, P)) - 1) * m_p /1000 << " MeV" <<endl);
CoulombScat
(
R
,
P
,
dT_m
);
}
else
{
// The particle is stopped in the material, set labl
e_m
to -1
// The particle is stopped in the material, set lab
e
l to -1
locParts_m
[
i
].
label
=
-
1.0
;
stoppedPartStat_m
++
;
lossDs_m
->
addParticle
(
R
,
P
,
-
locParts_m
[
i
].
IDincol
);
...
...
@@ -292,13 +291,13 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
Particles that have entered material are flagged as Bin[i] == -1.
Fixme: should use PType
Flagged particles are copied to a local structue within Collimator Physics locParts_m.
Flagged particles are copied to a local structu
r
e within Collimator Physics locParts_m.
Particles in that structure will be pushed in the material and either come
back to the bunch or will be fully stopped in the material. For the push in the
material we use sub-timesteps.
New
e
ly entered particles will be copied to locParts_m at the end of apply.
Newly entered particles will be copied to locParts_m at the end of apply.
*/
Eavg_m
=
0.0
;
...
...
@@ -316,7 +315,7 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
T_m
=
bunch
->
getT
();
/*
Because this is not prop
p
er set in the Component class when calling in the Constructor
Because this is not proper
ly
set in the Component class when calling in the Constructor
*/
#ifdef OPAL_DKS
...
...
@@ -387,7 +386,7 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
IpplTimings
::
stopTimer
(
DegraderLoopTimer_m
);
if
(
onlyOneLoopOverParticles
)
copyFromBunchDKS
(
bunch
,
boundingSphere
);
copyFromBunchDKS
(
bunch
,
boundingSphere
);
T_m
+=
dT_m
;
...
...
@@ -470,7 +469,6 @@ void CollimatorPhysics::apply(PartBunchBase<double, 3> *bunch,
}
else
{
onlyOneLoopOverParticles
=
true
;
}
}
while
(
onlyOneLoopOverParticles
==
false
);
#endif
...
...
@@ -834,7 +832,7 @@ void CollimatorPhysics::addBackToBunch(PartBunchBase<double, 3> *bunch, unsigned
/*
This particle is back to the bunch, by set
ting the lab
l
e to -1.0
ting the labe
l
to -1.0
the particle will be deleted.
*/
locParts_m
[
i
].
label
=
-
1.0
;
...
...
@@ -868,7 +866,7 @@ void CollimatorPhysics::copyFromBunch(PartBunchBase<double, 3> *bunch,
tester
=
new
FlexCollimatorInsideTester
(
element_ref_m
);
break
;
default:
throw
OpalException
(
"CollimatorPhysics::
doPhysics
"
,
throw
OpalException
(
"CollimatorPhysics::
copyFromBunch
"
,
"Unsupported element type"
);
}
...
...
@@ -890,7 +888,7 @@ void CollimatorPhysics::copyFromBunch(PartBunchBase<double, 3> *bunch,
x
.
Qincol
=
bunch
->
Q
[
i
];
x
.
Bfincol
=
bunch
->
Bf
[
i
];
x
.
Efincol
=
bunch
->
Ef
[
i
];
x
.
label
=
0
;
// al
l
ive in matter
x
.
label
=
0
;
// alive in matter
locParts_m
.
push_back
(
x
);
ne
++
;
...
...
@@ -1055,7 +1053,7 @@ void CollimatorPhysics::addBackToBunchDKS(PartBunchBase<double, 3> *bunch, unsig
}
void
CollimatorPhysics
::
copyFromBunchDKS
(
PartBunchBase
<
double
,
3
>
*
bunch
,
const
std
::
pair
<
Vector_t
,
double
>
&
boundingSphere
)
const
std
::
pair
<
Vector_t
,
double
>
&
boundingSphere
)
{
const
size_t
nL
=
bunch
->
getLocalNum
();
if
(
nL
==
0
)
return
;
...
...
@@ -1080,7 +1078,7 @@ void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
tester
=
new
FlexCollimatorInsideTester
(
element_ref_m
);
break
;
default:
throw
OpalException
(
"CollimatorPhysics::
doPhysics
"
,
throw
OpalException
(
"CollimatorPhysics::
copyFromBunchDKS
"
,
"Unsupported element type"
);
}
...
...
@@ -1103,7 +1101,7 @@ void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
x
.
Qincol
=
bunch
->
Q
[
i
];
x
.
Bfincol
=
bunch
->
Bf
[
i
];
x
.
Efincol
=
bunch
->
Ef
[
i
];
x
.
label
=
0
;
// al
l
ive in matter
x
.
label
=
0
;
// alive in matter
PART_DKS
x_gpu
;
x_gpu
.
label
=
x
.
label
;
...
...
@@ -1130,7 +1128,7 @@ void CollimatorPhysics::copyFromBunchDKS(PartBunchBase<double, 3> *bunch,
}
void
CollimatorPhysics
::
setupCollimatorDKS
(
PartBunchBase
<
double
,
3
>
*
bunch
,
size_t
numParticlesInSimulation
)
size_t
numParticlesInSimulation
)
{
if
(
curandInitSet
==
-
1
)
{
...
...
src/Classic/Solvers/CollimatorPhysics.hh
View file @
2bf2fb40
...
...
@@ -101,7 +101,7 @@ private:
bool
EnergyLoss
(
double
&
Eng
,
const
double
&
deltat
);
void
Rot
(
double
&
px
,
double
&
pz
,
double
&
x
,
double
&
z
,
double
xplane
,
double
Norm_P
,
double
thetacou
,
double
deltas
,
int
coord
);
double
thetacou
,
double
deltas
,
int
coord
);
void
copyFromBunch
(
PartBunchBase
<
double
,
3
>
*
bunch
,
const
std
::
pair
<
Vector_t
,
double
>
&
boundingSphere
);
...
...
@@ -109,7 +109,7 @@ private:
#ifdef OPAL_DKS
void
copyFromBunchDKS
(
PartBunchBase
<
double
,
3
>
*
bunch
,
const
std
::
pair
<
Vector_t
,
double
>
&
boundingSphere
);
const
std
::
pair
<
Vector_t
,
double
>
&
boundingSphere
);
void
addBackToBunchDKS
(
PartBunchBase
<
double
,
3
>
*
bunch
,
unsigned
i
);
void
setupCollimatorDKS
(
PartBunchBase
<
double
,
3
>
*
bunch
,
size_t
numParticlesInSimulation
);
...
...
@@ -126,9 +126,6 @@ private:
void
calcStat
(
double
Eng
);
// :FIXME: remove unused declaration
//bool allParticlesIn_m;
double
T_m
;
// own time, maybe larger than in the bunch object
double
dT_m
;
// dt from bunch
...
...
@@ -195,9 +192,9 @@ inline
void
CollimatorPhysics
::
calcStat
(
double
Eng
)
{
Eavg_m
+=
Eng
;
if
(
Emin_m
>
Eng
)
Emin_m
=
Eng
;
Emin_m
=
Eng
;
if
(
Emax_m
<
Eng
)
Emax_m
=
Eng
;
Emax_m
=
Eng
;
}
inline
...
...
src/Classic/Solvers/ParticleMatterInteractionHandler.hh
View file @
2bf2fb40
...
...
@@ -32,7 +32,7 @@ public:
protected:
ElementBase
*
element_ref_m
;
bool
allParticleInMat_m
;
bool
allParticleInMat_m
;
///< if all particles are in matter stay inside the particle matter interaction
private:
const
std
::
string
name_m
;
...
...
src/Elements/OpalECollimator.cpp
View file @
2bf2fb40
...
...
@@ -96,7 +96,7 @@ void OpalECollimator::update() {
coll
->
setElementLength
(
length
);
if
(
getOpalName
()
!=
"ECOLLIMATOR"
)
{
double
width
=
2
*
Attributes
::
getReal
(
itsAttr
[
XSIZE
]);
double
width
=
2
*
Attributes
::
getReal
(
itsAttr
[
XSIZE
]);
double
height
=
2
*
Attributes
::
getReal
(
itsAttr
[
YSIZE
]);
std
::
stringstream
description
;
description
<<
"ellipse("
<<
width
<<
","
<<
height
<<
")"
;
...
...
src/Elements/OpalRCollimator.cpp
View file @
2bf2fb40
...
...
@@ -57,8 +57,7 @@ OpalRCollimator::OpalRCollimator(const std::string &name, OpalRCollimator *paren
OpalRCollimator
::~
OpalRCollimator
()
{
if
(
parmatint_m
)
delete
parmatint_m
;
delete
parmatint_m
;
}
...
...
@@ -97,7 +96,7 @@ void OpalRCollimator::update() {
coll
->
setElementLength
(
Attributes
::
getReal
(
itsAttr
[
LENGTH
]));
if
(
getOpalName
()
!=
"RCOLLIMATOR"
)
{
double
width
=
2
*
Attributes
::
getReal
(
itsAttr
[
XSIZE
]);
double
width
=
2
*
Attributes
::
getReal
(
itsAttr
[
XSIZE
]);
double
height
=
2
*
Attributes
::
getReal
(
itsAttr
[
YSIZE
]);
std
::
stringstream
description
;
description
<<
"rectangle("
<<
width
<<
","
<<
height
<<
")"
;
...
...
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