Cantera  2.4.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 #include "cantera/base/AnyMap.h"
11 
12 namespace Cantera
13 {
14 
15 class SpeciesThermoInterpType;
16 class TransportData;
17 class XML_Node;
18 
19 //! Contains data about a single chemical species
20 /*!
21  * This class stores the data about a species which may be needed to add it to
22  * a ThermoPhase or Transport object.
23  */
24 class Species
25 {
26 public:
27  Species();
28 
29  //! Constructor
30  Species(const std::string& name, const compositionMap& comp,
31  double charge=0.0, double size=1.0);
32 
33  //! Species objects are not copyable or assignable
34  Species(const Species&) = delete;
35  Species& operator=(const Species& other) = delete;
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  //! Extra data used for specific models
59 };
60 
61 //! Create a new Species object from a 'species' XML_Node.
62 shared_ptr<Species> newSpecies(const XML_Node& species_node);
63 
64 //! Generate Species objects for all `<species>` nodes in an XML document.
65 //!
66 //! The `<species>` nodes are assumed to be children of the `<speciesData>` node
67 //! in an XML document with a `<ctml>` root node, as in the case of XML files
68 //! produced by conversion from CTI files.
69 //!
70 //! This function can be used in combination with get_XML_File and
71 //! get_XML_from_string to get Species objects from either a file or a string,
72 //! respectively, where the string or file is formatted as either CTI or XML.
73 std::vector<shared_ptr<Species> > getSpecies(const XML_Node& node);
74 
75 }
76 
77 #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:80
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:35
double charge
The electrical charge on the species, in units of the elementary charge.
Definition: Species.h:46
AnyMap extra
Extra data used for specific models.
Definition: Species.h:58
compositionMap composition
The elemental composition of the species.
Definition: Species.h:43
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:173
double size
The effective size of the species.
Definition: Species.h:50
Contains data about a single chemical species.
Definition: Species.h:24
shared_ptr< SpeciesThermoInterpType > thermo
Thermodynamic data for the species.
Definition: Species.h:55
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8