File indexing completed on 2026-11-07 10:11:41
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010
0011 #include "corecel/Types.hh"
0012 #include "corecel/sys/ActionGroups.hh"
0013 #include "celeritas/Types.hh"
0014 #include "celeritas/user/ActionTimes.hh"
0015 #include "celeritas/user/StepTimes.hh"
0016
0017 #include "CoreState.hh"
0018
0019 namespace celeritas
0020 {
0021 template<class P, template<MemSpace M> class S>
0022 class ActionGroups;
0023
0024 namespace optical
0025 {
0026 class CoreParams;
0027 template<MemSpace M>
0028 class CoreState;
0029 class CoreStateBase;
0030
0031
0032
0033
0034
0035
0036
0037
0038 class Transporter
0039 {
0040 public:
0041
0042
0043 using CoreStateHost = CoreState<MemSpace::host>;
0044 using CoreStateDevice = CoreState<MemSpace::device>;
0045 using SPConstParams = std::shared_ptr<CoreParams const>;
0046 using SPActionTimes = std::shared_ptr<ActionTimes>;
0047 using SPStepTimes = std::shared_ptr<StepTimes>;
0048 using MapStrDbl = ActionTimes::MapStrDbl;
0049 using VecDbl = StepTimes::VecDbl;
0050
0051
0052 struct Input
0053 {
0054 SPConstParams params;
0055 SPActionTimes action_times;
0056 SPStepTimes step_times;
0057 };
0058
0059 public:
0060
0061 explicit Transporter(Input&&);
0062
0063
0064 void operator()(CoreStateBase&) const;
0065
0066
0067 SPConstParams const& params() const { return input_.params; }
0068
0069
0070 MapStrDbl get_action_times(AuxStateVec const&) const;
0071
0072 MapStrDbl exchange_action_times(AuxStateVec&) const;
0073
0074
0075 VecDbl get_step_times(AuxStateVec const&) const;
0076
0077 VecDbl exchange_step_times(AuxStateVec&) const;
0078
0079 private:
0080
0081
0082 using ActionGroupsT = ActionGroups<CoreParams, CoreState>;
0083 using SPActionGroups = std::shared_ptr<ActionGroupsT>;
0084
0085
0086
0087 Input input_;
0088 SPActionGroups actions_;
0089
0090
0091
0092 template<MemSpace M>
0093 void transport_impl(CoreState<M>&) const;
0094 };
0095
0096
0097 }
0098 }