mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Changed the name of the max_lost_particles in the C++ layer to match the python side
This commit is contained in:
parent
18b469bfa5
commit
a9d1e37aba
4 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue