Loading [MathJax]/extensions/tex2jax.js
Cantera  3.2.0a1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ReactionPathDiagram Class Reference

Reaction path diagrams (graphs). More...

#include <ReactionPath.h>

Detailed Description

Reaction path diagrams (graphs).

Definition at line 160 of file ReactionPath.h.

Public Member Functions

 ReactionPathDiagram (shared_ptr< Kinetics > kin, const string &element_)
 Construct new reaction path diagram.
 
virtual ~ReactionPathDiagram ()
 Destructor.
 
double maxFlow ()
 The largest one-way flow value in any path.
 
double netFlow (size_t k1, size_t k2)
 The net flow from node k1 to node k2.
 
double flow (size_t k1, size_t k2)
 The one-way flow from node k1 to node k2.
 
bool hasNode (size_t k)
 True if a node for species k exists.
 
void writeData (std::ostream &s)
 
string getData ()
 Get a (roughly) human-readable representation of the reaction path diagram.
 
void exportToDot (std::ostream &s)
 Export the reaction path diagram.
 
string getDot ()
 Export string in dot format.
 
void add (ReactionPathDiagram &d)
 
void add (shared_ptr< ReactionPathDiagram > d)
 Add fluxes from other ReactionPathDiagram to this diagram.
 
SpeciesNodenode (size_t k)
 
Pathpath (size_t k1, size_t k2)
 
Pathpath (size_t n)
 
size_t nPaths ()
 
size_t nNodes ()
 
void addNode (size_t k, const string &nm, double x=0.0)
 
void displayOnly (size_t k=npos)
 Include only species and fluxes that are directly connected to a species.
 
void linkNodes (size_t k1, size_t k2, size_t rxn, double value, string legend="")
 
void include (const string &aaname)
 
void exclude (const string &aaname)
 
void include (vector< string > &names)
 
void exclude (vector< string > &names)
 
vector< string > & included ()
 
vector< string > & excluded ()
 
vector< size_t > species ()
 
vector< int > reactions ()
 
void findMajorPaths (double threshold, size_t lda, double *a)
 Undocumented.
 
void setFont (const string &font)
 Set name of the font used.
 
const string flowType () const
 Get the way flows are drawn. Either 'NetFlow' or 'OneWayFlow'.
 
void setFlowType (const string &fType)
 Get the way flows are drawn. Either 'NetFlow' or 'OneWayFlow'.
 
void build ()
 Build the reaction path diagram.
 
string getLog ()
 Get logging messages generated while building the reaction path diagram.
 

Public Attributes

Public Attributes
string title
 Reaction path diagram title.
 
string bold_color = "blue"
 Color for bold lines.
 
string normal_color = "steelblue"
 Color for normal-weight lines.
 
string dashed_color = "gray"
 Color for dashed lines.
 
string element
 Element used for the construction of a reaction path diagram.
 
string m_font = "Helvetica"
 Reaction path diagram font.
 
double threshold = 0.005
 Threshold for the minimum flux relative value that will be plotted.
 
double bold_min = 0.2
 Minimum relative flux for bold lines.
 
double dashed_max = 0.0
 Maximum relative flux for dashed lines.
 
double label_min = 0.0
 Minimum relative flux for labels.
 
double x_size = -1.0
 Maximum size (x-dimension).
 
double y_size = -1.0
 Maximum size (y-dimension).
 
string name = "reaction_paths"
 Name used for dot export.
 
string dot_options = "center=1;"
 Options for the 'dot' program.
 
flow_t flow_type = NetFlow
 The way flows are drawn. Either 'NetFlow' or 'OneWayFlow'.
 
double scale = -1
 The scaling factor for the fluxes.
 
double arrow_width = -5.0
 The arrow width. If < 0, then scale with flux value.
 
bool show_details = false
 Boolean flag to show details.
 
double arrow_hue = 0.6666
 Unused.
 

Protected Attributes

double m_flxmax = 0.0
 
map< size_t, map< size_t, Path * > > m_paths
 
map< size_t, SpeciesNode * > m_nodes
 map of species index to SpeciesNode
 
vector< Path * > m_pathlist
 
vector< string > m_include
 
vector< string > m_exclude
 
vector< size_t > m_speciesNumber
 
set< size_t > m_rxns
 Indices of reactions that are included in the diagram.
 
size_t m_local = npos
 
bool m_isBuilt = false
 Boolean indicating whether diagram is built.
 
shared_ptr< Kineticsm_kin
 Kinetics used by ReactionPathBuilder.
 
shared_ptr< ReactionPathBuilderm_builder
 Shared pointer to ReactionPathBuilder.
 
std::stringstream m_log
 Logging stream.
 

Constructor & Destructor Documentation

◆ ReactionPathDiagram()

ReactionPathDiagram ( shared_ptr< Kinetics kin,
const string &  element_ 
)

Construct new reaction path diagram.

The method creates a reaction path diagram for the fluxes of element according to instantaneous net reaction rates.

Parameters
kinShared pointer to Kinetics object.
element_Element used for the calculation of net reaction rates.

Definition at line 82 of file ReactionPath.cpp.

◆ ~ReactionPathDiagram()

~ReactionPathDiagram ( )
virtual

Destructor.

Deletes all nodes and paths in the diagram.

Definition at line 93 of file ReactionPath.cpp.

Member Function Documentation

◆ maxFlow()

double maxFlow ( )
inline

The largest one-way flow value in any path.

Definition at line 180 of file ReactionPath.h.

◆ netFlow()

double netFlow ( size_t  k1,
size_t  k2 
)
inline

The net flow from node k1 to node k2.

Definition at line 185 of file ReactionPath.h.

◆ flow()

double flow ( size_t  k1,
size_t  k2 
)
inline

The one-way flow from node k1 to node k2.

Definition at line 190 of file ReactionPath.h.

◆ hasNode()

bool hasNode ( size_t  k)
inline

True if a node for species k exists.

Definition at line 195 of file ReactionPath.h.

◆ writeData()

void writeData ( std::ostream &  s)

Definition at line 219 of file ReactionPath.cpp.

◆ getData()

string getData ( )

Get a (roughly) human-readable representation of the reaction path diagram.

See also
writeData

Definition at line 204 of file ReactionPath.cpp.

◆ exportToDot()

void exportToDot ( std::ostream &  s)

Export the reaction path diagram.

This method writes to stream s the commands for the 'dot' program in the 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:

dot -Tps paths.dot > paths.ps
double dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
Function that calculates a templated inner product.
Definition utilities.h:82

To generate a GIF image, replace -Tps with -Tgif

Definition at line 239 of file ReactionPath.cpp.

◆ getDot()

string getDot ( )

Export string in dot format.

Return a string containing the reaction path diagram formatted for use by Graphviz's 'dot' program.

See also
exportToDot

Definition at line 194 of file ReactionPath.cpp.

◆ add() [1/2]

void add ( ReactionPathDiagram d)

Definition at line 130 of file ReactionPath.cpp.

◆ add() [2/2]

void add ( shared_ptr< ReactionPathDiagram d)

Add fluxes from other ReactionPathDiagram to this diagram.

Definition at line 140 of file ReactionPath.cpp.

◆ node()

SpeciesNode * node ( size_t  k)
inline

Definition at line 234 of file ReactionPath.h.

◆ path() [1/2]

Path * path ( size_t  k1,
size_t  k2 
)
inline

Definition at line 237 of file ReactionPath.h.

◆ path() [2/2]

Path * path ( size_t  n)
inline

Definition at line 240 of file ReactionPath.h.

◆ nPaths()

size_t nPaths ( )
inline

Definition at line 243 of file ReactionPath.h.

◆ nNodes()

size_t nNodes ( )
inline

Definition at line 246 of file ReactionPath.h.

◆ addNode()

void addNode ( size_t  k,
const string &  nm,
double  x = 0.0 
)

Definition at line 422 of file ReactionPath.cpp.

◆ displayOnly()

void displayOnly ( size_t  k = npos)
inline

Include only species and fluxes that are directly connected to a species.

Set to -1 to include all species.

Definition at line 254 of file ReactionPath.h.

◆ linkNodes()

void linkNodes ( size_t  k1,
size_t  k2,
size_t  rxn,
double  value,
string  legend = "" 
)

Definition at line 433 of file ReactionPath.cpp.

◆ include() [1/2]

void include ( const string &  aaname)
inline

Definition at line 260 of file ReactionPath.h.

◆ exclude() [1/2]

void exclude ( const string &  aaname)
inline

Definition at line 263 of file ReactionPath.h.

◆ include() [2/2]

void include ( vector< string > &  names)
inline

Definition at line 266 of file ReactionPath.h.

◆ exclude() [2/2]

void exclude ( vector< string > &  names)
inline

Definition at line 271 of file ReactionPath.h.

◆ included()

vector< string > & included ( )
inline

Definition at line 276 of file ReactionPath.h.

◆ excluded()

vector< string > & excluded ( )
inline

Definition at line 279 of file ReactionPath.h.

◆ species()

vector< size_t > species ( )

Definition at line 447 of file ReactionPath.cpp.

◆ reactions()

vector< int > reactions ( )

Definition at line 107 of file ReactionPath.cpp.

◆ findMajorPaths()

void findMajorPaths ( double  threshold,
size_t  lda,
double *  a 
)

Undocumented.

Todo:
Add documentation.

Definition at line 145 of file ReactionPath.cpp.

◆ setFont()

void setFont ( const string &  font)
inline

Set name of the font used.

Definition at line 292 of file ReactionPath.h.

◆ flowType()

const string flowType ( ) const

Get the way flows are drawn. Either 'NetFlow' or 'OneWayFlow'.

Definition at line 168 of file ReactionPath.cpp.

◆ setFlowType()

void setFlowType ( const string &  fType)

Get the way flows are drawn. Either 'NetFlow' or 'OneWayFlow'.

Definition at line 176 of file ReactionPath.cpp.

◆ build()

void build ( )

Build the reaction path diagram.

Called automatically by methods which return representations of the diagram, for example writeDot().

Definition at line 188 of file ReactionPath.cpp.

◆ getLog()

string getLog ( )

Get logging messages generated while building the reaction path diagram.

Definition at line 214 of file ReactionPath.cpp.

Member Data Documentation

◆ title

string title

Reaction path diagram title.

Definition at line 315 of file ReactionPath.h.

◆ bold_color

string bold_color = "blue"

Color for bold lines.

Definition at line 316 of file ReactionPath.h.

◆ normal_color

string normal_color = "steelblue"

Color for normal-weight lines.

Definition at line 317 of file ReactionPath.h.

◆ dashed_color

string dashed_color = "gray"

Color for dashed lines.

Definition at line 318 of file ReactionPath.h.

◆ element

string element

Element used for the construction of a reaction path diagram.

Definition at line 319 of file ReactionPath.h.

◆ m_font

string m_font = "Helvetica"

Reaction path diagram font.

Definition at line 320 of file ReactionPath.h.

◆ threshold

double threshold = 0.005

Threshold for the minimum flux relative value that will be plotted.

Definition at line 322 of file ReactionPath.h.

◆ bold_min

double bold_min = 0.2

Minimum relative flux for bold lines.

Definition at line 323 of file ReactionPath.h.

◆ dashed_max

double dashed_max = 0.0

Maximum relative flux for dashed lines.

Definition at line 324 of file ReactionPath.h.

◆ label_min

double label_min = 0.0

Minimum relative flux for labels.

Definition at line 325 of file ReactionPath.h.

◆ x_size

double x_size = -1.0

Maximum size (x-dimension).

Definition at line 326 of file ReactionPath.h.

◆ y_size

double y_size = -1.0

Maximum size (y-dimension).

Definition at line 327 of file ReactionPath.h.

◆ name

string name = "reaction_paths"

Name used for dot export.

Definition at line 328 of file ReactionPath.h.

◆ dot_options

string dot_options = "center=1;"

Options for the 'dot' program.

Definition at line 329 of file ReactionPath.h.

◆ flow_type

flow_t flow_type = NetFlow

The way flows are drawn. Either 'NetFlow' or 'OneWayFlow'.

Definition at line 331 of file ReactionPath.h.

◆ scale

double scale = -1

The scaling factor for the fluxes.

Set to -1 to normalize by the maximum net flux. Scale to use for normalization.

Definition at line 334 of file ReactionPath.h.

◆ arrow_width

double arrow_width = -5.0

The arrow width. If < 0, then scale with flux value.

Definition at line 336 of file ReactionPath.h.

◆ show_details

bool show_details = false

Boolean flag to show details.

Definition at line 337 of file ReactionPath.h.

◆ arrow_hue

double arrow_hue = 0.6666

Unused.

Definition at line 338 of file ReactionPath.h.

◆ m_flxmax

double m_flxmax = 0.0
protected

Definition at line 343 of file ReactionPath.h.

◆ m_paths

map<size_t, map<size_t, Path*> > m_paths
protected

Definition at line 344 of file ReactionPath.h.

◆ m_nodes

map<size_t, SpeciesNode*> m_nodes
protected

map of species index to SpeciesNode

Definition at line 347 of file ReactionPath.h.

◆ m_pathlist

vector<Path*> m_pathlist
protected

Definition at line 348 of file ReactionPath.h.

◆ m_include

vector<string> m_include
protected

Definition at line 349 of file ReactionPath.h.

◆ m_exclude

vector<string> m_exclude
protected

Definition at line 350 of file ReactionPath.h.

◆ m_speciesNumber

vector<size_t> m_speciesNumber
protected

Definition at line 351 of file ReactionPath.h.

◆ m_rxns

set<size_t> m_rxns
protected

Indices of reactions that are included in the diagram.

Definition at line 354 of file ReactionPath.h.

◆ m_local

size_t m_local = npos
protected

Definition at line 355 of file ReactionPath.h.

◆ m_isBuilt

bool m_isBuilt = false
protected

Boolean indicating whether diagram is built.

Definition at line 357 of file ReactionPath.h.

◆ m_kin

shared_ptr<Kinetics> m_kin
protected

Kinetics used by ReactionPathBuilder.

Definition at line 358 of file ReactionPath.h.

◆ m_builder

shared_ptr<ReactionPathBuilder> m_builder
protected

Shared pointer to ReactionPathBuilder.

Definition at line 359 of file ReactionPath.h.

◆ m_log

std::stringstream m_log
protected

Logging stream.

Definition at line 360 of file ReactionPath.h.


The documentation for this class was generated from the following files: