21 enum flow_t { NetFlow, OneWayFlow };
23 Group parseGroupString(std::string str, std::vector<std::string>& esyms);
36 visible(false), m_in(0.0), m_out(0.0) {}
59 const Path* path(
int n)
const {
67 return static_cast<int>(m_paths.size());
73 doublereal outflow() {
79 doublereal netOutflow() {
89 std::vector<Path*> m_paths;
99 typedef std::map<size_t, doublereal> rxn_path_map;
105 Path(SpeciesNode* begin, SpeciesNode* end);
110 void addReaction(
size_t rxnNumber, doublereal value, std::string label =
"");
113 const SpeciesNode* begin()
const {
116 SpeciesNode* begin() {
121 const SpeciesNode* end()
const {
132 SpeciesNode* otherNode(SpeciesNode* n) {
133 return (n == m_a ? m_b : (n == m_b ? m_a : 0));
140 void setFlow(doublereal v) {
146 return static_cast<int>(m_rxn.size());
150 const rxn_path_map& reactionMap() {
154 void writeLabel(std::ostream& s, doublereal threshold = 0.005);
158 std::map<std::string, doublereal> m_label;
159 SpeciesNode* m_a, *m_b;
188 doublereal
flow(
size_t k1,
size_t k2) {
189 return (m_paths[k1][k2] ? m_paths[k1][k2]->
flow() : 0.0);
194 return (m_nodes[k] != 0);
197 void writeData(std::ostream& s);
203 Path* path(
size_t k1,
size_t k2) {
204 return m_paths[k1][k2];
206 Path* path(
size_t n) {
207 return m_pathlist[n];
210 return m_pathlist.size();
213 return m_nodes.size();
216 void addNode(
size_t k, std::string nm, doublereal x = 0.0);
218 void displayOnly(
size_t k=
npos) {
222 void linkNodes(
size_t k1,
size_t k2,
size_t rxn, doublereal value,
223 std::string legend =
"");
225 void include(std::string aaname) {
226 m_include.push_back(aaname);
228 void exclude(std::string aaname) {
229 m_exclude.push_back(aaname);
231 void include(std::vector<std::string>& names) {
232 for (
size_t i = 0; i < names.size(); i++) {
233 m_include.push_back(names[i]);
236 void exclude(std::vector<std::string>& names) {
237 for (
size_t i = 0; i < names.size(); i++) {
238 m_exclude.push_back(names[i]);
241 std::vector<std::string>& included() {
244 std::vector<std::string>& excluded() {
247 std::vector<size_t> species();
249 void findMajorPaths(doublereal threshold,
size_t lda, doublereal* a);
250 void setFont(std::string font) {
256 std::string bold_color;
257 std::string normal_color;
258 std::string dashed_color;
261 doublereal threshold,
262 bold_min, dashed_max, label_min;
263 doublereal x_size, y_size;
264 std::string name, dot_options;
267 doublereal arrow_width;
269 doublereal arrow_hue;
274 std::map<size_t, std::map<size_t, Path*> > m_paths;
275 std::map<size_t, SpeciesNode*> m_nodes;
276 std::vector<Path*> m_pathlist;
277 std::vector<std::string> m_include;
278 std::vector<std::string> m_exclude;
279 std::vector<size_t> m_speciesNumber;
280 std::map<size_t, int> m_rxns;
286 class ReactionPathBuilder
290 ReactionPathBuilder() {}
291 virtual ~ReactionPathBuilder() {}
293 int init(std::ostream& logfile, Kinetics& s);
295 int build(Kinetics& s, std::string element, std::ostream& output,
296 ReactionPathDiagram& r,
bool quiet=
false);
298 int findGroups(std::ostream& logfile, Kinetics& s);
300 void writeGroup(std::ostream& out,
const Group& g);
303 void findElements(Kinetics& kin);
311 std::vector<std::vector<size_t> > m_reac;
312 std::vector<std::vector<size_t> > m_prod;
313 DenseMatrix m_elatoms;
314 std::vector<std::vector<int> > m_groups;
315 std::vector<Group> m_sgroup;
316 std::vector<std::string> m_elementSymbols;
318 std::map<size_t, std::map<size_t, std::map<size_t, Group> > > m_transfer;
319 std::vector<bool> m_determinate;
321 std::map<std::string, size_t> m_enamemap;