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

openmc-dev / openmc / 20698018026

04 Jan 2026 07:31PM UTC coverage: 81.948% (-0.2%) from 82.174%
20698018026

Pull #3702

github

web-flow
Merge 08bff5d91 into 9c91bddf0
Pull Request #3702: Random Ray Kinetic Simulation Mode

17559 of 24377 branches covered (72.03%)

Branch coverage included in aggregate %.

885 of 1122 new or added lines in 19 files covered. (78.88%)

403 existing lines in 14 files now uncovered.

55921 of 65290 relevant lines covered (85.65%)

50692989.71 hits per line

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

71.63
/src/random_ray/source_region.cpp
1
#include "openmc/random_ray/source_region.h"
2
#include "openmc/random_ray/random_ray.h"
3

4
#include "openmc/error.h"
5
#include "openmc/message_passing.h"
6
#include "openmc/simulation.h"
7

8
namespace openmc {
9

10
//==============================================================================
11
// SourceRegionHandle implementation
12
//==============================================================================
13
SourceRegionHandle::SourceRegionHandle(SourceRegion& sr)
47,967,786✔
14
  : negroups_(sr.scalar_flux_old_.size()), material_(&sr.material_),
47,967,786✔
15
    is_small_(&sr.is_small_), n_hits_(&sr.n_hits_),
47,967,786✔
16
    is_linear_(sr.source_gradients_.size() > 0), lock_(&sr.lock_),
95,935,572✔
17
    volume_(&sr.volume_), volume_t_(&sr.volume_t_), volume_sq_(&sr.volume_sq_),
47,967,786✔
18
    volume_sq_t_(&sr.volume_sq_t_), volume_naive_(&sr.volume_naive_),
47,967,786✔
19
    position_recorded_(&sr.position_recorded_),
47,967,786✔
20
    external_source_present_(&sr.external_source_present_),
47,967,786✔
21
    position_(&sr.position_), centroid_(&sr.centroid_),
47,967,786✔
22
    centroid_iteration_(&sr.centroid_iteration_), centroid_t_(&sr.centroid_t_),
47,967,786✔
23
    mom_matrix_(&sr.mom_matrix_), mom_matrix_t_(&sr.mom_matrix_t_),
47,967,786✔
24
    volume_task_(&sr.volume_task_), mesh_(&sr.mesh_),
47,967,786✔
25
    parent_sr_(&sr.parent_sr_), scalar_flux_old_(sr.scalar_flux_old_.data()),
47,967,786✔
26
    scalar_flux_new_(sr.scalar_flux_new_.data()), source_(sr.source_.data()),
47,967,786✔
27
    source_final_(sr.source_.data()),
47,967,786✔
28
    external_source_(sr.external_source_.data()),
47,967,786✔
29
    scalar_flux_final_(sr.scalar_flux_final_.data()),
47,967,786✔
30
    source_gradients_(sr.source_gradients_.data()),
47,967,786✔
31
    flux_moments_old_(sr.flux_moments_old_.data()),
47,967,786✔
32
    flux_moments_new_(sr.flux_moments_new_.data()),
47,967,786✔
33
    flux_moments_t_(sr.flux_moments_t_.data()),
47,967,786✔
34
    tally_task_(sr.tally_task_.data()),
47,967,786✔
35
    source_time_derivative_(sr.source_time_derivative_.data()),
47,967,786✔
36
    scalar_flux_time_derivative_2_(sr.scalar_flux_time_derivative_2_.data()),
47,967,786✔
37
    delayed_fission_source_(sr.delayed_fission_source_.data()),
47,967,786✔
38
    precursors_old_(sr.precursors_old_.data()),
47,967,786✔
39
    precursors_new_(sr.precursors_new_.data()),
47,967,786✔
40
    precursors_final_(sr.precursors_final_.data()),
47,967,786✔
41
    scalar_flux_bd_(sr.scalar_flux_bd_.data()),
47,967,786✔
42
    source_bd_(sr.source_bd_.data()), precursors_bd_(sr.precursors_bd_.data()),
47,967,786✔
43
    scalar_flux_rhs_bd_(sr.scalar_flux_rhs_bd_.data()),
47,967,786✔
44
    source_rhs_bd_(sr.source_rhs_bd_.data()),
47,967,786✔
45
    scalar_flux_rhs_bd_2_(sr.scalar_flux_rhs_bd_2_.data()),
47,967,786✔
46
    precursors_rhs_bd_(sr.precursors_rhs_bd_.data()),
47,967,786✔
47
    tally_delay_task_(sr.tally_delay_task_.data())
95,935,572✔
48
{}
47,967,786✔
49

50
//==============================================================================
51
// SourceRegion implementation
52
//==============================================================================
53
SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear)
2,375,944✔
54
{
55
  if (settings::run_mode == RunMode::EIGENVALUE) {
2,375,944✔
56
    // If in eigenvalue mode, set starting flux to guess of 1
57
    scalar_flux_old_.assign(negroups, 1.0);
84,194✔
58
  } else {
59
    // If in fixed source mode, set starting flux to guess of zero
60
    // and initialize external source arrays
61
    scalar_flux_old_.assign(negroups, 0.0);
2,291,750✔
62
    external_source_.assign(negroups, 0.0);
2,291,750✔
63
  }
64

65
  scalar_flux_new_.assign(negroups, 0.0);
2,375,944✔
66
  source_.assign(negroups, 0.0);
2,375,944✔
67
  scalar_flux_final_.assign(negroups, 0.0);
2,375,944✔
68

69
  tally_task_.resize(negroups);
2,375,944✔
70
  if (is_linear) {
2,375,944✔
71
    source_gradients_.resize(negroups);
821,062✔
72
    flux_moments_old_.resize(negroups);
821,062✔
73
    flux_moments_new_.resize(negroups);
821,062✔
74
    flux_moments_t_.resize(negroups);
821,062✔
75
  }
76
  if (settings::kinetic_simulation) {
2,375,944✔
77
    scalar_flux_bd_.resize(negroups);
34,859✔
78
    scalar_flux_rhs_bd_.resize(negroups);
34,859✔
79

80
    // Source Derivative Propogation arrays
81
    if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
34,859!
NEW
82
      source_final_.assign(negroups, 0.0);
×
83

NEW
84
      source_time_derivative_.assign(negroups, 0.0);
×
NEW
85
      scalar_flux_time_derivative_2_.assign(negroups, 0.0);
×
86

NEW
87
      source_bd_.resize(negroups);
×
NEW
88
      source_rhs_bd_.resize(negroups);
×
NEW
89
      scalar_flux_rhs_bd_2_.resize(negroups);
×
90
    }
91

92
    if (settings::create_delayed_neutrons) {
34,859!
93
      delayed_fission_source_.assign(ndgroups, 0.0);
34,859✔
94
      precursors_old_.assign(ndgroups, 0.0);
34,859✔
95
      precursors_new_.assign(ndgroups, 0.0);
34,859✔
96
      precursors_final_.assign(ndgroups, 0.0);
34,859✔
97

98
      precursors_bd_.resize(ndgroups);
34,859✔
99
      precursors_rhs_bd_.resize(ndgroups);
34,859✔
100

101
      tally_delay_task_.resize(ndgroups);
34,859✔
102
    }
103
  }
