23 double charge_,
double size_)
37 , composition(other.composition)
38 , charge(other.charge)
40 , transport(other.transport)
43 "To be removed after Cantera 2.3.");
45 thermo.reset(other.
thermo->duplMyselfAsSpeciesThermoInterpType());
52 "To be removed after Cantera 2.3.");
60 transport = other.transport;
62 thermo.reset(other.
thermo->duplMyselfAsSpeciesThermoInterpType());
69 std::string name = species_node[
"name"];
71 auto s = make_shared<Species>(name, comp);
72 if (species_node.
hasChild(
"charge")) {
73 s->charge =
getFloat(species_node,
"charge");
76 s->size =
getFloat(species_node,
"size");
81 if (species_node.
hasChild(
"transport")) {
83 s->transport->validate(*s);
91 std::vector<shared_ptr<Species> > all_species;
92 for (
const auto& spnode : node.
child(
"speciesData").
getChildren(
"species")) {
std::map< std::string, doublereal > compositionMap
Map connecting a string name with a double.
std::vector< XML_Node * > getChildren(const std::string &name) const
Get a vector of pointers to XML_Node containing all of the children of the current node which match t...
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.
Species & operator=(const Species &other)
Class XML_Node is a tree-based representation of the contents of an XML file.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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.
std::string value() const
Return the value of an XML node as a string.
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.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
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.
Header for factory functions to build instances of classes that manage the standard-state thermodynam...
double size
The effective size 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.
Namespace for the Cantera kernel.
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.