From cdd2a6b1cacb54387de050e96c36bca74c114777 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 3 Nov 2022 20:43:29 -0500 Subject: [PATCH] Correcting doc scope and some reads --- src/initialize.cpp | 10 ++++++---- src/settings.cpp | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/initialize.cpp b/src/initialize.cpp index 44f84034a7..cb35ebce9d 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -298,14 +298,14 @@ void read_input_xml() std::string model_filename = settings::path_input + "model.xml"; bool use_model_file = file_exists(model_filename); pugi::xml_node model_root; + pugi::xml_document doc; if (use_model_file) { - write_message("Found model.xml file."); - pugi::xml_document doc; + write_message("Reading model.xml..."); auto result = doc.load_file(model_filename.c_str()); if (!result) { fatal_error("Error processing model.xml file."); } - auto model_root = doc.document_element(); + model_root = doc.document_element(); auto other_inputs = {"materials.xml", "geometry.xml", "settings.xml", "tallies.xml", "plots.xml"}; for (const auto& input : other_inputs) { @@ -320,12 +320,14 @@ void read_input_xml() if (!check_for_node(model_root, "settings")) { fatal_error("No node present in the model.xml file."); } - read_settings_xml(model_root.child("settings")); + auto settings_root = model_root.child("settings"); + read_settings_xml(); } else { read_settings_xml(); } read_cross_sections_xml(); + if (use_model_file) { if (!check_for_node(model_root, "materials")) { fatal_error("No node present in the model.xml file."); diff --git a/src/settings.cpp b/src/settings.cpp index 710fb28101..de24e200ac 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -266,6 +266,7 @@ void read_settings_xml(pugi::xml_node root) // Find if a multi-group or continuous-energy simulation is desired if (check_for_node(root, "energy_mode")) { + std::cout << "Here" << std::endl; std::string temp_str = get_node_value(root, "energy_mode", true, true); if (temp_str == "mg" || temp_str == "multi-group") { run_CE = false; @@ -273,6 +274,7 @@ void read_settings_xml(pugi::xml_node root) run_CE = true; } } + std::cout << "Here" << std::endl; // Look for deprecated cross_sections.xml file in settings.xml if (check_for_node(root, "cross_sections")) {