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

openmc-dev / openmc / 12659257633

07 Jan 2025 09:02PM UTC coverage: 84.867% (+0.04%) from 84.823%
12659257633

Pull #2655

github

web-flow
Merge 6280602de into 393334829
Pull Request #2655: Raytrace plots

373 of 413 new or added lines in 4 files covered. (90.31%)

414 existing lines in 5 files now uncovered.

50068 of 58996 relevant lines covered (84.87%)

35067219.93 hits per line

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

91.84
/src/particle_data.cpp
1
#include "openmc/particle_data.h"
2

3
#include <sstream>
4

5
#include "openmc/cell.h"
6
#include "openmc/error.h"
7
#include "openmc/geometry.h"
8
#include "openmc/material.h"
9
#include "openmc/nuclide.h"
10
#include "openmc/photon.h"
11
#include "openmc/settings.h"
12
#include "openmc/tallies/derivative.h"
13
#include "openmc/tallies/filter.h"
14
#include "openmc/tallies/tally.h"
15

16
namespace openmc {
17

NEW
18
void GeometryState::mark_as_lost(const char* message)
×
19
{
NEW
20
  fatal_error(message);
×
21
}
22

23
void GeometryState::mark_as_lost(const std::string& message)
6,792✔
24
{
25
  mark_as_lost(message.c_str());
6,792✔
26
}
6,781✔
27

28
void GeometryState::mark_as_lost(const std::stringstream& message)
×
29
{
30
  mark_as_lost(message.str());
×
31
}
32

33
void LocalCoord::rotate(const vector<double>& rotation)
3,006,107✔
34
{
35
  r = r.rotate(rotation);
3,006,107✔
36
  u = u.rotate(rotation);
3,006,107✔
37
  rotated = true;
3,006,107✔
38
}
3,006,107✔
39

40
void LocalCoord::reset()
1,244,895,188✔
41
{
42
  cell = C_NONE;
1,244,895,188✔
43
  universe = C_NONE;
1,244,895,188✔
44
  lattice = C_NONE;
1,244,895,188✔
45
  lattice_i[0] = 0;
1,244,895,188✔
46
  lattice_i[1] = 0;
1,244,895,188✔
47
  lattice_i[2] = 0;
1,244,895,188✔
48
  rotated = false;
1,244,895,188✔
49
}
1,244,895,188✔
50

51
GeometryState::GeometryState()
177,987,322✔
52
{
53
  // Create and clear coordinate levels
54
  coord_.resize(model::n_coord_levels);
177,987,322✔
55
  cell_last_.resize(model::n_coord_levels);
177,987,322✔
56
  clear();
177,987,322✔
57
}
177,987,322✔
58

59
ParticleData::ParticleData()
152,337,440✔
60
{
61
  zero_delayed_bank();
152,337,440✔
62

63
  // Every particle starts with no accumulated flux derivative.  Note that in
64
  // event mode, we construct the particle once up front, so have to run this
65
  // even if the current batch is inactive.
66
  if (!model::active_tallies.empty() || settings::event_based) {
152,337,440✔
67
    flux_derivs_.resize(model::tally_derivs.size());
30,468,352✔
68
    zero_flux_derivs();
30,468,352✔
69
  }
70

71
  // Allocate space for tally filter matches
72
  filter_matches_.resize(model::tally_filters.size());
152,337,440✔
73

74
  // Create microscopic cross section caches
75
  neutron_xs_.resize(data::nuclides.size());
152,337,440✔
76
  photon_xs_.resize(data::elements.size());
152,337,440✔
77

78
  // Creates the pulse-height storage for the particle
79
  if (!model::pulse_height_cells.empty()) {
152,337,440✔
80
    pht_storage_.resize(model::pulse_height_cells.size(), 0.0);
5,700✔
81
  }
82
}
152,337,440✔
83

84
TrackState ParticleData::get_track_state() const
19,895✔
85
{
86
  TrackState state;
19,895✔
87
  state.r = this->r();
19,895✔
88
  state.u = this->u();
19,895✔
89
  state.E = this->E();
19,895✔
90
  state.time = this->time();
19,895✔
91
  state.wgt = this->wgt();
19,895✔
92
  state.cell_id = model::cells[this->lowest_coord().cell]->id_;
19,895✔
93
  state.cell_instance = this->cell_instance();
19,895✔
94
  if (this->material() != MATERIAL_VOID) {
19,895✔
95
    state.material_id = model::materials[material()]->id_;
19,895✔
96
  }
97
  return state;
19,895✔
98
}
99

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

© 2025 Coveralls, Inc