mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
External sources alias sampler (#3201)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
dd01c40ae1
commit
2d988a69a1
6 changed files with 30 additions and 16 deletions
|
|
@ -563,6 +563,13 @@ void read_settings_xml(pugi::xml_node root)
|
|||
model::external_sources.push_back(make_unique<FileSource>(path));
|
||||
}
|
||||
|
||||
// Build probability mass function for sampling external sources
|
||||
vector<double> source_strengths;
|
||||
for (auto& s : model::external_sources) {
|
||||
source_strengths.push_back(s->strength());
|
||||
}
|
||||
model::external_sources_probability.assign(source_strengths);
|
||||
|
||||
// If no source specified, default to isotropic point source at origin with
|
||||
// Watt spectrum. No default source is needed in random ray mode.
|
||||
if (model::external_sources.empty() &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue