moved transport functions in simulation to be more consistent

This commit is contained in:
John Tramm 2020-01-14 02:48:27 +00:00
parent e1abbe6fcb
commit b05dedb179
3 changed files with 34 additions and 28 deletions

View file

@ -37,31 +37,6 @@
namespace openmc {
void transport_history_based_single_particle(Particle& p)
{
while(true) {
p.event_calculate_xs();
p.event_advance();
if( p.collision_distance_ > p.boundary_.distance )
p.event_cross_surface();
else
p.event_collide();
p.event_revive_from_secondary();
if(!p.alive_)
break;
}
p.event_death();
}
void transport_history_based()
{
#pragma omp parallel for schedule(runtime)
for (int64_t i_work = 1; i_work <= simulation::work_per_rank; ++i_work) {
Particle p;
initialize_history(&p, i_work);
transport_history_based_single_particle(p);
}
}
} // namespace openmc
@ -590,4 +565,30 @@ void free_memory_simulation()
simulation::entropy.clear();
}
void transport_history_based_single_particle(Particle& p)
{
while(true) {
p.event_calculate_xs();
p.event_advance();
if( p.collision_distance_ > p.boundary_.distance )
p.event_cross_surface();
else
p.event_collide();
p.event_revive_from_secondary();
if(!p.alive_)
break;
}
p.event_death();
}
void transport_history_based()
{
#pragma omp parallel for schedule(runtime)
for (int64_t i_work = 1; i_work <= simulation::work_per_rank; ++i_work) {
Particle p;
initialize_history(&p, i_work);
transport_history_based_single_particle(p);
}
}
} // namespace openmc