Commit 55904787 authored by adelmann's avatar adelmann 🎗
Browse files

Fix uninitialized variables in boundary geometry handling.

Number of impacts are not integrated anymore, now we have impacts per timestep
OpalData can be asked if a global Geometry is avaidable
parent 15b3bfb6
......@@ -626,7 +626,10 @@ void PartBunch::calcGammas() {
}
s += pInBin;
}
if(s != getTotalNum())
if(s != getTotalNum() && !OpalData::getInstance()->hasGlobalGeometry())
ERRORMSG("sum(Bins)= " << s << " != sum(R)= " << getTotalNum() << endl;);
if(emittedBins >= 2) {
......@@ -932,8 +935,6 @@ void PartBunch::computeSelfFields() {
//write out rho
// #define DBG_SCALARFIELD
#ifdef DBG_SCALARFIELD
INFOMSG("*** START DUMPING SCALAR FIELD ***" << endl);
......
......@@ -390,6 +390,12 @@ BoundaryGeometry *OpalData::getGlobalGeometry() {
return p->bg_m;
}
bool OpalData::hasGlobalGeometry() {
return p->bg_m != 0;
}
void OpalData::apply(const ObjectFunction &fun) {
for(ObjectDir::iterator i = p->mainDirectory.begin();
i != p->mainDirectory.end(); ++i) {
......
......@@ -213,6 +213,9 @@ public:
///
BoundaryGeometry *getGlobalGeometry();
bool hasGlobalGeometry();
void setMaxPhase(std::string elName, double phi);
std::vector<MaxPhasesT>::iterator getFirstMaxPhases();
......
This diff is collapsed.
......@@ -204,10 +204,6 @@ public:
// overwrite the execute-methode from DefaultVisitor
virtual void visitBeamline(const Beamline &);
// For benchmark
size_t Nimpact_m;// benchmark
double SeyNum_m;// benchmark
/// set Multipacting flag
inline void setMpacflg(bool mpacflg) {
......@@ -332,6 +328,9 @@ private:
// 3 --- AMTS (Adaptive Boris-Buneman with multiple time stepping)
int timeIntegrator_m;
size_t Nimpact_m;
double SeyNum_m;
/********************** END VARIABLES ***********************************/
int LastVisited;
......
......@@ -2490,7 +2490,7 @@ void DataSink::writeImpactStatistics(PartBunch &beam, long long &step, size_t &i
if(!nEmissionMode) {
if(step == 0) {
fid << "#Time/ns" << std::setw(18) << "tot_impac" << std::setw(18) << "tot_sey" << std::setw(18)
fid << "#Time/ns" << std::setw(18) << "#Geometry impacts" << std::setw(18) << "tot_sey" << std::setw(18)
<< "TotalCharge" << std::setw(18) << "PartNum" << " numberOfFieldEmittedParticles " << endl ;
}
fid << t << std::setw(18) << impact << std::setw(18) << sey_num << std::setw(18) << charge
......@@ -2498,7 +2498,7 @@ void DataSink::writeImpactStatistics(PartBunch &beam, long long &step, size_t &i
} else {
if(step == 0) {
fid << "#Time/ns" << std::setw(18) << "tot_impac" << std::setw(18) << "tot_sey" << std::setw(18)
fid << "#Time/ns" << std::setw(18) << "#Geometry impacts" << std::setw(18) << "tot_sey" << std::setw(18)
<< "ParticleNumber" << " numberOfFieldEmittedParticles " << endl;
}
fid << t << std::setw(18) << impact << std::setw(18) << sey_num
......
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