diff --git a/tests/graphnet_sandbox/approx8.net b/tests/graphnet_sandbox/approx8.net index e69de29b..995adb66 100644 --- a/tests/graphnet_sandbox/approx8.net +++ b/tests/graphnet_sandbox/approx8.net @@ -0,0 +1,26 @@ +# Reaction network definition for the approx8 network. +# This file lists the reactions to be included for a direct +# comparison with the hard-coded approx8 network. + +# --- PP Chain --- +p(p,e+)d +d(p,g)he3 +he3(he3,2p)he4 + +# --- CNO Cycle --- +# Note: approx8 simplifies the CNO cycle using branching fractions, +# but these are the primary gateway reactions. +c12(p,g)n13 +n14(p,g)o15 +n14(a,g)f18 +o16(p,g)f17 + +# --- Alpha Captures & Triple Alpha --- +c12(a,g)o16 +n14(a,g)f18 +o16(a,g)ne20 +ne20(a,g)mg24 + +# --- Carbon & Oxygen Burning --- +c12(c12,a)ne20 +o16(c12,a)mg24 \ No newline at end of file diff --git a/tests/graphnet_sandbox/main.cpp b/tests/graphnet_sandbox/main.cpp index 3b4c035b..1b8e1858 100644 --- a/tests/graphnet_sandbox/main.cpp +++ b/tests/graphnet_sandbox/main.cpp @@ -3,7 +3,9 @@ #include "gridfire/engine/engine_graph.h" #include "gridfire/engine/engine_approx8.h" -#include "gridfire/engine/engine_adaptive.h" +#include "gridfire/engine/views/engine_adaptive.h" +#include "gridfire/engine/views/engine_defined.h" +#include "gridfire/io/network_file.h" #include "gridfire/solver/solver.h" @@ -39,7 +41,7 @@ void quill_terminate_handler() int main() { g_previousHandler = std::set_terminate(quill_terminate_handler); quill::Logger* logger = fourdst::logging::LogManager::getInstance().getLogger("log"); - logger->set_log_level(quill::LogLevel::TraceL1); + logger->set_log_level(quill::LogLevel::Debug); LOG_DEBUG(logger, "Starting Adaptive Engine View Example..."); using namespace gridfire; @@ -62,16 +64,22 @@ int main() { netIn.dt0 = 1e12; NetOut netOut; + + netIn.dt0 = 1e12; // approx8::Approx8Network approx8Network; // netOut = approx8Network.evaluate(netIn); - // std::cout << "Approx8 Network Output: " << netOut << std::endl; + // std::cout << "Approx8 Network H-1: " << netOut.composition.getMassFraction("H-1") << " in " << netOut.num_steps << " steps." << std::endl; + netIn.dt0 = 1e-15; GraphEngine ReaclibEngine(composition); - AdaptiveEngineView adaptiveEngine(ReaclibEngine); - solver::QSENetworkSolver solver(adaptiveEngine); + // AdaptiveEngineView adaptiveEngine(ReaclibEngine); + io::SimpleReactionListFileParser parser{}; + FileDefinedEngineView approx8EngineView(ReaclibEngine, "approx8.net", parser); + approx8EngineView.setScreeningModel(screening::ScreeningType::WEAK); + solver::QSENetworkSolver solver(approx8EngineView); netOut = solver.evaluate(netIn); - std::cout << "QSE Graph Network Output: " << netOut << std::endl; + std::cout << "QSE Graph Network H-1: " << netOut.composition.getMassFraction("H-1") << " in " << netOut.num_steps << " steps." << std::endl; } \ No newline at end of file