Storing surface source points using a cell ID (#2888)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Joffrey Dorville 2024-06-19 10:11:58 -05:00 committed by GitHub
parent 84f561c1ed
commit ddc9526966
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
120 changed files with 3963 additions and 86 deletions

View file

@ -119,6 +119,8 @@ std::unordered_set<int> sourcepoint_batch;
std::unordered_set<int> statepoint_batch;
std::unordered_set<int> source_write_surf_id;
int64_t max_surface_particles;
int64_t ssw_cell_id {C_NONE};
SSWCellType ssw_cell_type {SSWCellType::None};
TemperatureMethod temperature_method {TemperatureMethod::NEAREST};
double temperature_tolerance {10.0};
double temperature_default {293.6};
@ -747,7 +749,9 @@ void read_settings_xml(pugi::xml_node root)
// Get surface source write node
xml_node node_ssw = root.child("surf_source_write");
// Determine surface ids at which crossing particles are to be banked
// Determine surface ids at which crossing particles are to be banked.
// If no surfaces are specified, all surfaces in the model will be used
// to bank source points.
if (check_for_node(node_ssw, "surface_ids")) {
auto temp = get_node_array<int>(node_ssw, "surface_ids");
for (const auto& b : temp) {
@ -759,7 +763,12 @@ void read_settings_xml(pugi::xml_node root)
if (check_for_node(node_ssw, "max_particles")) {
max_surface_particles =
std::stoll(get_node_value(node_ssw, "max_particles"));
} else {
fatal_error("A maximum number of particles needs to be specified "
"using the 'max_particles' parameter to store surface "
"source points.");
}
if (check_for_node(node_ssw, "mcpl")) {
surf_mcpl_write = get_node_value_bool(node_ssw, "mcpl");
@ -769,6 +778,27 @@ void read_settings_xml(pugi::xml_node root)
"surface source files.");
}
}
// Get cell information
if (check_for_node(node_ssw, "cell")) {
ssw_cell_id = std::stoll(get_node_value(node_ssw, "cell"));
ssw_cell_type = SSWCellType::Both;
}
if (check_for_node(node_ssw, "cellfrom")) {
if (ssw_cell_id != C_NONE) {
fatal_error(
"'cell', 'cellfrom' and 'cellto' cannot be used at the same time.");
}
ssw_cell_id = std::stoll(get_node_value(node_ssw, "cellfrom"));
ssw_cell_type = SSWCellType::From;
}
if (check_for_node(node_ssw, "cellto")) {
if (ssw_cell_id != C_NONE) {
fatal_error(
"'cell', 'cellfrom' and 'cellto' cannot be used at the same time.");
}
ssw_cell_id = std::stoll(get_node_value(node_ssw, "cellto"));
ssw_cell_type = SSWCellType::To;
}
}
// If source is not separate and is to be written out in the statepoint file,