104
}
2,375,944✔
105

106
//==============================================================================
107
// SourceRegionContainer implementation
108
//==============================================================================
109

110
void SourceRegionContainer::push_back(const SourceRegion& sr)
2,274,491✔
111
{
112
  n_source_regions_++;
2,274,491✔
113

114
  // Scalar fields
115
  material_.push_back(sr.material_);
2,274,491✔
116
  is_small_.push_back(sr.is_small_);
2,274,491✔
117
  n_hits_.push_back(sr.n_hits_);
2,274,491✔
118
  lock_.push_back(sr.lock_);
2,274,491✔
119
  volume_.push_back(sr.volume_);
2,274,491✔
120
  volume_t_.push_back(sr.volume_t_);
2,274,491✔
121
  volume_sq_.push_back(sr.volume_sq_);
2,274,491✔
122
  volume_sq_t_.push_back(sr.volume_sq_t_);
2,274,491✔
123
  volume_naive_.push_back(sr.volume_naive_);
2,274,491✔
124
  position_recorded_.push_back(sr.position_recorded_);
2,274,491✔
125
  external_source_present_.push_back(sr.external_source_present_);
2,274,491✔
126
  position_.push_back(sr.position_);
2,274,491✔
127
  volume_task_.push_back(sr.volume_task_);
2,274,491✔
128
  mesh_.push_back(sr.mesh_);
2,274,491✔
129
  parent_sr_.push_back(sr.parent_sr_);
2,274,491✔
130

131
  // Only store these fields if is_linear_ is true
132
  if (is_linear_) {
2,274,491✔
133
    centroid_.push_back(sr.centroid_);
787,908✔
134
    centroid_iteration_.push_back(sr.centroid_iteration_);
787,908✔
135
    centroid_t_.push_back(sr.centroid_t_);
787,908✔
136
    mom_matrix_.push_back(sr.mom_matrix_);
787,908✔
137
    mom_matrix_t_.push_back(sr.mom_matrix_t_);
787,908✔
138
  }
139

140
  // Energy-dependent fields
141
  for (int g = 0; g < negroups_; ++g) {
5,128,021✔
142
    scalar_flux_old_.push_back(sr.scalar_flux_old_[g]);
2,853,530✔
143
    scalar_flux_new_.push_back(sr.scalar_flux_new_[g]);
2,853,530✔
144
    scalar_flux_final_.push_back(sr.scalar_flux_final_[g]);
2,853,530✔
145
    source_.push_back(sr.source_[g]);
2,853,530✔
146
    if (settings::run_mode == RunMode::FIXED_SOURCE) {
2,853,530✔
147
      external_source_.push_back(sr.external_source_[g]);
2,236,342✔
148
    }
149

150
    // Only store these fields if is_linear_ is true
151
    if (is_linear_) {
2,853,530✔
152
      source_gradients_.push_back(sr.source_gradients_[g]);
856,284✔
153
      flux_moments_old_.push_back(sr.flux_moments_old_[g]);
856,284✔
154
      flux_moments_new_.push_back(sr.flux_moments_new_[g]);
856,284✔
155
      flux_moments_t_.push_back(sr.flux_moments_t_[g]);
856,284✔
156
    }
157

158
    // Tally tasks
159
    tally_task_.emplace_back(sr.tally_task_[g]);
2,853,530✔
160

161
    // Energy-dependent fields for kinetic simulations
162
    if (settings::kinetic_simulation) {
2,853,530✔
163
      scalar_flux_bd_.push_back(sr.scalar_flux_bd_[g]);
298,848✔
164
      scalar_flux_rhs_bd_.push_back(sr.scalar_flux_rhs_bd_[g]);
298,848✔
165

166
      // Source Derivative Propogation arrays
167
      if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
298,848!
NEW
168
        source_final_.push_back(sr.source_final_[g]);
×
169

NEW
170
        source_time_derivative_.push_back(sr.source_time_derivative_[g]);
×
NEW
171
        scalar_flux_time_derivative_2_.push_back(
×
NEW
172
          sr.scalar_flux_time_derivative_2_[g]);
×
173

NEW
174
        source_bd_.push_back(sr.source_bd_[g]);
×
NEW
175
        source_rhs_bd_.push_back(sr.source_rhs_bd_[g]);
×
NEW
176
        scalar_flux_rhs_bd_2_.push_back(sr.scalar_flux_rhs_bd_2_[g]);
×
177
      }
178
    }
179
  }
180
  // Delay group-dependent fields for kinetic simulations
181
  if (settings::kinetic_simulation && settings::create_delayed_neutrons) {
2,274,491!
182
    for (int dg = 0; dg < ndgroups_; dg++) {
304,480✔
183
      delayed_fission_source_.push_back(sr.delayed_fission_source_[dg]);
269,632✔
184
      precursors_old_.push_back(sr.precursors_old_[dg]);
269,632✔
185
      precursors_new_.push_back(sr.precursors_new_[dg]);
269,632✔
186
      precursors_final_.push_back(sr.precursors_final_[dg]);
269,632✔
187
      tally_delay_task_.emplace_back(sr.tally_delay_task_[dg]);
269,632✔
188

189
      // Backward difference arrays
190
      precursors_bd_.push_back(sr.precursors_bd_[dg]);
269,632✔
191
      precursors_rhs_bd_.push_back(sr.precursors_rhs_bd_[dg]);
269,632✔
192
    }
193
  }
194
}
2,274,491✔
195

196
void SourceRegionContainer::assign(
×
197
  int n_source_regions, const SourceRegion& source_region)
198
{
199
  // Clear existing data
200
  n_source_regions_ = 0;
×
201
  material_.clear();
×
202
  is_small_.clear();
×
203
  n_hits_.clear();
×
204
  lock_.clear();
×
205
  volume_.clear();
×
206
  volume_t_.clear();
×
207
  volume_sq_.clear();
×
208
  volume_sq_t_.clear();
×
209
  volume_naive_.clear();
×
210
  position_recorded_.clear();
×
211
  external_source_present_.clear();
×
212
  position_.clear();
×
213
  mesh_.clear();
×
214
  parent_sr_.clear();
×
215

216
  if (is_linear_) {
×
217
    centroid_.clear();
×
218
    centroid_iteration_.clear();
×
219
    centroid_t_.clear();
×
220
    mom_matrix_.clear();
×
221
    mom_matrix_t_.clear();
×
222
  }
223

224
  scalar_flux_old_.clear();
×
225
  scalar_flux_new_.clear();
×
226
  scalar_flux_final_.clear();
×
227
  source_.clear();
×
228
  external_source_.clear();
×
229

230
  if (is_linear_) {
×
231
    source_gradients_.clear();
×
232
    flux_moments_old_.clear();
×
233
    flux_moments_new_.clear();
×
234
    flux_moments_t_.clear();
×
235
  }
236

237
  tally_task_.clear();
×
238
  volume_task_.clear();
×
239

240
  // Clear existing data for kinetic simulatons
NEW
241
  if (settings::kinetic_simulation) {
×
NEW
242
    scalar_flux_bd_.clear();
×
NEW
243
    scalar_flux_rhs_bd_.clear();
×
244

NEW
245
    if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
×
NEW
246
      source_final_.clear();
×
247

NEW
248
      source_time_derivative_.clear();
×
NEW
249
      scalar_flux_time_derivative_2_.clear();
×
250

NEW
251
      source_bd_.clear();
×
NEW
252
      source_rhs_bd_.clear();
×
NEW
253
      scalar_flux_rhs_bd_2_.clear();
×
254
    }
255

NEW
256
    if (settings::create_delayed_neutrons) {
×
NEW
257
      precursors_bd_.clear();
×
NEW
258
      precursors_rhs_bd_.clear();
×
259

NEW
260
      delayed_fission_source_.clear();
×
NEW
261
      precursors_old_.clear();
×
NEW
262
      precursors_new_.clear();
×
NEW
263
      precursors_final_.clear();
×
NEW
264
      tally_delay_task_.clear();
×
265
    }
266
  }
