Compare commits
1
Commits
jrupp
...
jrupp_testing
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d73f372f3 |
@@ -18,14 +18,25 @@ using namespace std;
|
|||||||
class T2Ie_Recombination : public TI_e_Precomputed_Interaction_Base {
|
class T2Ie_Recombination : public TI_e_Precomputed_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T2Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : TI_e_Precomputed_Interaction_Base(ePopulation, rngUni, 2*mT_eV) {
|
T2Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : TI_e_Precomputed_Interaction_Base(ePopulation, rngUni, 2*mT_eV) {
|
||||||
|
std::cout << "Konstruktor T2Ie_Recombinaton" << "\n";
|
||||||
calc_values(); // need to call here, because, constructor can't call pure virtual function
|
calc_values(); // need to call here, because, constructor can't call pure virtual function
|
||||||
}
|
}
|
||||||
|
|
||||||
InteractionOut do_Interaction (Particle *interPart);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
protected:
|
protected:
|
||||||
double get_microSigma_m2(const double &E_eV) {
|
double get_microSigma_m2(const double &E_eV) {
|
||||||
//std::cout<<"Reco Crosssection: "<<Janev_eT2I_Recombination::get_TCS(E_eV)<<"\n";
|
|
||||||
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
//std::cout << "kommen wir hier rein? --------------------------" << "\n";
|
||||||
|
//std::cout << " Energie in microsigma T2+ mit e-" << E_eV << "\n";
|
||||||
|
//std::cout<<" Reco Crosssection T2 mit e-: "<< Janev_eT2I_Recombination::get_TCS(E_eV)<<"\n";
|
||||||
|
//double a = Janev_eT2I_Recombination::get_TCS(E_eV);
|
||||||
|
//return a*100;
|
||||||
|
|
||||||
|
|
||||||
|
double twoEam2 = (E_eV + m2_eV) * 2 * m1_eV;
|
||||||
|
double E_kin_incident = twoEam2 / (2 * m2_eV) - m1_eV;
|
||||||
|
|
||||||
|
return Janev_eT2I_Recombination::get_TCS(E_kin_incident);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -33,23 +44,39 @@ inline InteractionOut T2Ie_Recombination::do_Interaction (Particle *interPart) {
|
|||||||
InteractionOut res;
|
InteractionOut res;
|
||||||
res.set_delete_current(true);
|
res.set_delete_current(true);
|
||||||
|
|
||||||
//std::cout <<"Interactiin particle in do interaction: " <<interPart->get_species()<<"\n";
|
std::cout <<interPart->get_species() << " RECO mit " <<Population->get_species()<<"\n";
|
||||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
//std::cout << "Energie von teilchen " << interPart->get_E_eV() <<"\n";
|
||||||
std::cout << "Ort des interpart = " << interPart->get_x_m()<<"\n";
|
//std::cout << "sigma von interaction T2+ mit e- " << get_microSigma_m2(interPart->get_E_eV())<<"\n";
|
||||||
std::cout << "v_ms = " << Population->roll_v_ms(interPart->get_x_m())<<"\n";
|
|
||||||
|
|
||||||
|
//std::cout << "v_ms von pop e- = " << Population->roll_v_ms(interPart->get_x_m())[0]<<"\n";
|
||||||
|
//std::cout << "v_ms von pop e- = " << Population->roll_v_ms(interPart->get_x_m())[0]<<"\n";
|
||||||
|
//double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||||
|
//double E_eV = calc_E_eV_from_v_ms_richtig(Population->roll_v_ms(interPart->get_x_m()));
|
||||||
|
double E_eV = Population->roll_v_ms(interPart->get_x_m())(0);
|
||||||
|
//fehler? roll_v_ms gibt eine energie
|
||||||
|
std::cout << "Energie aus e- pop " << E_eV <<"\n";
|
||||||
|
//std::cout << "Ort des interpart = " << interPart->get_x_m()<<"\n";
|
||||||
|
|
||||||
|
//E_eV = 1.0; //damit es mal geht, komischer Fehler
|
||||||
|
|
||||||
|
double E_min_eV = 1e-7;
|
||||||
|
double E_max_eV = 2e4;
|
||||||
|
int number_E_bins = 50;
|
||||||
Log_Scale E_scale;
|
Log_Scale E_scale;
|
||||||
|
E_scale = Log_Scale(E_min_eV, E_max_eV, number_E_bins);
|
||||||
int Ee_bin = E_scale.calc_index(E_eV);
|
int Ee_bin = E_scale.calc_index(E_eV);
|
||||||
std::cout<<"Ee_bin = " << Ee_bin<<"\n";
|
std::cout<<"Ee_bin = " << Ee_bin<<"\n";
|
||||||
std::cout << "E_eV = " << E_eV<<"\n";
|
//std::cout << "E_eV = " << E_eV<<"\n";
|
||||||
Bins loc_bin = Population->get_loc_bin(interPart->get_x_m());
|
Bins loc_bin = Population->get_loc_bin(interPart->get_x_m());
|
||||||
|
|
||||||
//std::cout<<"E aus roll v = "<<E_eV<<"\n";
|
//std::cout<<"E aus roll v = "<<E_eV<<"\n";
|
||||||
double n1 = Population->get_density_m3(Ee_bin, loc_bin); //nur zum schauen
|
double n1 = Population->get_density_m3(Ee_bin, loc_bin); //nur zum schauen
|
||||||
std::cout<<"Population vor Reco = "<<n1<<"\n";
|
//std::cout<<"Population vor Recombination = "<<n1<<"\n";
|
||||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||||
double n2 = Population->get_density_m3(Ee_bin, loc_bin); //nur zum schauen
|
double n2 = Population->get_density_m3(Ee_bin, loc_bin); //nur zum schauen
|
||||||
std::cout<<"Population vor Reco = "<<n2<<"\n";
|
//std::cout<<"Population nach Recombination = "<<n2<<"\n";
|
||||||
std::cout<<"T2+ wurde gelöscht"<<"\n";
|
//std::cout<<"T2+ wurde gelöscht"<<"\n";
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,31 +47,176 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline double TI_e_Interaction_Base::get_macro_sigma_m(const Particle &interPart) {
|
inline double TI_e_Interaction_Base::get_macro_sigma_m(const Particle &interPart) {
|
||||||
|
//std::cout<< "wird das gemacht? nich precomputed" << "\n";
|
||||||
|
|
||||||
return calc_macro_sigma_m(interPart.get_E_eV(), interPart.get_x_m());
|
return calc_macro_sigma_m(interPart.get_E_eV(), interPart.get_x_m());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double gammafaktor(double v) {
|
||||||
|
return 1/sqrt(1-pow(v/c_ms, 2));
|
||||||
|
}
|
||||||
|
|
||||||
inline double TI_e_Interaction_Base::calc_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
inline double TI_e_Interaction_Base::calc_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
||||||
Bins loc_bins = Population->get_loc_bin(loc_m);
|
Bins loc_bins = Population->get_loc_bin(loc_m);
|
||||||
|
|
||||||
|
std::cout << "Energie von T2+ in calc macro sigma also in mirco sigma: " << E_eV << "\n";
|
||||||
|
|
||||||
double macro_sigma_m = 0;
|
double macro_sigma_m = 0;
|
||||||
for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
||||||
macro_sigma_m += calc_microSigma_m2(E_eV, Ee_bin) * Population->get_density_m3(Ee_bin, loc_bins);
|
|
||||||
}
|
|
||||||
return macro_sigma_m;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline double TI_e_Interaction_Base::calc_microSigma_m2(const double &E2_eV, const int &Ee_bin) {
|
macro_sigma_m += calc_microSigma_m2(E_eV, Ee_bin) * Population->get_density_m3(Ee_bin, loc_bins);
|
||||||
//return get_microSigma_m2(Ee_mids[Ee_bin]); // No Integration... Only e- energy
|
if(Population->get_density_m3(Ee_bin, loc_bins) > 0 ){
|
||||||
double v1_ms = ve_mids[Ee_bin];
|
|
||||||
double v2_ms = calc_v_ms_from_E_eV(E2_eV, m2_eV);
|
double v1_ms = ve_mids[Ee_bin]; //ist nährungsweise die richitge geschwindigkeit für elektorn
|
||||||
|
double v2_ms = calc_v_ms_from_E_eV(E_eV, m2_eV); //ist die richtige geschwindigkeit für ion
|
||||||
|
|
||||||
if (v1_ms > v2_ms*2000 ) { // 2000 represents 1% variation in energy
|
if (v1_ms > v2_ms*2000 ) { // 2000 represents 1% variation in energy
|
||||||
|
//std::cout << "machen wir das?" << "\n";
|
||||||
|
//std::cout << Ee_mids[Ee_bin] << "\n";
|
||||||
|
//std::cout << get_microSigma_m2(Ee_mids[Ee_bin]) << "\n";
|
||||||
|
//std::cout << "wird nicht gemacht oder? " << "\n";
|
||||||
return get_microSigma_m2(Ee_mids[Ee_bin]);
|
return get_microSigma_m2(Ee_mids[Ee_bin]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
//neu
|
||||||
|
|
||||||
|
double v1_ms = ve_mids[Ee_bin];
|
||||||
|
double v2_ms = calc_v_ms_from_E_eV(E_eV, m2_eV);
|
||||||
|
//std::cout << "v1 " << v1_ms <<"\n";
|
||||||
|
//std::cout << "v2 " << v2_ms <<"\n";
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
|
||||||
|
|
||||||
|
double p1 = gammafaktor(v2_ms) * m2_eV * v2_ms / c_ms;
|
||||||
|
double p2 = gammafaktor(v1_ms) * m1_eV * v1_ms / c_ms;
|
||||||
|
|
||||||
|
double E1 = sqrt(pow(m2_eV, 2) + pow(p1, 2)); // so ist es wie im python skyript
|
||||||
|
double E2 = sqrt(pow(m1_eV, 2) + pow(p2, 2)); // wie im skrpt
|
||||||
|
|
||||||
|
/*
|
||||||
|
std::cout << "E1 " << E1 << "\n"; // ion
|
||||||
|
std::cout << "E2 " << E2 << "\n"; // elektron
|
||||||
|
std::cout << "v1 " << v1_ms << "\n"; // elektron
|
||||||
|
std::cout << "v2 " << v2_ms << "\n"; // ion
|
||||||
|
std::cout << "p1 " << p1 << "\n"; // p von ion
|
||||||
|
std::cout << "p2 " << p2 << "\n"; // p von elektorn
|
||||||
|
std::cout << "m1 " << m1_eV << "\n"; // elektron
|
||||||
|
std::cout << "m2 " << m2_eV << "\n"; // ion
|
||||||
|
*/
|
||||||
|
double s = pow(m1_eV,2) + pow(m2_eV,2) + 2 * E1 * E2 - 2 * p1 * p2 * cos(theta);
|
||||||
|
//std::cout << "s " << s << "\n";
|
||||||
|
double E_cm_eV = sqrt(s) - m1_eV - m2_eV;
|
||||||
|
//std::cout << "theta " << theta << "\n";
|
||||||
|
//std::cout << "E_cm_eV " << E_cm_eV << "\n";
|
||||||
|
double twoEam2 = s - pow(m1_eV, 2) - pow(m2_eV, 2);
|
||||||
|
double E_incident = twoEam2/(2*m1_eV);
|
||||||
|
double E_kin_incident = E_incident - m2_eV;
|
||||||
|
double E_eV = E_kin_incident;
|
||||||
|
|
||||||
|
//E_eV = m2_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2); // m1_eV equals reduced mass
|
||||||
|
|
||||||
|
//std::cout << "Energie für microsigma berechnung " << E_eV <<"\n";
|
||||||
|
return get_microSigma_m2(E_eV);
|
||||||
|
};
|
||||||
|
|
||||||
|
double integralergebnis = integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
//std::cout << "integral gibt: " << integralergebnis <<"\n";
|
||||||
|
|
||||||
|
/* //alt
|
||||||
auto integrand = [&](double theta) {
|
auto integrand = [&](double theta) {
|
||||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
return get_microSigma_m2(E_eV);
|
return get_microSigma_m2(E_eV);
|
||||||
};
|
};
|
||||||
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "monte carlo micro sigma " << calc_microSigma_m2(E_eV, Ee_bin) << "\n";
|
||||||
|
std::cout << "Monte carlo macro sigma " << macro_sigma_m << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
//std::cout << "micro sigma in calcmacrosigma in ohne precomputed" << calc_microSigma_m2(E_eV, Ee_bin) <<"\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return macro_sigma_m;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline double TI_e_Interaction_Base::calc_microSigma_m2(const double &E2_eV, const int &Ee_bin) {
|
||||||
|
//return get_microSigma_m2(Ee_mids[Ee_bin]); // No Integration... Only e- energy
|
||||||
|
double v1_ms = ve_mids[Ee_bin]; //ist nährungsweise die richitge geschwindigkeit für elektorn
|
||||||
|
double v2_ms = calc_v_ms_from_E_eV(E2_eV, m2_eV); //ist die richtige geschwindigkeit für ion
|
||||||
|
|
||||||
|
if (v1_ms > v2_ms*2000 ) { // 2000 represents 1% variation in energy
|
||||||
|
//std::cout << "machen wir das?" << "\n";
|
||||||
|
//std::cout << Ee_mids[Ee_bin] << "\n";
|
||||||
|
//std::cout << get_microSigma_m2(Ee_mids[Ee_bin]) << "\n";
|
||||||
|
return get_microSigma_m2(Ee_mids[Ee_bin]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//neu
|
||||||
|
|
||||||
|
double v1_ms = ve_mids[Ee_bin];
|
||||||
|
double v2_ms = calc_v_ms_from_E_eV(E2_eV, m2_eV);
|
||||||
|
//std::cout << "v1 " << v1_ms <<"\n";
|
||||||
|
//std::cout << "v2 " << v2_ms <<"\n";
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
|
||||||
|
|
||||||
|
double p1 = gammafaktor(v2_ms) * m2_eV * v2_ms / c_ms;
|
||||||
|
double p2 = gammafaktor(v1_ms) * m1_eV * v1_ms / c_ms;
|
||||||
|
|
||||||
|
double E1 = sqrt(pow(m2_eV, 2) + pow(p1, 2)); // so ist es wie im python skyript
|
||||||
|
double E2 = sqrt(pow(m1_eV, 2) + pow(p2, 2)); // wie im skrpt
|
||||||
|
|
||||||
|
|
||||||
|
//std::cout << "E1 " << E1 << "\n"; // ion
|
||||||
|
//std::cout << "E2 " << E2 << "\n"; // elektron
|
||||||
|
//std::cout << "v1 " << v1_ms << "\n"; // elektron
|
||||||
|
//std::cout << "v2 " << v2_ms << "\n"; // ion
|
||||||
|
//std::cout << "p1 " << p1 << "\n"; // p von ion
|
||||||
|
//std::cout << "p2 " << p2 << "\n"; // p von elektorn
|
||||||
|
//std::cout << "m1 " << m1_eV << "\n"; // elektron
|
||||||
|
//std::cout << "m2 " << m2_eV << "\n"; // ion
|
||||||
|
|
||||||
|
double s = pow(m1_eV,2) + pow(m2_eV,2) + 2 * E1 * E2 - 2 * p1 * p2 * cos(theta);
|
||||||
|
//std::cout << "s " << s << "\n";
|
||||||
|
double E_cm_eV = sqrt(s) - m1_eV - m2_eV;
|
||||||
|
//std::cout << "theta " << theta << "\n";
|
||||||
|
//std::cout << "E_cm_eV " << E_cm_eV << "\n";
|
||||||
|
double twoEam2 = s - pow(m1_eV, 2) - pow(m2_eV, 2);
|
||||||
|
double E_incident = twoEam2/(2*m1_eV);
|
||||||
|
double E_kin_incident = E_incident - m2_eV;
|
||||||
|
|
||||||
|
|
||||||
|
//double E_eV = m2_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2); // m1_eV equals reduced mass
|
||||||
|
|
||||||
|
//std::cout << "Energie für microsigma berechnung " << E_eV <<"\n";
|
||||||
|
return get_microSigma_m2(E_kin_incident);
|
||||||
|
};
|
||||||
|
|
||||||
|
double integralergebnis = integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
return integralergebnis;
|
||||||
|
//std::cout << "integral gibt: " << integralergebnis <<"\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
//alt
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
|
return get_microSigma_m2(E_eV);
|
||||||
|
};
|
||||||
|
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,8 +239,11 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline void TI_e_Precomputed_Interaction_Base::calc_values() {
|
inline void TI_e_Precomputed_Interaction_Base::calc_values() {
|
||||||
|
|
||||||
|
std::cout << "EI_bins " << E_scale.get_number_bins() << "\n";
|
||||||
|
std::cout << "Ee_bins " << num_Ee_bins << "\n";
|
||||||
for (int EI_bin=0; EI_bin<E_scale.get_number_bins(); EI_bin++) {
|
for (int EI_bin=0; EI_bin<E_scale.get_number_bins(); EI_bin++) {
|
||||||
std::cout<<"EI_bin = "<<EI_bin<<"\n";
|
//std::cout<<"EI_bin = "<<EI_bin<<"\n";
|
||||||
for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
||||||
precomputed_values[EI_bin][Ee_bin] = calc_microSigma_m2(E_scale.get_bin_mid(EI_bin), Ee_bin);
|
precomputed_values[EI_bin][Ee_bin] = calc_microSigma_m2(E_scale.get_bin_mid(EI_bin), Ee_bin);
|
||||||
}
|
}
|
||||||
@@ -104,25 +252,61 @@ inline void TI_e_Precomputed_Interaction_Base::calc_values() {
|
|||||||
|
|
||||||
inline double TI_e_Precomputed_Interaction_Base::get_macro_sigma_m(const Particle &interPart) {
|
inline double TI_e_Precomputed_Interaction_Base::get_macro_sigma_m(const Particle &interPart) {
|
||||||
vec3 loc_m = interPart.get_x_m();
|
vec3 loc_m = interPart.get_x_m();
|
||||||
|
|
||||||
double E_eV = interPart.get_E_eV();
|
double E_eV = interPart.get_E_eV();
|
||||||
|
|
||||||
|
//std::cout << "wird das gemacht: precomputed " << "\n";
|
||||||
|
//std::cout << "Energie: " << E_eV << "\n";
|
||||||
|
//Bins loc_bin = Population-> get_loc_bin(loc_m);
|
||||||
|
|
||||||
|
//for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
||||||
|
// std::cout << "E_bin" << Ee_bin <<"\n";
|
||||||
|
// std::cout << "Energie in bin: "<< Population->get_E_bin_mid_eV(Ee_bin) <<"\n";
|
||||||
|
// std::cout << "Dichte in bin: "<< Population->get_density_m3(Ee_bin, loc_bin)<<"\n";
|
||||||
|
//}
|
||||||
|
|
||||||
|
//std::cout << "Pop in TI_e_precomputed_interaction_base: " << Population->get_species() << "\n";
|
||||||
|
//std::cout << "Dichte der Pop in get_macro_sigma: " << Population->get_density_m3(Ee_bin, loc_bin) <<"\n";
|
||||||
|
|
||||||
if (E_scale.in_scale(E_eV)) {
|
if (E_scale.in_scale(E_eV)) {
|
||||||
return lookup_macro_sigma_m(E_eV, loc_m);
|
std::cout << "look up" << "\n";
|
||||||
|
//double a = lookup_macro_sigma_m(E_eV, loc_m);
|
||||||
|
//std::cout << "TI_e_Precomputed_interaction_base lookup_macro_sigma: "<< a << "\n";
|
||||||
|
return lookup_macro_sigma_m(E_eV, loc_m); //ist hier richtig
|
||||||
|
//return calc_macro_sigma_m(E_eV, loc_m);
|
||||||
} else {
|
} else {
|
||||||
|
//double a = calc_macro_sigma_m(E_eV, loc_m);
|
||||||
|
//std::cout << "TI_e_Precomputed_interaction_base calc_macro_sigma: "<< a <<"\n";
|
||||||
|
//return lookup_macro_sigma_m(E_eV, loc_m);
|
||||||
|
std::cout << "calc" << "\n";
|
||||||
return calc_macro_sigma_m(E_eV, loc_m);
|
return calc_macro_sigma_m(E_eV, loc_m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double TI_e_Precomputed_Interaction_Base::lookup_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
inline double TI_e_Precomputed_Interaction_Base::lookup_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
||||||
|
|
||||||
|
|
||||||
int EI_bin = E_scale.calc_index(E_eV);
|
int EI_bin = E_scale.calc_index(E_eV);
|
||||||
double *microSigmas = precomputed_values[EI_bin];
|
double *microSigmas = precomputed_values[EI_bin];
|
||||||
|
|
||||||
|
std::cout << "EI_bin Ion Energie bin? " << EI_bin << "\n";
|
||||||
|
//std::cout << "microSigmas schaut in precomputed values bei EI_bin: " << microSigmas << "\n";
|
||||||
|
|
||||||
Bins loc_bins = Population->get_loc_bin(loc_m);
|
Bins loc_bins = Population->get_loc_bin(loc_m);
|
||||||
double macro_sigma_m = 0;
|
double macro_sigma_m = 0;
|
||||||
|
|
||||||
for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
for (int Ee_bin = 0; Ee_bin<num_Ee_bins; Ee_bin++) {
|
||||||
macro_sigma_m += microSigmas[Ee_bin] * Population->get_density_m3(Ee_bin, loc_bins);
|
macro_sigma_m += microSigmas[Ee_bin] * Population->get_density_m3(Ee_bin, loc_bins);
|
||||||
|
if(Population->get_density_m3(Ee_bin, loc_bins) > 0){
|
||||||
|
std::cout << "Pop die Beitrag liefert: " << Population->get_species() << " "<< Population->get_density_m3(Ee_bin, loc_bins) <<"\n";
|
||||||
|
std::cout << "micro sigma in look up macro sigma: " << microSigmas[Ee_bin] <<"\n";
|
||||||
|
//std::cout << macro_sigma_m<<"\n";
|
||||||
|
//std::cout << Ee_bin <<"\n";
|
||||||
|
}
|
||||||
|
//std::cout << "hier gehts rein?" << "\n";
|
||||||
}
|
}
|
||||||
|
//std::cout << 1e17 * macro_sigma_m <<"\n";
|
||||||
|
//std::cout << macro_sigma_m<<"\n";
|
||||||
return macro_sigma_m;
|
return macro_sigma_m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
#define drift_base_h
|
#define drift_base_h
|
||||||
|
|
||||||
#include "mover_base.h"
|
#include "mover_base.h"
|
||||||
|
#include "constants.h"
|
||||||
|
#include <iostream>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
// Drift Approximation: Assume constant B and only movement out in z=0, z=wgtsLength_m...
|
// Drift Approximation: Assume constant B and only movement out in z=0, z=wgtsLength_m...
|
||||||
class Drift_Base : public Mover_Base {
|
class Drift_Base : public Mover_Base {
|
||||||
@@ -18,6 +20,8 @@ public:
|
|||||||
Drift_Base(species this_species, Particle_Logger_Base *Logger, Population_Base *Population) : Mover_Base(this_species, Logger, Population) {};
|
Drift_Base(species this_species, Particle_Logger_Base *Logger, Population_Base *Population) : Mover_Base(this_species, Logger, Population) {};
|
||||||
|
|
||||||
void move(Particle *movePart, const double ¯o_sigma_m);
|
void move(Particle *movePart, const double ¯o_sigma_m);
|
||||||
|
//std::default_random_engine generator;
|
||||||
|
//std::uniform_real_distribution<double> distribution(1e-15,1.0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double get_zNew_m(Particle *movePart, const double ¯o_sigma_m);
|
double get_zNew_m(Particle *movePart, const double ¯o_sigma_m);
|
||||||
@@ -38,7 +42,120 @@ inline void Drift_Base::move(Particle *movePart, const double ¯o_sigma_m) {
|
|||||||
movePart->set_x_m(newLoc_m);
|
movePart->set_x_m(newLoc_m);
|
||||||
do_E_calculus(movePart, oldLoc_m, macro_sigma_m);
|
do_E_calculus(movePart, oldLoc_m, macro_sigma_m);
|
||||||
Logger->log(*movePart, oldLoc_m);
|
Logger->log(*movePart, oldLoc_m);
|
||||||
|
|
||||||
|
//std::cout << "Pop in move sollte die vom current particle sein: " << Population->get_species() <<"\n";
|
||||||
|
|
||||||
|
double E_min_eV = 1e-7;
|
||||||
|
double E_max_eV = 2e4;
|
||||||
|
int number_E_bins = 50;
|
||||||
|
|
||||||
|
Log_Scale E_scale;
|
||||||
|
E_scale = Log_Scale(E_min_eV, E_max_eV, number_E_bins);
|
||||||
|
double E_eV = movePart->get_E_eV();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
double n = Population->get_density_m3(oldLoc_m);
|
||||||
|
//std::cout << "Pop vor Erhöhung: " << Population->get_species() << " "<< n <<"\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(const MyException& e)
|
||||||
|
{
|
||||||
|
double E_eV = movePart->get_E_eV();
|
||||||
|
int Ee_bin = E_scale.calc_index(E_eV);
|
||||||
|
Bins loc_bin = Population->get_loc_bin(oldLoc_m);
|
||||||
|
double n = Population->get_density_m3(Ee_bin, loc_bin);
|
||||||
|
//std::cout << "Pop vor Erhöhung: " << Population->get_species() << " " << n << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bins dummyloc0 = Population->get_loc_bin(vec3(0,0,0));
|
||||||
|
Bins dummyloc1 = Population->get_loc_bin(vec3(0,0,1));
|
||||||
|
Bins dummyloc2 = Population->get_loc_bin(vec3(0,0,2));
|
||||||
|
Bins dummyloc3 = Population->get_loc_bin(vec3(0,0,3));
|
||||||
|
Bins dummyloc4 = Population->get_loc_bin(vec3(0,0,4));
|
||||||
|
Bins dummyloc5 = Population->get_loc_bin(vec3(0,0,5));
|
||||||
|
Bins dummyloc6 = Population->get_loc_bin(vec3(0,0,6));
|
||||||
|
Bins dummyloc7 = Population->get_loc_bin(vec3(0,0,7));
|
||||||
|
Bins dummyloc8 = Population->get_loc_bin(vec3(0,0,8));
|
||||||
|
Bins dummyloc9 = Population->get_loc_bin(vec3(0,0,9));
|
||||||
|
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc0) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc1) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc2) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc3) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc4) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc5) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc6) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc7) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc8) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc9) << "\n";
|
||||||
|
*/
|
||||||
|
//std::cerr << e.what() << '\n';
|
||||||
|
/*
|
||||||
|
for (int Ee_bin = 0; Ee_bin<number_E_bins; Ee_bin++) {
|
||||||
|
if(Population->get_density_m3(Ee_bin, loc_bin) > 0){
|
||||||
|
std::cout << "Dichte die einen Beitrag liefert: " << Population->get_density_m3(Ee_bin, loc_bin) <<"\n";
|
||||||
|
//std::cout << macro_sigma_m<<"\n";
|
||||||
|
//std::cout << Ee_bin <<"\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//std::cout << "hier gehts rein?" << "\n";
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Population->get_density_m3()
|
||||||
Population->increase_density(*movePart, oldLoc_m);
|
Population->increase_density(*movePart, oldLoc_m);
|
||||||
|
//Population->get_density_m3()
|
||||||
|
try
|
||||||
|
{
|
||||||
|
double n = Population->get_density_m3(oldLoc_m);
|
||||||
|
//std::cout << "Pop nach Erhöhung: " << Population->get_species() << " " << n <<"\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(const MyException& e)
|
||||||
|
{
|
||||||
|
double E_eV = movePart->get_E_eV();
|
||||||
|
int Ee_bin = E_scale.calc_index(E_eV);
|
||||||
|
Bins loc_bin = Population->get_loc_bin(oldLoc_m);
|
||||||
|
double n = Population->get_density_m3(Ee_bin, loc_bin);
|
||||||
|
//std::cout << "Pop nach Erhöhung: " << Population->get_species() << " " << n << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bins dummyloc0 = Population->get_loc_bin(vec3(0,0,0));
|
||||||
|
Bins dummyloc1 = Population->get_loc_bin(vec3(0,0,1));
|
||||||
|
Bins dummyloc2 = Population->get_loc_bin(vec3(0,0,2));
|
||||||
|
Bins dummyloc3 = Population->get_loc_bin(vec3(0,0,3));
|
||||||
|
Bins dummyloc4 = Population->get_loc_bin(vec3(0,0,4));
|
||||||
|
Bins dummyloc5 = Population->get_loc_bin(vec3(0,0,5));
|
||||||
|
Bins dummyloc6 = Population->get_loc_bin(vec3(0,0,6));
|
||||||
|
Bins dummyloc7 = Population->get_loc_bin(vec3(0,0,7));
|
||||||
|
Bins dummyloc8 = Population->get_loc_bin(vec3(0,0,8));
|
||||||
|
Bins dummyloc9 = Population->get_loc_bin(vec3(0,0,9));
|
||||||
|
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc0) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc1) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc2) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc3) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc4) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc5) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc6) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc7) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc8) << "\n";
|
||||||
|
std::cout << "pop: " << Population->get_density_m3(Ee_bin, dummyloc9) << "\n";
|
||||||
|
*/
|
||||||
|
//std::cerr << e.what() << '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯o_sigma_m) {
|
inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯o_sigma_m) {
|
||||||
@@ -57,7 +174,14 @@ inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯o_sig
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
double distance_m = 1/macro_sigma_m;
|
double distance_m = 1/macro_sigma_m;
|
||||||
std::cout<<"Distanz = " << distance_m<<"\n";
|
//distance * e^x mit mu=1
|
||||||
|
//std::cout<<"Distanz ohne random = " << distance_m<<"\n";
|
||||||
|
UniRNG rngUni;
|
||||||
|
double number = rngUni.random();
|
||||||
|
//double number = distribution(generator);
|
||||||
|
//std::cout << "rngUni " << x <<"\n";
|
||||||
|
distance_m = - distance_m * log(number);
|
||||||
|
//std::cout<<"Distanz mit random = " << distance_m<<"\n";
|
||||||
znew_m = zold_m + zDir*vForwardAbs_ms/vTotAbs_ms * distance_m;
|
znew_m = zold_m + zDir*vForwardAbs_ms/vTotAbs_ms * distance_m;
|
||||||
}
|
}
|
||||||
return znew_m;
|
return znew_m;
|
||||||
|
|||||||
@@ -16,12 +16,14 @@
|
|||||||
class eT2I_Recombination : public e_thermal_Precomputed_Interaction_Base {
|
class eT2I_Recombination : public e_thermal_Precomputed_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
eT2I_Recombination(Population_Base *T2IPopulation, UniRNG *rngUni) : e_thermal_Precomputed_Interaction_Base(T2IPopulation, rngUni, me_eV) {
|
eT2I_Recombination(Population_Base *T2IPopulation, UniRNG *rngUni) : e_thermal_Precomputed_Interaction_Base(T2IPopulation, rngUni, me_eV) {
|
||||||
|
std::cout << "Konstruktor eT2I_Recombinaton" << "\n";
|
||||||
calc_values(); // need to call here, because, constructor can't call pure virtual function
|
calc_values(); // need to call here, because, constructor can't call pure virtual function
|
||||||
}
|
}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV) {
|
double get_microSigma_m2(const double &E_eV) {
|
||||||
//std::cout<<"werde ich benutzt?"<<"\n";
|
//std::cout<<"werde ich benutzt?"<<"\n";
|
||||||
//std::cout<< "micro sigma = "<< Janev_eT2I_Recombination::get_TCS(E_eV)<<"\n";
|
//std::cout << " Energie in microsigma e- mit T2+" << E_eV << "\n";
|
||||||
|
//std::cout<< " micro sigma e- mit T2+ = "<< Janev_eT2I_Recombination::get_TCS(E_eV)<<"\n";
|
||||||
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
||||||
}
|
}
|
||||||
InteractionOut do_Interaction (Particle *interPart);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
@@ -32,13 +34,15 @@ inline InteractionOut eT2I_Recombination::do_Interaction (Particle *interPart) {
|
|||||||
InteractionOut res;
|
InteractionOut res;
|
||||||
res.set_delete_current(true);
|
res.set_delete_current(true);
|
||||||
//std::cout<<"eT2I:\t"<<*interPart<<"\n";
|
//std::cout<<"eT2I:\t"<<*interPart<<"\n";
|
||||||
std::cout<<"e- wurde gelöscht"<<"\n";
|
std::cout<<interPart->get_species()<<" RECO mit " << Population->get_species() << "\n";
|
||||||
|
//std::cout << "Energie von teilchen " << interPart->get_E_eV() <<"\n";
|
||||||
|
//std::cout << "sigma von interaction e- mit T2+ " << get_microSigma_m2(interPart->get_E_eV())<< "\n";
|
||||||
//Bins loc_bin = Population->get_loc_bin(interPart->get_x_m());
|
//Bins loc_bin = Population->get_loc_bin(interPart->get_x_m());
|
||||||
double n1 = Population->get_density_m3(interPart->get_x_m()); //nur zum schauen
|
double n1 = Population->get_density_m3(interPart->get_x_m()); //nur zum schauen
|
||||||
std::cout<<"Population vor Reco = "<< n1<<"\n";
|
//std::cout<<"Population vor Recombination = "<< n1<<"\n";
|
||||||
Population->decrease_denisty(interPart->get_x_m(), 0);
|
Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||||
double n2 = Population->get_density_m3(interPart->get_x_m());
|
double n2 = Population->get_density_m3(interPart->get_x_m());
|
||||||
std::cout<<"Population nach Reco = " <<n2<<"\n";
|
//std::cout<<"Population nach Recombination = " <<n2<<"\n";
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,17 +15,19 @@
|
|||||||
class e_thermal_Interaction_Base : public Interaction_Base { // Interactions of electrons with thermal Populations
|
class e_thermal_Interaction_Base : public Interaction_Base { // Interactions of electrons with thermal Populations
|
||||||
protected:
|
protected:
|
||||||
double m1_eV; // energy of kinetic particle in CS measurement : e-
|
double m1_eV; // energy of kinetic particle in CS measurement : e-
|
||||||
|
|
||||||
double E_limit; // limit for integration calculation
|
double E_limit; // limit for integration calculation
|
||||||
double v_therm; // typical spped for thermal population
|
double v_therm; // typical spped for thermal population
|
||||||
|
|
||||||
public:
|
public:
|
||||||
e_thermal_Interaction_Base(Population_Base *Population, UniRNG *rngUni, double m_eV) : Interaction_Base(Population, rngUni) {
|
e_thermal_Interaction_Base(Population_Base *Population, UniRNG *rngUni, double m_eV) : Interaction_Base(Population, rngUni) {
|
||||||
|
//std::cout << "machen wir das? "<< Population->get_species()<<"\n"; //wird am anfang geladen ist T2+ pop, also schon ok
|
||||||
if (Population->get_number_E_bins() > 1) {
|
if (Population->get_number_E_bins() > 1) {
|
||||||
throw MyException("Population is not thermal, when expected thermal.");
|
throw MyException("Population is not thermal, when expected thermal.");
|
||||||
}
|
}
|
||||||
m1_eV = m_eV;
|
m1_eV = m_eV;
|
||||||
v_therm = Population->get_thermal_v_ms(); // Typical Speed of "Thermal Blur"
|
//v_therm = Population->get_thermal_v_ms(); // Typical Speed of "Thermal Blur"
|
||||||
|
//v_therm = calc_v_ms_from_E_eV(0.1, 2*mT_eV); //gleiche energie
|
||||||
|
v_therm = calc_v_ms_from_E_eV(0.001, me_eV); // gleiche geschwidingkeit
|
||||||
E_limit = calc_E_eV_from_v_ms(v_therm * 2000, m1_eV); // 2000 represents 1% variation in energy
|
E_limit = calc_E_eV_from_v_ms(v_therm * 2000, m1_eV); // 2000 represents 1% variation in energy
|
||||||
}
|
}
|
||||||
double get_macro_sigma_m(const Particle &interPart);
|
double get_macro_sigma_m(const Particle &interPart);
|
||||||
@@ -42,26 +44,172 @@ inline double e_thermal_Interaction_Base::get_macro_sigma_m(const Particle &inte
|
|||||||
vec3 loc_m = interPart.get_x_m();
|
vec3 loc_m = interPart.get_x_m();
|
||||||
double v_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
|
double v_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
|
||||||
double E_eV = calc_E_eV_from_v_ms(v_ms, m1_eV); // Lab energy without thermal integration
|
double E_eV = calc_E_eV_from_v_ms(v_ms, m1_eV); // Lab energy without thermal integration
|
||||||
|
//std::cout << "e-thermal-base get-macro-sigma-m"<< "\n"; //wird es nicht
|
||||||
return calc_macro_sigma_m(E_eV, loc_m);
|
return calc_macro_sigma_m(E_eV, loc_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double gammafaktor2(double v) {
|
||||||
|
return 1/sqrt(1-pow(v/c_ms, 2));
|
||||||
|
}
|
||||||
|
|
||||||
inline double e_thermal_Interaction_Base::calc_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
inline double e_thermal_Interaction_Base::calc_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
||||||
//std::cout<<"hi"<<"\n";
|
//std::cout <<"calc"<<"\n";
|
||||||
|
//std::cout << "Dichte für get sigma: " << Population->get_density_m3(loc_m)<<"\n";
|
||||||
|
//std::cout << "calc macro_sigma in e_thermal interaction base macht was "<< "\n";
|
||||||
|
//std::cout << "Dichte die verwednet wird: "<<Population->get_density_m3(loc_m)<<"\n"; //die dichte ist falsch?, also sollte sich halt verkleinern
|
||||||
|
//std::cout << "macro sigma von calc macro sigma in e_thermal interaction base " << 1e15 * calc_microSigma_m2(E_eV)*Population->get_density_m3(loc_m)<<"\n";
|
||||||
|
//std::cout << "microsigma = " << get_microSigma_m2(E_eV) << "\n";
|
||||||
|
std::cout << "Energie = " << E_eV << "\n";
|
||||||
|
|
||||||
|
double v1_ms = calc_v_ms_from_E_eV(E_eV, m1_eV);
|
||||||
|
// Integration over theta and v
|
||||||
|
double m2_eV = Population->get_m_eV();
|
||||||
|
//std::cout << "m2 " << m2_eV << "\n";
|
||||||
|
|
||||||
|
double v2_ms = v_therm;
|
||||||
|
//std::cout << "v2 " << v2_ms << "\n";
|
||||||
|
|
||||||
|
//double E1 = E_eV; //unnötig
|
||||||
|
//double E2 = calc_E_eV_from_v_ms(v2_ms, m2_eV);
|
||||||
|
|
||||||
|
//auto integrand = [&](double v2_ms, double theta)
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
|
||||||
|
|
||||||
|
//double v2_ms = calc_v_ms_from_E_eV(E_eV, m2_eV);
|
||||||
|
|
||||||
|
//std::cout << "v1 " << v1_ms <<"\n";
|
||||||
|
//std::cout << "v2 " << v2_ms <<"\n";
|
||||||
|
|
||||||
|
double p1 = gammafaktor2(v1_ms) * m1_eV * v1_ms / c_ms; // e-
|
||||||
|
double p2 = gammafaktor2(v2_ms) * m2_eV * v2_ms / c_ms; // ion
|
||||||
|
double E1 = sqrt(pow(m1_eV, 2) + pow(p1, 2)); // e-
|
||||||
|
double E2 = sqrt(pow(m2_eV, 2) + pow(p2, 2)); // ion
|
||||||
|
/*
|
||||||
|
std::cout << "E1 " << E1 << "\n"; //elektron
|
||||||
|
std::cout << "E2 " << E2 << "\n"; // ion
|
||||||
|
std::cout << "v1 " << v1_ms << "\n"; // elektron
|
||||||
|
std::cout << "v2 " << v2_ms << "\n"; // ion
|
||||||
|
std::cout << "p1 " << p1 << "\n"; // p von elektron
|
||||||
|
std::cout << "p2 " << p2 << "\n"; // p von ion
|
||||||
|
std::cout << "m1 " << m1_eV << "\n"; // elektron
|
||||||
|
std::cout << "m2 " << m2_eV << "\n"; // ion
|
||||||
|
*/
|
||||||
|
double s = pow(m1_eV,2) + pow(m2_eV,2) + 2 * E1 * E2 - 2 * p1 * p2 * cos(theta);
|
||||||
|
//std::cout << "s " << s << "\n";
|
||||||
|
double E_cm_eV = sqrt(s) - m1_eV - m2_eV;
|
||||||
|
//std::cout << "theta " << theta << "\n";
|
||||||
|
//std::cout << "E_cm_eV " << E_cm_eV << "\n";
|
||||||
|
double twoEam2 = s - pow(m1_eV, 2) - pow(m2_eV, 2);
|
||||||
|
double E_incident = twoEam2/(2*m2_eV);
|
||||||
|
double E_kin_incident = E_incident - m1_eV;
|
||||||
|
|
||||||
|
|
||||||
|
//double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2); // m1_eV equals reduced mass
|
||||||
|
//std::cout << "geschwindigkeit pop " << v2_ms << "\n";
|
||||||
|
//std::cout << "Energie " << E_eV <<"\n";
|
||||||
|
//return Population->get_v_pdf(v2_ms)*get_microSigma_m2(E_eV)/pi;
|
||||||
|
return get_microSigma_m2(E_kin_incident);
|
||||||
|
};
|
||||||
|
//std::cout << "Masse m1 " << m1_eV << "\n";
|
||||||
|
//std::cout << "Masse m2 " << m2_eV << "\n";
|
||||||
|
//std::cout << "thermal v " << v_therm << "\n";
|
||||||
|
|
||||||
|
//std::cout << "integral für e- ergebnis: " << double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, INT_N, INT_N) << "\n";
|
||||||
|
double integralergebnis = integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
std::cout << "integral gibt: " << integralergebnis <<"\n";
|
||||||
|
std::cout << "Energie? " << E_eV << "\n";
|
||||||
|
//std::cout << "E_limit? " << E_limit << "\n";
|
||||||
|
std::cout << "get microsigma ohne integral (wird nicht verwendet) " << get_microSigma_m2(E_eV) << "\n";
|
||||||
|
std::cout << "Monte Carlo sigma = " << calc_microSigma_m2(E_eV) << "\n";
|
||||||
|
|
||||||
return calc_microSigma_m2(E_eV)*Population->get_density_m3(loc_m);
|
return calc_microSigma_m2(E_eV)*Population->get_density_m3(loc_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double e_thermal_Interaction_Base::calc_microSigma_m2(const double &E_eV) {
|
inline double e_thermal_Interaction_Base::calc_microSigma_m2(const double &E_eV) {
|
||||||
//return get_microSigma_m2(E_eV); //No Integration... Only e- energy
|
//return get_microSigma_m2(E_eV); //No Integration... Only e- energy
|
||||||
if (E_eV > E_limit) {
|
if (E_eV > E_limit) {
|
||||||
|
//std::cout << " microsigma = " << get_microSigma_m2(E_eV) << "\n";
|
||||||
return get_microSigma_m2(E_eV);
|
return get_microSigma_m2(E_eV);
|
||||||
} else {
|
} else {
|
||||||
double v1_ms = calc_v_ms_from_E_eV(E_eV, m1_eV);
|
double v1_ms = calc_v_ms_from_E_eV(E_eV, m1_eV);
|
||||||
|
|
||||||
|
double m2_eV = Population->get_m_eV();
|
||||||
|
//std::cout << "m2 " << m2_eV << "\n";
|
||||||
|
|
||||||
|
double v2_ms = v_therm;
|
||||||
|
//std::cout << "v2 " << v2_ms << "\n";
|
||||||
|
|
||||||
|
//double E1 = E_eV; //unnötig
|
||||||
|
//double E2 = calc_E_eV_from_v_ms(v2_ms, m2_eV);
|
||||||
|
|
||||||
|
//auto integrand = [&](double v2_ms, double theta)
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
//double v2_ms = calc_v_ms_from_E_eV(E_eV, m2_eV);
|
||||||
|
|
||||||
|
//std::cout << "v1 " << v1_ms <<"\n";
|
||||||
|
//std::cout << "v2 " << v2_ms <<"\n";
|
||||||
|
|
||||||
|
double p1 = gammafaktor2(v1_ms) * m1_eV * v1_ms / c_ms; // e-
|
||||||
|
double p2 = gammafaktor2(v2_ms) * m2_eV * v2_ms / c_ms; // ion
|
||||||
|
double E1 = sqrt(pow(m1_eV, 2) + pow(p1, 2)); // e-
|
||||||
|
double E2 = sqrt(pow(m2_eV, 2) + pow(p2, 2)); // ion
|
||||||
|
|
||||||
|
//std::cout << "E1 " << E1 << "\n"; //elektron
|
||||||
|
//std::cout << "E2 " << E2 << "\n"; // ion
|
||||||
|
//std::cout << "v1 " << v1_ms << "\n"; // elektron
|
||||||
|
//std::cout << "v2 " << v2_ms << "\n"; // ion
|
||||||
|
//std::cout << "p1 " << p1 << "\n"; // p von elektron
|
||||||
|
//std::cout << "p2 " << p2 << "\n"; // p von ion
|
||||||
|
//std::cout << "m1 " << m1_eV << "\n"; // elektron
|
||||||
|
//std::cout << "m2 " << m2_eV << "\n"; // ion
|
||||||
|
|
||||||
|
double s = pow(m1_eV,2) + pow(m2_eV,2) + 2 * E1 * E2 - 2 * p1 * p2 * cos(theta);
|
||||||
|
//std::cout << "s " << s << "\n";
|
||||||
|
double E_cm_eV = sqrt(s) - m1_eV - m2_eV;
|
||||||
|
//std::cout << "theta " << theta << "\n";
|
||||||
|
//std::cout << "E_cm_eV " << E_cm_eV << "\n";
|
||||||
|
double twoEam2 = s - pow(m1_eV, 2) - pow(m2_eV, 2);
|
||||||
|
double E_incident = twoEam2/(2*m2_eV);
|
||||||
|
double E_kin_incident = E_incident - m1_eV;
|
||||||
|
|
||||||
|
|
||||||
|
//double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2); // m1_eV equals reduced mass
|
||||||
|
//std::cout << "geschwindigkeit pop " << v2_ms << "\n";
|
||||||
|
//std::cout << "Energie " << E_eV <<"\n";
|
||||||
|
//return Population->get_v_pdf(v2_ms)*get_microSigma_m2(E_eV)/pi;
|
||||||
|
return get_microSigma_m2(E_kin_incident);
|
||||||
|
};
|
||||||
|
//std::cout << "Masse m1 " << m1_eV << "\n";
|
||||||
|
//std::cout << "Masse m2 " << m2_eV << "\n";
|
||||||
|
//std::cout << "thermal v " << v_therm << "\n";
|
||||||
|
//std::cout << "integral für e- ergebnis: " << double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, INT_N, INT_N) << "\n";
|
||||||
|
double integralergebnis = integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
return integralergebnis;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Integration over theta and v
|
||||||
|
double v2_ms = v_therm;
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
|
return get_microSigma_m2(E_eV);
|
||||||
|
};
|
||||||
|
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* //alt
|
||||||
// Integration over theta and v
|
// Integration over theta and v
|
||||||
auto integrand = [&](double v2_ms, double theta) {
|
auto integrand = [&](double v2_ms, double theta) {
|
||||||
|
v2_ms = v2_ms + Population->get_drift()
|
||||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
return Population->get_v_pdf(v2_ms)*get_microSigma_m2(E_eV)/pi;
|
return Population->get_v_pdf(v2_ms)*get_microSigma_m2(E_eV)/pi;
|
||||||
};
|
};
|
||||||
return double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, INT_N, INT_N); // 3*v_therm equals 99% of the integral
|
return double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, INT_N, INT_N); // 3*v_therm equals 99% of the integral
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,26 +246,47 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline void e_thermal_Precomputed_Interaction_Base::calc_values() {
|
inline void e_thermal_Precomputed_Interaction_Base::calc_values() {
|
||||||
|
std::cout << "number E bins " << E_scale.get_number_bins() << "\n";
|
||||||
for (int i=0; i<E_scale.get_number_bins(); i++) {
|
for (int i=0; i<E_scale.get_number_bins(); i++) {
|
||||||
precomputed_values[i] = calc_microSigma_m2(E_scale.get_bin_mid(i));
|
precomputed_values[i] = calc_microSigma_m2(E_scale.get_bin_mid(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double e_thermal_Precomputed_Interaction_Base::get_macro_sigma_m(const Particle &interPart) {
|
inline double e_thermal_Precomputed_Interaction_Base::get_macro_sigma_m(const Particle &interPart) {
|
||||||
//std::cout<<"e_thermal... getmacrosigma macht was"<<"\n";
|
//std::cout << "wird das verwendet e_termal_precomputed_interaciton_base::get_macro_sigma_m "<<"\n"; //wird verwendet, ok gut -> hier suchen!
|
||||||
|
|
||||||
vec3 loc_m = interPart.get_x_m();
|
vec3 loc_m = interPart.get_x_m();
|
||||||
//std::cout<<"loc_m = "<<loc_m<<"\n";
|
//std::cout << "Pop in e_thermal_precomputed_interaction_base: " << Population->get_species() << "\n";
|
||||||
|
//std::cout << "verwendete Dichte für get_macro_sigma_m in e_thermal_precomputed_interaction_base: " << Population->get_species() << " "<<Population->get_density_m3(loc_m)<<"\n";
|
||||||
double v_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
|
double v_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
|
||||||
//std::cout<<"v_ms = "<<v_ms<<"\n";
|
//std::cout << Population->get_species() << "\n";
|
||||||
double E_eV = calc_E_eV_from_v_ms(v_ms, m1_eV); // Lab energy without thermal integration
|
//double v_ms = calc_vec3_abs(interPart.get_v_ms()); //test ohne shift
|
||||||
//std::cout<<"E_eV = "<<E_eV<<"\n";
|
//std::cout << "verwendete geschwindigkeit: " << v_ms << "\n";
|
||||||
|
//std::cout << "thermal dirft v = " << Population->get_drift_v_ms(loc_m) << "\n";
|
||||||
|
double E_eV = calc_E_eV_from_v_ms(v_ms, m1_eV); // Lab energy without thermal
|
||||||
|
//E_eV = interPart.get_E_eV(); // warum nicht so?
|
||||||
|
//double microsigma_montecarlo = calc_microSigma_m2(E_eV);
|
||||||
|
//std::cout << "Monte Carlo Micro Sigma = " << microsigma_montecarlo << "\n";
|
||||||
|
//std::cout << "pop in get_macro_sigma_m in e_thermal_precomputed_interaction_base: " << Population->get_species()<<"\n";
|
||||||
|
|
||||||
|
|
||||||
|
//return calc_macro_sigma_m(E_eV, loc_m);
|
||||||
|
|
||||||
if (E_scale.in_scale(E_eV)) {
|
if (E_scale.in_scale(E_eV)) {
|
||||||
//std::cout<< "Macro sigma = " << lookup_macro_sigma_m(E_eV, loc_m)<<"\n";
|
//double a;
|
||||||
|
//a = lookup_macro_sigma_m(E_eV, loc_m);
|
||||||
|
//std::cout << " lookup_macro_sigma in get_macro_sigma in e_thermal_precomputed_base gibt: " << a <<"\n";
|
||||||
|
std::cout << "look_up" << "\n";
|
||||||
return lookup_macro_sigma_m(E_eV, loc_m);
|
return lookup_macro_sigma_m(E_eV, loc_m);
|
||||||
|
//return calc_macro_sigma_m(E_eV, loc_m); // zum testen
|
||||||
} else {
|
} else {
|
||||||
//std::cout<< "Macro sigma = " << calc_macro_sigma_m(E_eV, loc_m)<<"\n";
|
//double a;
|
||||||
|
//a = calc_macro_sigma_m(E_eV, loc_m);
|
||||||
|
//std::cout << "calc_macro_sigma in get_macro_sigma in e_thermal_precomputed_base: " << a << "\n";
|
||||||
|
std::cout<< "calc" <<"\n";
|
||||||
return calc_macro_sigma_m(E_eV, loc_m);
|
return calc_macro_sigma_m(E_eV, loc_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double e_thermal_Precomputed_Interaction_Base::lookup_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
inline double e_thermal_Precomputed_Interaction_Base::lookup_macro_sigma_m(const double &E_eV, const vec3 &loc_m) {
|
||||||
@@ -126,6 +295,9 @@ inline double e_thermal_Precomputed_Interaction_Base::lookup_macro_sigma_m(const
|
|||||||
//std::cout <<"precomputed_values[i] = " << precomputed_values[i]<< "\n";
|
//std::cout <<"precomputed_values[i] = " << precomputed_values[i]<< "\n";
|
||||||
//std::cout << "pop denisity = " << Population->get_density_m3(loc_m)<<"\n";
|
//std::cout << "pop denisity = " << Population->get_density_m3(loc_m)<<"\n";
|
||||||
//std::cout << "pop denisity species = " << Population->get_species()<<"\n";
|
//std::cout << "pop denisity species = " << Population->get_species()<<"\n";
|
||||||
|
//std::cout <<"look up"<<"\n";
|
||||||
|
//std::cout << "Dichte für get sigma in e_thermal_precomuputed_interaction_base: " << Population->get_density_m3(loc_m)<<"\n";
|
||||||
|
std::cout << "precomputaed value der verwendet wird (Monte Carlo Sigma): " << precomputed_values[i] <<"\n";
|
||||||
return precomputed_values[i] * Population->get_density_m3(loc_m);
|
return precomputed_values[i] * Population->get_density_m3(loc_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,43 +15,51 @@ using namespace std;
|
|||||||
|
|
||||||
pop_bin sample_log_cell = {0,0,0,0,0,0,0};
|
pop_bin sample_log_cell = {0,0,0,0,0,0,0};
|
||||||
const size_t H5TB_Population_Interface::size = sizeof(pop_bin);
|
const size_t H5TB_Population_Interface::size = sizeof(pop_bin);
|
||||||
const char *H5TB_Population_Interface::fieldNames[7] = {
|
const char *H5TB_Population_Interface::fieldNames[9] = {
|
||||||
"phys_time_s",
|
"phys_time_s",
|
||||||
"z_bin",
|
"z_bin",
|
||||||
"r_bin",
|
"r_bin",
|
||||||
"phi_bin",
|
"phi_bin",
|
||||||
"E_bin",
|
"E_bin",
|
||||||
"cum_time",
|
"cum_time",
|
||||||
"offset"};
|
"offset",
|
||||||
const size_t H5TB_Population_Interface::offset[7] = {
|
"n_m3",
|
||||||
|
"tracking"};
|
||||||
|
const size_t H5TB_Population_Interface::offset[9] = {
|
||||||
HOFFSET(pop_bin, phys_time_s),
|
HOFFSET(pop_bin, phys_time_s),
|
||||||
HOFFSET(pop_bin, z_bin),
|
HOFFSET(pop_bin, z_bin),
|
||||||
HOFFSET(pop_bin, r_bin),
|
HOFFSET(pop_bin, r_bin),
|
||||||
HOFFSET(pop_bin, phi_bin),
|
HOFFSET(pop_bin, phi_bin),
|
||||||
HOFFSET(pop_bin, E_bin),
|
HOFFSET(pop_bin, E_bin),
|
||||||
HOFFSET(pop_bin, cumulated_time_s),
|
HOFFSET(pop_bin, cumulated_time_s),
|
||||||
HOFFSET(pop_bin, offset)};
|
HOFFSET(pop_bin, offset),
|
||||||
const hid_t H5TB_Population_Interface::fieldTypes[7] = {
|
HOFFSET(pop_bin, n_m3),
|
||||||
|
HOFFSET(pop_bin, tracking)};
|
||||||
|
const hid_t H5TB_Population_Interface::fieldTypes[9] = {
|
||||||
H5T_NATIVE_DOUBLE,
|
H5T_NATIVE_DOUBLE,
|
||||||
H5T_NATIVE_INT,
|
H5T_NATIVE_INT,
|
||||||
H5T_NATIVE_INT,
|
H5T_NATIVE_INT,
|
||||||
H5T_NATIVE_INT,
|
H5T_NATIVE_INT,
|
||||||
H5T_NATIVE_INT,
|
H5T_NATIVE_INT,
|
||||||
H5T_NATIVE_DOUBLE,
|
H5T_NATIVE_DOUBLE,
|
||||||
|
H5T_NATIVE_INT,
|
||||||
|
H5T_NATIVE_DOUBLE,
|
||||||
H5T_NATIVE_INT};
|
H5T_NATIVE_INT};
|
||||||
const hsize_t H5TB_Population_Interface::chunkSize = 225;
|
const hsize_t H5TB_Population_Interface::chunkSize = 225;
|
||||||
const size_t H5TB_Population_Interface::sizes[7] = {
|
const size_t H5TB_Population_Interface::sizes[9] = {
|
||||||
sizeof( sample_log_cell.phys_time_s),
|
sizeof( sample_log_cell.phys_time_s),
|
||||||
sizeof( sample_log_cell.z_bin),
|
sizeof( sample_log_cell.z_bin),
|
||||||
sizeof( sample_log_cell.r_bin),
|
sizeof( sample_log_cell.r_bin),
|
||||||
sizeof( sample_log_cell.phi_bin),
|
sizeof( sample_log_cell.phi_bin),
|
||||||
sizeof( sample_log_cell.E_bin),
|
sizeof( sample_log_cell.E_bin),
|
||||||
sizeof( sample_log_cell.cumulated_time_s),
|
sizeof( sample_log_cell.cumulated_time_s),
|
||||||
sizeof( sample_log_cell.offset)};
|
sizeof( sample_log_cell.offset),
|
||||||
|
sizeof( sample_log_cell.n_m3),
|
||||||
|
sizeof( sample_log_cell.tracking)};
|
||||||
|
|
||||||
|
|
||||||
void H5TB_Population_Interface::create() {
|
void H5TB_Population_Interface::create() {
|
||||||
herr_t state = H5TBmake_table(table_name.c_str(), *loc_id, table_name.c_str(), 7, 0,
|
herr_t state = H5TBmake_table(table_name.c_str(), *loc_id, table_name.c_str(), 9, 0,
|
||||||
size, fieldNames, offset, fieldTypes,
|
size, fieldNames, offset, fieldTypes,
|
||||||
chunkSize, NULL, 0, NULL);
|
chunkSize, NULL, 0, NULL);
|
||||||
if (state < 0) {
|
if (state < 0) {
|
||||||
|
|||||||
@@ -24,16 +24,18 @@ struct pop_bin {
|
|||||||
int E_bin;
|
int E_bin;
|
||||||
double cumulated_time_s;
|
double cumulated_time_s;
|
||||||
int offset;
|
int offset;
|
||||||
|
double n_m3;
|
||||||
|
int tracking;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class H5TB_Population_Interface {
|
class H5TB_Population_Interface {
|
||||||
static const size_t size;
|
static const size_t size;
|
||||||
static const char *fieldNames[7];
|
static const char *fieldNames[9];
|
||||||
static const size_t offset[7];
|
static const size_t offset[9];
|
||||||
static const hid_t fieldTypes[7];
|
static const hid_t fieldTypes[9];
|
||||||
static const hsize_t chunkSize;
|
static const hsize_t chunkSize;
|
||||||
static const size_t sizes[7];
|
static const size_t sizes[9];
|
||||||
|
|
||||||
int buffer_size = 225;
|
int buffer_size = 225;
|
||||||
pop_bin buffer[225];
|
pop_bin buffer[225];
|
||||||
|
|||||||
@@ -28,10 +28,21 @@ public:
|
|||||||
Injector(UniRNG *rngUni, NormalRNG *rngNormal, Population_Base *T2Population, int method, double energy_eV, int ions) : RNG_Base(rngUni, rngNormal){
|
Injector(UniRNG *rngUni, NormalRNG *rngNormal, Population_Base *T2Population, int method, double energy_eV, int ions) : RNG_Base(rngUni, rngNormal){
|
||||||
this->T2Population = T2Population;
|
this->T2Population = T2Population;
|
||||||
this->method = method;
|
this->method = method;
|
||||||
|
//std::cout << "Method in konsturktur: " << method <<"\n";
|
||||||
this->energy_eV = energy_eV;
|
this->energy_eV = energy_eV;
|
||||||
this->ions = ions;
|
this->ions = ions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void set_method(int i){
|
||||||
|
method = i;
|
||||||
|
std::cout << "habe methode auf " << i << " gesetzt" << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_method(){
|
||||||
|
std::cout << "aktuelle method ist " << method <<"\n";
|
||||||
|
}
|
||||||
|
|
||||||
int inject (std::vector<Particle> *particle_queue, const int &last_ID);
|
int inject (std::vector<Particle> *particle_queue, const int &last_ID);
|
||||||
private:
|
private:
|
||||||
double roll_FermiEnergy_eV();
|
double roll_FermiEnergy_eV();
|
||||||
@@ -42,6 +53,7 @@ private:
|
|||||||
inline int Injector::inject (std::vector<Particle> *particle_queue, const int &last_ID) {
|
inline int Injector::inject (std::vector<Particle> *particle_queue, const int &last_ID) {
|
||||||
vec3 loc_m = T2Population->roll_x_ms();
|
vec3 loc_m = T2Population->roll_x_ms();
|
||||||
vec3 v_ms;
|
vec3 v_ms;
|
||||||
|
vec3 vTI_ms;
|
||||||
//vec3 direction;
|
//vec3 direction;
|
||||||
double E_eV;
|
double E_eV;
|
||||||
switch(method) {
|
switch(method) {
|
||||||
@@ -61,18 +73,28 @@ inline int Injector::inject (std::vector<Particle> *particle_queue, const int &l
|
|||||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||||
break;
|
break;
|
||||||
case 3: // Delta Injection for Recombination Testing
|
case 3: // Delta Injection for Recombination Testing
|
||||||
|
|
||||||
|
std::cout << "injecte e-" <<"\n";
|
||||||
loc_m = vec3(0.,0.,9.99);
|
loc_m = vec3(0.,0.,9.99);
|
||||||
E_eV = energy_eV;
|
E_eV = energy_eV;
|
||||||
//std::cout<<"E = "<< E_eV<<"\n";
|
//std::cout<<"E = "<< E_eV<<"\n";
|
||||||
//direction = vec3(0,0,-1);
|
//direction = vec3(0,0,-1);
|
||||||
v_ms = vec3(0.,0.,-1.) * calc_v_ms_from_E_eV(E_eV, me_eV);
|
v_ms = vec3(0.,0.,-1.) * calc_v_ms_from_E_eV(E_eV, me_eV);
|
||||||
|
std::cout << "Geschwindigkeit e-: " << v_ms << "\n";
|
||||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
loc_m = vec3(0.,0.,z_WGTS_end_m);
|
std::cout << "injecte T2+" <<"\n";
|
||||||
E_eV = energy_eV;
|
E_eV = energy_eV;
|
||||||
|
loc_m = vec3(0.,0.,9.99);
|
||||||
|
vTI_ms = vec3(0.,0.,-1.) * calc_v_ms_from_E_eV(E_eV, me_eV);
|
||||||
|
std::cout << "Geschwindigkeit T+: " << vTI_ms << "\n";
|
||||||
|
particle_queue->push_back(PartFac.create_T2I(loc_m, vTI_ms, last_ID+1, last_ID+1));
|
||||||
|
|
||||||
|
//loc_m = vec3(0.,0.,z_WGTS_end_m);
|
||||||
|
//E_eV = energy_eV;
|
||||||
//direction = vec3(0,0,-1);
|
//direction = vec3(0,0,-1);
|
||||||
v_ms = vec3(0.,0.,-1.) * calc_v_ms_from_E_eV(E_eV, me_eV);
|
//v_ms = vec3(0.,0.,-1.) * calc_v_ms_from_E_eV(E_eV, me_eV);
|
||||||
//particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
//particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -90,7 +112,8 @@ inline int Injector::inject (std::vector<Particle> *particle_queue, const int &l
|
|||||||
if (ions == 2) { // 2: Delta Injection for Testing Recombination
|
if (ions == 2) { // 2: Delta Injection for Testing Recombination
|
||||||
vec3 direction = vec3(0.,0.,-1.);
|
vec3 direction = vec3(0.,0.,-1.);
|
||||||
vec3 loc_m = vec3(0.,0.,9.99);
|
vec3 loc_m = vec3(0.,0.,9.99);
|
||||||
vec3 vTI_ms = direction * calc_v_ms_from_E_eV(E_eV, 2*mT_eV);
|
vec3 vTI_ms = direction * calc_v_ms_from_E_eV(E_eV, me_eV); //gleiche geschwindigkeit
|
||||||
|
//vec3 vTI_ms = direction * calc_v_ms_from_E_eV(E_eV, 2*mT_eV); // gleiche energie
|
||||||
particle_queue->push_back(PartFac.create_T2I(loc_m, vTI_ms, last_ID+2, last_ID+2));
|
particle_queue->push_back(PartFac.create_T2I(loc_m, vTI_ms, last_ID+2, last_ID+2));
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
|
|||||||
@@ -52,18 +52,18 @@ Interaction_Manager Interaction_Builder::build(Population_Manager *Populations,
|
|||||||
Interaction_Manager Interactions;
|
Interaction_Manager Interactions;
|
||||||
Interactions.add(build_electron(Populations, rngUni));
|
Interactions.add(build_electron(Populations, rngUni));
|
||||||
//Interactions.add(build_tritium(Populations, rngUni));
|
//Interactions.add(build_tritium(Populations, rngUni));
|
||||||
Interactions.add(build_tritiumI(Populations, rngUni));
|
//Interactions.add(build_tritiumI(Populations, rngUni));
|
||||||
Interactions.add(build_tritium2I(Populations, rngUni));
|
Interactions.add(build_tritium2I(Populations, rngUni));
|
||||||
Interactions.add(build_tritium3I(Populations, rngUni));
|
//Interactions.add(build_tritium3I(Populations, rngUni));
|
||||||
Interactions.add(build_tritium5I(Populations, rngUni));
|
//Interactions.add(build_tritium5I(Populations, rngUni));
|
||||||
return Interactions;
|
return Interactions;
|
||||||
}
|
}
|
||||||
Interaction_Channel_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Channel_Base *eInteraction = new Interaction_Channel_Base(electron, rngUni);
|
Interaction_Channel_Base *eInteraction = new Interaction_Channel_Base(electron, rngUni);
|
||||||
Population_Base *T2Population = Populations->find(tritium2);
|
Population_Base *T2Population = Populations->find(tritium2);
|
||||||
Population_Base *T2IPopulation = Populations->find(tritium2I);
|
Population_Base *T2IPopulation = Populations->find(tritium2I);
|
||||||
Population_Base *T3IPopulation = Populations->find(tritium3I);
|
//Population_Base *T3IPopulation = Populations->find(tritium3I);
|
||||||
Population_Base *T5IPopulation = Populations->find(tritium5I);
|
//Population_Base *T5IPopulation = Populations->find(tritium5I);
|
||||||
DCS_Base *exc_dcs = new ZeroPi_DCS(rngUni);
|
DCS_Base *exc_dcs = new ZeroPi_DCS(rngUni);
|
||||||
|
|
||||||
if (load_parameter("eT2_ELA") == 1) {
|
if (load_parameter("eT2_ELA") == 1) {
|
||||||
|
|||||||
@@ -32,8 +32,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline InteractionOut Interaction_Channel_Base::do_Interaction(Particle *interPart) {
|
inline InteractionOut Interaction_Channel_Base::do_Interaction(Particle *interPart) {
|
||||||
double macro_sigma_m = get_macro_sigma_m(*interPart);
|
|
||||||
//std::cout<<"MacroSigma_m = "<<macro_sigma_m<<"\n";
|
double macro_sigma_m = get_macro_sigma_m(*interPart); //hier kommt 0 raus???
|
||||||
|
//std::cout<<"MacroSigma_m = "<<macro_sigma_m<<"\n"; //wird gemacht
|
||||||
double currentStackedSigma = 0;
|
double currentStackedSigma = 0;
|
||||||
double targetStackedSigma = rngUni->random() * macro_sigma_m;
|
double targetStackedSigma = rngUni->random() * macro_sigma_m;
|
||||||
//std::cout<<"TargetStackedSigma_m = "<<targetStackedSigma<<"\n";
|
//std::cout<<"TargetStackedSigma_m = "<<targetStackedSigma<<"\n";
|
||||||
@@ -41,9 +42,16 @@ inline InteractionOut Interaction_Channel_Base::do_Interaction(Particle *interPa
|
|||||||
|
|
||||||
for (int i = 0; i < numSubInteractions; i++) {
|
for (int i = 0; i < numSubInteractions; i++) {
|
||||||
currentStackedSigma += SubInteractions[i]->get_macro_sigma_m(*interPart);
|
currentStackedSigma += SubInteractions[i]->get_macro_sigma_m(*interPart);
|
||||||
if (currentStackedSigma >= targetStackedSigma) {
|
if (currentStackedSigma > targetStackedSigma) {
|
||||||
|
std::cout << "mache Interaktion" << "\n";
|
||||||
return SubInteractions[i]->do_Interaction(interPart);
|
return SubInteractions[i]->do_Interaction(interPart);
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
InteractionOut nichts;
|
||||||
|
std::cout << "Teilchen fliegt weiter"<< "\n";
|
||||||
|
return nichts;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss<<"Interaction_Channel_Base::do_Interaction: No Interactions added.\n";
|
ss<<"Interaction_Channel_Base::do_Interaction: No Interactions added.\n";
|
||||||
@@ -57,8 +65,11 @@ inline double Interaction_Channel_Base::get_macro_sigma_m(const Particle &interP
|
|||||||
//std::cout<< "macro_sigma_m = " << macro_sigma_m << "\n";
|
//std::cout<< "macro_sigma_m = " << macro_sigma_m << "\n";
|
||||||
//std::cout<<"Subinteraction "<<SubInteractions[i]<<"\n";
|
//std::cout<<"Subinteraction "<<SubInteractions[i]<<"\n";
|
||||||
macro_sigma_m += SubInteractions[i]->get_macro_sigma_m(interPart);
|
macro_sigma_m += SubInteractions[i]->get_macro_sigma_m(interPart);
|
||||||
|
//std::cout<< "macro_sigma aus get_macro_sigma in interaction_channel_base gibt im " << i << " Iterattionsschritt: " <<macro_sigma_m <<"\n";
|
||||||
}
|
}
|
||||||
return macro_sigma_m;
|
//std::cout << "wird das gemacht?"<<"\n"; ja wird es, hier kommt ein sigma raus immer auch wenn dichte 0 ???
|
||||||
|
|
||||||
|
return macro_sigma_m; // kommt dann raus bei particle looper, gut bzw. schlecht sollte 0 sein für dichte 0
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Interaction_Channel_Base::add(Interaction_Base *addSubInteraction) {
|
inline void Interaction_Channel_Base::add(Interaction_Base *addSubInteraction) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ typedef blitz::TinyVector<double,3> vec3;
|
|||||||
|
|
||||||
|
|
||||||
inline double calc_vec3_abs(const vec3 &vec) {
|
inline double calc_vec3_abs(const vec3 &vec) {
|
||||||
|
//std::cout << vec[0] <<"\n";
|
||||||
return sqrt( pow(vec[0],2) + pow(vec[1],2) + pow(vec[2],2));
|
return sqrt( pow(vec[0],2) + pow(vec[1],2) + pow(vec[2],2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +36,19 @@ inline double calc_v_ms_from_E_eV(const double &E_eV, const double &m_eV) {
|
|||||||
return sqrt(2*E_eV/m_eV) * c_ms;
|
return sqrt(2*E_eV/m_eV) * c_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline double get_vx_from_vec3(const vec3 &vec){
|
||||||
|
|
||||||
|
double a = sqrt( pow(vec[0],2) + pow(vec[1],2) + pow(vec[2],2));
|
||||||
|
//a = a / (sqrt(3));
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline double calc_E_eV_from_v_ms_richtig(const vec3 &v_ms){
|
||||||
|
return get_vx_from_vec3(v_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline vec3 calc_n_new(const vec3 &direction_old, const double &theta_change, const double &phi_change) {
|
inline vec3 calc_n_new(const vec3 &direction_old, const double &theta_change, const double &phi_change) {
|
||||||
// Alireza Haghighat: Appendix 3 (p.249)
|
// Alireza Haghighat: Appendix 3 (p.249)
|
||||||
vec3 nOld = direction_old/calc_vec3_abs(direction_old);
|
vec3 nOld = direction_old/calc_vec3_abs(direction_old);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public:
|
|||||||
inline Kinetic_Population::Kinetic_Population(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV) : Population_Base(this_species), RNG_Base(rngUni, rngNormal), container(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, E_min_eV, E_max_eV) {
|
inline Kinetic_Population::Kinetic_Population(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV) : Population_Base(this_species), RNG_Base(rngUni, rngNormal), container(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, E_min_eV, E_max_eV) {
|
||||||
this->timer = timer;
|
this->timer = timer;
|
||||||
m_eV = get_species_mass(this_species);
|
m_eV = get_species_mass(this_species);
|
||||||
|
//std::cout<< "Kinetic Population: " << this_species<<"\n";
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void Kinetic_Population::increase_density (const Particle &upPart, const vec3 &oldLoc_m) {
|
inline void Kinetic_Population::increase_density (const Particle &upPart, const vec3 &oldLoc_m) {
|
||||||
@@ -53,7 +54,7 @@ inline void Kinetic_Population::increase_density (const Particle &upPart, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Kinetic_Population::decrease_denisty (const vec3 &loc_m, const double &E_eV) {
|
inline void Kinetic_Population::decrease_denisty (const vec3 &loc_m, const double &E_eV) {
|
||||||
std::cout<<"Kinetic POP"<<"\n";
|
//std::cout<<"Kinetic POP"<<"\n";
|
||||||
container.increase_offset(loc_m, E_eV);
|
container.increase_offset(loc_m, E_eV);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,17 +76,27 @@ double Kinetic_Population::get_E_bin_mid_eV(const int &E_bin) {
|
|||||||
inline vec3 Kinetic_Population::roll_v_ms (const vec3 &loc_m) {
|
inline vec3 Kinetic_Population::roll_v_ms (const vec3 &loc_m) {
|
||||||
Bins loc_bins = get_loc_bin(loc_m);
|
Bins loc_bins = get_loc_bin(loc_m);
|
||||||
double target = 0;
|
double target = 0;
|
||||||
|
//std::cout << get_number_E_bins() <<"\n";
|
||||||
for (int E_bin = 0; E_bin<get_number_E_bins(); E_bin++) {
|
for (int E_bin = 0; E_bin<get_number_E_bins(); E_bin++) {
|
||||||
double E = get_E_bin_mid_eV(E_bin);
|
double E = get_E_bin_mid_eV(E_bin);
|
||||||
//std::cout<<"E_bin = "<< E_bin<<" E = "<<E<<"\n";
|
//std::cout<<"E_bin = "<< E_bin<<" E = "<<E<< " Dichte die dazu kommt " << get_density_m3(E_bin, loc_bins) << "\n";
|
||||||
target += get_density_m3(E_bin, loc_bins);
|
target += get_density_m3(E_bin, loc_bins);
|
||||||
}
|
}
|
||||||
target *= rngUni->random();
|
//std::cout << "Summe aller Dichten über alle bins: " << target<<"\n";
|
||||||
|
target *= rngUni->random(); //wenn 0 dann blöd
|
||||||
|
//target = 0;
|
||||||
|
//std::cout << "target mit random number:" << target<<"\n";
|
||||||
|
|
||||||
double current = 0;
|
double current = 0;
|
||||||
for (int E_bin = 0; E_bin<get_number_E_bins(); E_bin++) {
|
for (int E_bin = 0; E_bin<get_number_E_bins(); E_bin++) {
|
||||||
current += get_density_m3(E_bin, loc_bins);
|
current += get_density_m3(E_bin, loc_bins);
|
||||||
|
//std::cout <<"E_bin = "<< E_bin << " die dichte die vom bin dazu kommt " << current <<"\n";
|
||||||
|
|
||||||
if (current >= target) {
|
if (current >= target) {
|
||||||
std::cout<<"roll_v_ms output = "<<container.roll_E_eV_in_bin(E_bin, rngUni)<<"\n";
|
//std::cout << "E_bin: " << E_bin <<"\n";
|
||||||
|
//std::cout<<"roll_v_ms output = "<<container.roll_E_eV_in_bin(E_bin, rngUni)<<"\n";
|
||||||
|
//double v = calc_v_ms_from_E_eV(container.roll_E_eV_in_bin(E_bin, rngUni), me_eV);
|
||||||
|
//std::cout << "v aus roll v_ms von e- pop: " << v<<"\n";
|
||||||
return container.roll_E_eV_in_bin(E_bin, rngUni);
|
return container.roll_E_eV_in_bin(E_bin, rngUni);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,15 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
Simulation Sim;
|
Simulation Sim;
|
||||||
|
|
||||||
|
|
||||||
int start_time = MPI_Wtime();
|
int start_time = MPI_Wtime();
|
||||||
Sim.doit();
|
Sim.doit();
|
||||||
if (rank == 0) {
|
if (rank == 0) {
|
||||||
cout<<"Total Time: "<<MPI_Wtime()-start_time<<" s\n";
|
cout<<"Total Time: "<<MPI_Wtime()-start_time<<" s\n";
|
||||||
}
|
}
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ void Particle_Looper::init_managers() {
|
|||||||
populations = Population_Builder::build(&timer, &rngUni, &rngNormal);
|
populations = Population_Builder::build(&timer, &rngUni, &rngNormal);
|
||||||
|
|
||||||
injector = Injector_Builder::build(&rngUni, &rngNormal, &populations);
|
injector = Injector_Builder::build(&rngUni, &rngNormal, &populations);
|
||||||
|
injector2 = Injector_Builder::build(&rngUni, &rngNormal, &populations);
|
||||||
movers = Mover_Builder::build(&part_loggers, &populations);
|
movers = Mover_Builder::build(&part_loggers, &populations);
|
||||||
interactions = Interaction_Builder::build(&populations, &rngUni);
|
interactions = Interaction_Builder::build(&populations, &rngUni);
|
||||||
terminators = Terminator_Builder::build();
|
terminators = Terminator_Builder::build();
|
||||||
@@ -31,6 +32,30 @@ void Particle_Looper::do_loops(int target_decays) {
|
|||||||
while ( (number_decays < target_decays) || (!particle_queue.empty()) ) {
|
while ( (number_decays < target_decays) || (!particle_queue.empty()) ) {
|
||||||
if (particle_queue.empty()) {
|
if (particle_queue.empty()) {
|
||||||
int num_new = injector.inject(&particle_queue, get_last_id());
|
int num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
std::cout << "sind wir hier? " <<"\n";
|
||||||
|
std::cout << "umschalter " << umschalter <<"\n";
|
||||||
|
int num_new;
|
||||||
|
if(umschalter == false){
|
||||||
|
|
||||||
|
std::cout << "umschalter " << umschalter << "\n";
|
||||||
|
injector.set_method(3);
|
||||||
|
injector.print_method();
|
||||||
|
num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
umschalter = true;
|
||||||
|
std::cout << "wird umgeschaltet? " << umschalter << "\n";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
std::cout << "umschalter " << umschalter << "\n";
|
||||||
|
injector.set_method(4);
|
||||||
|
injector.print_method();
|
||||||
|
num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
umschalter = false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
number_decays = number_decays + 1;
|
number_decays = number_decays + 1;
|
||||||
local_decays = local_decays + 1;
|
local_decays = local_decays + 1;
|
||||||
ID_counter = ID_counter + num_new;
|
ID_counter = ID_counter + num_new;
|
||||||
@@ -40,9 +65,64 @@ void Particle_Looper::do_loops(int target_decays) {
|
|||||||
pop_loggers.log();
|
pop_loggers.log();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Particle_Looper::do_loops(int target_decays, bool switcher) {
|
||||||
|
vector<Particle> particle_queue;
|
||||||
|
int number_decays = 0;
|
||||||
|
while ( (number_decays < target_decays) || (!particle_queue.empty()) ) {
|
||||||
|
if (particle_queue.empty()) {
|
||||||
|
int num_new;
|
||||||
|
if(switcher){
|
||||||
|
injector.set_method(3);
|
||||||
|
num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
injector.set_method(4);
|
||||||
|
num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
std::cout << "sind wir hier? " <<"\n";
|
||||||
|
std::cout << "umschalter " << umschalter <<"\n";
|
||||||
|
int num_new;
|
||||||
|
if(umschalter == false){
|
||||||
|
|
||||||
|
std::cout << "umschalter " << umschalter << "\n";
|
||||||
|
injector.set_method(3);
|
||||||
|
injector.print_method();
|
||||||
|
num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
umschalter = true;
|
||||||
|
std::cout << "wird umgeschaltet? " << umschalter << "\n";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
std::cout << "umschalter " << umschalter << "\n";
|
||||||
|
injector.set_method(4);
|
||||||
|
injector.print_method();
|
||||||
|
num_new = injector.inject(&particle_queue, get_last_id());
|
||||||
|
umschalter = false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
number_decays = number_decays + 1;
|
||||||
|
local_decays = local_decays + 1;
|
||||||
|
ID_counter = ID_counter + num_new;
|
||||||
|
}
|
||||||
|
process_one(&particle_queue);
|
||||||
|
}
|
||||||
|
pop_loggers.log();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Particle_Looper::process_one(std::vector<Particle> *particle_queue) {
|
void Particle_Looper::process_one(std::vector<Particle> *particle_queue) {
|
||||||
int i = floor(rngUni.random()*particle_queue->size());
|
int i = floor(rngUni.random()*particle_queue->size());
|
||||||
|
//int i = particle_queue->size();
|
||||||
|
//i = 0;
|
||||||
|
//std::cout << i << "\n";
|
||||||
Particle curPart = particle_queue->at(i);
|
Particle curPart = particle_queue->at(i);
|
||||||
|
; std::cout<<"################################################"<<"\n";
|
||||||
|
std::cout<<"Current Particle: "<< curPart.get_species() <<"\n";
|
||||||
|
std::cout<<"current particle energy "<< curPart.get_E_eV()<<"\n";
|
||||||
//Particle curPart = particle_queue->front();
|
//Particle curPart = particle_queue->front();
|
||||||
Mover_Base *moverPtr = movers.find(curPart.get_species());
|
Mover_Base *moverPtr = movers.find(curPart.get_species());
|
||||||
Interaction_Channel_Base *interactionPtr = interactions.find(curPart.get_species());
|
Interaction_Channel_Base *interactionPtr = interactions.find(curPart.get_species());
|
||||||
@@ -53,22 +133,26 @@ void Particle_Looper::process_one(std::vector<Particle> *particle_queue) {
|
|||||||
vec3 oldLoc_m;
|
vec3 oldLoc_m;
|
||||||
while (!terminatorPtr->check_terminlization(curPart)) {
|
while (!terminatorPtr->check_terminlization(curPart)) {
|
||||||
oldLoc_m = curPart.get_x_m();
|
oldLoc_m = curPart.get_x_m();
|
||||||
|
std::cout << "Wo sind wir gerade? " << oldLoc_m << "\n";
|
||||||
|
//std::cout << "noch nichts passiert, richtig?"<< "\n";
|
||||||
macro_sigma_m = interactionPtr->get_macro_sigma_m(curPart);
|
macro_sigma_m = interactionPtr->get_macro_sigma_m(curPart);
|
||||||
|
//macro_sigma_m = macro_sigma_m * 1e21;
|
||||||
|
//std::cout<<"MacroSigma in particle_looper wird für move verwendet: "<< macro_sigma_m<<"\n";
|
||||||
|
|
||||||
//macro_sigma_m = 1; //nur test
|
//macro_sigma_m = 1; //nur test
|
||||||
|
//std::cout<<"Test macro_sigma auf 1 gesetzt -> also Interaktion "<<"\n";
|
||||||
std::cout<<"###############################"<<"\n";
|
std::cout << "Move: " << "\n";
|
||||||
std::cout<<"Current Particle: "<<curPart<<"\n";
|
|
||||||
std::cout<<"MacroSigma von Current Particle = "<< macro_sigma_m<<"\n";
|
|
||||||
|
|
||||||
|
|
||||||
moverPtr->move(&curPart, macro_sigma_m);
|
moverPtr->move(&curPart, macro_sigma_m);
|
||||||
|
|
||||||
|
std::cout << "Wo sind wir nach move? " << curPart.get_x_m() << "\n";
|
||||||
|
|
||||||
if (terminatorPtr->check_terminlization(curPart)) {
|
if (terminatorPtr->check_terminlization(curPart)) {
|
||||||
std::cout<<"Keine Interaktion."<<"\n";
|
std::cout<<"Keine Interaktion."<<"\n";
|
||||||
|
|
||||||
break; // Don't double check terminlization, else n_double.
|
break; // Don't double check terminlization, else n_double.
|
||||||
} else {
|
} else {
|
||||||
std::cout<<"Interaktion."<<"\n";
|
std::cout<<"Interaktion: "<<"\n";
|
||||||
|
//curPart.set_x_m(oldLoc_m);
|
||||||
IntOut = interactionPtr->do_Interaction(&curPart);
|
IntOut = interactionPtr->do_Interaction(&curPart);
|
||||||
for (int i=0; i<IntOut.get_number_new_particles(); i++) {
|
for (int i=0; i<IntOut.get_number_new_particles(); i++) {
|
||||||
particle_queue->push_back(IntOut.get_new_particles()[i]);
|
particle_queue->push_back(IntOut.get_new_particles()[i]);
|
||||||
@@ -80,7 +164,7 @@ void Particle_Looper::process_one(std::vector<Particle> *particle_queue) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
particle_queue->erase(particle_queue->begin() + i);
|
particle_queue->erase(particle_queue->begin() + i );
|
||||||
}
|
}
|
||||||
|
|
||||||
long int Particle_Looper::get_new_id() {
|
long int Particle_Looper::get_new_id() {
|
||||||
@@ -101,6 +185,15 @@ void Particle_Looper::do_logging_off_loops(int target_decays) {
|
|||||||
ID_counter = prev_ID_counter;
|
ID_counter = prev_ID_counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Particle_Looper::do_logging_off_loops(int taget_decays, bool switcher){
|
||||||
|
int prev_ID_counter = ID_counter;
|
||||||
|
set_logging(false);
|
||||||
|
do_loops(taget_decays, switcher);
|
||||||
|
set_logging(true);
|
||||||
|
ID_counter = prev_ID_counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Particle_Looper::set_logging(bool logging) {
|
void Particle_Looper::set_logging(bool logging) {
|
||||||
vector<species> all_species = get_all_species_vector();
|
vector<species> all_species = get_all_species_vector();
|
||||||
species current_species;
|
species current_species;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class Particle_Looper {
|
|||||||
Population_Manager populations;
|
Population_Manager populations;
|
||||||
|
|
||||||
Injector injector;
|
Injector injector;
|
||||||
|
Injector injector2;
|
||||||
Mover_Manager movers;
|
Mover_Manager movers;
|
||||||
Interaction_Manager interactions;
|
Interaction_Manager interactions;
|
||||||
Terminator_Manager terminators;
|
Terminator_Manager terminators;
|
||||||
@@ -66,6 +67,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void do_loops(int target_decays);
|
void do_loops(int target_decays);
|
||||||
|
void do_loops(int taget_decays, bool switcher);
|
||||||
private:
|
private:
|
||||||
void process_one(std::vector<Particle> *particle_queue);
|
void process_one(std::vector<Particle> *particle_queue);
|
||||||
long int get_new_id();
|
long int get_new_id();
|
||||||
@@ -73,6 +75,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void do_logging_off_loops(int target_decays);
|
void do_logging_off_loops(int target_decays);
|
||||||
|
void do_logging_off_loops(int target_decays, bool switcher);
|
||||||
private:
|
private:
|
||||||
void set_logging(bool logging);
|
void set_logging(bool logging);
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,18 @@ Population_Manager Population_Builder::build(Timer *timer,UniRNG *rngUni, Normal
|
|||||||
Populations.add(new Thermal_Population(tritium3I, new WGTS_Kinematics(3*mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
Populations.add(new Thermal_Population(tritium3I, new WGTS_Kinematics(3*mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||||
Populations.add(new Thermal_Population(tritium5I, new WGTS_Kinematics(5*mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
Populations.add(new Thermal_Population(tritium5I, new WGTS_Kinematics(5*mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||||
Populations.add(new T2_Population(new WGTS_Kinematics(2*mT_eV, wgtsTemp_K, rngUni, rngNormal), rngUni, rngNormal));
|
Populations.add(new T2_Population(new WGTS_Kinematics(2*mT_eV, wgtsTemp_K, rngUni, rngNormal), rngUni, rngNormal));
|
||||||
} else {
|
}
|
||||||
|
else if (v_flow == 1){
|
||||||
|
Populations.add(new Kinetic_Population(tritium, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START, POP_E_END));
|
||||||
|
Populations.add(new Kinetic_Population(tritiumI, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START, POP_E_END));
|
||||||
|
Populations.add(new Kinetic_Population(tritium2I, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START, POP_E_END));
|
||||||
|
Populations.add(new Kinetic_Population(tritium3I, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START, POP_E_END));
|
||||||
|
Populations.add(new Kinetic_Population(tritium5I, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START, POP_E_END));
|
||||||
|
Populations.add(new T2_Population(new WGTS_Kinematics(2*mT_eV, wgtsTemp_K, rngUni, rngNormal), rngUni, rngNormal));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
Populations.add(new Thermal_Population(tritium, new Lin_Kinematics(mT_eV, wgtsTemp_K, v_flow, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
Populations.add(new Thermal_Population(tritium, new Lin_Kinematics(mT_eV, wgtsTemp_K, v_flow, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||||
Populations.add(new Thermal_Population(tritiumI, new Lin_Kinematics(mT_eV, wgtsTemp_K, v_flow, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
Populations.add(new Thermal_Population(tritiumI, new Lin_Kinematics(mT_eV, wgtsTemp_K, v_flow, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||||
Populations.add(new Thermal_Population(tritium2I, new Lin_Kinematics(2*mT_eV, wgtsTemp_K, v_flow, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
Populations.add(new Thermal_Population(tritium2I, new Lin_Kinematics(2*mT_eV, wgtsTemp_K, v_flow, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ void Population_Container::increase_cum_time_s(const vec3 &loc1_m, const vec3 &l
|
|||||||
bin = calc_data_bin(bins_1, E_bin);
|
bin = calc_data_bin(bins_1, E_bin);
|
||||||
cum_times_s[bin] += cum_time_s;
|
cum_times_s[bin] += cum_time_s;
|
||||||
}
|
}
|
||||||
|
//double n_m3 = cum_time_s/time_s/V_m3 - offset/V_m3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ void Population_Container::increase_offset(const vec3 &loc_m, const double &E_eV
|
|||||||
Bins loc_bins = calc_loc_bin(loc_m);
|
Bins loc_bins = calc_loc_bin(loc_m);
|
||||||
int bin = calc_data_bin(loc_bins, E_bin);
|
int bin = calc_data_bin(loc_bins, E_bin);
|
||||||
offsets[bin] += 1;
|
offsets[bin] += 1;
|
||||||
std::cout<<"Offset[bin]= "<<offsets[bin]<<"["<<bin<<"]"<<"\n";
|
//std::cout<<"Offset[bin]= "<<offsets[bin]<<"["<<bin<<"]"<<"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
double Population_Container::get_density_m3(const vec3 &loc_m, const double &E_eV, const double &time_s) {
|
double Population_Container::get_density_m3(const vec3 &loc_m, const double &E_eV, const double &time_s) {
|
||||||
@@ -145,9 +146,20 @@ double Population_Container::get_density_m3(const int &E_bin, const Bins &loc_bi
|
|||||||
//std::cout<<"offset = " <<offset<<"\n";
|
//std::cout<<"offset = " <<offset<<"\n";
|
||||||
|
|
||||||
double n_m3 = cum_time_s/time_s/V_m3 - offset/V_m3;
|
double n_m3 = cum_time_s/time_s/V_m3 - offset/V_m3;
|
||||||
|
//double n_m3 = cum_time_s/time_s/V_m3 ;
|
||||||
|
|
||||||
|
|
||||||
if (n_m3<0) {
|
if (n_m3<0) {
|
||||||
std::cout<<"Offset größer als n"<<"\n";
|
std::cout<<"Offset größer als n"<<"\n";
|
||||||
n_m3 = 0;
|
n_m3 = 0;
|
||||||
|
cum_times_s[data_bin] = 0;
|
||||||
|
offsets[data_bin] = 0;
|
||||||
|
//std::cout << "cumtime in data bin " << cum_times_s[data_bin] << "\n";
|
||||||
|
//std::cout << "cumtime in data bin+1 " << cum_times_s[data_bin+1] << "\n";
|
||||||
|
//std::cout << "offset in data bin " << offsets[data_bin] << "\n";
|
||||||
|
//std::cout << "offset in data bin+1 " << offsets[data_bin+1] << "\n";
|
||||||
|
//cumtime = 0
|
||||||
|
//offset = 0
|
||||||
}
|
}
|
||||||
return n_m3;
|
return n_m3;
|
||||||
}
|
}
|
||||||
@@ -170,8 +182,12 @@ double Population_Container::get_E_bin_mid_eV(const int &E_bin) {
|
|||||||
|
|
||||||
double Population_Container::roll_E_eV_in_bin(const int &E_bin, UniRNG *rngUni) {
|
double Population_Container::roll_E_eV_in_bin(const int &E_bin, UniRNG *rngUni) {
|
||||||
double low = E_scale.get_lower_bin_bound(E_bin);
|
double low = E_scale.get_lower_bin_bound(E_bin);
|
||||||
|
//std::cout << "low " << low<<"\n";
|
||||||
double up = E_scale.get_upper_bin_bound(E_bin);
|
double up = E_scale.get_upper_bin_bound(E_bin);
|
||||||
return low + rngUni->random()*(up-low);
|
//std::cout << "up " << up<<"\n";
|
||||||
|
double a = low + rngUni->random()*(up-low);
|
||||||
|
//std::cout << a <<"\n";
|
||||||
|
return low + rngUni->random()*(up-low);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Population_Container::calc_data_bin(const Bins &loc_bin, const double &E_bin) {
|
int Population_Container::calc_data_bin(const Bins &loc_bin, const double &E_bin) {
|
||||||
|
|||||||
@@ -95,9 +95,15 @@ inline void Population_Logger::create_h5tb() {
|
|||||||
inline void Population_Logger::log() {
|
inline void Population_Logger::log() {
|
||||||
pop_bin temp_bin;
|
pop_bin temp_bin;
|
||||||
temp_bin.phys_time_s = timer->get_time_s();
|
temp_bin.phys_time_s = timer->get_time_s();
|
||||||
|
|
||||||
|
//std::cout << "logging time " << timer->get_time_s() << "\n";
|
||||||
int bin;
|
int bin;
|
||||||
for (int i_z=0; i_z < container->scales.z.get_number_bins(); i_z++) {
|
for (int i_z=0; i_z < container->scales.z.get_number_bins(); i_z++) {
|
||||||
temp_bin.z_bin = i_z;
|
temp_bin.z_bin = i_z;
|
||||||
|
|
||||||
|
//temp_bin.tracking += 1;
|
||||||
|
//std::cout << "tracking " << temp_bin.tracking << "\n";
|
||||||
|
|
||||||
for (int i_r=0; i_r < container->scales.r.get_number_bins(); i_r++) {
|
for (int i_r=0; i_r < container->scales.r.get_number_bins(); i_r++) {
|
||||||
temp_bin.r_bin = i_r;
|
temp_bin.r_bin = i_r;
|
||||||
for (int i_phi=0; i_phi < container->scales.phi.get_number_bins(); i_phi++) {
|
for (int i_phi=0; i_phi < container->scales.phi.get_number_bins(); i_phi++) {
|
||||||
@@ -107,6 +113,11 @@ inline void Population_Logger::log() {
|
|||||||
bin = container->calc_data_bin(Bins{i_z, i_r, i_phi}, i_E);
|
bin = container->calc_data_bin(Bins{i_z, i_r, i_phi}, i_E);
|
||||||
temp_bin.cumulated_time_s = container->cum_times_s[bin];
|
temp_bin.cumulated_time_s = container->cum_times_s[bin];
|
||||||
temp_bin.offset = container->offsets[bin];
|
temp_bin.offset = container->offsets[bin];
|
||||||
|
temp_bin.n_m3 = container->get_density_m3(i_E, bin, temp_bin.phys_time_s);
|
||||||
|
//std::cout << temp_bin.n_m3 << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h5tb.write(temp_bin);
|
h5tb.write(temp_bin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ void Simulation::deconstruct_pop_arrays() { // Deallocate memory properly
|
|||||||
|
|
||||||
|
|
||||||
void Simulation::doit() { // 2 Phase: 1. calc average densities, 2. actual simulate
|
void Simulation::doit() { // 2 Phase: 1. calc average densities, 2. actual simulate
|
||||||
do_cycle(popCalcDecays, popCalcStep, false);
|
//do_cycle(popCalcDecays, popCalcStep, false);
|
||||||
if (mpi_rank == 0) {
|
if (mpi_rank == 0) {
|
||||||
cout<<"Population calculation done.\n";
|
cout<<"Population calculation done.\n";
|
||||||
}
|
}
|
||||||
@@ -168,8 +168,18 @@ void Simulation::do_cycle(long int number_total, long int step_size, bool loggin
|
|||||||
if (mpi_rank < overflow) { // Split overflows equaly to left over CPUs.
|
if (mpi_rank < overflow) { // Split overflows equaly to left over CPUs.
|
||||||
num_remaining += 1;
|
num_remaining += 1;
|
||||||
}
|
}
|
||||||
|
switcher = true;
|
||||||
for (int i = 0; i<(num_cycles-1); i++) {
|
for (int i = 0; i<(num_cycles-1); i++) {
|
||||||
|
std::cout << "sind wir hier?" <<"\n";
|
||||||
|
|
||||||
do_decays(step_size, logging);
|
do_decays(step_size, logging);
|
||||||
|
if(switcher == true){
|
||||||
|
switcher = false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
switcher = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (num_cycles == 0) { // Rather unrealistic case.. maybe find a more elegant solution later.
|
if (num_cycles == 0) { // Rather unrealistic case.. maybe find a more elegant solution later.
|
||||||
do_decays(num_remaining, logging);
|
do_decays(num_remaining, logging);
|
||||||
@@ -182,8 +192,10 @@ void Simulation::do_cycle(long int number_total, long int step_size, bool loggin
|
|||||||
void Simulation::do_decays(const long int &number_decays, const bool &logging) {
|
void Simulation::do_decays(const long int &number_decays, const bool &logging) {
|
||||||
if (logging) {
|
if (logging) {
|
||||||
looper.do_loops(number_decays);
|
looper.do_loops(number_decays);
|
||||||
|
//looper.do_loops(number_decays, switcher);
|
||||||
} else {
|
} else {
|
||||||
looper.do_logging_off_loops(number_decays);
|
looper.do_logging_off_loops(number_decays);
|
||||||
|
//looper.do_logging_off_loops(number_decays, switcher);
|
||||||
}
|
}
|
||||||
number_local_decays += number_decays;
|
number_local_decays += number_decays;
|
||||||
sync_cpus();
|
sync_cpus();
|
||||||
@@ -246,12 +258,12 @@ void Simulation::print_term_stats() {
|
|||||||
Terminator_Manager *terminators = looper.get_terminators();
|
Terminator_Manager *terminators = looper.get_terminators();
|
||||||
vector<species> all_species = get_all_species_vector();
|
vector<species> all_species = get_all_species_vector();
|
||||||
Termination_Stats local_stats, global_stats;
|
Termination_Stats local_stats, global_stats;
|
||||||
int local_array[7], global_array[7];
|
int local_array[8], global_array[8];
|
||||||
for (vector<species>::iterator itr = all_species.begin(); itr!= all_species.end(); itr++) {
|
for (vector<species>::iterator itr = all_species.begin(); itr!= all_species.end(); itr++) {
|
||||||
if (terminators->exists(*itr)) {
|
if (terminators->exists(*itr)) {
|
||||||
local_stats = terminators->find(*itr)->get_stats();
|
local_stats = terminators->find(*itr)->get_stats();
|
||||||
local_stats.to_array(local_array);
|
local_stats.to_array(local_array);
|
||||||
MPI_Allreduce(local_array, global_array, 7, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
|
MPI_Allreduce(local_array, global_array, 8, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
|
||||||
global_stats.from_array(global_array);
|
global_stats.from_array(global_array);
|
||||||
if (mpi_rank == 0) {
|
if (mpi_rank == 0) {
|
||||||
std::cout<<"# "<<*itr<<"\n";
|
std::cout<<"# "<<*itr<<"\n";
|
||||||
@@ -262,6 +274,7 @@ void Simulation::print_term_stats() {
|
|||||||
std::cout<<"n_max\t"<<global_stats.n_max<<"\n";
|
std::cout<<"n_max\t"<<global_stats.n_max<<"\n";
|
||||||
std::cout<<"n_energy\t"<<global_stats.n_energy<<"\n";
|
std::cout<<"n_energy\t"<<global_stats.n_energy<<"\n";
|
||||||
std::cout<<"n_reaction\t"<<global_stats.n_reaction<<"\n";
|
std::cout<<"n_reaction\t"<<global_stats.n_reaction<<"\n";
|
||||||
|
std::cout<<"n_offset\t"<<global_stats.n_offset<<"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ class Simulation {
|
|||||||
static const long int popCalcDecays;
|
static const long int popCalcDecays;
|
||||||
static const long int popCalcStep;
|
static const long int popCalcStep;
|
||||||
|
|
||||||
|
bool switcher;
|
||||||
|
|
||||||
long int numberTotalParticles = 0;
|
long int numberTotalParticles = 0;
|
||||||
long int number_local_decays = 0;
|
long int number_local_decays = 0;
|
||||||
long int number_global_decays = 0;
|
long int number_global_decays = 0;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ struct Termination_Stats {
|
|||||||
n_max = array [4];
|
n_max = array [4];
|
||||||
n_energy = array [5];
|
n_energy = array [5];
|
||||||
n_reaction = array [6];
|
n_reaction = array [6];
|
||||||
|
n_offset = array [7];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,11 +28,14 @@ public:
|
|||||||
|
|
||||||
void increase_density (const Particle &upPart, const vec3 &oldLoc_m) {container.increase_cum_time_s(oldLoc_m, upPart.get_x_m(), calc_vec3_abs(upPart.get_v_ms()), upPart.get_E_eV());}
|
void increase_density (const Particle &upPart, const vec3 &oldLoc_m) {container.increase_cum_time_s(oldLoc_m, upPart.get_x_m(), calc_vec3_abs(upPart.get_v_ms()), upPart.get_E_eV());}
|
||||||
void decrease_denisty (const vec3 &loc_m, const double &E_eV) {
|
void decrease_denisty (const vec3 &loc_m, const double &E_eV) {
|
||||||
std::cout<<"THermal POP"<<"\n";
|
|
||||||
container.increase_offset(loc_m, E_eV);
|
container.increase_offset(loc_m, E_eV);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double get_density_m3(const vec3 &loc_m) {return container.get_density_m3(loc_m, 0, timer->get_time_s());}
|
double get_density_m3(const vec3 &loc_m) {
|
||||||
|
//std::cout << "get denistiy in thermal pop wird benutzt?"<< "\n"; //ja wird benutzt
|
||||||
|
//std::cout << "dichte von der thermal pop: "<<container.get_density_m3(loc_m, 0, timer->get_time_s())<<"\n";
|
||||||
|
return container.get_density_m3(loc_m, 0, timer->get_time_s());}
|
||||||
|
|
||||||
double get_density_m3(const int &E_bin, const Bins &loc_bins) {throw MyException("Should not be called.\n.");}
|
double get_density_m3(const int &E_bin, const Bins &loc_bins) {throw MyException("Should not be called.\n.");}
|
||||||
int get_number_E_bins() {return 1;}
|
int get_number_E_bins() {return 1;}
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ void Timer::set_T2_activity_s() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double Timer::get_time_s() {
|
double Timer::get_time_s() {
|
||||||
|
//std::cout << "T2 aktivity " << T2_activity_s << "\n";
|
||||||
|
//std::cout << "off set_time " << offset_time_s << "\n";
|
||||||
|
//std::cout << "calc total decays " << calc_total_decays() << "\n";
|
||||||
|
//std::cout << "get_time " << double(calc_total_decays())/T2_activity_s + offset_time_s << "\n";
|
||||||
return double(calc_total_decays())/T2_activity_s + offset_time_s;
|
return double(calc_total_decays())/T2_activity_s + offset_time_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user