Local adjoint source for Random Ray (#3717)

This commit is contained in:
Jack Fletcher 2026-04-28 17:10:03 -04:00 committed by GitHub
parent 1116c4bdc0
commit 368ea069ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 2663 additions and 462 deletions

View file

@ -280,8 +280,9 @@ void get_run_parameters(pugi::xml_node node_base)
} else {
fatal_error("Specify random ray inactive distance in settings XML");
}
if (check_for_node(random_ray_node, "source")) {
xml_node source_node = random_ray_node.child("source");
if (check_for_node(random_ray_node, "ray_source")) {
xml_node ray_source_node = random_ray_node.child("ray_source");
xml_node source_node = ray_source_node.child("source");
// Get point to list of <source> elements and make sure there is at least
// one
RandomRay::ray_source_ = Source::create(source_node);
@ -369,6 +370,13 @@ void get_run_parameters(pugi::xml_node node_base)
"between 0 and 1");
}
}
if (check_for_node(random_ray_node, "adjoint_source")) {
pugi::xml_node adj_source_node = random_ray_node.child("adjoint_source");
for (pugi::xml_node source_node : adj_source_node.children("source")) {
// Find any local adjoint sources
model::adjoint_sources.push_back(Source::create(source_node));
}
}
}
}
@ -1276,6 +1284,16 @@ void read_settings_xml(pugi::xml_node root)
break;
}
}
// If any weight window generators have local FW-CADIS target tallies,
// user-defined adjoint sources cannot be used at the same time.
if (!model::adjoint_sources.empty()) {
for (const auto& wwg : variance_reduction::weight_windows_generators) {
if (!wwg->targets_.empty()) {
fatal_error("Cannot use both user-defined adjoint sources and "
"FW-CADIS target tallies at the same time.");
}
}
}
}
// Set up weight window checkpoints