Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
kraus
src
Commits
832df403
Commit
832df403
authored
Apr 02, 2019
by
snuverink_j
Browse files
dont print rms values if single particle (suppresses nans)
parent
cf4044fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
src/Classic/Algorithms/PartBunchBase.h
src/Classic/Algorithms/PartBunchBase.h
+0
-2
src/Classic/Algorithms/PartBunchBase.hpp
src/Classic/Algorithms/PartBunchBase.hpp
+11
-9
No files found.
src/Classic/Algorithms/PartBunchBase.h
View file @
832df403
...
...
@@ -12,8 +12,6 @@
#include "Algorithms/PartBinsCyc.h"
#include "Algorithms/PartData.h"
#include "Algorithms/Quaternion.h"
#include "Utilities/SwitcherError.h"
#include "Physics/Physics.h"
#include <iosfwd>
#include <vector>
...
...
src/Classic/Algorithms/PartBunchBase.hpp
View file @
832df403
#ifndef PART_BUNCH_BASE_HPP
#define PART_BUNCH_BASE_HPP
#include "PartBunchBase.h"
#include "Distribution/Distribution.h"
#include "AbstractObjects/OpalData.h" // OPAL file
#include "Physics/Physics.h"
#include "Utilities/OpalException.h"
#include "Utilities/Options.h"
#include "Utilities/SwitcherError.h"
#include "Utilities/Util.h"
extern
Inform
*
gmsg
;
...
...
@@ -1993,7 +1993,7 @@ void PartBunchBase<T, Dim>::correctEnergy(double avrgp_m) {
template
<
class
T
,
unsigned
Dim
>
Inform
&
PartBunchBase
<
T
,
Dim
>::
print
(
Inform
&
os
)
{
if
(
getTotalNum
()
!=
0
)
{
// to suppress Nan
'
s
if
(
getTotalNum
()
!=
0
)
{
// to suppress Nans
Inform
::
FmtFlags_t
ff
=
os
.
flags
();
double
lengthUnitConverter
=
1
;
...
...
@@ -2016,12 +2016,14 @@ Inform &PartBunchBase<T, Dim>::print(Inform &os) {
<<
"dEkin = "
<<
std
::
setw
(
17
)
<<
Util
::
getEnergyString
(
dE_m
)
<<
"
\n
"
;
os
<<
"* rmax = "
<<
Util
::
getLengthString
(
rmax_m
,
5
)
<<
"
\n
"
;
os
<<
"* rmin = "
<<
Util
::
getLengthString
(
rmin_m
,
5
)
<<
"
\n
"
;
os
<<
"* rms beam size = "
<<
Util
::
getLengthString
(
rrms_m
,
5
)
<<
"
\n
"
;
os
<<
"* rms momenta = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
prms_m
<<
" [beta gamma]
\n
"
;
os
<<
"* mean position = "
<<
Util
::
getLengthString
(
rmean_m
,
5
)
<<
"
\n
"
;
os
<<
"* mean momenta = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
pmean_m
<<
" [beta gamma]
\n
"
;
os
<<
"* rms emittance = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
eps_m
<<
" (not normalized)
\n
"
;
os
<<
"* rms correlation = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
rprms_m
<<
"
\n
"
;
if
(
getTotalNum
()
>=
2
)
{
// to suppress Nans
os
<<
"* rms beam size = "
<<
Util
::
getLengthString
(
rrms_m
,
5
)
<<
"
\n
"
;
os
<<
"* rms momenta = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
prms_m
<<
" [beta gamma]
\n
"
;
os
<<
"* mean position = "
<<
Util
::
getLengthString
(
rmean_m
,
5
)
<<
"
\n
"
;
os
<<
"* mean momenta = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
pmean_m
<<
" [beta gamma]
\n
"
;
os
<<
"* rms emittance = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
eps_m
<<
" (not normalized)
\n
"
;
os
<<
"* rms correlation = "
<<
std
::
setw
(
12
)
<<
std
::
setprecision
(
5
)
<<
rprms_m
<<
"
\n
"
;
}
os
<<
"* hr = "
<<
Util
::
getLengthString
(
get_hr
(),
5
)
<<
"
\n
"
;
os
<<
"* dh = "
<<
std
::
setw
(
13
)
<<
std
::
setprecision
(
5
)
<<
dh_m
*
100
<<
" [%]
\n
"
;
os
<<
"* t = "
<<
std
::
setw
(
17
)
<<
Util
::
getTimeString
(
getT
())
<<
" "
...
...
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