diff --git a/include/cantera/kinetics/Group.h b/include/cantera/kinetics/Group.h index 7ac35cbe8..da2316dbc 100644 --- a/include/cantera/kinetics/Group.h +++ b/include/cantera/kinetics/Group.h @@ -101,6 +101,12 @@ public: // } } + /*! + * A group is 'valid' if all of its nonzero atom numbers have + * the same sign, either positive or negative. This method + * checks for this, and if the group is not valid it sets + * m_sign to -999, and sets all atom numbers to zero. + */ void validate(); /** diff --git a/include/cantera/kinetics/ReactionPath.h b/include/cantera/kinetics/ReactionPath.h index adc920c7e..bc9db6eb6 100644 --- a/include/cantera/kinetics/ReactionPath.h +++ b/include/cantera/kinetics/ReactionPath.h @@ -17,7 +17,6 @@ namespace Cantera { - enum flow_t { NetFlow, OneWayFlow }; // forward references @@ -42,9 +41,6 @@ public: doublereal value; ///< May be used to set node appearance bool visible; ///< Visible on graph; - - // public methods - /** * @name References. * Return a reference to a path object connecting this node @@ -59,7 +55,6 @@ public: } //@} - /// Total number of paths to or from this node int nPaths() const { return static_cast(m_paths.size()); @@ -80,7 +75,6 @@ public: void printPaths(); - protected: doublereal m_in; doublereal m_out; @@ -88,12 +82,9 @@ protected: }; - class Path { - public: - typedef std::map rxn_path_map; /** @@ -105,6 +96,11 @@ public: /// Destructor virtual ~Path() {} + /** + * Add a reaction to the path. Increment the flow from this + * reaction, the total flow, and the flow associated with this + * label. + */ void addReaction(size_t rxnNumber, doublereal value, const std::string& label = ""); @@ -150,10 +146,13 @@ public: return m_rxn; } + /** + * Write the label for a path connecting two species, indicating + * the percent of the total flow due to each reaction. + */ void writeLabel(std::ostream& s, doublereal threshold = 0.005); protected: - std::map m_label; SpeciesNode* m_a, *m_b; rxn_path_map m_rxn; @@ -166,11 +165,12 @@ protected: */ class ReactionPathDiagram { - public: - ReactionPathDiagram(); + /** + * Destructor. Deletes all nodes and paths in the diagram. + */ virtual ~ReactionPathDiagram(); /// The largest one-way flow value in any path @@ -194,7 +194,23 @@ public: } void writeData(std::ostream& s); + + /** + * Export the reaction path diagram. This method writes to stream + * \c s the commands for the 'dot' program in the \c GraphViz + * package from AT&T. (GraphViz may be downloaded from + * www.graphviz.org.) + * + * To generate a postscript reaction path diagram from the + * output of this method saved in file paths.dot, for example, give + * the command: + * \code + * dot -Tps paths.dot > paths.ps + * \endcode + * To generate a GIF image, replace -Tps with -Tgif + */ void exportToDot(std::ostream& s); + void add(ReactionPathDiagram& d); SpeciesNode* node(size_t k) { return m_nodes[k]; @@ -268,7 +284,6 @@ public: doublereal arrow_hue; protected: - doublereal m_flxmax; std::map > m_paths; std::map m_nodes; @@ -281,10 +296,8 @@ protected: }; - class ReactionPathBuilder { - public: ReactionPathBuilder() {} virtual ~ReactionPathBuilder() {} @@ -294,6 +307,8 @@ public: int build(Kinetics& s, const std::string& element, std::ostream& output, ReactionPathDiagram& r, bool quiet=false); + //! Analyze a reaction to determine which reactants lead to which + //! products. int findGroups(std::ostream& logfile, Kinetics& s); void writeGroup(std::ostream& out, const Group& g); diff --git a/src/kinetics/Group.cpp b/src/kinetics/Group.cpp index 0e2252f69..ce43aef88 100644 --- a/src/kinetics/Group.cpp +++ b/src/kinetics/Group.cpp @@ -16,12 +16,6 @@ namespace Cantera { -/** - * A group is 'valid' if all of its nonzero atom numbers have - * the same sign, either positive or negative. This method - * checks for this, and if the group is not valid it sets - * m_sign to -999, and sets all atom numbers to zero. - */ void Group::validate() { diff --git a/src/kinetics/ReactionPath.cpp b/src/kinetics/ReactionPath.cpp index 7d9367cec..d4420b60f 100644 --- a/src/kinetics/ReactionPath.cpp +++ b/src/kinetics/ReactionPath.cpp @@ -14,7 +14,6 @@ using namespace std; namespace Cantera { -/// add a path to or from this node void SpeciesNode::addPath(Path* path) { m_paths.push_back(path); @@ -36,10 +35,6 @@ void SpeciesNode::printPaths() } } - -/** - * Construct a path connecting two species nodes. - */ Path::Path(SpeciesNode* begin, SpeciesNode* end) : m_a(begin), m_b(end), m_total(0.0) { @@ -47,12 +42,6 @@ Path::Path(SpeciesNode* begin, SpeciesNode* end) end->addPath(this); } - -/** - * add a reaction to the path. Increment the flow from this - * reaction, the total flow, and the flow associated with this - * label. - */ void Path::addReaction(size_t rxnNumber, doublereal value, const string& label) { @@ -63,11 +52,6 @@ void Path::addReaction(size_t rxnNumber, doublereal value, } } - -/** - * Write the label for a path connecting two species, indicating - * the percent of the total flow due to each reaction. - */ void Path::writeLabel(ostream& s, doublereal threshold) { size_t nn = m_label.size(); @@ -92,10 +76,6 @@ void Path::writeLabel(ostream& s, doublereal threshold) } } - -/** - * Default constructor. - */ ReactionPathDiagram::ReactionPathDiagram() { name = "reaction_paths"; @@ -120,10 +100,6 @@ ReactionPathDiagram::ReactionPathDiagram() m_local = npos; } - -/** - * Destructor. Deletes all nodes and paths in the diagram. - */ ReactionPathDiagram::~ReactionPathDiagram() { // delete the nodes @@ -139,7 +115,6 @@ ReactionPathDiagram::~ReactionPathDiagram() } } - vector_int ReactionPathDiagram::reactions() { size_t i, npaths = nPaths(); @@ -243,21 +218,6 @@ void ReactionPathDiagram::writeData(ostream& s) } } - -/** - * Export the reaction path diagram. This method writes to stream - * \c s the commands for the 'dot' program in the \c GraphViz - * package from AT&T. (GraphViz may be downloaded from - * www.graphviz.org.) - * - * To generate a postscript reaction path diagram from the - * output of this method saved in file paths.dot, for example, give - * the command: - * \code - * dot -Tps paths.dot > paths.ps - * \endcode - * To generate a GIF image, replace -Tps with -Tgif - */ void ReactionPathDiagram::exportToDot(ostream& s) { doublereal flxratio, flmax = 0.0, lwidth; @@ -497,10 +457,6 @@ std::vector ReactionPathDiagram::species() return m_speciesNumber; } - -/** - * analyze a reaction to determine which reactants lead to which products. - */ int ReactionPathBuilder::findGroups(ostream& logfile, Kinetics& s) { m_groups.resize(m_nr); @@ -718,8 +674,6 @@ void ReactionPathBuilder::findElements(Kinetics& kin) } } - - int ReactionPathBuilder::init(ostream& logfile, Kinetics& kin) { //m_warn.clear(); @@ -879,7 +833,6 @@ string reactionLabel(size_t i, size_t kr, size_t nr, return label; } - int ReactionPathBuilder::build(Kinetics& s, const string& element, ostream& output, ReactionPathDiagram& r, bool quiet) { @@ -1033,5 +986,4 @@ int ReactionPathBuilder::build(Kinetics& s, const string& element, return 1; } - }