267

268
  // Fill with copies of source_region
269
  for (int i = 0; i < n_source_regions; ++i) {
×
270
    push_back(source_region);
×
271
  }
272
}
×
273

274
void SourceRegionContainer::flux_swap()
108,362✔
275
{
276
  scalar_flux_old_.swap(scalar_flux_new_);
108,362✔
277
  if (is_linear_) {
108,362✔
278
    flux_moments_old_.swap(flux_moments_new_);
6,875✔
279
  }
280
}
108,362✔
281

282
SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr)
2,147,483,647✔
283
{
284
  SourceRegionHandle handle;
2,147,483,647✔
285
  handle.negroups_ = negroups();
2,147,483,647✔
286
  handle.material_ = &material(sr);
2,147,483,647✔
287
  handle.is_small_ = &is_small(sr);
2,147,483,647✔
288
  handle.n_hits_ = &n_hits(sr);
2,147,483,647✔
289
  handle.is_linear_ = is_linear();
2,147,483,647✔
290
  handle.lock_ = &lock(sr);
2,147,483,647✔
291
  handle.volume_ = &volume(sr);
2,147,483,647✔
292
  handle.volume_t_ = &volume_t(sr);
2,147,483,647✔
293
  handle.volume_sq_ = &volume_sq(sr);
2,147,483,647✔
294
  handle.volume_sq_t_ = &volume_sq_t(sr);
2,147,483,647✔
295
  handle.volume_naive_ = &volume_naive(sr);
2,147,483,647✔
296
  handle.position_recorded_ = &position_recorded(sr);
2,147,483,647✔
297
  handle.external_source_present_ = &external_source_present(sr);
2,147,483,647✔
298
  handle.position_ = &position(sr);
2,147,483,647✔
299
  handle.volume_task_ = &volume_task(sr);
2,147,483,647✔
300
  handle.mesh_ = &mesh(sr);
2,147,483,647✔
301
  handle.parent_sr_ = &parent_sr(sr);
2,147,483,647✔
302
  handle.scalar_flux_old_ = &scalar_flux_old(sr, 0);
2,147,483,647✔
303
  handle.scalar_flux_new_ = &scalar_flux_new(sr, 0);
2,147,483,647✔
304
  handle.source_ = &source(sr, 0);
2,147,483,647✔
305
  if (settings::run_mode == RunMode::FIXED_SOURCE) {
2,147,483,647✔
306
    handle.external_source_ = &external_source(sr, 0);
1,089,982,737✔
307
  } else {
308
    handle.external_source_ = nullptr;
2,147,483,647✔
309
  }
310
  handle.scalar_flux_final_ = &scalar_flux_final(sr, 0);
2,147,483,647✔
311
  handle.tally_task_ = &tally_task(sr, 0);
2,147,483,647✔
312

313
  if (handle.is_linear_) {
2,147,483,647✔
314
    handle.centroid_ = &centroid(sr);
649,737,011✔
315
    handle.centroid_iteration_ = &centroid_iteration(sr);
649,737,011✔
316
    handle.centroid_t_ = &centroid_t(sr);
649,737,011✔
317
    handle.mom_matrix_ = &mom_matrix(sr);
649,737,011✔
318
    handle.mom_matrix_t_ = &mom_matrix_t(sr);
649,737,011✔
319
    handle.source_gradients_ = &source_gradients(sr, 0);
649,737,011✔
320
    handle.flux_moments_old_ = &flux_moments_old(sr, 0);
649,737,011✔
321
    handle.flux_moments_new_ = &flux_moments_new(sr, 0);
649,737,011✔
322
    handle.flux_moments_t_ = &flux_moments_t(sr, 0);
649,737,011✔
323
  }
324

325
  if (settings::kinetic_simulation) {
2,147,483,647✔
326
    handle.scalar_flux_bd_ = &scalar_flux_bd(sr, 0);
2,147,483,647✔
327
    handle.scalar_flux_rhs_bd_ = &scalar_flux_rhs_bd(sr, 0);
2,147,483,647✔
328

329
    if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
2,147,483,647!
NEW
330
      handle.source_final_ = &source_final(sr, 0);
×
331

NEW
332
      handle.source_time_derivative_ = &source_time_derivative(sr, 0);
×
NEW
333
      handle.scalar_flux_time_derivative_2_ =
×
NEW
334
        &scalar_flux_time_derivative_2(sr, 0);
×
335

NEW
336
      handle.source_bd_ = &source_bd(sr, 0);
×
NEW
337
      handle.source_rhs_bd_ = &source_rhs_bd(sr, 0);
×
NEW
338
      handle.scalar_flux_rhs_bd_2_ = &scalar_flux_rhs_bd_2(sr, 0);
×
339
    }
340

341
    if (settings::create_delayed_neutrons) {
2,147,483,647!
342
      handle.delayed_fission_source_ = &delayed_fission_source(sr, 0);
2,147,483,647✔
343
      handle.precursors_old_ = &precursors_old(sr, 0);
2,147,483,647✔
344
      handle.precursors_new_ = &precursors_new(sr, 0);
2,147,483,647✔
345
      handle.precursors_final_ = &precursors_final(sr, 0);
2,147,483,647✔
346

347
      handle.precursors_bd_ = &precursors_bd(sr, 0);
2,147,483,647✔
348
      handle.precursors_rhs_bd_ = &precursors_rhs_bd(sr, 0);
2,147,483,647✔
349

350
      handle.tally_delay_task_ = &tally_delay_task(sr, 0);
2,147,483,647✔
351
    }
352
  }
353

354
  return handle;
2,147,483,647✔
355
}
356

357
void SourceRegionContainer::adjoint_reset()
753✔
358
{
359
  std::fill(n_hits_.begin(), n_hits_.end(), 0);
753✔
360
  std::fill(volume_.begin(), volume_.end(), 0.0);
753✔
361
  std::fill(volume_t_.begin(), volume_t_.end(), 0.0);
753✔
362
  std::fill(volume_sq_.begin(), volume_sq_.end(), 0.0);
753✔
363
  std::fill(volume_sq_t_.begin(), volume_sq_t_.end(), 0.0);
753✔
364
  std::fill(volume_naive_.begin(), volume_naive_.end(), 0.0);
753✔
365
  std::fill(
753✔
366
    external_source_present_.begin(), external_source_present_.end(), 0);
753✔
367
  std::fill(external_source_.begin(), external_source_.end(), 0.0);
753✔
368
  std::fill(centroid_.begin(), centroid_.end(), Position {0.0, 0.0, 0.0});
753✔
369
  std::fill(centroid_iteration_.begin(), centroid_iteration_.end(),
753✔
370
    Position {0.0, 0.0, 0.0});
753✔
371
  std::fill(centroid_t_.begin(), centroid_t_.end(), Position {0.0, 0.0, 0.0});
753✔
372
  std::fill(mom_matrix_.begin(), mom_matrix_.end(),
753✔
373
    MomentMatrix {0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
753✔
374
  std::fill(mom_matrix_t_.begin(), mom_matrix_t_.end(),
753✔
375
    MomentMatrix {0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
753✔
376
  if (settings::run_mode == RunMode::FIXED_SOURCE) {
753✔
377
    std::fill(scalar_flux_old_.begin(), scalar_flux_old_.end(), 0.0);
65✔
378
  } else {
379
    std::fill(scalar_flux_old_.begin(), scalar_flux_old_.end(), 1.0);
688✔
380
  }
381
  std::fill(scalar_flux_new_.begin(), scalar_flux_new_.end(), 0.0);
753✔
382
  std::fill(source_.begin(), source_.end(), 0.0f);
753✔
383
  std::fill(external_source_.begin(), external_source_.end(), 0.0f);
753✔
384
  std::fill(source_gradients_.begin(), source_gradients_.end(),
753✔
385
    MomentArray {0.0, 0.0, 0.0});
753✔
386
  std::fill(flux_moments_old_.begin(), flux_moments_old_.end(),
753✔
387
    MomentArray {0.0, 0.0, 0.0});
753✔
388
  std::fill(flux_moments_new_.begin(), flux_moments_new_.end(),
753✔
389
    MomentArray {0.0, 0.0, 0.0});
753✔
390
  std::fill(flux_moments_t_.begin(), flux_moments_t_.end(),
753✔
391
    MomentArray {0.0, 0.0, 0.0});
753✔
392
  // Reset arrays for kinetic adjoint simulations
393
  if (settings::kinetic_simulation && !simulation::is_initial_condition) {
753✔
394
    if (settings::create_delayed_neutrons) {
560!
395
      std::fill(
560✔
396
        delayed_fission_source_.begin(), delayed_fission_source_.end(), 0.0);
560✔
397
      std::fill(precursors_old_.begin(), precursors_old_.end(), 0.0);
560✔
398
      std::fill(precursors_new_.begin(), precursors_new_.end(), 0.0);
560✔
399
      std::fill(precursors_rhs_bd_.begin(), precursors_rhs_bd_.end(), 0.0);
560✔
400
    }
401

402
    // BD Vectors
403
    std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0);
560✔
404

405
    if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
560!
NEW
406
      std::fill(
×
NEW
407
        source_time_derivative_.begin(), source_time_derivative_.end(), 0.0);
×
NEW
408
      std::fill(scalar_flux_time_derivative_2_.begin(),
×
NEW
409
        scalar_flux_time_derivative_2_.end(), 0.0);
×
410

NEW
411
      std::fill(source_rhs_bd_.begin(), source_rhs_bd_.end(), 0.0);
×
NEW
412
      std::fill(
×
NEW
413
        scalar_flux_rhs_bd_2_.begin(), scalar_flux_rhs_bd_2_.end(), 0.0);
×
414
    }
415
  }
416
}
753✔
417

418
//-----------------------------------------------------------------------------
419
// Methods for kinetic simulations
420

421
void SourceRegionContainer::precursors_swap()
96,250✔
422
{
423
  precursors_old_.swap(precursors_new_);
96,250✔
424
}
96,250✔
425

426
void SourceRegionContainer::time_step_reset()
672✔
427
{
428
  std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0);
672✔
429
  std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0);
672✔
430
}
672✔
431

432
} // 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