File indexing completed on 2025-09-18 09:09:17
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010 #include <vector>
0011
0012 #include "corecel/data/StreamStore.hh"
0013 #include "corecel/io/OutputInterface.hh"
0014 #include "celeritas/global/ActionInterface.hh"
0015 #include "celeritas/global/CoreTrackData.hh"
0016
0017 #include "ParticleTallyData.hh"
0018
0019 namespace celeritas
0020 {
0021
0022 class ParticleParams;
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 class StepDiagnostic final : public CoreStepActionInterface,
0033 public OutputInterface
0034 {
0035 public:
0036
0037
0038 using SPConstParticle = std::shared_ptr<ParticleParams const>;
0039 using VecVecCount = std::vector<std::vector<size_type>>;
0040
0041
0042 public:
0043
0044 static std::shared_ptr<StepDiagnostic>
0045 make_and_insert(CoreParams const& core, size_type max_bins);
0046
0047
0048 StepDiagnostic(ActionId id,
0049 SPConstParticle particle,
0050 size_type max_bins,
0051 size_type num_streams);
0052
0053
0054 ~StepDiagnostic() final;
0055
0056
0057
0058
0059
0060 void step(CoreParams const&, CoreStateHost&) const final;
0061
0062 void step(CoreParams const&, CoreStateDevice&) const final;
0063
0064 ActionId action_id() const final { return id_; }
0065
0066 std::string_view label() const final { return "step-diagnostic"; }
0067
0068 std::string_view description() const final;
0069
0070 StepActionOrder order() const final { return StepActionOrder::user_post; }
0071
0072
0073
0074
0075
0076
0077 Category category() const final { return Category::result; }
0078
0079 void output(JsonPimpl*) const final;
0080
0081
0082
0083 VecVecCount calc_steps() const;
0084
0085
0086 size_type state_size() const;
0087
0088
0089 void clear();
0090
0091 private:
0092 using StoreT = StreamStore<ParticleTallyParamsData, ParticleTallyStateData>;
0093
0094 ActionId id_;
0095 size_type num_streams_;
0096 mutable StoreT store_;
0097 };
0098
0099
0100 }