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
dbdee57e
Commit
dbdee57e
authored
Dec 07, 2013
by
adelmann
🎗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass initial number of particles
parent
33e7f1ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
src/Algorithms/ParallelTTracker.cpp
src/Algorithms/ParallelTTracker.cpp
+10
-2
src/Algorithms/ParallelTTracker.h
src/Algorithms/ParallelTTracker.h
+5
-2
src/Track/TrackRun.cpp
src/Track/TrackRun.cpp
+8
-6
No files found.
src/Algorithms/ParallelTTracker.cpp
View file @
dbdee57e
...
...
@@ -72,10 +72,12 @@ using namespace OPALTimer;
ParallelTTracker
::
ParallelTTracker
(
const
Beamline
&
beamline
,
const
PartData
&
reference
,
bool
revBeam
,
bool
revTrack
)
:
bool
revTrack
,
size_t
N
)
:
Tracker
(
beamline
,
reference
,
revBeam
,
revTrack
),
itsBunch
(
NULL
),
itsDataSink_m
(
NULL
),
specifiedNPart_m
(
N
),
bgf_m
(
NULL
),
itsOpalBeamline_m
(),
lineDensity_m
(),
...
...
@@ -128,9 +130,11 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
bool
revTrack
,
int
maxSTEPS
,
double
zstop
,
int
timeIntegrator
)
:
int
timeIntegrator
,
size_t
N
)
:
Tracker
(
beamline
,
reference
,
revBeam
,
revTrack
),
itsBunch
(
&
bunch
),
specifiedNPart_m
(
N
),
itsDataSink_m
(
&
ds
),
bgf_m
(
NULL
),
itsOpalBeamline_m
(),
...
...
@@ -1932,6 +1936,10 @@ void ParallelTTracker::emitParticles(long long step) {
if
(
step
>
minStepforReBin_m
)
{
itsBunch
->
Rebin
();
itsBunch
->
resetInterpolationCache
(
true
);
// if (itsBunch->getTotalNum() < specifiedNPart_m) {
// WARNMSG("Rebinning, but less particles emitted than specifyed. Either increase MINSTEPFORREBIN or you have particle losses!"<< endl);
//}
}
}
...
...
src/Algorithms/ParallelTTracker.h
View file @
dbdee57e
...
...
@@ -113,7 +113,7 @@ public:
// If [b]revBeam[/b] is true, the beam runs from s = C to s = 0.
// If [b]revTrack[/b] is true, we track against the beam.
explicit
ParallelTTracker
(
const
Beamline
&
bl
,
const
PartData
&
data
,
bool
revBeam
,
bool
revTrack
);
bool
revBeam
,
bool
revTrack
,
size_t
N
);
/// Constructor.
// The beam line to be tracked is "bl".
...
...
@@ -122,7 +122,7 @@ public:
// If [b]revBeam[/b] is true, the beam runs from s = C to s = 0.
// If [b]revTrack[/b] is true, we track against the beam.
explicit
ParallelTTracker
(
const
Beamline
&
bl
,
PartBunch
&
bunch
,
DataSink
&
ds
,
const
PartData
&
data
,
bool
revBeam
,
bool
revTrack
,
int
maxSTEPS
,
double
zstop
,
int
timeIntegrator
);
const
PartData
&
data
,
bool
revBeam
,
bool
revTrack
,
int
maxSTEPS
,
double
zstop
,
int
timeIntegrator
,
size_t
N
);
virtual
~
ParallelTTracker
();
...
...
@@ -280,6 +280,9 @@ private:
double
surfaceEmissionStop_m
;
size_t
specifiedNPart_m
;
// This variable controls the minimal number of steps of emission (using bins)
// before we can merge the bins
int
minStepforReBin_m
;
...
...
src/Track/TrackRun.cpp
View file @
dbdee57e
...
...
@@ -322,7 +322,8 @@ void TrackRun::execute() {
itsTracker
=
new
ParallelTTracker
(
*
Track
::
block
->
use
->
fetchLine
(),
dynamic_cast
<
PartBunch
&>
(
*
Track
::
block
->
bunch
),
*
ds
,
Track
::
block
->
reference
,
false
,
false
,
Track
::
block
->
localTimeSteps
,
Track
::
block
->
zstop
,
Track
::
block
->
timeIntegrator
);
Track
::
block
->
zstop
,
Track
::
block
->
timeIntegrator
,
beam
->
getNumberOfParticles
());
itsTracker
->
setMpacflg
(
mpacflg
);
// set multipacting flag in ParallelTTracker
}
else
if
(
method
==
"PARALLEL-Z"
)
{
...
...
@@ -362,7 +363,7 @@ void TrackRun::execute() {
getFrequency() gets RF frequency [MHz], NOT isochronous revolution frequency of particle!
getCurrent() gets beamcurrent [A]
*/
*/
macrocharge
=
beam
->
getCurrent
()
/
(
beam
->
getFrequency
()
*
1.0e6
);
// [MHz]-->[Hz]
if
(
!
OPAL
->
hasBunchAllocated
())
{
...
...
@@ -372,8 +373,8 @@ void TrackRun::execute() {
dist
->
CreateOpalCycl
(
*
Track
::
block
->
bunch
,
beam
->
getNumberOfParticles
(),
Options
::
scan
);
}
else
{
dist
->
DoRestartOpalCycl
(
*
Track
::
block
->
bunch
,
beam
->
getNumberOfParticles
(),
OPAL
->
getRestartStep
(),
specifiedNumBunch
);
dist
->
DoRestartOpalCycl
(
*
Track
::
block
->
bunch
,
beam
->
getNumberOfParticles
(),
OPAL
->
getRestartStep
(),
specifiedNumBunch
);
macrocharge
/=
beam
->
getNumberOfParticles
();
macromass
=
beam
->
getMass
()
*
macrocharge
/
(
beam
->
getCharge
()
*
q_e
);
}
...
...
@@ -703,10 +704,11 @@ ParallelTTracker *TrackRun::setupForAutophase() {
double
coefE
=
1.0
/
(
4
*
pi
*
epsilon_0
);
Track
::
block
->
bunch
->
setCouplingConstant
(
coefE
);
size_t
N
=
1
;
return
new
ParallelTTracker
(
*
Track
::
block
->
use
->
fetchLine
(),
dynamic_cast
<
PartBunch
&>
(
*
Track
::
block
->
bunch
),
*
ds
,
Track
::
block
->
reference
,
false
,
false
,
Track
::
block
->
localTimeSteps
,
Track
::
block
->
zstop
,
Track
::
block
->
timeIntegrator
);
Track
::
block
->
zstop
,
Track
::
block
->
timeIntegrator
,
N
);
}
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