20 enum flow_t { NetFlow, OneWayFlow };
33 visible(false), m_in(0.0), m_out(0.0) {}
53 const Path* path(
int n)
const {
60 return static_cast<int>(m_paths.size());
66 doublereal outflow() {
72 doublereal netOutflow() {
81 std::vector<Path*> m_paths;
88 typedef std::map<size_t, doublereal> rxn_path_map;
94 Path(SpeciesNode* begin, SpeciesNode* end);
104 void addReaction(
size_t rxnNumber, doublereal value,
105 const std::string& label =
"");
108 const SpeciesNode* begin()
const {
111 SpeciesNode* begin() {
116 const SpeciesNode* end()
const {
127 SpeciesNode* otherNode(SpeciesNode* n) {
128 return (n == m_a ? m_b : (n == m_b ? m_a : 0));
135 void setFlow(doublereal v) {
141 return static_cast<int>(m_rxn.size());
145 const rxn_path_map& reactionMap() {
153 void writeLabel(std::ostream& s, doublereal threshold = 0.005);
156 std::map<std::string, doublereal> m_label;
157 SpeciesNode* m_a, *m_b;
187 doublereal
flow(
size_t k1,
size_t k2) {
188 return (m_paths[k1][k2] ? m_paths[k1][k2]->
flow() : 0.0);
193 return (m_nodes[k] != 0);
196 void writeData(std::ostream& s);
218 Path* path(
size_t k1,
size_t k2) {
219 return m_paths[k1][k2];
221 Path* path(
size_t n) {
222 return m_pathlist[n];
225 return m_pathlist.size();
228 return m_nodes.size();
231 void addNode(
size_t k,
const std::string& nm, doublereal x = 0.0);
233 void displayOnly(
size_t k=
npos) {
237 void linkNodes(
size_t k1,
size_t k2,
size_t rxn, doublereal value,
238 std::string legend =
"");
240 void include(
const std::string& aaname) {
241 m_include.push_back(aaname);
243 void exclude(
const std::string& aaname) {
244 m_exclude.push_back(aaname);
246 void include(std::vector<std::string>& names) {
247 for (
size_t i = 0; i < names.size(); i++) {
248 m_include.push_back(names[i]);
251 void exclude(std::vector<std::string>& names) {
252 for (
size_t i = 0; i < names.size(); i++) {
253 m_exclude.push_back(names[i]);
256 std::vector<std::string>& included() {
259 std::vector<std::string>& excluded() {
262 std::vector<size_t> species();
264 void findMajorPaths(doublereal threshold,
size_t lda, doublereal* a);
265 void setFont(
const std::string& font) {
271 std::string bold_color;
272 std::string normal_color;
273 std::string dashed_color;
276 doublereal threshold,
277 bold_min, dashed_max, label_min;
278 doublereal x_size, y_size;
279 std::string name, dot_options;
282 doublereal arrow_width;
284 doublereal arrow_hue;
288 std::map<size_t, std::map<size_t, Path*> > m_paths;
289 std::map<size_t, SpeciesNode*> m_nodes;
290 std::vector<Path*> m_pathlist;
291 std::vector<std::string> m_include;
292 std::vector<std::string> m_exclude;
293 std::vector<size_t> m_speciesNumber;
294 std::map<size_t, int> m_rxns;
299 class ReactionPathBuilder
302 ReactionPathBuilder() {}
303 virtual ~ReactionPathBuilder() {}
305 int init(std::ostream& logfile, Kinetics& s);
307 int build(Kinetics& s,
const std::string& element, std::ostream& output,
308 ReactionPathDiagram& r,
bool quiet=
false);
312 int findGroups(std::ostream& logfile, Kinetics& s);
314 void writeGroup(std::ostream& out,
const Group& g);
317 void findElements(Kinetics& kin);
325 std::vector<std::vector<size_t> > m_reac;
326 std::vector<std::vector<size_t> > m_prod;
327 DenseMatrix m_elatoms;
328 std::vector<std::vector<int> > m_groups;
329 std::vector<Group> m_sgroup;
330 std::vector<std::string> m_elementSymbols;
332 std::map<size_t, std::map<size_t, std::map<size_t, Group> > > m_transfer;
333 std::vector<bool> m_determinate;
335 std::map<std::string, size_t> m_enamemap;
bool visible
Visible on graph;.
void exportToDot(std::ostream &s)
Export the reaction path diagram.
const size_t npos
index returned by functions to indicate "no position"
Nodes in reaction path graphs.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
size_t number
Species number.
void addPath(Path *path)
add a path to or from this node
std::vector< int > vector_int
Vector of ints.
doublereal flow(size_t k1, size_t k2)
The one-way flow from node k1 to node k2.
virtual ~ReactionPathDiagram()
Destructor.
bool hasNode(size_t k)
True if a node for species k exists.
virtual ~SpeciesNode()
Destructor.
doublereal value
May be used to set node appearance.
Reaction path diagrams (graphs).
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
std::string name
Label on graph.
doublereal maxFlow()
The largest one-way flow value in any path.
SpeciesNode()
Default constructor.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
int nPaths() const
Total number of paths to or from this node.
doublereal netFlow(size_t k1, size_t k2)
The net flow from node k1 to node k2.