mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
moved transport functions in simulation to be more consistent
This commit is contained in:
parent
e1abbe6fcb
commit
b05dedb179
3 changed files with 34 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue