13#include "PrismConstants.h"
17#include <unordered_map>
18#include "yaml-cpp/yaml.h"
52 void setCheckRefs(
const bool check_refs) { _check_refs = check_refs; }
53 void setReadXsecFiles(
const bool read_xsec_files) { _read_xsec_files = read_xsec_files; }
69 preventInvalidDataFetch();
81 preventInvalidDataFetch();
93 preventInvalidDataFetch();
94 return _tabulated_xsec_based;
105 preventInvalidDataFetch();
106 return _function_xsec_based;
117 preventInvalidDataFetch();
118 return _tabulated_rate_based;
129 preventInvalidDataFetch();
130 return _function_rate_based;
139 const std::vector<std::shared_ptr<const Species>> &
transientSpecies()
const;
156 const std::vector<std::shared_ptr<Species>> &
species()
const;
188 NetworkParser(
const NetworkParser &) =
delete;
190 NetworkParser & operator=(
const NetworkParser &) =
delete;
195 static NetworkParser * _instance;
197 bool _network_has_errors;
199 bool _network_has_bib_errors;
205 bool _read_xsec_files;
207 std::unordered_map<std::string, YAML::Node> _networks;
209 std::unordered_map<std::string, std::string> _bibs;
211 std::unordered_map<std::string, std::string> _data_paths;
213 std::unordered_map<std::string, std::string> _delimiters;
223 void checkFile(
const std::string & file)
const;
230 void checkBibFile(
const YAML::Node & network,
const std::string & file)
const;
244 void parseReactions(
const YAML::Node & inputs,
246 std::vector<std::shared_ptr<Reaction>> * rxn_list,
247 std::vector<std::shared_ptr<const Reaction>> * tabulated_rxn_list,
248 std::vector<std::shared_ptr<const Reaction>> * function_rxn_list,
249 const std::string & type,
250 const std::string & data_path,
251 const std::string & bib_file,
252 const std::string & _delimiter);
257 void (
TableWriterBase::*addReaction)(
const std::shared_ptr<const Reaction> & r),
258 const std::vector<std::shared_ptr<const Reaction>> & rxn_list)
const;
265 void preventInvalidDataFetch()
const;
270 std::vector<std::shared_ptr<Reaction>> _rate_based;
271 std::vector<std::shared_ptr<const Reaction>> _tabulated_rate_based;
272 std::vector<std::shared_ptr<const Reaction>> _function_rate_based;
273 std::vector<std::shared_ptr<Reaction>> _xsec_based;
274 std::vector<std::shared_ptr<const Reaction>> _tabulated_xsec_based;
275 std::vector<std::shared_ptr<const Reaction>> _function_xsec_based;
Class for collecting and managing cite keys from the user provided bib files.
Definition BibTexHelper.h:24
const std::vector< std::shared_ptr< Species > > & species() const
Gets all of the species in the network This function will also exist the program if there are any err...
Definition NetworkParser.C:365
void parseNetwork(const std::string &file)
Method goes through all of the reactions in this network constructs Reaction objects and then puts th...
Definition NetworkParser.C:161
void writeReactionTable(const std::string &file, TableWriterBase &writer) const
Writes the latex table representation of the reaction mechanism this method uses whatever custom tabl...
const std::vector< std::shared_ptr< Reaction > > & xsecBasedReactions() const
Gets all of the reactions in the xsec-based block that have cross section data in a file.
Definition NetworkParser.h:79
const std::vector< std::shared_ptr< const Reaction > > & functionXSecReactions() const
Gets all of the reactions in the xsec-based block that have cross section that can be represented wit...
Definition NetworkParser.h:103
const std::vector< std::shared_ptr< const Reaction > > & tabulatedXSecReactions() const
Gets all of the reactions in the xsec-based block that have cross section data in a file.
Definition NetworkParser.h:91
void writeSpeciesSummary(const std::string &file, SpeciesSummaryWriterBase &writer) const
Writes a summary of the species in the network to a file this method uses whatever custom summary wri...
static NetworkParser & instance()
Getter for the singleton instance.
Definition NetworkParser.C:47
void writeSpeciesSummary(const std::string &file)
Writes a summary of the species in the network to a file this method using the default summary writer...
const std::vector< std::shared_ptr< const Reaction > > & functionRateReactions() const
Gets all of the reactions in the xsec-based block that have rate data that can be represented with a ...
Definition NetworkParser.h:127
const std::vector< std::shared_ptr< const Reaction > > & tabulatedRateReactions() const
Gets all of the reactions in the xsec-based block that have rate data in a file.
Definition NetworkParser.h:115
void clear()
Resets the parser to a fresh state, as if no networks have been processed.
Definition NetworkParser.C:57
const std::vector< std::shared_ptr< Reaction > > & rateBasedReactions() const
Gets all of the reactions in the xsec-based block that have cross section data in a file.
Definition NetworkParser.h:67
void writeReactionTable(const std::string &file) const
Writes the latex table representation of the reaction mechanism this method uses the default table wr...
const std::vector< std::string > & speciesNames() const
Gets the names of all of the species in the network This function will also exist the program if ther...
Definition NetworkParser.C:358
const std::vector< std::shared_ptr< const Species > > & transientSpecies() const
Gets all of the species in the network that have a non-zero This function will also exist the program...
Definition NetworkParser.C:372
Stores all of the data needed to perform calculations with a specific reaction.
Definition Reaction.h:73
This factory creates and stores, and passes around all of the species that exist in a reaction mechan...
Definition SpeciesFactory.h:31
Definition SpeciesSummaryWriterBase.h:23
The species object which represents the products and reactants in the reaction.
Definition Species.h:47
Definition TableWriterBase.h:22