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

openmc-dev / openmc / 20932149956

12 Jan 2026 07:24PM UTC coverage: 81.996% (-0.2%) from 82.195%
20932149956

Pull #3702

github

web-flow
Merge 80e4cff3d into 0486e433d
Pull Request #3702: Random Ray Kinetic Simulation Mode

17686 of 24568 branches covered (71.99%)

Branch coverage included in aggregate %.

1002 of 1145 new or added lines in 20 files covered. (87.51%)

484 existing lines in 23 files now uncovered.

56448 of 65844 relevant lines covered (85.73%)

52849177.45 hits per line

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

82.07
/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)
56,961,122✔
14
  : negroups_(sr.scalar_flux_old_.size()), material_(&sr.material_),
56,961,122✔
15
    is_small_(&sr.is_small_), n_hits_(&sr.n_hits_),
56,961,122✔
16
    is_linear_(sr.source_gradients_.size() > 0), lock_(&sr.lock_),
113,922,244✔
17
    volume_(&sr.volume_), volume_t_(&sr.volume_t_), volume_sq_(&sr.volume_sq_),
56,961,122✔
18
    volume_sq_t_(&sr.volume_sq_t_), volume_naive_(&sr.volume_naive_),
56,961,122✔
19
    position_recorded_(&sr.position_recorded_),
56,961,122✔
20
    external_source_present_(&sr.external_source_present_),
56,961,122✔
21
    position_(&sr.position_), centroid_(&sr.centroid_),
56,961,122✔
22
    centroid_iteration_(&sr.centroid_iteration_), centroid_t_(&sr.centroid_t_),
56,961,122✔
23
    mom_matrix_(&sr.mom_matrix_), mom_matrix_t_(&sr.mom_matrix_t_),
56,961,122✔
24
    volume_task_(&sr.volume_task_), mesh_(&sr.mesh_),
56,961,122✔
25
    parent_sr_(&sr.parent_sr_), scalar_flux_old_(sr.scalar_flux_old_.data()),
56,961,122✔
26
    scalar_flux_new_(sr.scalar_flux_new_.data()), source_(sr.source_.data()),
56,961,122✔
27
    source_final_(sr.source_.data()),
56,961,122✔
28
    external_source_(sr.external_source_.data()),
56,961,122✔
29
    scalar_flux_final_(sr.scalar_flux_final_.data()),
56,961,122✔
30
    source_gradients_(sr.source_gradients_.data()),
56,961,122✔
31
    flux_moments_old_(sr.flux_moments_old_.data()),
56,961,122✔
32
    flux_moments_new_(sr.flux_moments_new_.data()),
56,961,122✔
33
    flux_moments_t_(sr.flux_moments_t_.data()),
56,961,122✔
34
    tally_task_(sr.tally_task_.data()), phi_prime_(sr.phi_prime_.data()),
56,961,122✔
35
    T1_(sr.T1_.data()),
56,961,122✔
36
    delayed_fission_source_(sr.delayed_fission_source_.data()),
56,961,122✔
37
    precursors_old_(sr.precursors_old_.data()),
56,961,122✔
38
    precursors_new_(sr.precursors_new_.data()),
56,961,122✔
39
    precursors_final_(sr.precursors_final_.data()),
56,961,122✔
40
    scalar_flux_bd_(sr.scalar_flux_bd_.data()),
56,961,122✔
41
    source_bd_(sr.source_bd_.data()), precursors_bd_(sr.precursors_bd_.data()),
56,961,122✔
42
    scalar_flux_rhs_bd_(sr.scalar_flux_rhs_bd_.data()),
56,961,122✔
43
    source_rhs_bd_(sr.source_rhs_bd_.data()),
56,961,122✔
44
    scalar_flux_rhs_bd_2_(sr.scalar_flux_rhs_bd_2_.data()),
56,961,122✔
45
    precursors_rhs_bd_(sr.precursors_rhs_bd_.data()),
56,961,122✔
46
    tally_delay_task_(sr.tally_delay_task_.data())
113,922,244✔
47
{}
56,961,122✔
48

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

64
  scalar_flux_new_.assign(negroups, 0.0);
2,409,747✔
65
  source_.assign(negroups, 0.0);
2,409,747✔
66
  scalar_flux_final_.assign(negroups, 0.0);
2,409,747✔
67

68
  tally_task_.resize(negroups);
2,409,747✔
69
  if (is_linear) {
2,409,747✔
70
    source_gradients_.resize(negroups);
821,062✔
71
    flux_moments_old_.resize(negroups);
821,062✔
72
    flux_moments_new_.resize(negroups);
821,062✔
73
    flux_moments_t_.resize(negroups);
821,062✔
74
  }
75
  if (settings::kinetic_simulation) {
2,409,747✔
76
    scalar_flux_bd_.resize(negroups);
68,662✔
77
    scalar_flux_rhs_bd_.resize(negroups);
68,662✔
78

79
    if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) {
68,662✔
80
      // Time Isotropic arrays
81
      phi_prime_.assign(negroups, 0.0);
64,086✔
82
    } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
4,576!
83
      // Source Derivative Propogation arrays
84
      source_final_.assign(negroups, 0.0);
4,576✔
85

86
      T1_.assign(negroups, 0.0);
4,576✔
87

88
      source_bd_.resize(negroups);
4,576✔
89
      source_rhs_bd_.resize(negroups);
4,576✔
90
      scalar_flux_rhs_bd_2_.resize(negroups);
4,576✔
91
    }
92

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

99
      precursors_bd_.resize(ndgroups);
68,662✔
100
      precursors_rhs_bd_.resize(ndgroups);
68,662✔
101

102
      tally_delay_task_.resize(ndgroups);
68,662✔
103
    }
104
  }
105
}
2,409,747✔
106

107
//==============================================================================
108
// SourceRegionContainer implementation
109
//==============================================================================
110

111
void SourceRegionContainer::push_back(const SourceRegion& sr)
2,308,283✔
112
{
113
  n_source_regions_++;
2,308,283✔
114

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

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

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

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

159
    // Tally tasks
160
    tally_task_.emplace_back(sr.tally_task_[g]);
3,144,986✔
161

162
    // Energy-dependent fields for kinetic simulations
163
    if (settings::kinetic_simulation) {
3,144,986✔
164
      scalar_flux_bd_.push_back(sr.scalar_flux_bd_[g]);
590,304✔
165
      scalar_flux_rhs_bd_.push_back(sr.scalar_flux_rhs_bd_[g]);
590,304✔
166

167
      if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) {
590,304✔
168
        // Time Isotropic arrays
169
        phi_prime_.push_back(sr.phi_prime_[g]);
503,360✔
170
      } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
86,944!
171
        // Source Derivative Propogation arrays
172
        source_final_.push_back(sr.source_final_[g]);
86,944✔
173

174
        T1_.push_back(sr.T1_[g]);
86,944✔
175

176
        source_bd_.push_back(sr.source_bd_[g]);
86,944✔
177
        source_rhs_bd_.push_back(sr.source_rhs_bd_[g]);
86,944✔
178
        scalar_flux_rhs_bd_2_.push_back(sr.scalar_flux_rhs_bd_2_[g]);
86,944✔
179
      }
180
    }
181
  }
182
  // Delay group-dependent fields for kinetic simulations
183
  if (settings::kinetic_simulation && settings::create_delayed_neutrons) {
2,308,283!
184
    for (int dg = 0; dg < ndgroups_; dg++) {
599,456✔
185
      delayed_fission_source_.push_back(sr.delayed_fission_source_[dg]);
530,816✔
186
      precursors_old_.push_back(sr.precursors_old_[dg]);
530,816✔
187
      precursors_new_.push_back(sr.precursors_new_[dg]);
530,816✔
188
      precursors_final_.push_back(sr.precursors_final_[dg]);
530,816✔
189
      tally_delay_task_.emplace_back(sr.tally_delay_task_[dg]);
530,816✔
190

191
      // Backward difference arrays
192
      precursors_bd_.push_back(sr.precursors_bd_[dg]);
530,816✔
193
      precursors_rhs_bd_.push_back(sr.precursors_rhs_bd_[dg]);
530,816✔
194
    }
195
  }
196
}
2,308,283✔
197

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

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

226
  scalar_flux_old_.clear();
×
227
  scalar_flux_new_.clear();
×
228
  scalar_flux_final_.clear();
×
229
  source_.clear();
×
230
  external_source_.clear();
×
231

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

239
  tally_task_.clear();
×
240
  volume_task_.clear();
×
241

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

NEW
247
    if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) {
×
NEW
248
      phi_prime_.clear();
×
NEW
249
    } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
×
NEW
250
      source_final_.clear();
×
251

NEW
252
      T1_.clear();
×
253

NEW
254
      source_bd_.clear();
×
NEW
255
      source_rhs_bd_.clear();
×
NEW
256
      scalar_flux_rhs_bd_2_.clear();
×
257
    }
258

NEW
259
    if (settings::create_delayed_neutrons) {
×
NEW
260
      precursors_bd_.clear();
×
NEW
261
      precursors_rhs_bd_.clear();
×
262

NEW
263
      delayed_fission_source_.clear();
×
NEW
264
      precursors_old_.clear();
×
NEW
265
      precursors_new_.clear();
×
NEW
266
      precursors_final_.clear();
×
NEW
267
      tally_delay_task_.clear();
×
268
    }
269
  }
270

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

277
void SourceRegionContainer::flux_swap()
143,012✔
278
{
279
  scalar_flux_old_.swap(scalar_flux_new_);
143,012✔
280
  if (is_linear_) {
143,012✔
281
    flux_moments_old_.swap(flux_moments_new_);
6,875✔
282
  }
283
}
143,012✔
284

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

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

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

332
    if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) {
2,147,483,647✔
333
      handle.phi_prime_ = &phi_prime(sr, 0);
2,147,483,647✔
334
    } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
550,388,861!
335
      handle.source_final_ = &source_final(sr, 0);
550,388,861✔
336

337
      handle.T1_ = &T1(sr, 0);
550,388,861✔
338

339
      handle.source_bd_ = &source_bd(sr, 0);
550,388,861✔
340
      handle.source_rhs_bd_ = &source_rhs_bd(sr, 0);
550,388,861✔
341
      handle.scalar_flux_rhs_bd_2_ = &scalar_flux_rhs_bd_2(sr, 0);
550,388,861✔
342
    }
343

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

350
      handle.precursors_bd_ = &precursors_bd(sr, 0);
2,147,483,647✔
351
      handle.precursors_rhs_bd_ = &precursors_rhs_bd(sr, 0);
2,147,483,647✔
352

353
      handle.tally_delay_task_ = &tally_delay_task(sr, 0);
2,147,483,647✔
354
    }
355
  }
356

357
  return handle;
2,147,483,647✔
358
}
359

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

405
    // BD Vectors
406
    std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0);
960✔
407

408
    if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) {
960✔
409
      std::fill(phi_prime_.begin(), phi_prime_.end(), 0.0);
640✔
410
    } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) {
320!
411
      std::fill(T1_.begin(), T1_.end(), 0.0);
320✔
412

413
      std::fill(source_rhs_bd_.begin(), source_rhs_bd_.end(), 0.0);
320✔
414
      std::fill(
320✔
415
        scalar_flux_rhs_bd_2_.begin(), scalar_flux_rhs_bd_2_.end(), 0.0);
640✔
416
    }
417
  }
418
}
1,233✔
419

420
//-----------------------------------------------------------------------------
421
// Methods for kinetic simulations
422

423
void SourceRegionContainer::precursors_swap()
130,900✔
424
{
425
  precursors_old_.swap(precursors_new_);
130,900✔
426
}
130,900✔
427

428
void SourceRegionContainer::time_step_reset()
1,152✔
429
{
430
  std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0);
1,152✔
431
  std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0);
1,152✔
432
  if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION)
1,152✔
433
    std::fill(source_final_.begin(), source_final_.end(), 0.0);
384✔
434
}
1,152✔
435

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