diff --git a/src/base/ctml.cpp b/src/base/ctml.cpp index 00940ce4c..8406349fc 100644 --- a/src/base/ctml.cpp +++ b/src/base/ctml.cpp @@ -505,99 +505,6 @@ size_t getFloatArray(const Cantera::XML_Node& node, std::vector & v, return v.size(); } -int getNamedFloatArray(const Cantera::XML_Node& parentNode, const std::string& nodeName, std::vector & v, - const bool convert, const std::string unitsString) -{ - std::string::size_type icom; - std::string numstr; - doublereal dtmp; - std::string nn = parentNode.name(); - v.clear(); - const Cantera::XML_Node* readNode = parentNode.findByName(nodeName); - if (!readNode) { - return 0; - } - - doublereal vmin = Undef; - doublereal vmax = Undef; - doublereal funit = 1.0; - /* - * Get the attributes field, units, from the XML node - */ - std::string units = (*readNode)["units"]; - if (units != "" && convert) { - if (unitsString == "actEnergy" && units != "") { - funit = actEnergyToSI(units); - } else if (unitsString != "" && units != "") { - funit = toSI(units); - } - } - - if ((*readNode)["min"] != "") { - vmin = fpValueCheck((*readNode)["min"]); - } - if ((*readNode)["max"] != "") { - vmax = fpValueCheck((*readNode)["max"]); - } - - int expectedSize = 0; - nn = (*readNode)["size"]; - expectedSize = atoi(nn.c_str()); - - nn = (*readNode)["vtype"]; - if (nn != "floatArray") { - throw CanteraError("getNamedFloatArray", - "node named " + nodeName + "didn't have correct vtype"); - } - - - doublereal vv; - std::string val = readNode->value(); - while (1 > 0) { - icom = val.find(','); - if (icom != string::npos) { - numstr = val.substr(0,icom); - val = val.substr(icom+1,val.size()); - dtmp = fpValueCheck(numstr); - v.push_back(dtmp); - } else { - /* - * This little bit of code is to allow for the - * possibility of a comma being the last - * item in the value text. This was allowed in - * previous versions of Cantera, even though it - * would appear to be odd. So, we keep the - * possibilty in for backwards compatibility. - */ - int nlen = strlen(val.c_str()); - if (nlen > 0) { - dtmp = fpValueCheck(val); - v.push_back(dtmp); - } - break; - } - vv = v.back(); - if (vmin != Undef && vv < vmin - Tiny) { - writelog("\nWarning: value "+fp2str(vv)+ - " is below lower limit of " +fp2str(vmin)+".\n"); - } - if (vmax != Undef && vv > vmax + Tiny) { - writelog("\nWarning: value "+fp2str(vv)+ - " is above upper limit of " +fp2str(vmin)+".\n"); - } - } - int nv = v.size(); - for (int n = 0; n < nv; n++) { - v[n] *= funit; - } - if (nv != expectedSize) { - throw CanteraError("getNamedFloatArray", - "node named " + nodeName + "didn't have correct number of floats" - + int2str(expectedSize) + " vs " + int2str(nv)); - } - return nv; -} - void getMap(const Cantera::XML_Node& node, std::map& m) { std::vector v;