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

Open-Sn / opensn / 18928565313

22 Oct 2025 07:55PM UTC coverage: 74.771%. Remained the same
18928565313

push

github

web-flow
Merge pull request #807 from wdhawkins/clang-tidy-init-variables

Fixing clang-tidy init-variables warnings

132 of 179 new or added lines in 52 files covered. (73.74%)

184 existing lines in 3 files now uncovered.

18203 of 24345 relevant lines covered (74.77%)

53868061.69 hits per line

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

0.0
/modules/linear_boltzmann_solvers/lbs_problem/source_functions/transient_source_function.cc
1
// SPDX-FileCopyrightText: 2024 The OpenSn Authors <https://open-sn.github.io/opensn/>
2
// SPDX-License-Identifier: MIT
3

4
#include "modules/linear_boltzmann_solvers/lbs_problem/source_functions/transient_source_function.h"
5

6
namespace opensn
7
{
8

9
TransientSourceFunction::TransientSourceFunction(const LBSProblem& lbs_problem,
×
10
                                                 double& ref_dt,
11
                                                 SteppingMethod& method)
×
12
  : SourceFunction(lbs_problem), dt_(ref_dt), method_(method)
×
13
{
14
}
×
15

16
double
17
TransientSourceFunction::DelayedFission(const PrecursorList& precursors,
×
18
                                        const double& rho,
19
                                        const std::vector<double>& nu_delayed_sigma_f,
20
                                        const double* phi) const
21
{
22
  const auto& BackwardEuler = SteppingMethod::IMPLICIT_EULER;
×
23
  const auto& CrankNicolson = SteppingMethod::CRANK_NICOLSON;
×
24

NEW
25
  double theta = 0.7;
×
26
  if (method_ == BackwardEuler)
×
27
    theta = 1.0;
28
  else if (method_ == CrankNicolson)
×
29
    theta = 0.5;
×
30

31
  const double eff_dt = theta * dt_;
×
32

33
  double value = 0.0;
×
34
  if (apply_ags_fission_src_)
×
35
    for (size_t gp = first_grp_; gp <= last_grp_; ++gp)
×
UNCOV
36
      if (gp < gs_i_ or gp > gs_f_)
×
37
        for (const auto& precursor : precursors)
×
38
        {
UNCOV
39
          const double coeff = precursor.emission_spectrum[g_] * precursor.decay_constant /
×
40
                               (1.0 + eff_dt * precursor.decay_constant);
×
41

UNCOV
42
          value += coeff * eff_dt * precursor.fractional_yield * rho * nu_delayed_sigma_f[gp] *
×
UNCOV
43
                   phi[gp] / cell_volume_;
×
44
        }
45

46
  if (apply_wgs_fission_src_)
×
UNCOV
47
    for (size_t gp = gs_i_; gp <= gs_f_; ++gp)
×
48
      for (const auto& precursor : precursors)
×
49
      {
UNCOV
50
        const double coeff = precursor.emission_spectrum[g_] * precursor.decay_constant /
×
51
                             (1.0 + eff_dt * precursor.decay_constant);
×
52

UNCOV
53
        value += coeff * eff_dt * precursor.fractional_yield * rho * nu_delayed_sigma_f[gp] *
×
UNCOV
54
                 phi[gp] / cell_volume_;
×
55
      }
56

UNCOV
57
  return value;
×
58
}
59

60
} // namespace opensn
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