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
8997fb4e
Commit
8997fb4e
authored
Jun 07, 2020
by
kraus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace all pointers to ElementBase with shared and weak pointers resp.
parent
d7d4f1f1
Changes
95
Hide whitespace changes
Inline
Side-by-side
Showing
95 changed files
with
436 additions
and
430 deletions
+436
-430
src/AbstractObjects/BeamSequence.h
src/AbstractObjects/BeamSequence.h
+4
-2
src/AbstractObjects/Table.h
src/AbstractObjects/Table.h
+4
-2
src/Algorithms/ParallelTTracker.cpp
src/Algorithms/ParallelTTracker.cpp
+9
-9
src/Algorithms/ParallelTTracker.h
src/Algorithms/ParallelTTracker.h
+3
-2
src/Classic/AbsBeamline/BeamStripping.cpp
src/Classic/AbsBeamline/BeamStripping.cpp
+4
-4
src/Classic/AbsBeamline/BeamStripping.h
src/Classic/AbsBeamline/BeamStripping.h
+4
-2
src/Classic/AbsBeamline/CCollimator.h
src/Classic/AbsBeamline/CCollimator.h
+4
-2
src/Classic/AbsBeamline/ElementBase.cpp
src/Classic/AbsBeamline/ElementBase.cpp
+4
-4
src/Classic/AbsBeamline/ElementBase.h
src/Classic/AbsBeamline/ElementBase.h
+10
-10
src/Classic/AbsBeamline/FlexibleCollimator.h
src/Classic/AbsBeamline/FlexibleCollimator.h
+2
-2
src/Classic/AbsBeamline/Integrator.cpp
src/Classic/AbsBeamline/Integrator.cpp
+2
-2
src/Classic/AbsBeamline/Integrator.h
src/Classic/AbsBeamline/Integrator.h
+6
-6
src/Classic/Beamlines/ElmPtr.cpp
src/Classic/Beamlines/ElmPtr.cpp
+2
-2
src/Classic/Beamlines/ElmPtr.h
src/Classic/Beamlines/ElmPtr.h
+1
-1
src/Classic/Construction/Factory.h
src/Classic/Construction/Factory.h
+3
-2
src/Classic/Solvers/CSRIGFWakeFunction.cpp
src/Classic/Solvers/CSRIGFWakeFunction.cpp
+4
-4
src/Classic/Solvers/CSRIGFWakeFunction.hh
src/Classic/Solvers/CSRIGFWakeFunction.hh
+3
-3
src/Classic/Solvers/CSRWakeFunction.cpp
src/Classic/Solvers/CSRWakeFunction.cpp
+4
-4
src/Classic/Solvers/CSRWakeFunction.hh
src/Classic/Solvers/CSRWakeFunction.hh
+3
-3
src/Classic/Solvers/CollimatorPhysics.cpp
src/Classic/Solvers/CollimatorPhysics.cpp
+21
-22
src/Classic/Solvers/GreenWakeFunction.cpp
src/Classic/Solvers/GreenWakeFunction.cpp
+3
-3
src/Classic/Solvers/GreenWakeFunction.hh
src/Classic/Solvers/GreenWakeFunction.hh
+0
-1
src/Classic/Solvers/ParticleMatterInteractionHandler.hh
src/Classic/Solvers/ParticleMatterInteractionHandler.hh
+2
-0
src/Classic/Solvers/WakeFunction.hh
src/Classic/Solvers/WakeFunction.hh
+5
-5
src/Elements/CMakeLists.txt
src/Elements/CMakeLists.txt
+16
-16
src/Elements/OpalBeamStripping.cpp
src/Elements/OpalBeamStripping.cpp
+6
-6
src/Elements/OpalCCollimator.cpp
src/Elements/OpalCCollimator.cpp
+4
-3
src/Elements/OpalCavity.cpp
src/Elements/OpalCavity.cpp
+3
-3
src/Elements/OpalCyclotron.cpp
src/Elements/OpalCyclotron.cpp
+5
-4
src/Elements/OpalDegrader.cpp
src/Elements/OpalDegrader.cpp
+3
-3
src/Elements/OpalDrift.cpp
src/Elements/OpalDrift.cpp
+10
-17
src/Elements/OpalDrift.h
src/Elements/OpalDrift.h
+2
-1
src/Elements/OpalECollimator.cpp
src/Elements/OpalECollimator.cpp
+5
-5
src/Elements/OpalElement.cpp
src/Elements/OpalElement.cpp
+2
-2
src/Elements/OpalElement.h
src/Elements/OpalElement.h
+2
-2
src/Elements/OpalFlexibleCollimator.cpp
src/Elements/OpalFlexibleCollimator.cpp
+5
-5
src/Elements/OpalHKicker.cpp
src/Elements/OpalHKicker.cpp
+4
-4
src/Elements/OpalHMonitor.cpp
src/Elements/OpalHMonitor.cpp
+3
-3
src/Elements/OpalInstrument.cpp
src/Elements/OpalInstrument.cpp
+4
-4
src/Elements/OpalKicker.cpp
src/Elements/OpalKicker.cpp
+4
-4
src/Elements/OpalMarker.cpp
src/Elements/OpalMarker.cpp
+4
-4
src/Elements/OpalMonitor.cpp
src/Elements/OpalMonitor.cpp
+2
-2
src/Elements/OpalMultipole.cpp
src/Elements/OpalMultipole.cpp
+4
-4
src/Elements/OpalMultipoleT.cpp
src/Elements/OpalMultipoleT.cpp
+13
-13
src/Elements/OpalMultipoleTCurvedConstRadius.cpp
src/Elements/OpalMultipoleTCurvedConstRadius.cpp
+4
-4
src/Elements/OpalMultipoleTCurvedVarRadius.cpp
src/Elements/OpalMultipoleTCurvedVarRadius.cpp
+4
-4
src/Elements/OpalMultipoleTStraight.cpp
src/Elements/OpalMultipoleTStraight.cpp
+4
-4
src/Elements/OpalOctupole.cpp
src/Elements/OpalOctupole.cpp
+4
-4
src/Elements/OpalOffset/OpalGlobalCartesianOffset.cpp
src/Elements/OpalOffset/OpalGlobalCartesianOffset.cpp
+1
-1
src/Elements/OpalOffset/OpalLocalCartesianOffset.cpp
src/Elements/OpalOffset/OpalLocalCartesianOffset.cpp
+2
-2
src/Elements/OpalParallelPlate.cpp
src/Elements/OpalParallelPlate.cpp
+4
-4
src/Elements/OpalPatch.cpp
src/Elements/OpalPatch.cpp
+3
-3
src/Elements/OpalPepperPot.cpp
src/Elements/OpalPepperPot.cpp
+3
-3
src/Elements/OpalProbe.cpp
src/Elements/OpalProbe.cpp
+3
-3
src/Elements/OpalQuadrupole.cpp
src/Elements/OpalQuadrupole.cpp
+9
-9
src/Elements/OpalRBend.cpp
src/Elements/OpalRBend.cpp
+7
-7
src/Elements/OpalRBend3D.cpp
src/Elements/OpalRBend3D.cpp
+4
-4
src/Elements/OpalRCollimator.cpp
src/Elements/OpalRCollimator.cpp
+5
-5
src/Elements/OpalRingDefinition.cpp
src/Elements/OpalRingDefinition.cpp
+2
-2
src/Elements/OpalSBend.cpp
src/Elements/OpalSBend.cpp
+8
-8
src/Elements/OpalSBend3D.cpp
src/Elements/OpalSBend3D.cpp
+1
-1
src/Elements/OpalSRot.cpp
src/Elements/OpalSRot.cpp
+3
-3
src/Elements/OpalScalingFFAMagnet.cpp
src/Elements/OpalScalingFFAMagnet.cpp
+1
-1
src/Elements/OpalSeparator.cpp
src/Elements/OpalSeparator.cpp
+4
-4
src/Elements/OpalSeptum.cpp
src/Elements/OpalSeptum.cpp
+2
-2
src/Elements/OpalSextupole.cpp
src/Elements/OpalSextupole.cpp
+4
-4
src/Elements/OpalSlit.cpp
src/Elements/OpalSlit.cpp
+5
-5
src/Elements/OpalSolenoid.cpp
src/Elements/OpalSolenoid.cpp
+4
-4
src/Elements/OpalSource.cpp
src/Elements/OpalSource.cpp
+2
-2
src/Elements/OpalStripper.cpp
src/Elements/OpalStripper.cpp
+1
-1
src/Elements/OpalTravelingWave.cpp
src/Elements/OpalTravelingWave.cpp
+5
-5
src/Elements/OpalVKicker.cpp
src/Elements/OpalVKicker.cpp
+4
-3
src/Elements/OpalVMonitor.cpp
src/Elements/OpalVMonitor.cpp
+3
-3
src/Elements/OpalVariableRFCavity.cpp
src/Elements/OpalVariableRFCavity.cpp
+2
-2
src/Elements/OpalVariableRFCavityFringeField.cpp
src/Elements/OpalVariableRFCavityFringeField.cpp
+5
-5
src/Elements/OpalVerticalFFAMagnet.cpp
src/Elements/OpalVerticalFFAMagnet.cpp
+2
-2
src/Elements/OpalYRot.cpp
src/Elements/OpalYRot.cpp
+4
-3
src/Lines/Line.cpp
src/Lines/Line.cpp
+12
-12
src/Lines/Line.h
src/Lines/Line.h
+2
-2
src/Lines/Replacer.cpp
src/Lines/Replacer.cpp
+3
-3
src/Lines/Replacer.h
src/Lines/Replacer.h
+5
-4
src/Lines/Sequence.cpp
src/Lines/Sequence.cpp
+15
-14
src/Lines/Sequence.h
src/Lines/Sequence.h
+5
-3
src/Lines/SequenceParser.cpp
src/Lines/SequenceParser.cpp
+2
-2
src/Structure/OpalWake.cpp
src/Structure/OpalWake.cpp
+31
-38
src/Structure/OpalWake.h
src/Structure/OpalWake.h
+5
-5
src/Structure/ParticleMatterInteraction.h
src/Structure/ParticleMatterInteraction.h
+5
-4
src/Tables/AttList.cpp
src/Tables/AttList.cpp
+1
-1
src/Tables/AttWriter.cpp
src/Tables/AttWriter.cpp
+2
-2
src/Tables/Flatten.h
src/Tables/Flatten.h
+5
-3
src/Tables/RangeSelector.cpp
src/Tables/RangeSelector.cpp
+3
-3
src/Tables/Survey.cpp
src/Tables/Survey.cpp
+3
-4
src/Tables/Survey.h
src/Tables/Survey.h
+4
-4
src/Tables/Twiss.cpp
src/Tables/Twiss.cpp
+2
-3
src/Tables/Twiss.h
src/Tables/Twiss.h
+4
-4
No files found.
src/AbstractObjects/BeamSequence.h
View file @
8997fb4e
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include "AbstractObjects/Element.h"
#include "AbstractObjects/Element.h"
#include <memory>
class
Beamline
;
class
Beamline
;
...
@@ -48,7 +50,7 @@ public:
...
@@ -48,7 +50,7 @@ public:
/// Return the embedded CLASSIC beam line.
/// Return the embedded CLASSIC beam line.
// The result it the ideal line.
// The result it the ideal line.
virtual
Beamline
*
fetchLine
()
const
=
0
;
virtual
std
::
shared_ptr
<
Beamline
>
fetchLine
()
const
=
0
;
protected:
protected:
...
@@ -68,4 +70,4 @@ private:
...
@@ -68,4 +70,4 @@ private:
void
operator
=
(
const
BeamSequence
&
);
void
operator
=
(
const
BeamSequence
&
);
};
};
#endif // OPAL_BeamSequence_HH
#endif // OPAL_BeamSequence_HH
\ No newline at end of file
src/AbstractObjects/Table.h
View file @
8997fb4e
...
@@ -20,7 +20,9 @@
...
@@ -20,7 +20,9 @@
#include "AbstractObjects/Object.h"
#include "AbstractObjects/Object.h"
#include "AbstractObjects/Expressions.h"
#include "AbstractObjects/Expressions.h"
#include <vector>
#include <vector>
#include <memory>
class
Attribute
;
class
Attribute
;
class
Beamline
;
class
Beamline
;
...
@@ -113,7 +115,7 @@ public:
...
@@ -113,7 +115,7 @@ public:
/// Return embedded CLASSIC beamline.
/// Return embedded CLASSIC beamline.
// Returns the CLASSIC beamline representing the table.
// Returns the CLASSIC beamline representing the table.
// The data of the table are attached to each position in the line.
// The data of the table are attached to each position in the line.
virtual
const
Beamline
*
getLine
()
const
=
0
;
virtual
std
::
shared_ptr
<
const
Beamline
>
getLine
()
const
=
0
;
/// Return a table row.
/// Return a table row.
// Returns the values stored in the row specified by the first argument,
// Returns the values stored in the row specified by the first argument,
...
@@ -165,4 +167,4 @@ private:
...
@@ -165,4 +167,4 @@ private:
void
operator
=
(
const
Table
&
);
void
operator
=
(
const
Table
&
);
};
};
#endif // OPAL_Table_HH
#endif // OPAL_Table_HH
\ No newline at end of file
src/Algorithms/ParallelTTracker.cpp
View file @
8997fb4e
...
@@ -605,7 +605,7 @@ void ParallelTTracker::computeExternalFields(OrbitThreader &oth) {
...
@@ -605,7 +605,7 @@ void ParallelTTracker::computeExternalFields(OrbitThreader &oth) {
void
ParallelTTracker
::
computeWakefield
(
IndexMap
::
value_t
&
elements
)
{
void
ParallelTTracker
::
computeWakefield
(
IndexMap
::
value_t
&
elements
)
{
bool
hasWake
=
false
;
bool
hasWake
=
false
;
WakeFunction
*
wfInstance
;
std
::
shared_ptr
<
WakeFunction
>
wfInstance
;
Inform
msg
(
"ParallelTTracker "
,
*
gmsg
);
Inform
msg
(
"ParallelTTracker "
,
*
gmsg
);
...
@@ -640,7 +640,7 @@ void ParallelTTracker::computeWakefield(IndexMap::value_t &elements) {
...
@@ -640,7 +640,7 @@ void ParallelTTracker::computeWakefield(IndexMap::value_t &elements) {
if
(
!
wakeStatus_m
)
{
if
(
!
wakeStatus_m
)
{
msg
<<
level2
<<
"============== START WAKE CALCULATION ============="
<<
endl
;
msg
<<
level2
<<
"============== START WAKE CALCULATION ============="
<<
endl
;
wfInstance
->
initialize
(
(
*
it
).
get
()
);
wfInstance
->
initialize
(
*
it
);
wakeStatus_m
=
true
;
wakeStatus_m
=
true
;
}
}
...
@@ -677,7 +677,7 @@ void ParallelTTracker::computeWakefield(IndexMap::value_t &elements) {
...
@@ -677,7 +677,7 @@ void ParallelTTracker::computeWakefield(IndexMap::value_t &elements) {
void
ParallelTTracker
::
computeParticleMatterInteraction
(
IndexMap
::
value_t
elements
,
OrbitThreader
&
oth
)
{
void
ParallelTTracker
::
computeParticleMatterInteraction
(
IndexMap
::
value_t
elements
,
OrbitThreader
&
oth
)
{
Inform
msg
(
"ParallelTTracker "
,
*
gmsg
);
Inform
msg
(
"ParallelTTracker "
,
*
gmsg
);
std
::
set
<
IndexMap
::
value_t
::
value_type
>
elementsWithParticleMatterInteraction
;
std
::
set
<
IndexMap
::
value_t
::
value_type
>
elementsWithParticleMatterInteraction
;
std
::
set
<
ParticleMatterInteractionHandler
*
>
particleMatterinteractionHandlers
;
std
::
set
<
ParticleMatterInteractionHandler
::
SP
>
particleMatterinteractionHandlers
;
std
::
pair
<
double
,
double
>
currentRange
(
0.0
,
0.0
);
std
::
pair
<
double
,
double
>
currentRange
(
0.0
,
0.0
);
while
(
elements
.
size
()
>
0
)
{
while
(
elements
.
size
()
>
0
)
{
...
@@ -698,8 +698,8 @@ void ParallelTTracker::computeParticleMatterInteraction(IndexMap::value_t elemen
...
@@ -698,8 +698,8 @@ void ParallelTTracker::computeParticleMatterInteraction(IndexMap::value_t elemen
}
}
if
(
elementsWithParticleMatterInteraction
.
size
()
>
0
)
{
if
(
elementsWithParticleMatterInteraction
.
size
()
>
0
)
{
std
::
set
<
ParticleMatterInteractionHandler
*
>
oldSPHandlers
;
std
::
set
<
ParticleMatterInteractionHandler
::
SP
>
oldSPHandlers
;
std
::
vector
<
ParticleMatterInteractionHandler
*
>
leftBehindSPHandlers
,
newSPHandlers
;
std
::
vector
<
ParticleMatterInteractionHandler
::
SP
>
leftBehindSPHandlers
,
newSPHandlers
;
for
(
auto
it
:
activeParticleMatterInteractionHandlers_m
)
{
for
(
auto
it
:
activeParticleMatterInteractionHandlers_m
)
{
oldSPHandlers
.
insert
(
it
);
oldSPHandlers
.
insert
(
it
);
}
}
...
@@ -738,7 +738,7 @@ void ParallelTTracker::computeParticleMatterInteraction(IndexMap::value_t elemen
...
@@ -738,7 +738,7 @@ void ParallelTTracker::computeParticleMatterInteraction(IndexMap::value_t elemen
do
{
do
{
///all particles in material if max per node is 2 and other degraders have 0 particles
///all particles in material if max per node is 2 and other degraders have 0 particles
//check if more than one degrader has particles
//check if more than one degrader has particles
ParticleMatterInteractionHandler
*
onlyDegraderWithParticles
=
NULL
;
ParticleMatterInteractionHandler
::
SP
onlyDegraderWithParticles
=
NULL
;
int
degradersWithParticlesCount
=
0
;
int
degradersWithParticlesCount
=
0
;
for
(
auto
it
:
activeParticleMatterInteractionHandlers_m
)
{
for
(
auto
it
:
activeParticleMatterInteractionHandlers_m
)
{
it
->
setFlagAllParticlesIn
(
false
);
it
->
setFlagAllParticlesIn
(
false
);
...
@@ -979,7 +979,7 @@ void ParallelTTracker::writePhaseSpace(const long long /*step*/, bool psDump, bo
...
@@ -979,7 +979,7 @@ void ParallelTTracker::writePhaseSpace(const long long /*step*/, bool psDump, bo
FieldList
collimators
=
itsOpalBeamline_m
.
getElementByType
(
ElementBase
::
CCOLLIMATOR
);
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
)
{
for
(
FieldList
::
iterator
it
=
collimators
.
begin
();
it
!=
collimators
.
end
();
++
it
)
{
FlexibleCollimator
*
coll
=
static_cast
<
FlexibleCollimator
*>
(
it
->
getElement
().
ge
t
());
std
::
shared_ptr
<
FlexibleCollimator
>
coll
=
std
::
static_pointer_cast
<
FlexibleCollimator
>
(
it
->
getElemen
t
());
std
::
string
name
=
coll
->
getName
();
std
::
string
name
=
coll
->
getName
();
unsigned
int
losses
=
coll
->
getLosses
();
unsigned
int
losses
=
coll
->
getLosses
();
collimatorLosses
.
push_back
(
std
::
make_pair
(
name
,
losses
));
collimatorLosses
.
push_back
(
std
::
make_pair
(
name
,
losses
));
...
@@ -1216,7 +1216,7 @@ void ParallelTTracker::autophaseCavities(const BorisPusher &pusher) {
...
@@ -1216,7 +1216,7 @@ void ParallelTTracker::autophaseCavities(const BorisPusher &pusher) {
auto
elementSet
=
itsOpalBeamline_m
.
getElements
(
nextR
);
auto
elementSet
=
itsOpalBeamline_m
.
getElements
(
nextR
);
for
(
auto
element
:
elementSet
)
{
for
(
auto
element
:
elementSet
)
{
if
(
element
->
getType
()
==
ElementBase
::
TRAVELINGWAVE
)
{
if
(
element
->
getType
()
==
ElementBase
::
TRAVELINGWAVE
)
{
const
TravelingWave
*
TWelement
=
static_cast
<
const
TravelingWave
*>
(
element
.
get
()
);
std
::
shared_ptr
<
const
TravelingWave
>
TWelement
=
std
::
static_pointer_cast
<
const
TravelingWave
>
(
element
);
if
(
!
TWelement
->
getAutophaseVeto
())
{
if
(
!
TWelement
->
getAutophaseVeto
())
{
CavityAutophaser
ap
(
itsReference
,
element
);
CavityAutophaser
ap
(
itsReference
,
element
);
ap
.
getPhaseAtMaxEnergy
(
itsOpalBeamline_m
.
transformToLocalCS
(
element
,
itsBunch_m
->
RefPartR_m
),
ap
.
getPhaseAtMaxEnergy
(
itsOpalBeamline_m
.
transformToLocalCS
(
element
,
itsBunch_m
->
RefPartR_m
),
...
@@ -1225,7 +1225,7 @@ void ParallelTTracker::autophaseCavities(const BorisPusher &pusher) {
...
@@ -1225,7 +1225,7 @@ void ParallelTTracker::autophaseCavities(const BorisPusher &pusher) {
}
}
}
else
if
(
element
->
getType
()
==
ElementBase
::
RFCAVITY
)
{
}
else
if
(
element
->
getType
()
==
ElementBase
::
RFCAVITY
)
{
const
RFCavity
*
RFelement
=
static_cast
<
const
RFCavity
*>
(
element
.
get
()
);
std
::
shared_ptr
<
const
RFCavity
>
RFelement
=
std
::
static_pointer_cast
<
const
RFCavity
>
(
element
);
if
(
!
RFelement
->
getAutophaseVeto
())
{
if
(
!
RFelement
->
getAutophaseVeto
())
{
CavityAutophaser
ap
(
itsReference
,
element
);
CavityAutophaser
ap
(
itsReference
,
element
);
ap
.
getPhaseAtMaxEnergy
(
itsOpalBeamline_m
.
transformToLocalCS
(
element
,
itsBunch_m
->
RefPartR_m
),
ap
.
getPhaseAtMaxEnergy
(
itsOpalBeamline_m
.
transformToLocalCS
(
element
,
itsBunch_m
->
RefPartR_m
),
...
...
src/Algorithms/ParallelTTracker.h
View file @
8997fb4e
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
#include <list>
#include <list>
#include <vector>
#include <vector>
#include <memory>
class
ParticleMatterInteractionHandler
;
class
ParticleMatterInteractionHandler
;
...
@@ -205,7 +206,7 @@ private:
...
@@ -205,7 +206,7 @@ private:
bool
deletedParticles_m
;
bool
deletedParticles_m
;
WakeFunction
*
wakeFunction_m
;
std
::
shared_ptr
<
WakeFunction
>
wakeFunction_m
;
double
pathLength_m
;
double
pathLength_m
;
...
@@ -242,7 +243,7 @@ private:
...
@@ -242,7 +243,7 @@ private:
IpplTimings
::
TimerRef
BinRepartTimer_m
;
IpplTimings
::
TimerRef
BinRepartTimer_m
;
IpplTimings
::
TimerRef
WakeFieldTimer_m
;
IpplTimings
::
TimerRef
WakeFieldTimer_m
;
std
::
set
<
ParticleMatterInteractionHandler
*
>
activeParticleMatterInteractionHandlers_m
;
std
::
set
<
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
>
activeParticleMatterInteractionHandlers_m
;
bool
particleMatterStatus_m
;
bool
particleMatterStatus_m
;
unsigned
long
totalParticlesInSimulation_m
;
unsigned
long
totalParticlesInSimulation_m
;
...
...
src/Classic/AbsBeamline/BeamStripping.cpp
View file @
8997fb4e
...
@@ -69,7 +69,7 @@ BeamStripping::BeamStripping(const BeamStripping &right):
...
@@ -69,7 +69,7 @@ BeamStripping::BeamStripping(const BeamStripping &right):
maxr_m
(
right
.
maxr_m
),
maxr_m
(
right
.
maxr_m
),
minz_m
(
right
.
minz_m
),
minz_m
(
right
.
minz_m
),
maxz_m
(
right
.
maxz_m
),
maxz_m
(
right
.
maxz_m
),
parmatint_m
(
NULL
)
{
parmatint_m
(
nullptr
)
{
}
}
BeamStripping
::
BeamStripping
(
const
std
::
string
&
name
)
:
BeamStripping
::
BeamStripping
(
const
std
::
string
&
name
)
:
...
@@ -84,7 +84,7 @@ BeamStripping::BeamStripping(const std::string &name):
...
@@ -84,7 +84,7 @@ BeamStripping::BeamStripping(const std::string &name):
maxr_m
(
0.0
),
maxr_m
(
0.0
),
minz_m
(
0.0
),
minz_m
(
0.0
),
maxz_m
(
0.0
),
maxz_m
(
0.0
),
parmatint_m
(
NULL
)
{
parmatint_m
(
nullptr
)
{
}
}
...
@@ -166,7 +166,7 @@ bool BeamStripping::getStop() const {
...
@@ -166,7 +166,7 @@ bool BeamStripping::getStop() const {
}
}
bool
BeamStripping
::
checkBeamStripping
(
PartBunchBase
<
double
,
3
>
*
bunch
,
std
::
shared_ptr
<
Cyclotron
>
cycl
,
bool
BeamStripping
::
checkBeamStripping
(
PartBunchBase
<
double
,
3
>
*
bunch
,
std
::
shared_ptr
<
Cyclotron
>
c
onst
&
c
ycl
,
const
int
/*turnnumber*/
,
const
double
/*t*/
,
const
double
/*tstep*/
)
{
const
int
/*turnnumber*/
,
const
double
/*t*/
,
const
double
/*tstep*/
)
{
bool
flagNeedUpdate
=
false
;
bool
flagNeedUpdate
=
false
;
...
@@ -190,7 +190,7 @@ bool BeamStripping::checkBeamStripping(PartBunchBase<double, 3> *bunch, std::sha
...
@@ -190,7 +190,7 @@ bool BeamStripping::checkBeamStripping(PartBunchBase<double, 3> *bunch, std::sha
}
}
reduce
(
&
flagNeedUpdate
,
&
flagNeedUpdate
+
1
,
&
flagNeedUpdate
,
OpBitwiseOrAssign
());
reduce
(
&
flagNeedUpdate
,
&
flagNeedUpdate
+
1
,
&
flagNeedUpdate
,
OpBitwiseOrAssign
());
if
(
flagNeedUpdate
&&
parmatint_m
)
{
if
(
flagNeedUpdate
&&
parmatint_m
)
{
dynamic_cast
<
BeamStrippingPhysics
*
>
(
parmatint_m
)
->
setCyclotron
(
cycl
);
std
::
dynamic_pointer_cast
<
BeamStrippingPhysics
>
(
parmatint_m
)
->
setCyclotron
(
cycl
);
parmatint_m
->
apply
(
bunch
,
boundingSphere
);
parmatint_m
->
apply
(
bunch
,
boundingSphere
);
}
}
return
flagNeedUpdate
;
return
flagNeedUpdate
;
...
...
src/Classic/AbsBeamline/BeamStripping.h
View file @
8997fb4e
...
@@ -27,9 +27,11 @@
...
@@ -27,9 +27,11 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include <memory>
class
BeamlineVisitor
;
class
BeamlineVisitor
;
class
Cyclotron
;
class
Cyclotron
;
class
ParticleMatterInteractionHandler
;
struct
PFieldData
{
struct
PFieldData
{
std
::
string
filename
;
std
::
string
filename
;
...
@@ -77,7 +79,7 @@ public:
...
@@ -77,7 +79,7 @@ public:
/// Apply visitor to BeamStripping.
/// Apply visitor to BeamStripping.
virtual
void
accept
(
BeamlineVisitor
&
)
const
;
virtual
void
accept
(
BeamlineVisitor
&
)
const
;
virtual
bool
checkBeamStripping
(
PartBunchBase
<
double
,
3
>
*
bunch
,
std
::
shared_ptr
<
Cyclotron
>
cycl
,
const
int
turnnumber
,
const
double
t
,
const
double
tstep
);
virtual
bool
checkBeamStripping
(
PartBunchBase
<
double
,
3
>
*
bunch
,
std
::
shared_ptr
<
Cyclotron
>
c
onst
&
c
ycl
,
const
int
turnnumber
,
const
double
t
,
const
double
tstep
);
virtual
void
initialise
(
PartBunchBase
<
double
,
3
>
*
bunch
,
double
&
startField
,
double
&
endField
);
virtual
void
initialise
(
PartBunchBase
<
double
,
3
>
*
bunch
,
double
&
startField
,
double
&
endField
);
...
@@ -145,7 +147,7 @@ private:
...
@@ -145,7 +147,7 @@ private:
double
maxz_m
;
/// mm
double
maxz_m
;
/// mm
///@}
///@}
ParticleMatterInteractionHandler
*
parmatint_m
;
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
parmatint_m
;
protected:
protected:
// object of Matrices including pressure field map and its derivates
// object of Matrices including pressure field map and its derivates
...
...
src/Classic/AbsBeamline/CCollimator.h
View file @
8997fb4e
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include "AbsBeamline/PluginElement.h"
#include "AbsBeamline/PluginElement.h"
#include <memory>
class
ParticleMatterInteractionHandler
;
class
ParticleMatterInteractionHandler
;
class
CCollimator
:
public
PluginElement
{
class
CCollimator
:
public
PluginElement
{
...
@@ -83,7 +85,7 @@ private:
...
@@ -83,7 +85,7 @@ private:
///@}
///@}
double
rmax_m
;
///< maximum extend in r
double
rmax_m
;
///< maximum extend in r
ParticleMatterInteractionHandler
*
parmatint_m
=
nullptr
;
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
parmatint_m
=
nullptr
;
};
};
inline
inline
...
@@ -100,4 +102,4 @@ inline
...
@@ -100,4 +102,4 @@ inline
double
CCollimator
::
getWidth
()
{
double
CCollimator
::
getWidth
()
{
return
width_m
;
return
width_m
;
}
}
#endif // CLASSIC_CCollimator_HH
#endif // CLASSIC_CCollimator_HH
\ No newline at end of file
src/Classic/AbsBeamline/ElementBase.cpp
View file @
8997fb4e
...
@@ -151,7 +151,7 @@ Channel *ElementBase::getChannel(const std::string &aKey, bool create) {
...
@@ -151,7 +151,7 @@ Channel *ElementBase::getChannel(const std::string &aKey, bool create) {
const
ConstChannel
*
ElementBase
::
getConstChannel
(
const
std
::
string
&
aKey
)
const
{
const
ConstChannel
*
ElementBase
::
getConstChannel
(
const
std
::
string
&
aKey
)
const
{
// Use const_cast to allow calling the non-const method GetChannel().
// Use const_cast to allow calling the non-const method GetChannel().
// The const return value of this method will nevertheless inhibit set().
// The const return value of this method will nevertheless inhibit set().
return
const_cast
<
ElementBase
*>
(
this
)
->
getChannel
(
aKey
);
return
const_cast
<
ElementBase
*
>
(
this
)
->
getChannel
(
aKey
);
}
}
...
@@ -310,15 +310,15 @@ bool ElementBase::update(const AttributeSet &set) {
...
@@ -310,15 +310,15 @@ bool ElementBase::update(const AttributeSet &set) {
return
true
;
return
true
;
}
}
void
ElementBase
::
setWake
(
WakeFunction
*
wk
)
{
void
ElementBase
::
setWake
(
std
::
shared_ptr
<
WakeFunction
>
const
&
wf
)
{
wake_m
=
w
k
;
//->clone(getName() + std::string("_wake")); }
wake_m
=
w
f
;
}
}
void
ElementBase
::
setBoundaryGeometry
(
BoundaryGeometry
*
geo
)
{
void
ElementBase
::
setBoundaryGeometry
(
BoundaryGeometry
*
geo
)
{
bgeometry_m
=
geo
;
//->clone(getName() + std::string("_wake")); }
bgeometry_m
=
geo
;
//->clone(getName() + std::string("_wake")); }
}
}
void
ElementBase
::
setParticleMatterInteraction
(
ParticleMatterInteractionHandler
*
parmatint
)
{
void
ElementBase
::
setParticleMatterInteraction
(
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
const
&
parmatint
)
{
parmatint_m
=
parmatint
;
parmatint_m
=
parmatint
;
}
}
...
...
src/Classic/AbsBeamline/ElementBase.h
View file @
8997fb4e
...
@@ -399,16 +399,16 @@ public:
...
@@ -399,16 +399,16 @@ public:
/// attach a wake field to the element
/// attach a wake field to the element
virtual
void
setWake
(
WakeFunction
*
wf
);
virtual
void
setWake
(
std
::
shared_ptr
<
WakeFunction
>
const
&
wf
);
/// return the attached wake object if there is any
/// return the attached wake object if there is any
virtual
WakeFunction
*
getWake
()
const
;
virtual
std
::
shared_ptr
<
WakeFunction
>
getWake
()
const
;
virtual
bool
hasWake
()
const
;
virtual
bool
hasWake
()
const
;
virtual
void
setParticleMatterInteraction
(
ParticleMatterInteractionHandler
*
spys
);
virtual
void
setParticleMatterInteraction
(
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
const
&
spys
);
virtual
ParticleMatterInteractionHandler
*
getParticleMatterInteraction
()
const
;
virtual
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
getParticleMatterInteraction
()
const
;
virtual
bool
hasParticleMatterInteraction
()
const
;
virtual
bool
hasParticleMatterInteraction
()
const
;
...
@@ -466,11 +466,11 @@ private:
...
@@ -466,11 +466,11 @@ private:
// The user-defined set of attributes.
// The user-defined set of attributes.
AttributeSet
userAttribs
;
AttributeSet
userAttribs
;
WakeFunction
*
wake_m
;
std
::
shared_ptr
<
WakeFunction
>
wake_m
;
BoundaryGeometry
*
bgeometry_m
;
BoundaryGeometry
*
bgeometry_m
;
ParticleMatterInteractionHandler
*
parmatint_m
;
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
parmatint_m
;
bool
positionIsFixed
;
bool
positionIsFixed
;
///@{ ELEMEDGE attribute
///@{ ELEMEDGE attribute
...
@@ -541,12 +541,12 @@ bool ElementBase::isSharable() const
...
@@ -541,12 +541,12 @@ bool ElementBase::isSharable() const
{
return
shareFlag
;
}
{
return
shareFlag
;
}
inline
inline
WakeFunction
*
ElementBase
::
getWake
()
const
std
::
shared_ptr
<
WakeFunction
>
ElementBase
::
getWake
()
const
{
return
wake_m
;
}
{
return
wake_m
;
}
inline
inline
bool
ElementBase
::
hasWake
()
const
bool
ElementBase
::
hasWake
()
const
{
return
wake_m
!=
NULL
;
}
{
return
wake_m
!=
nullptr
;
}
inline
inline
BoundaryGeometry
*
ElementBase
::
getBoundaryGeometry
()
const
BoundaryGeometry
*
ElementBase
::
getBoundaryGeometry
()
const
...
@@ -557,12 +557,12 @@ bool ElementBase::hasBoundaryGeometry() const
...
@@ -557,12 +557,12 @@ bool ElementBase::hasBoundaryGeometry() const
{
return
bgeometry_m
!=
NULL
;
}
{
return
bgeometry_m
!=
NULL
;
}
inline
inline
ParticleMatterInteractionHandler
*
ElementBase
::
getParticleMatterInteraction
()
const
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
ElementBase
::
getParticleMatterInteraction
()
const
{
return
parmatint_m
;
}
{
return
parmatint_m
;
}
inline
inline
bool
ElementBase
::
hasParticleMatterInteraction
()
const
bool
ElementBase
::
hasParticleMatterInteraction
()
const
{
return
parmatint_m
!=
NULL
;
}
{
return
parmatint_m
!=
nullptr
;
}
inline
inline
void
ElementBase
::
setCSTrafoGlobal2Local
(
const
CoordinateSystemTrafo
&
trafo
)
void
ElementBase
::
setCSTrafoGlobal2Local
(
const
CoordinateSystemTrafo
&
trafo
)
...
...
src/Classic/AbsBeamline/FlexibleCollimator.h
View file @
8997fb4e
...
@@ -80,7 +80,7 @@ private:
...
@@ -80,7 +80,7 @@ private:
unsigned
int
losses_m
;
unsigned
int
losses_m
;
std
::
unique_ptr
<
LossDataSink
>
lossDs_m
;
std
::
unique_ptr
<
LossDataSink
>
lossDs_m
;
ParticleMatterInteractionHandler
*
parmatint_m
;
std
::
shared_ptr
<
ParticleMatterInteractionHandler
>
parmatint_m
;
};
};
inline
inline
...
@@ -108,4 +108,4 @@ std::string FlexibleCollimator::getDescription() const {
...
@@ -108,4 +108,4 @@ std::string FlexibleCollimator::getDescription() const {
return
description_m
;
return
description_m
;
}
}
#endif // CLASSIC_FlexibleCollimator_HH
#endif // CLASSIC_FlexibleCollimator_HH
\ No newline at end of file
src/Classic/AbsBeamline/Integrator.cpp
View file @
8997fb4e
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
// Class Integrator
// Class Integrator
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
Integrator
::
Integrator
(
ElementBase
*
elem
)
:
Integrator
::
Integrator
(
ElementBase
::
SP
const
&
elem
)
:
ElementBase
(
elem
->
getName
()),
itsElement
(
elem
)
ElementBase
(
elem
->
getName
()),
itsElement
(
elem
)
{}
{}
...
@@ -42,4 +42,4 @@ Integrator::~Integrator()
...
@@ -42,4 +42,4 @@ Integrator::~Integrator()
void
Integrator
::
makeSharable
()
{
void
Integrator
::
makeSharable
()
{
shareFlag
=
true
;
shareFlag
=
true
;
itsElement
->
makeSharable
();
itsElement
->
makeSharable
();
}
}
\ No newline at end of file
src/Classic/AbsBeamline/Integrator.h
View file @
8997fb4e
...
@@ -42,12 +42,12 @@ class Integrator: public ElementBase {
...
@@ -42,12 +42,12 @@ class Integrator: public ElementBase {
public:
public:
explicit
Integrator
(
ElementBase
*
);
explicit
Integrator
(
ElementBase
::
SP
const
&
);
Integrator
(
const
Integrator
&
rhs
);
Integrator
(
const
Integrator
&
rhs
);
virtual
~
Integrator
();
virtual
~
Integrator
();
/// Return the embedded element.
/// Return the embedded element.
inline
ElementBase
*
getElement
()
const
;
inline
ElementBase
::
SP
getElement
()
const
;
/// Set sharable flag.
/// Set sharable flag.
// The whole structure depending on [b]this[/b] is marked as sharable.
// The whole structure depending on [b]this[/b] is marked as sharable.
...
@@ -81,7 +81,7 @@ public:
...
@@ -81,7 +81,7 @@ public:
protected:
protected:
/// Pointer to the replaced element.
/// Pointer to the replaced element.
Pointer
<
ElementBase
>
itsElement
;
ElementBase
::
SP
itsElement
;
private:
private:
...
@@ -94,8 +94,8 @@ private:
...
@@ -94,8 +94,8 @@ private:
// Implementation.
// Implementation.
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
inline
ElementBase
*
Integrator
::
getElement
()
const
{
inline
ElementBase
::
SP
Integrator
::
getElement
()
const
{
return
&*
itsElement
;
return
itsElement
;
}
}
#endif // CLASSIC_Integrator_HH
#endif // CLASSIC_Integrator_HH
\ No newline at end of file
src/Classic/Beamlines/ElmPtr.cpp
View file @
8997fb4e
...
@@ -33,7 +33,7 @@ ElmPtr::ElmPtr(const ElmPtr &rhs):
...
@@ -33,7 +33,7 @@ ElmPtr::ElmPtr(const ElmPtr &rhs):
{}
{}
ElmPtr
::
ElmPtr
(
ElementBase
*
elem
)
:
ElmPtr
::
ElmPtr
(
ElementBase
::
SP
const
&
elem
)
:
itsElement
(
elem
)
itsElement
(
elem
)
{}
{}
...
@@ -44,4 +44,4 @@ ElmPtr::~ElmPtr()
...
@@ -44,4 +44,4 @@ ElmPtr::~ElmPtr()
void
ElmPtr
::
accept
(
BeamlineVisitor
&
visitor
)
const
{
void
ElmPtr
::
accept
(
BeamlineVisitor
&
visitor
)
const
{
itsElement
->
accept
(
visitor
);
itsElement
->
accept
(
visitor
);
}
}
\ No newline at end of file
src/Classic/Beamlines/ElmPtr.h
View file @
8997fb4e
...
@@ -35,7 +35,7 @@ public:
...
@@ -35,7 +35,7 @@ public:
ElmPtr
();
ElmPtr
();
ElmPtr
(
const
ElmPtr
&
);
ElmPtr
(
const
ElmPtr
&
);
ElmPtr
(
ElementBase
*
);
ElmPtr
(
ElementBase
::
SP
const
&
);
virtual
~
ElmPtr
();
virtual
~
ElmPtr
();
/// Apply visitor.
/// Apply visitor.
...
...
src/Classic/Construction/Factory.h
View file @
8997fb4e
...
@@ -20,10 +20,11 @@
...
@@ -20,10 +20,11 @@
//
//
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
#include "AbsBeamline/Definition.h"
#include <string>
#include <string>
#include <memory>
#include <memory>
class
ElementBase
;
class
AttributeSet
;