Commit d5c2c0f3 authored by snuverink_j's avatar snuverink_j
Browse files

reorder initialisation to match declaration

parent a5536c72
......@@ -150,8 +150,8 @@ public:
// If this constructor is used, the user must call 'initialize' with
// a layout object in order to use this.
IpplParticleBase() :
Layout(NULL),
MIN_NUM_PART_PER_CORE(0),
Layout(NULL),
TotalNum(0),
LocalNum(0),
DestroyNum(0),
......@@ -160,8 +160,8 @@ public:
// constructor 2: arguments = layout to use.
IpplParticleBase(PLayout *layout) :
Layout(layout),
MIN_NUM_PART_PER_CORE(0),
Layout(layout),
TotalNum(0),
LocalNum(0),
DestroyNum(0),
......
......@@ -130,7 +130,7 @@ Inform::Inform(const char *myname, std::ostream& os, int pnode)
/////////////////////////////////////////////////////////////////////
// class constructor specifying an other Inform instance
Inform::Inform(const char *myname, const Inform& os, int pnode)
: FormatBuf(std::ios::out), OpenedSuccessfully(true), MsgDest(os.MsgDest) {
: FormatBuf(std::ios::out), MsgDest(os.MsgDest), OpenedSuccessfully(true) {
// just store a ref to the provided stream
NeedClose = false;
......
......@@ -151,11 +151,11 @@ struct OpalDataImpl {
OpalDataImpl::OpalDataImpl():
mainDirectory(), referenceMomentum(0), modified(false), itsTitle_m(),
restart_dump_freq_m(1), last_step_m(0),
hasPriorRun_m(false),
isRestart_m(false),
restartStep_m(0),
hasRestartFile_m(false),
restart_dump_freq_m(1), last_step_m(0),
hasBunchAllocated_m(false),
hasDataSinkAllocated_m(false),
hasSLBunchAllocated_m(false),
......
......@@ -119,12 +119,12 @@ ParallelCyclotronTracker::ParallelCyclotronTracker(const Beamline &beamline,
const PartData &reference,
bool revBeam, bool revTrack):
Tracker(beamline, reference, revBeam, revTrack),
lastDumpedStep_m(0),
eta_m(0.01),
myNode_m(Ippl::myNode()),
initialLocalNum_m(0),
initialTotalNum_m(0),
opalRing_m(NULL),
lastDumpedStep_m(0) {
opalRing_m(NULL) {
itsBeamline = dynamic_cast<Beamline *>(beamline.clone());
}
......@@ -148,13 +148,13 @@ ParallelCyclotronTracker::ParallelCyclotronTracker(const Beamline &beamline,
int maxSTEPS, int timeIntegrator):
Tracker(beamline, reference, revBeam, revTrack),
maxSteps_m(maxSTEPS),
lastDumpedStep_m(0),
timeIntegrator_m(timeIntegrator),
eta_m(0.01),
myNode_m(Ippl::myNode()),
initialLocalNum_m(bunch.getLocalNum()),
initialTotalNum_m(bunch.getTotalNum()),
opalRing_m(NULL),
lastDumpedStep_m(0) {
opalRing_m(NULL) {
itsBeamline = dynamic_cast<Beamline *>(beamline.clone());
itsBunch = &bunch;
itsDataSink = &ds;
......
......@@ -78,13 +78,13 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
repartFreq_m(-1),
emissionSteps_m(std::numeric_limits<unsigned int>::max()),
numParticlesInSimulation_m(0),
totalParticlesInSimulation_m(0),
timeIntegrationTimer1_m(IpplTimings::getTimer("TIntegration1")),
timeIntegrationTimer2_m(IpplTimings::getTimer("TIntegration2")),
fieldEvaluationTimer_m(IpplTimings::getTimer("External field eval")),
BinRepartTimer_m(IpplTimings::getTimer("Binaryrepart")),
WakeFieldTimer_m(IpplTimings::getTimer("WakeField")),
surfaceStatus_m(false)
surfaceStatus_m(false),
totalParticlesInSimulation_m(0)
// , logger_m("designPath_" + std::to_string(Ippl::myNode()) + ".dat")
{
......@@ -125,13 +125,13 @@ ParallelTTracker::ParallelTTracker(const Beamline &beamline,
repartFreq_m(-1),
emissionSteps_m(numeric_limits<unsigned int>::max()),
numParticlesInSimulation_m(0),
totalParticlesInSimulation_m(0),
timeIntegrationTimer1_m(IpplTimings::getTimer("TIntegration1")),
timeIntegrationTimer2_m(IpplTimings::getTimer("TIntegration2")),
fieldEvaluationTimer_m(IpplTimings::getTimer("External field eval")),
BinRepartTimer_m(IpplTimings::getTimer("Binaryrepart")),
WakeFieldTimer_m(IpplTimings::getTimer("WakeField")),
surfaceStatus_m(false)
surfaceStatus_m(false),
totalParticlesInSimulation_m(0)
// , logger_m("designPath_" + std::to_string(Ippl::myNode()) + ".dat")
{
......
......@@ -74,11 +74,11 @@ Cyclotron::Cyclotron(const Cyclotron &right):
maxr_m(right.maxr_m),
minz_m(right.minz_m),
maxz_m(right.maxz_m),
fmLowE_m(right.fmLowE_m),
fmHighE_m(right.fmHighE_m),
RFfilename_m(right.RFfilename_m),
RFFCoeff_fn_m(right.RFFCoeff_fn_m),
RFVCoeff_fn_m(right.RFVCoeff_fn_m),
fmLowE_m(right.fmLowE_m),
fmHighE_m(right.fmHighE_m) {
RFVCoeff_fn_m(right.RFVCoeff_fn_m) {
}
......
......@@ -27,7 +27,7 @@
#include "Utilities/Util.h"
#include "gsl/gsl_interp.h"
//#include "gsl/gsl_spline.h"
#include "gsl/gsl_spline.h"
#include <iostream>
#include <fstream>
#ifdef OPAL_NOCPLUSPLUS11_NULLPTR
......@@ -43,18 +43,22 @@ using namespace std;
RFCavity::RFCavity():
Component(),
phase_td_m(nullptr),
amplitude_td_m(nullptr),
frequency_td_m(nullptr),
filename_m(""),
scale_m(1.0),
scaleError_m(0.0),
phase_m(0.0),
phaseError_m(0.0),
frequency_m(0.0),
fast_m(true),
autophaseVeto_m(false),
designEnergy_m(-1.0),
startField_m(0.0),
endField_m(0.0),
length_m(0.0),
type_m(SW),
fast_m(true),
autophaseVeto_m(false),
rmin_m(0.0),
rmax_m(0.0),
angle_m(0.0),
......@@ -63,17 +67,10 @@ RFCavity::RFCavity():
pdis_m(0.0),
gapwidth_m(0.0),
phi0_m(0.0),
designEnergy_m(-1.0),
RNormal_m(nullptr),
VrNormal_m(nullptr),
DvDr_m(nullptr),
num_points_m(0),
phase_td_m(nullptr),
amplitude_td_m(nullptr),
frequency_td_m(nullptr),
phase_name_m(""),
amplitude_name_m(""),
frequency_name_m("")
num_points_m(0)
{
setElType(isRF);
}
......@@ -81,18 +78,25 @@ RFCavity::RFCavity():
RFCavity::RFCavity(const RFCavity &right):
Component(right),
phase_td_m(right.phase_td_m),
phase_name_m(right.phase_name_m),
amplitude_td_m(right.amplitude_td_m),
amplitude_name_m(right.amplitude_name_m),
frequency_td_m(right.frequency_td_m),
frequency_name_m(right.frequency_name_m),
filename_m(right.filename_m),
scale_m(right.scale_m),
scaleError_m(right.scaleError_m),
phase_m(right.phase_m),
phaseError_m(right.phaseError_m),
frequency_m(right.frequency_m),
fast_m(right.fast_m),
autophaseVeto_m(right.autophaseVeto_m),
designEnergy_m(right.designEnergy_m),
startField_m(right.startField_m),
endField_m(right.endField_m),
length_m(right.length_m),
type_m(right.type_m),
fast_m(right.fast_m),
autophaseVeto_m(right.autophaseVeto_m),
rmin_m(right.rmin_m),
rmax_m(right.rmax_m),
angle_m(right.angle_m),
......@@ -101,17 +105,10 @@ RFCavity::RFCavity(const RFCavity &right):
pdis_m(right.pdis_m),
gapwidth_m(right.gapwidth_m),
phi0_m(right.phi0_m),
designEnergy_m(right.designEnergy_m),
RNormal_m(nullptr),
VrNormal_m(nullptr),
DvDr_m(nullptr),
num_points_m(right.num_points_m),
phase_td_m(right.phase_td_m),
amplitude_td_m(right.amplitude_td_m),
frequency_td_m(right.frequency_td_m),
phase_name_m(right.phase_name_m),
amplitude_name_m(right.amplitude_name_m),
frequency_name_m(right.frequency_name_m)
num_points_m(right.num_points_m)
{
setElType(isRF);
}
......@@ -119,18 +116,22 @@ RFCavity::RFCavity(const RFCavity &right):
RFCavity::RFCavity(const std::string &name):
Component(name),
phase_td_m(nullptr),
amplitude_td_m(nullptr),
frequency_td_m(nullptr),
filename_m(""),
scale_m(1.0),
scaleError_m(0.0),
phase_m(0.0),
phaseError_m(0.0),
frequency_m(0.0),
fast_m(true),
autophaseVeto_m(false),
designEnergy_m(-1.0),
startField_m(0.0),
endField_m(0.0),
length_m(0.0),
type_m(SW),
fast_m(true),
autophaseVeto_m(false),
rmin_m(0.0),
rmax_m(0.0),
angle_m(0.0),
......@@ -139,17 +140,13 @@ RFCavity::RFCavity(const std::string &name):
pdis_m(0.0),
gapwidth_m(0.0),
phi0_m(0.0),
designEnergy_m(-1.0),
RNormal_m(nullptr),
VrNormal_m(nullptr),
DvDr_m(nullptr),
// RNormal_m(std::nullptr_t(NULL)),
// VrNormal_m(std::nullptr_t(NULL)),
// DvDr_m(std::nullptr_t(NULL)),
num_points_m(0),
phase_td_m(nullptr),
amplitude_td_m(nullptr),
frequency_td_m(nullptr)
num_points_m(0)
{
setElType(isRF);
}
......
......@@ -62,8 +62,8 @@ TravelingWave::TravelingWave(const TravelingWave &right):
RFCavity(right),
CoreFieldmap_m(NULL),
scale_m(right.scale_m),
scaleError_m(right.scaleError_m),
scaleCore_m(right.scaleCore_m),
scaleError_m(right.scaleError_m),
scaleCoreError_m(right.scaleCoreError_m),
phase_m(right.phase_m),
phaseCore1_m(right.phaseCore1_m),
......@@ -89,8 +89,8 @@ TravelingWave::TravelingWave(const std::string &name):
RFCavity(name),
CoreFieldmap_m(NULL),
scale_m(1.0),
scaleError_m(0.0),
scaleCore_m(1.0),
scaleError_m(0.0),
scaleCoreError_m(0.0),
phase_m(0.0),
phaseCore1_m(0.0),
......
......@@ -70,6 +70,7 @@ PartBunch::PartBunch(const PartData *ref):
lossDs_m(nullptr),
pmsg_m(nullptr),
f_stream(nullptr),
lowParticleCount_m(false),
reference(ref),
unit_state_(units),
stateOfLastBoundP_(unitless),
......@@ -79,6 +80,8 @@ PartBunch::PartBunch(const PartData *ref):
eKin_m(0.0),
dE_m(0.0),
spos_m(0.0),
globalMeanR_m(Vector_t(0.0, 0.0, 0.0)),
globalToLocalQuaternion_m(Quaternion_t(1.0, 0.0, 0.0, 0.0)),
rmax_m(0.0),
rmin_m(0.0),
rrms_m(0.0),
......@@ -112,12 +115,9 @@ PartBunch::PartBunch(const PartData *ref):
SteptoLastInj_m(0),
partPerNode_m(nullptr),
globalPartPerNode_m(nullptr),
minLocNum_m(0),
dist_m(nullptr),
globalMeanR_m(Vector_t(0.0, 0.0, 0.0)),
globalToLocalQuaternion_m(Quaternion_t(1.0, 0.0, 0.0, 0.0)),
lowParticleCount_m(false),
dcBeam_m(false),
minLocNum_m(0) {
dcBeam_m(false) {
addAttribute(P);
addAttribute(Q);
addAttribute(M);
......@@ -170,6 +170,7 @@ PartBunch::PartBunch(const PartBunch &rhs):
lossDs_m(nullptr),
pmsg_m(nullptr),
f_stream(nullptr),
lowParticleCount_m(rhs.lowParticleCount_m),
reference(rhs.reference),
unit_state_(rhs.unit_state_),
stateOfLastBoundP_(rhs.stateOfLastBoundP_),
......@@ -179,6 +180,8 @@ PartBunch::PartBunch(const PartBunch &rhs):
eKin_m(rhs.eKin_m),
dE_m(rhs.dE_m),
spos_m(0.0),
globalMeanR_m(Vector_t(0.0, 0.0, 0.0)),
globalToLocalQuaternion_m(Quaternion_t(1.0, 0.0, 0.0, 0.0)),
rmax_m(rhs.rmax_m),
rmin_m(rhs.rmin_m),
rrms_m(rhs.rrms_m),
......@@ -212,12 +215,9 @@ PartBunch::PartBunch(const PartBunch &rhs):
SteptoLastInj_m(rhs.SteptoLastInj_m),
partPerNode_m(nullptr),
globalPartPerNode_m(nullptr),
minLocNum_m(rhs.minLocNum_m),
dist_m(nullptr),
globalMeanR_m(Vector_t(0.0, 0.0, 0.0)),
globalToLocalQuaternion_m(Quaternion_t(1.0, 0.0, 0.0, 0.0)),
lowParticleCount_m(rhs.lowParticleCount_m),
dcBeam_m(rhs.dcBeam_m),
minLocNum_m(rhs.minLocNum_m) {
dcBeam_m(rhs.dcBeam_m) {
ERRORMSG("should not be here: PartBunch::PartBunch(const PartBunch &rhs):" << endl);
std::exit(0);
}
......@@ -230,6 +230,7 @@ PartBunch::PartBunch(const std::vector<Particle> &rhs, const PartData *ref):
lossDs_m(nullptr),
pmsg_m(nullptr),
f_stream(nullptr),
lowParticleCount_m(false),
reference(ref),
unit_state_(units),
stateOfLastBoundP_(unitless),
......@@ -239,6 +240,8 @@ PartBunch::PartBunch(const std::vector<Particle> &rhs, const PartData *ref):
eKin_m(0.0),
dE_m(0.0),
spos_m(0.0),
globalMeanR_m(Vector_t(0.0, 0.0, 0.0)),
globalToLocalQuaternion_m(Quaternion_t(1.0, 0.0, 0.0, 0.0)),
rmax_m(0.0),
rmin_m(0.0),
rrms_m(0.0),
......@@ -272,12 +275,9 @@ PartBunch::PartBunch(const std::vector<Particle> &rhs, const PartData *ref):
SteptoLastInj_m(0),
partPerNode_m(nullptr),
globalPartPerNode_m(nullptr),
minLocNum_m(0),
dist_m(nullptr),
globalMeanR_m(Vector_t(0.0, 0.0, 0.0)),
globalToLocalQuaternion_m(Quaternion_t(1.0, 0.0, 0.0, 0.0)),
dcBeam_m(false),
lowParticleCount_m(false),
minLocNum_m(0) {
dcBeam_m(false) {
ERRORMSG("should not be here: PartBunch::PartBunch(const std::vector<Particle> &rhs, const PartData *ref):" << endl);
}
......
......@@ -103,15 +103,13 @@ VectorMap* PolynomialPatch::clone() const {
}
PolynomialPatch::PolynomialPatch()
: grid_points_(NULL), validity_region_(NULL), points_(), point_dimension_(0),
: validity_region_(NULL), grid_points_(NULL), points_(), point_dimension_(0),
value_dimension_(0) {
}
PolynomialPatch::~PolynomialPatch() {
if (grid_points_ != NULL)
delete grid_points_;
if (validity_region_ != NULL)
delete validity_region_;
delete grid_points_;
delete validity_region_;
for (size_t i = 0; i < points_.size(); ++i)
delete points_[i];
}
......
......@@ -10,8 +10,8 @@ class PartBunch;
class WakeFunction {
public:
WakeFunction(std::string name, ElementBase *elref, unsigned int n):
name_m(name),
nBins_m(n) { };
nBins_m(n),
name_m(name) { };
virtual ~WakeFunction(){ };
virtual void initialize(const ElementBase *ref){ };
......
......@@ -234,6 +234,7 @@ Distribution::Distribution():
emitEnergyUpperLimit_m(0.0),
totalNumberParticles_m(0),
totalNumberEmittedParticles_m(0),
avrgpz_m(0.0),
inputMoUnits_m(InputMomentumUnitsT::NONE),
sigmaTRise_m(0.0),
sigmaTFall_m(0.0),
......@@ -258,13 +259,12 @@ Distribution::Distribution():
secondaryFlag_m(0),
ppVw_m(0.0),
vVThermal_m(0.0),
referencePz_m(0.0),
referenceZ_m(0.0),
avrgpz_m(0.0),
I_m(0.0),
E_m(0.0),
bega_m(0.0),
M_m(0.0)
M_m(0.0),
referencePz_m(0.0),
referenceZ_m(0.0),
bega_m(0.0)
{
setAttributes();
......@@ -360,15 +360,15 @@ Distribution::Distribution(const std::string &name, Distribution *parent):
secondaryFlag_m(parent->secondaryFlag_m),
ppVw_m(parent->ppVw_m),
vVThermal_m(parent->vVThermal_m),
I_m(parent->I_m),
E_m(parent->E_m),
M_m(parent->M_m),
tRise_m(parent->tRise_m),
tFall_m(parent->tFall_m),
sigmaRise_m(parent->sigmaRise_m),
sigmaFall_m(parent->sigmaFall_m),
cutoff_m(parent->cutoff_m),
I_m(parent->I_m),
E_m(parent->E_m),
bega_m(parent->bega_m),
M_m(parent->M_m)
bega_m(parent->bega_m)
{
gsl_rng_env_setup();
randGen_m = gsl_rng_alloc(gsl_rng_default);
......
......@@ -35,16 +35,16 @@ using namespace std;
#endif
DataSink::DataSink() :
H5call_m(0),
lossWrCounter_m(0),
doHDF5_m(true),
h5wrapper_m(NULL),
H5call_m(0)
h5wrapper_m(NULL)
{ }
DataSink::DataSink(H5PartWrapper *h5wrapper, int restartStep):
H5call_m(0),
lossWrCounter_m(0),
h5wrapper_m(h5wrapper),
H5call_m(0)
h5wrapper_m(h5wrapper)
{
namespace fs = boost::filesystem;
......@@ -84,9 +84,9 @@ DataSink::DataSink(H5PartWrapper *h5wrapper, int restartStep):
}
DataSink::DataSink(H5PartWrapper *h5wrapper):
H5call_m(0),
lossWrCounter_m(0),
h5wrapper_m(h5wrapper),
H5call_m(0)
h5wrapper_m(h5wrapper)
{
/// Constructor steps:
/// Get timers from IPPL.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment