Files
katrin-plasma/src/mc_electron/particle.cpp
T
2018-09-26 15:12:27 +02:00

60 lines
1014 B
C++

//
// particle.cpp
// mc_electron
//
// Created by Christian Reiling on 20.09.18.
// Copyright © 2018 Christian Reiling. All rights reserved.
//
#include "particle.h"
std::ostream& operator<<(std::ostream& os, const species& SpecOut) {
switch (SpecOut) {
case electron:
os<<"e-";
break;
case positron:
os<<"e+";
break;
case proton:
os<<"p";
break;
case tritium:
os<<"T3";
break;
case tritium2:
os<<"T_2";
break;
case helium:
os<<"He3";
break;
case deuterium:
os<<"D2";
break;
case DT:
os<<"DT";
break;
default:
std::cerr<<"unknown species";
exit(1);
}
return (os);
}
std::ostream& operator<<(std::ostream& os, const Particle& partOut) {
os
<< partOut.Id << ";"
<<partOut.parentId << ";"
<<partOut.s << ";"
<<partOut.m_eV << ";"
<< partOut.q_e << ";"
<< partOut.x_m[0] << ";"
<< partOut.x_m[1] << ";"
<< partOut.x_m[2] << ";"
<< partOut.v_ms[0] << ";"
<< partOut.v_ms[1] << ";"
<< partOut.v_ms[2] << ";";
return os;
}