@@ -225,8 +225,6 @@ void Particle::event_calculate_xs()
225225
226226void Particle::event_advance ()
227227{
228- // Find the distance to the nearest boundary
229-
230228 // Sample a distance to collision
231229 if (type () == ParticleType::electron || type () == ParticleType::positron) {
232230 collision_distance () = 0.0 ;
@@ -236,6 +234,7 @@ void Particle::event_advance()
236234 collision_distance () = -std::log (prn (current_seed ())) / macro_xs ().total ;
237235 }
238236
237+ // Find the distance to the nearest boundary
239238 boundary () = distance_to_boundary (*this );
240239
241240 double speed = this ->speed ();
@@ -575,14 +574,14 @@ void Particle::cross_surface(const Surface& surf)
575574 return ;
576575 }
577576#endif
578-
577+ int i_surface = std::abs ( surface ());
579578 bool verbose = settings::verbosity >= 10 || trace ();
580- if (surf-> is_triso_surface_ ) {
579+ if (surf. is_triso_surface_ ) {
581580 if (surface () > 0 ) {
582581 for (int i = n_coord (); i < model::n_coord_levels; i++) {
583582 coord (i).reset ();
584583 }
585- coord (n_coord () - 1 ).cell =
584+ coord (n_coord () - 1 ).cell () =
586585 model::cell_map[model::surfaces[i_surface - 1 ]->triso_base_index_ ];
587586 } else if (surface () < 0 ) {
588587 for (int i = n_coord (); i < model::n_coord_levels; i++) {
@@ -592,20 +591,20 @@ void Particle::cross_surface(const Surface& surf)
592591 fatal_error (fmt::format (" Particle cell of surface {} is not defined" ,
593592 model::surfaces[i_surface - 1 ]->id_ ));
594593 }
595- coord (n_coord () - 1 ).cell =
594+ coord (n_coord () - 1 ).cell () =
596595 model::cell_map[model::surfaces[i_surface - 1 ]->triso_particle_index_ ];
597596 }
598597
599598 // find material
600599 bool found = true ;
601- int i_cell = coord (n_coord () - 1 ).cell ;
600+ int i_cell = coord (n_coord () - 1 ).cell () ;
602601 for (;; ++n_coord ()) {
603602 if (i_cell == C_NONE) {
604- int i_universe = coord (n_coord () - 1 ).universe ;
603+ int i_universe = coord (n_coord () - 1 ).universe () ;
605604 const auto & univ {model::universes[i_universe]};
606605
607606 if (univ->filled_with_triso_base_ != -1 ) {
608- coord (n_coord () - 1 ).cell =
607+ coord (n_coord () - 1 ).cell () =
609608 model::cell_map[univ->filled_with_triso_base_ ];
610609 found = true ;
611610 } else {
@@ -616,7 +615,7 @@ void Particle::cross_surface(const Surface& surf)
616615 }
617616 }
618617
619- i_cell = coord (n_coord () - 1 ).cell ;
618+ i_cell = coord (n_coord () - 1 ).cell () ;
620619
621620 Cell& c {*model::cells[i_cell]};
622621 if (c.type_ == Fill::MATERIAL) {
@@ -650,14 +649,14 @@ void Particle::cross_surface(const Surface& surf)
650649
651650 // Set the lower coordinate level universe.
652651 auto & coor {coord (n_coord ())};
653- coor.universe = c.fill_ ;
652+ coor.universe () = c.fill_ ;
654653
655654 // Set the position and direction.
656- coor.r = r_local ();
657- coor.u = u_local ();
655+ coor.r () = r_local ();
656+ coor.u () = u_local ();
658657
659658 // Apply translation.
660- coor.r -= c.translation_ ;
659+ coor.r () -= c.translation_ ;
661660
662661 // Apply rotation.
663662 if (!c.rotation_ .empty ()) {
0 commit comments