Add setting parameter for surface source file reading

This commit is contained in:
YoungHui Park 2020-08-05 11:39:22 -05:00
parent 10e3e83f90
commit b5f6dacb7d
3 changed files with 22 additions and 0 deletions

View file

@ -46,6 +46,7 @@ extern bool source_latest; //!< write latest source at each batch?
extern bool source_separate; //!< write source to separate file?
extern bool source_write; //!< write source in HDF5 files?
extern bool surface_source; //!< write surface source file?
extern bool surf_src_read; //!< read surface source file?
extern bool survival_biasing; //!< use survival biasing?
extern bool temperature_multipole; //!< use multipole data?
extern "C" bool trigger_on; //!< tally triggers enabled?

View file

@ -61,6 +61,7 @@ bool source_latest {false};
bool source_separate {false};
bool source_write {true};
bool surface_source {false};
bool surf_src_read {false};
bool survival_biasing {false};
bool temperature_multipole {false};
bool trigger_on {false};

View file

@ -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 {