Cantera  2.3.0
Species.h
Go to the documentation of this file.
1 //! @file Species.h Declaration for class Cantera::Species.
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CT_SPECIES_H
7 #define CT_SPECIES_H
8 
9 #include "cantera/base/ct_defs.h"
10 
11 namespace Cantera
12 {
13 
14 class SpeciesThermoInterpType;
15 class TransportData;
16 class XML_Node;
17 
18 //! Contains data about a single chemical species
19 /*!
20  * This class stores the data about a species which may be needed to add it to
21  * a ThermoPhase or Transport object.
22  */
23 class Species
24 {
25 public:
26  Species();
27 
28  //! Constructor
29  Species(const std::string& name, const compositionMap& comp,
30  double charge=0.0, double size=1.0);
31 
32  //! @deprecated To be removed after Cantera 2.3.
33  Species(const Species& other);
34  //! @deprecated To be removed after Cantera 2.3.
35  Species& operator=(const Species& other);
36  ~Species();
37 
38  //! The name of the species
39  std::string name;
40 
41  //! The elemental composition of the species. Keys are element names; values
42  //! are the corresponding atomicities.
44 
45  //! The electrical charge on the species, in units of the elementary charge.
46  double charge;
47 
48  //! The effective size of the species. Currently used only for surface
49  //! species, where it represents the number of sites occupied.
50  double size;
51 
52  shared_ptr<TransportData> transport;
53 
54  //! Thermodynamic data for the species
55  shared_ptr<SpeciesThermoInterpType> thermo;
56 };
57 
58 //! Create a new Species object from a 'species' XML_Node.
59 shared_ptr<Species> newSpecies(const XML_Node& species_node);
60 
61 //! Generate Species objects for all `<species>` nodes in an XML document.
62 //!
63 //! The `<species>` nodes are assumed to be children of the `<speciesData>` node
64 //! in an XML document with a `<ctml>` root node, as in the case of XML files
65 //! produced by conversion from CTI files.
66 //!
67 //! This function can be used in combination with get_XML_File and
68 //! get_XML_from_string to get Species objects from either a file or a string,
69 //! respectively, where the string or file is formatted as either CTI or XML.
70 std::vector<shared_ptr<Species> > getSpecies(const XML_Node& node);
71 
72 }
73 
74 #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:89
Species & operator=(const Species &other)
Definition: Species.cpp:49
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
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:39
shared_ptr< Species > newSpecies(const XML_Node &species_node)
Create a new Species object from a &#39;species&#39; XML_Node.
Definition: Species.cpp:67
double charge
The electrical charge on the species, in units of the elementary charge.
Definition: Species.h:46
compositionMap composition
The elemental composition of the species.
Definition: Species.h:43
double size
The effective size of the species.
Definition: Species.h:50
Contains data about a single chemical species.
Definition: Species.h:23
shared_ptr< SpeciesThermoInterpType > thermo
Thermodynamic data for the species.
Definition: Species.h:55
Namespace for the Cantera kernel.
Definition: application.cpp:29