Loading src/modules/GenericPropagation/GenericPropagationModule.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -610,7 +610,7 @@ GenericPropagationModule::propagate(Event* event, double log_prob = 1. / std::log1p(-1. / local_gain); for(unsigned int i_carrier = 0; i_carrier < charge; ++i_carrier) { n_secondaries += static_cast<unsigned int>( std::floor(std::log(uniform_distribution(event->getRandomEngine())) * log_prob)); n_secondaries += static_cast<unsigned int>(std::log(uniform_distribution(event->getRandomEngine())) * log_prob); } auto inverted_type = invertCarrierType(type); Loading @@ -619,7 +619,7 @@ GenericPropagationModule::propagate(Event* event, (inverted_type == CarrierType::HOLE && propagate_holes_); }; if(n_secondaries != 0 && do_propagate()) { if(n_secondaries > 0 && do_propagate()) { // Generate new charge carriers of the opposite type // Same-type charge carriers are generated by increasing the charge at the end of the step // Placing new charge carrier at the end of the step: Loading src/modules/TransientPropagation/TransientPropagationModule.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -633,8 +633,7 @@ TransientPropagationModule::propagate(Event* event, // secondaries generated in this step double log_prob = 1. / std::log1p(-1. / local_gain); for(unsigned int i_carrier = 0; i_carrier < charge; ++i_carrier) { n_secondaries += static_cast<unsigned int>( std::floor(std::log(uniform_distribution(event->getRandomEngine())) * log_prob)); n_secondaries += static_cast<unsigned int>(std::log(uniform_distribution(event->getRandomEngine())) * log_prob); } if(n_secondaries != 0) { // Generate new charge carriers of the opposite type Loading Loading
src/modules/GenericPropagation/GenericPropagationModule.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -610,7 +610,7 @@ GenericPropagationModule::propagate(Event* event, double log_prob = 1. / std::log1p(-1. / local_gain); for(unsigned int i_carrier = 0; i_carrier < charge; ++i_carrier) { n_secondaries += static_cast<unsigned int>( std::floor(std::log(uniform_distribution(event->getRandomEngine())) * log_prob)); n_secondaries += static_cast<unsigned int>(std::log(uniform_distribution(event->getRandomEngine())) * log_prob); } auto inverted_type = invertCarrierType(type); Loading @@ -619,7 +619,7 @@ GenericPropagationModule::propagate(Event* event, (inverted_type == CarrierType::HOLE && propagate_holes_); }; if(n_secondaries != 0 && do_propagate()) { if(n_secondaries > 0 && do_propagate()) { // Generate new charge carriers of the opposite type // Same-type charge carriers are generated by increasing the charge at the end of the step // Placing new charge carrier at the end of the step: Loading
src/modules/TransientPropagation/TransientPropagationModule.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -633,8 +633,7 @@ TransientPropagationModule::propagate(Event* event, // secondaries generated in this step double log_prob = 1. / std::log1p(-1. / local_gain); for(unsigned int i_carrier = 0; i_carrier < charge; ++i_carrier) { n_secondaries += static_cast<unsigned int>( std::floor(std::log(uniform_distribution(event->getRandomEngine())) * log_prob)); n_secondaries += static_cast<unsigned int>(std::log(uniform_distribution(event->getRandomEngine())) * log_prob); } if(n_secondaries != 0) { // Generate new charge carriers of the opposite type Loading