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
5e0677c0
Commit
5e0677c0
authored
Mar 19, 2015
by
kraus
Browse files
fixing bug that prevented most distributions from beeing mirrored
parent
d2e81d3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/Distribution/Distribution.cpp
src/Distribution/Distribution.cpp
+6
-6
No files found.
src/Distribution/Distribution.cpp
View file @
5e0677c0
...
...
@@ -1936,14 +1936,14 @@ void Distribution::CreateOpalCycl(PartBunch &beam,
*
* For now we just cut the number of generated particles in half.
*/
if
(
Options
::
cZero
&&
!
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
if
(
Options
::
cZero
&&
!
(
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
)
numberOfPartToCreate
/=
2
;
// Create distribution.
Create
(
numberOfPartToCreate
,
beam
.
getM
());
// Now reflect particles if Options::cZero is true.
if
(
Options
::
cZero
&&
!
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
if
(
Options
::
cZero
&&
!
(
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
)
ReflectDistribution
(
numberOfPartToCreate
);
// Setup energy bins.
...
...
@@ -2071,7 +2071,7 @@ void Distribution::CreateOpalT(PartBunch &beam,
*
* For now we just cut the number of generated particles in half.
*/
if
(
Options
::
cZero
&&
!
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
if
(
Options
::
cZero
&&
!
(
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
)
numberOfParticles
/=
2
;
/*
...
...
@@ -2107,7 +2107,7 @@ void Distribution::CreateOpalT(PartBunch &beam,
AddDistributions
();
// Now reflect particles if Options::cZero is true
if
(
Options
::
cZero
&&
!
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
if
(
Options
::
cZero
&&
!
(
distrTypeT_m
==
DistrTypeT
::
FROMFILE
)
)
ReflectDistribution
(
numberOfParticles
);
// Check number of particles in distribution.
...
...
@@ -3475,7 +3475,7 @@ void Distribution::PrintDist(Inform &os, size_t numberOfParticles) const {
if
(
numberOfParticles
>
0
)
{
os
<<
"Number of particles: "
<<
numberOfParticles
*
(
Options
::
cZero
&&
!
distrTypeT_m
==
DistrTypeT
::
FROMFILE
?
2
:
1
)
<<
numberOfParticles
*
(
Options
::
cZero
&&
!
(
distrTypeT_m
==
DistrTypeT
::
FROMFILE
?
2
:
1
)
)
<<
endl
<<
endl
;
}
...
...
@@ -5051,4 +5051,4 @@ void Distribution::WriteOutFileInjection() {
reduce
(
numberOfParticles
,
numberOfParticles
,
OpAddAssign
());
}
}
}
\ No newline at end of file
}
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