27#include "quill/LogMacros.h"
31 std::vector <double> y;
32 y.reserve(
composition.getRegisteredSymbols().size());
33 const auto [fst, snd] =
composition.getComposition();
34 for (
const auto &name: fst | std::views::keys) {
42 m_config(fourdst::config::Config::getInstance()),
43 m_logManager(fourdst::logging::LogManager::getInstance()),
46 m_constants(fourdst::constant::Constants::getInstance()){
48 LOG_ERROR(
m_logger,
"nuclearNetwork::Network::Network() called with UNKNOWN format");
50 throw std::runtime_error(
"nuclearNetwork::Network::Network() called with UNKNOWN format");
66 std::vector<Reaction> reaclibReactions;
67 auto logger = fourdst::logging::LogManager::getInstance().getLogger(
"log");
70 if (
reaction.is_reverse() != reverse) {
73 bool gotReaction =
true;
74 const auto& reactants =
reaction.reactants();
75 for (
const auto& reactant : reactants) {
76 if (!composition.contains(reactant)) {
82 LOG_TRACE_L3(logger,
"Adding reaction {} to REACLIB reaction set.",
reaction.peName());
83 reaclibReactions.push_back(
reaction);
86 const ReactionSet reactionSet(reaclibReactions);
87 return packReactionSetToLogicalReactionSet(reactionSet);
92 auto startIt = str.begin();
93 auto endIt = str.end();
95 while (startIt != endIt && std::isspace(
static_cast<unsigned char>(*startIt))) {
98 if (startIt == endIt) {
101 auto ritr = std::find_if(str.rbegin(), std::string::const_reverse_iterator(startIt),
102 [](
unsigned char ch){ return !std::isspace(ch); });
103 return std::string(startIt, ritr.base());
fourdst::logging::LogManager & m_logManager
Log manager instance.
Network(const NetworkFormat format=NetworkFormat::APPROX8)
NetworkFormat getFormat() const
NetworkFormat m_format
Format of the network.
NetworkFormat setFormat(const NetworkFormat format)
quill::Logger * m_logger
Logger instance.
fourdst::config::Config & m_config
Configuration instance.
fourdst::constant::Constants & m_constants
const reaction::LogicalReactionSet & get_all_reactions()
Provides global access to the fully initialized REACLIB reaction set.
TemplatedReactionSet< LogicalReaction > LogicalReactionSet
A set of logical reactions.
std::string trim_whitespace(const std::string &str)
reaction::LogicalReactionSet build_reaclib_nuclear_network(const fourdst::composition::Composition &composition, bool reverse)
Defines classes for representing and managing nuclear reactions.
fourdst::composition::Composition composition
Composition of the network.
std::vector< double > MolarAbundance() const