diff --git a/src/settings.cpp b/src/settings.cpp index d9c2857f8b..76bad237a7 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -441,6 +441,20 @@ void read_settings_xml() } } + // Check if the user has specified to read surface source + if (check_for_node(root, "surf_src_read")) { + surf_src_read = true; + // Get surface source read node + xml_node node_ssr = root.child("surf_src_read"); + + std::string path = "surface_source.h5"; + // Check if the user has specified different file for surface source reading + if (check_for_node(node_ssr, "path")) { + path = get_node_value(node_ssr, "path", false, true); + } + model::external_sources.push_back(std::make_unique(path)); + } + // If no source specified, default to isotropic point source at origin with Watt spectrum if (model::external_sources.empty()) { model::external_sources.push_back(std::make_unique( @@ -646,20 +660,6 @@ void read_settings_xml() } } - // Check if the user has specified to read surface source - if (check_for_node(root, "surf_src_read")) { - surf_src_read = true; - // Get surface source read node - xml_node node_ssr = root.child("surf_src_read"); - - std::string path = "surface_source.h5"; - // Check if the user has specified different file for surface source reading - if (check_for_node(node_ssr, "path")) { - path = get_node_value(node_ssr, "path", false, true); - } - model::external_sources.push_back(std::make_unique(path)); - } - // If source is not seperate and is to be written out in the statepoint file, // make sure that the sourcepoint batch numbers are contained in the // statepoint list