Get rid of ERROR_INT and use 0 for "no surface"

This commit is contained in:
Paul Romano 2019-03-14 14:47:42 -05:00
parent 492d984525
commit 0fbe024e11
3 changed files with 4 additions and 6 deletions

View file

@ -403,8 +403,6 @@ constexpr int LEAKAGE {3};
// Miscellaneous
constexpr int C_NONE {-1};
constexpr int F90_NONE {0}; //TODO: replace usage of this with C_NONE
constexpr int ERROR_INT {-2147483647}; // TODO: use <numeric_limits> when F90
// interop is gone
// Interpolation rules
enum class Interpolation {

View file

@ -191,7 +191,7 @@ extern "C" void print_particle(Particle* p)
}
// Display miscellaneous info.
if (p->surface_ != ERROR_INT) {
if (p->surface_ != 0) {
const Surface& surf {*model::surfaces[std::abs(p->surface_)-1]};
std::cout << " Surface = " << std::copysign(surf.id_, p->surface_) << "\n";
}

View file

@ -259,7 +259,7 @@ Particle::transport()
if (lattice_translation[0] != 0 || lattice_translation[1] != 0 ||
lattice_translation[2] != 0) {
// Particle crosses lattice boundary
surface_ = ERROR_INT;
surface_ = 0;
cross_lattice(this, lattice_translation);
event_ = EVENT_LATTICE;
} else {
@ -291,7 +291,7 @@ Particle::transport()
score_surface_tally(this, model::active_meshsurf_tallies);
// Clear surface component
surface_ = ERROR_INT;
surface_ = 0;
if (settings::run_CE) {
collision(this);
@ -556,7 +556,7 @@ Particle::cross_surface()
// COULDN'T FIND PARTICLE IN NEIGHBORING CELLS, SEARCH ALL CELLS
// Remove lower coordinate levels and assignment of surface
surface_ = ERROR_INT;
surface_ = 0;
n_coord_ = 1;
bool found = find_cell(this, false);