Major update:
1. Added precalculation of integral values in thermal regime. 2. Minor Changes in Injection of \beta-electrons and ions.
This commit is contained in:
@@ -29,16 +29,16 @@ public:
|
||||
void add(Interaction_Base *addSubInteraction);
|
||||
|
||||
InteractionOut do_Interaction(Particle *interPart);
|
||||
double get_macroSigma_m(const Particle &interPart);
|
||||
double get_macro_sigma_m(const Particle &interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut Interaction_Channel_Base::do_Interaction(Particle *interPart) {
|
||||
double macroSigma_m = get_macroSigma_m(*interPart);
|
||||
double macro_sigma_m = get_macro_sigma_m(*interPart);
|
||||
double currentStackedSigma = 0;
|
||||
double targetStackedSigma = rngUni->random() * macroSigma_m;
|
||||
double targetStackedSigma = rngUni->random() * macro_sigma_m;
|
||||
|
||||
for (int i = 0; i < numSubInteractions; i++) {
|
||||
currentStackedSigma += SubInteractions[i]->get_macroSigma_m(*interPart);
|
||||
currentStackedSigma += SubInteractions[i]->get_macro_sigma_m(*interPart);
|
||||
if (currentStackedSigma >= targetStackedSigma) {
|
||||
return SubInteractions[i]->do_Interaction(interPart);
|
||||
}
|
||||
@@ -49,12 +49,12 @@ inline InteractionOut Interaction_Channel_Base::do_Interaction(Particle *interPa
|
||||
}
|
||||
|
||||
|
||||
inline double Interaction_Channel_Base::get_macroSigma_m(const Particle &interPart) {
|
||||
double macroSigma_m = 0;
|
||||
inline double Interaction_Channel_Base::get_macro_sigma_m(const Particle &interPart) {
|
||||
double macro_sigma_m = 0;
|
||||
for (int i = 0; i < numSubInteractions; i++) {
|
||||
macroSigma_m += SubInteractions[i]->get_macroSigma_m(interPart);
|
||||
macro_sigma_m += SubInteractions[i]->get_macro_sigma_m(interPart);
|
||||
}
|
||||
return macroSigma_m;
|
||||
return macro_sigma_m;
|
||||
}
|
||||
|
||||
inline void Interaction_Channel_Base::add(Interaction_Base *addSubInteraction) {
|
||||
|
||||
Reference in New Issue
Block a user