21 double charge_,
double size_)
33 Species::Species(
const Species& other)
35 , composition(other.composition)
36 , charge(other.charge)
38 , transport(other.transport)
41 thermo.reset(other.thermo->duplMyselfAsSpeciesThermoInterpType());
45 Species& Species::operator=(
const Species& other)
54 transport = other.transport;
56 thermo.reset(other.thermo->duplMyselfAsSpeciesThermoInterpType());
63 std::string name = species_node[
"name"];
65 shared_ptr<Species> s(
new Species(name, comp));
66 if (species_node.
hasChild(
"charge")) {
67 s->charge =
getFloat(species_node,
"charge");
70 s->size =
getFloat(species_node,
"size");
75 if (species_node.
hasChild(
"transport")) {
77 s->transport->validate(*s);
85 std::vector<shared_ptr<Species> > all_species;
86 std::vector<XML_Node*> species_nodes =
89 for (std::vector<XML_Node*>::iterator iter = species_nodes.begin();
90 iter != species_nodes.end();
std::map< std::string, doublereal > compositionMap
Map connecting a string name with a double.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
SpeciesThermoInterpType * newSpeciesThermoInterpType(int type, double tlow, double thigh, double pref, const double *coeffs)
Create a new SpeciesThermoInterpType object given a corresponding constant.
std::vector< shared_ptr< Species > > getSpecies(const XML_Node &node)
Generate Species objects for all <species> nodes in an XML document.
Class XML_Node is a tree-based representation of the contents of an XML file.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
std::string name
The name of the species.
shared_ptr< Species > newSpecies(const XML_Node &species_node)
Create a new Species object from a 'species' XML_Node.
double charge
The electrical charge on the species, in units of the elementary charge.
compositionMap composition
The elemental composition of the species.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
compositionMap parseCompString(const std::string &ss, const std::vector< std::string > &names)
Parse a composition string into a map consisting of individual key:composition pairs.
std::string value() const
Return the value of an XML node as a string.
Header for factory to build instances of classes that manage the standard-state thermodynamic propert...
double size
The effective size [m] of the species.
Contains declarations for string manipulation functions within Cantera.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Contains data about a single chemical species.
Declaration for class Cantera::Species.
shared_ptr< SpeciesThermoInterpType > thermo
Thermodynamic data for the species.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
shared_ptr< TransportData > newTransportData(const XML_Node &transport_node)
Create a new TransportData object from a 'transport' XML_Node.
void getChildren(const std::string &name, std::vector< XML_Node * > &children) const
Get a vector of pointers to XML_Node containing all of the children of the current node which matches...