feat(GridFire): Much more robust starting network

GraphEngine now can initialize with a much more robust set of reactions (including the entire reaction set). The jacobian can still be efficiently evaluated using CppAD's sparse jacobian feature. Further, the primeing network has been signifiganty enhanced to handle much hotter termperatures
This commit is contained in:
2025-07-14 14:50:49 -04:00
parent ddfa66d86f
commit 69bd2cd466
21 changed files with 650 additions and 131 deletions

View File

@@ -61,32 +61,6 @@ namespace gridfire {
return oldFormat;
}
reaction::LogicalReactionSet build_reaclib_nuclear_network(const fourdst::composition::Composition &composition, bool reverse) {
using namespace reaction;
std::vector<Reaction> reaclibReactions;
auto logger = fourdst::logging::LogManager::getInstance().getLogger("log");
for (const auto &reaction: reaclib::get_all_reactions()) {
if (reaction.is_reverse() != reverse) {
continue; // Skip reactions that do not match the requested direction
}
bool gotReaction = true;
const auto& reactants = reaction.reactants();
for (const auto& reactant : reactants) {
if (!composition.contains(reactant)) {
gotReaction = false;
break; // If any reactant is not in the composition, skip this reaction
}
}
if (gotReaction) {
LOG_TRACE_L3(logger, "Adding reaction {} to REACLIB reaction set.", reaction.peName());
reaclibReactions.push_back(reaction);
}
}
const ReactionSet reactionSet(reaclibReactions);
return packReactionSetToLogicalReactionSet(reactionSet);
}
// Trim whitespace from both ends of a string
std::string trim_whitespace(const std::string& str) {
auto startIt = str.begin();