Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Species.h
Go to the documentation of this file.
1 //! @file Species.h Declaration for class Cantera::Species.
2 
3 #ifndef CT_SPECIES_H
4 #define CT_SPECIES_H
5 
6 #include "cantera/base/ct_defs.h"
7 #include "cantera/base/smart_ptr.h"
8 
9 namespace Cantera
10 {
11 
12 class SpeciesThermoInterpType;
13 class TransportData;
14 class XML_Node;
15 
16 //! Contains data about a single chemical species
17 /*!
18  * This class stores the data about a species which may be needed to add it to
19  * a ThermoPhase or Transport object.
20  */
21 class Species
22 {
23 public:
24  Species();
25 
26  //! Constructor
27  Species(const std::string& name, const compositionMap& comp,
28  double charge=0.0, double size=1.0);
29 
30  Species(const Species& other);
31  Species& operator=(const Species& other);
32  ~Species();
33 
34  //! The name of the species
35  std::string name;
36 
37  //! The elemental composition of the species. Keys are element names; values
38  //! are the corresponding atomicities.
40 
41  //! The electrical charge on the species, in units of the elementary charge.
42  double charge;
43 
44  //! The effective size [m] of the species
45  double size;
46 
47  shared_ptr<TransportData> transport;
48 
49  //! Thermodynamic data for the species
50  shared_ptr<SpeciesThermoInterpType> thermo;
51 };
52 
53 //! Create a new Species object from a 'species' XML_Node.
54 shared_ptr<Species> newSpecies(const XML_Node& species_node);
55 
56 //! Generate Species objects for all `<species>` nodes in an XML document.
57 //!
58 //! The `<species>` nodes are assumed to be children of the `<speciesData>` node
59 //! in an XML document with a `<ctml>` root node, as in the case of XML files
60 //! produced by conversion from CTI files.
61 //!
62 //! This function can be used in combination with get_XML_File and
63 //! get_XML_from_string to get Species objects from either a file or a string,
64 //! respectively, where the string or file is formatted as either CTI or XML.
65 std::vector<shared_ptr<Species> > getSpecies(const XML_Node& node);
66 
67 }
68 
69 #endif
std::map< std::string, doublereal > compositionMap
Map connecting a string name with a double.
Definition: ct_defs.h:149
std::vector< shared_ptr< Species > > getSpecies(const XML_Node &node)
Generate Species objects for all <species> nodes in an XML document.
Definition: Species.cpp:83
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
std::string name
The name of the species.
Definition: Species.h:35
shared_ptr< Species > newSpecies(const XML_Node &species_node)
Create a new Species object from a 'species' XML_Node.
Definition: Species.cpp:61
double charge
The electrical charge on the species, in units of the elementary charge.
Definition: Species.h:42
compositionMap composition
The elemental composition of the species.
Definition: Species.h:39
double size
The effective size [m] of the species.
Definition: Species.h:45
Contains data about a single chemical species.
Definition: Species.h:21
shared_ptr< SpeciesThermoInterpType > thermo
Thermodynamic data for the species.
Definition: Species.h:50