23 double charge_,
double size_)
37 std::string name = species_node[
"name"];
39 auto s = make_shared<Species>(name, comp);
40 if (species_node.
hasChild(
"charge")) {
41 s->charge =
getFloat(species_node,
"charge");
44 s->size =
getFloat(species_node,
"size");
49 if (species_node.
hasChild(
"transport")) {
51 s->transport->validate(*s);
55 if (species_node.
hasChild(
"stoichIsMods")) {
56 s->extra[
"weak_acid_charge"] =
getFloat(species_node,
"stoichIsMods");
59 if (species_node.
hasChild(
"electrolyteSpeciesType")) {
60 s->extra[
"electrolyte_species_type"] = species_node.
child(
"electrolyteSpeciesType").
value();
65 if (stdstate && stdstate->
findByName(
"molarVolume")) {
66 s->extra[
"molar_volume"] =
getFloat(*stdstate,
"molarVolume",
"toSI");
71 if (thermo && thermo->
attrib(
"model") ==
"IonFromNeutral") {
72 if (thermo->
hasChild(
"specialSpecies")) {
73 s->extra[
"special_species"] =
true;
82 std::vector<shared_ptr<Species> > all_species;
83 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...
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node...
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.
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
shared_ptr< Species > newSpecies(const XML_Node &species_node)
Create a new Species object from a 'species' XML_Node.
std::string value() const
Return the value of an XML node as a string.
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...
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
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.
Declaration for class Cantera::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.