File indexing completed on 2025-09-18 09:09:09
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Assert.hh"
0010 #include "corecel/Macros.hh"
0011 #include "celeritas/Types.hh"
0012 #include "celeritas/optical/CoreTrackView.hh"
0013 #include "celeritas/optical/SimTrackView.hh"
0014
0015 namespace celeritas
0016 {
0017 namespace optical
0018 {
0019 namespace detail
0020 {
0021
0022
0023
0024
0025
0026
0027 struct PropagateExecutor
0028 {
0029 inline CELER_FUNCTION void operator()(CoreTrackView& track);
0030 };
0031
0032
0033 CELER_FUNCTION void PropagateExecutor::operator()(CoreTrackView& track)
0034 {
0035 auto&& sim = track.sim();
0036 CELER_ASSERT(sim.status() == TrackStatus::alive);
0037
0038
0039 real_type step = sim.step_length();
0040 CELER_ASSERT(step > 0);
0041
0042 auto&& geo = track.geometry();
0043 Propagation p = geo.find_next_step(step);
0044 if (p.boundary)
0045 {
0046 geo.move_to_boundary();
0047 sim.step_length(p.distance);
0048 sim.post_step_action(track.boundary_action());
0049 }
0050 else
0051 {
0052 CELER_ASSERT(step == p.distance);
0053 geo.move_internal(step);
0054 }
0055 }
0056
0057
0058 }
0059 }
0060 }