@@ -29,8 +29,11 @@ void openmc_run_random_ray()
2929 // ////////////////////////////////////////////////////////
3030
3131 if (mpi::master) {
32- bool adjoint_needed = FlatSourceDomain::adjoint_;
33- print_random_ray_headers (adjoint_needed);
32+ if (FlatSourceDomain::adjoint_) {
33+ FlatSourceDomain::adjoint_ = false ;
34+ openmc::print_adjoint_header ();
35+ FlatSourceDomain::adjoint_ = true ;
36+ }
3437 }
3538
3639 // Initialize OpenMC general data structures
@@ -383,15 +386,14 @@ void write_random_ray_hdf5(hid_t group)
383386 close_group (random_ray_group);
384387}
385388
386- void print_random_ray_headers ( bool & adjoint_needed )
389+ void print_adjoint_header ( )
387390{
388- // If we're going to do an adjoint simulation afterwards, report that this is
389- // the initial forward flux solve.
390- if (adjoint_needed && !FlatSourceDomain::adjoint_)
391+ if (!FlatSourceDomain::adjoint_)
392+ // If we're going to do an adjoint simulation afterwards, report that this
393+ // is the initial forward flux solve.
391394 header (" FORWARD FLUX SOLVE" , 3 );
392-
393- // Otherwise report that we are doing the adjoint simulation
394- if (adjoint_needed && FlatSourceDomain::adjoint_)
395+ else
396+ // Otherwise report that we are doing the adjoint simulation
395397 header (" ADJOINT FLUX SOLVE" , 3 );
396398}
397399
@@ -482,16 +484,11 @@ void RandomRaySimulation::prepare_fixed_sources_adjoint()
482484 }
483485}
484486
485- void RandomRaySimulation::print_random_ray_headers ()
486- {
487- openmc::print_random_ray_headers (adjoint_needed_);
488- }
489-
490487void RandomRaySimulation::run_single_simulation ()
491488{
492489 if (!is_first_simulation_) {
493- if (mpi::master)
494- print_random_ray_headers ();
490+ if (mpi::master && adjoint_needed_ )
491+ openmc::print_adjoint_header ();
495492
496493 // Reset the timers and reinitialize the general OpenMC datastructures if
497494 // this is after the first simulation
0 commit comments