Merge pull request #1773 from AI-Pranto/surface-source

[Fix] 'std::out_of_range' error
This commit is contained in:
Paul Romano 2021-03-02 21:34:44 -06:00 committed by GitHub
commit a760ec075b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -88,7 +88,7 @@ extern RunMode run_mode; //!< Run mode (eigenvalue, fixed src, e
extern std::unordered_set<int> sourcepoint_batch; //!< Batches when source should be written
extern std::unordered_set<int> statepoint_batch; //!< Batches when state should be written
extern std::unordered_set<int> source_write_surf_id; //!< Surface ids where sources will be written
extern int64_t max_particles; //!< maximum number of particles to be banked on surfaces per process
extern int64_t max_surface_particles; //!< maximum number of particles to be banked on surfaces per process
extern TemperatureMethod temperature_method; //!< method for choosing temperatures
extern double temperature_tolerance; //!< Tolerance in [K] on choosing temperatures
extern double temperature_default; //!< Default T in [K]

View file

@ -152,8 +152,8 @@ class Settings:
:surface_ids: List of surface ids at which crossing particles are to be
banked (int)
:max_particles: Maximum number of particles to be banked on surfaces
per process (int)
:max_particles: Maximum number of particles to be banked on
surfaces per process (int)
survival_biasing : bool
Indicate whether survival biasing is to be used
tabular_legendre : dict

View file

@ -101,7 +101,7 @@ RunMode run_mode {RunMode::UNSET};
std::unordered_set<int> sourcepoint_batch;
std::unordered_set<int> statepoint_batch;
std::unordered_set<int> source_write_surf_id;
int64_t max_particles;
int64_t max_surface_particles;
TemperatureMethod temperature_method {TemperatureMethod::NEAREST};
double temperature_tolerance {10.0};
double temperature_default {293.6};
@ -656,7 +656,7 @@ void read_settings_xml()
// Get maximum number of particles to be banked per surface
if (check_for_node(node_ssw, "max_particles")) {
max_particles = std::stoi(get_node_value(node_ssw, "max_particles"));
max_surface_particles = std::stoll(get_node_value(node_ssw, "max_particles"));
}
}

View file

@ -289,7 +289,7 @@ void allocate_banks()
if (settings::surf_source_write) {
// Allocate surface source bank
simulation::surf_source_bank.reserve(settings::max_particles);
simulation::surf_source_bank.reserve(settings::max_surface_particles);
}
}