mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Add setting parameter for surface source file reading
This commit is contained in:
parent
10e3e83f90
commit
b5f6dacb7d
3 changed files with 22 additions and 0 deletions
|
|
@ -72,6 +72,26 @@ IndependentSource::IndependentSource(pugi::xml_node node)
|
|||
|
||||
// Check for external source file
|
||||
if (check_for_node(node, "file")) {
|
||||
// Copy path of source file
|
||||
settings::path_source = get_node_value(node, "file", false, true);
|
||||
|
||||
// Check if source file exists
|
||||
if (!file_exists(settings::path_source)) {
|
||||
fatal_error(fmt::format("Source file '{}' does not exist.",
|
||||
settings::path_source));
|
||||
}
|
||||
|
||||
// Check if it is a surface source file.
|
||||
if (check_for_node(node, "surf_src_file")) {
|
||||
settings::surf_src_read = get_node_value_bool(node, "surf_src_file");
|
||||
}
|
||||
|
||||
} else if (check_for_node(node, "library")) {
|
||||
settings::path_source_library = get_node_value(node, "library", false, true);
|
||||
if (!file_exists(settings::path_source_library)) {
|
||||
fatal_error(fmt::format("Source library '{}' does not exist.",
|
||||
settings::path_source_library));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue