73 doublereal
toSI(
const std::string& units_) {
79 doublereal f = 1.0, fctr;
80 std::string u = units_, tok, tsub;
81 std::string::size_type k;
87 k = u.find_first_of(
"/-");
93 size_t tsize = tok.size();
96 }
else if (tok[tsize - 1] ==
'2') {
97 tsub = tok.substr(0,tsize-1);
100 }
else if (tok[tsize - 1] ==
'3') {
101 tsub = tok.substr(0,tsize-1);
104 }
else if (tok[tsize - 1] ==
'4') {
105 tsub = tok.substr(0,tsize-1);
107 fctr *= fctr*fctr*fctr;
108 }
else if (tok[tsize - 1] ==
'5') {
109 tsub = tok.substr(0,tsize-1);
111 fctr *= fctr*fctr*fctr*fctr;
112 }
else if (tok[tsize - 1] ==
'6') {
113 tsub = tok.substr(0,tsize-1);
115 fctr *= fctr*fctr*fctr*fctr*fctr;
124 throw CanteraError(
"Unit::toSI",
"unknown unit: '{}'", tsub);
128 }
else if (action ==
'/') {
135 u = u.substr(k+1,u.size());
150 std::map<std::string, doublereal>
m_u;
173 m_u[
"micron"] = 1.0e-6;
176 m_u[
"Angstrom"] = 1.0e-10;
177 m_u[
"Angstroms"] = 1.0e-10;
183 m_u[
"kcal"] = 4184.0;
191 m_u[
"gmol"] = 1.0e-3;
192 m_u[
"mole"] = 1.0e-3;
208 m_u[
"atm"] = 1.01325e5;
222 m_u[
"coulomb"] = 1.0;
237 m_u[
"centipoise"] = 0.001;
243 m_u[
"liter"] = 0.001;