diff --git a/include/openmc/settings.h b/include/openmc/settings.h index 3407eadf4b..8cee3c72ab 100644 --- a/include/openmc/settings.h +++ b/include/openmc/settings.h @@ -65,7 +65,7 @@ extern "C" std::string path_statepoint; //!< path to a statepoint file extern "C" int32_t n_batches; //!< number of (inactive+active) batches extern "C" int32_t n_inactive; //!< number of inactive batches -extern "C" int32_t n_max_lost_particles; //!< maximum number of lost particles +extern "C" int32_t max_lost_particles; //!< maximum number of lost particles extern double relative_max_lost_particles; //!< maximum number of lost particles, relative to the total number of particles extern "C" int32_t gen_per_batch; //!< number of generations per batch extern "C" int64_t n_particles; //!< number of particles per generation diff --git a/openmc/lib/settings.py b/openmc/lib/settings.py index 8345e00881..fa72e13234 100644 --- a/openmc/lib/settings.py +++ b/openmc/lib/settings.py @@ -22,7 +22,7 @@ class _Settings(object): entropy_on = _DLLGlobal(c_bool, 'entropy_on') generations_per_batch = _DLLGlobal(c_int32, 'gen_per_batch') inactive = _DLLGlobal(c_int32, 'n_inactive') - max_lost_particles = _DLLGlobal(c_int32, 'n_max_lost_particles') + max_lost_particles = _DLLGlobal(c_int32, 'max_lost_particles') rel_max_lost_particles = _DLLGlobal(c_double, 'relative_max_lost_particles') particles = _DLLGlobal(c_int64, 'n_particles') restart_run = _DLLGlobal(c_bool, 'restart_run') diff --git a/src/particle.cpp b/src/particle.cpp index 79e6625771..7e98b2ce67 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -630,7 +630,7 @@ Particle::mark_as_lost(const char* message) // Abort the simulation if the maximum number of lost particles has been // reached - if (simulation::n_lost_particles >= settings::n_max_lost_particles && + if (simulation::n_lost_particles >= settings::max_lost_particles && simulation::n_lost_particles >= settings::relative_max_lost_particles*n) { fatal_error("Maximum number of lost particles has been reached."); } diff --git a/src/settings.cpp b/src/settings.cpp index d72e5f17f7..933f9a2172 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -79,7 +79,7 @@ std::string path_statepoint; int32_t n_batches; int32_t n_inactive {0}; -int32_t n_max_lost_particles {10}; +int32_t max_lost_particles {10}; double relative_max_lost_particles {1.0e-6}; int32_t gen_per_batch {1}; int64_t n_particles {-1}; @@ -147,7 +147,7 @@ void get_run_parameters(pugi::xml_node node_base) // Get max number of lost particles if (check_for_node(node_base, "max_lost_particles")) { - n_max_lost_particles = std::stoi(get_node_value(node_base, "max_lost_particles")); + max_lost_particles = std::stoi(get_node_value(node_base, "max_lost_particles")); } // Get relative number of lost particles @@ -362,7 +362,7 @@ void read_settings_xml() fatal_error("Number of inactive batches must be non-negative."); } else if (n_particles <= 0) { fatal_error("Number of particles must be greater than zero."); - } else if (n_max_lost_particles <= 0) { + } else if (max_lost_particles <= 0) { fatal_error("Number of max lost particles must be greater than zero."); } else if (relative_max_lost_particles <= 0.0 || relative_max_lost_particles >= 1.0) { fatal_error("Relative max lost particles must be between zero and one.");