Commit 823702f7 authored by kraus's avatar kraus
Browse files

more pretty printing

parent eb3fb264
......@@ -2242,8 +2242,11 @@ Inform &PartBunch::print(Inform &os) {
Inform::FmtFlags_t ff = os.flags();
os << scientific;
os << "* ************** B U N C H ********************************************************* " << endl;
os << "* NP= " << this->getTotalNum() << " Qtot= " << abs(sum(Q) * 1.0E9) << " [nC] Qi= " << abs(qi_m) << " [C]" << endl;
os << "* Ekin = " << setw(12) << setprecision(5) << eKin_m << " [MeV] dEkin= " << dE_m << " [MeV]" << endl;
os << "* NP = " << this->getTotalNum() << "\n";
os << "* Qtot = " << setw(12) << setprecision(5) << abs(sum(Q)) * 1.0e9 << " [nC] "
<< "Qi = " << setw(12) << std::abs(qi_m) * 1e9 << " [nC]" << "\n";
os << "* Ekin = " << setw(12) << setprecision(5) << eKin_m << " [MeV] "
<< "dEkin = " << setw(12) << dE_m << " [MeV]" << endl;
os << "* rmax = " << setw(12) << setprecision(5) << rmax_m << " [m]" << endl;
os << "* rmin = " << setw(12) << setprecision(5) << rmin_m << " [m]" << endl;
os << "* rms beam size = " << setw(12) << setprecision(5) << rrms_m << " [m]" << endl;
......@@ -2254,7 +2257,8 @@ Inform &PartBunch::print(Inform &os) {
os << "* rms correlation = " << setw(12) << setprecision(5) << rprms_m << endl;
os << "* hr = " << setw(12) << setprecision(5) << hr_m << " [m]" << endl;
os << "* dh = " << setw(12) << setprecision(5) << dh_m << " [m]" << endl;
os << "* t = " << setw(12) << setprecision(5) << getT() << " [s] dT= " << getdT() << " [s]" << endl;
os << "* t = " << setw(12) << setprecision(5) << getT() << " [s] "
<< "dT = " << setw(12) << getdT() << " [s]" << endl;
os << "* spos = " << setw(12) << setprecision(5) << get_sPos() << " [m]" << endl;
os << "* ********************************************************************************** " << endl;
os.flags(ff);
......
......@@ -2127,14 +2127,22 @@ void ParallelTTracker::dumpStats(long long step) {
size_t totalParticles_f = numParticlesInSimulation_m;
if(totalParticles_f <= minBinEmitted_m) {
msg << myt2.time() << " Step " << step << "; only " << totalParticles_f << " particles emitted; t= " << itsBunch->getT()
<< " [s] E=" << itsBunch->get_meanEnergy() << " [MeV] " << endl;
msg << myt2.time() << " "
<< "Step " << setw(6) << step << "; "
<< "only " << setw(4) << totalParticles_f << " particles emitted; "
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s] "
<< "E=" << fixed << setprecision(3) << setw(9) << itsBunch->get_meanEnergy() << " [MeV] "
<< endl;
} else if(std::isnan(sposRef) || std::isinf(sposRef)) {
throw OpalException("ParallelTTracker::dumpStats()",
"there seems to be something wrong with the position of the bunch!");
} else {
msg << myt2.time() << " Step " << step << " at " << sposRef << " [m] t= "
<< itsBunch->getT() << " [s] E=" << itsBunch->get_meanEnergy() << " [MeV] " << endl;
msg << myt2.time() << " "
<< "Step " << setw(6) << step << " "
<< "at " << fixed << setprecision(3) << setw(8) << sposRef << " [m] "
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s] "
<< "E=" << fixed << setprecision(3) << setw(9) << itsBunch->get_meanEnergy() << " [MeV] "
<< endl;
writePhaseSpace(step, sposRef);
}
......
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