From 0fbe024e11c373e985fd5220353e57bdbca8c2dc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 14 Mar 2019 14:47:42 -0500 Subject: [PATCH] Get rid of ERROR_INT and use 0 for "no surface" --- include/openmc/constants.h | 2 -- src/output.cpp | 2 +- src/particle.cpp | 6 +++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 87388c91a..d9307abe2 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -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 when F90 - // interop is gone // Interpolation rules enum class Interpolation { diff --git a/src/output.cpp b/src/output.cpp index 82aaca989..df0976d94 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -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"; } diff --git a/src/particle.cpp b/src/particle.cpp index d2b845bf4..b307aec8d 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -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);