• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmc-dev / openmc / 21533365354

30 Jan 2026 10:48PM UTC coverage: 81.979% (-3.2%) from 85.162%
21533365354

Pull #3453

github

web-flow
Merge de22ee16c into 7b4617aff
Pull Request #3453: Secondary energy filter

17272 of 24046 branches covered (71.83%)

Branch coverage included in aggregate %.

50 of 52 new or added lines in 8 files covered. (96.15%)

4544 existing lines in 133 files now uncovered.

55847 of 65146 relevant lines covered (85.73%)

44003337.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

51.56
/src/tallies/filter_delayedgroup.cpp
1
#include "openmc/tallies/filter_delayedgroup.h"
2

3
#include "openmc/error.h"
4
#include "openmc/xml_interface.h"
5

6
namespace openmc {
7

8
void DelayedGroupFilter::from_xml(pugi::xml_node node)
134✔
9
{
10
  auto groups = get_node_array<int>(node, "bins");
134✔
11
  this->set_groups(groups);
134✔
12
}
134✔
13

14
void DelayedGroupFilter::set_groups(span<int> groups)
134✔
15
{
16
  // Clear existing groups
17
  groups_.clear();
134✔
18
  groups_.reserve(groups.size());
134✔
19

20
  // Make sure all the group index values are valid.
21
  // TODO: do these need to be decremented for zero-based indexing?
22
  for (auto group : groups) {
938✔
23
    if (group < 1) {
804!
24
      throw std::invalid_argument {"Encountered delayedgroup bin with index " +
×
25
                                   std::to_string(group) +
×
26
                                   " which is less than 1"};
×
27
    } else if (group > MAX_DELAYED_GROUPS) {
804!
28
      throw std::invalid_argument {
×
29
        "Encountered delayedgroup bin with index " + std::to_string(group) +
×
NEW
30
        " which is greater than MAX_DELAYED_GROUPS (" +
×
31
        std::to_string(MAX_DELAYED_GROUPS) + ")"};
×
32
    }
33
    groups_.push_back(group);
804✔
34
  }
35

36
  n_bins_ = groups_.size();
134✔
37
}
134✔
38

39
void DelayedGroupFilter::get_all_bins(
8,612,549✔
40
  const Particle& p, TallyEstimator estimator, FilterMatch& match) const
41
{
42
  // Note that the bin is set to zero here, but bins outside zero are
43
  // tallied to regardless. This is because that logic has to be handled
44
  // in the scoring code instead where looping over the delayed
45
  // group takes place (tally_scoring.cpp).
46
  match.bins_.push_back(0);
8,612,549✔
47
  match.weights_.push_back(1.0);
8,612,549✔
48
}
8,612,549✔
49

50
void DelayedGroupFilter::to_statepoint(hid_t filter_group) const
99✔
51
{
52
  Filter::to_statepoint(filter_group);
99✔
53
  write_dataset(filter_group, "bins", groups_);
99✔
54
}
99✔
55

56
std::string DelayedGroupFilter::text_label(int bin) const
129,162✔
57
{
58
  return "Delayed Group " + std::to_string(groups_[bin]);
258,324✔
59
}
60

61
} // namespace openmc
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc