50 exponent = stoichCoeff;
56 size_t i = specieName.find(
'^');
60 string exponentStr = specieName
63 specieName.size() - i - 1
65 exponent = scalar(atof(exponentStr.c_str()));
66 specieName = specieName(0, i);
69 if (species.
found(specieName))
71 index = species[specieName];
76 <<
"Specie " << specieName
77 <<
" not found in table " << species
86 <<
"Expected a word but found " << t.
info()
108 if (dlrhs.
last().index != -1)
116 else if (t == token::ASSIGN)
146 else if (t == token::ASSIGN)
171 <<
"Cannot continue reading reaction data from stream" 189 if (
mag(scs[i].stoichCoeff - 1) > small)
191 reaction << scs[i].stoichCoeff;
193 reaction << species[scs[i].index];
194 if (
mag(scs[i].exponent.operator scalar() - scs[i].stoichCoeff) > small)
196 reaction <<
"^" << scs[i].exponent;
210 reactionStr(reaction, species, lhs);
212 reactionStr(reaction, species, rhs);
213 return reaction.
str();
bool empty() const
Return true if the UList is empty (ie, size() is zero)
bool found(const word &) const
Does the list contain the specified name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Class to hold the specie index and its coefficients in the reaction rate expression.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
InfoProxy< token > info() const
Return info proxy.
const word & wordToken() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
A token holds items read from Istream.
void putBack(const token &)
Put back token.
bool good() const
Return true if next operation might succeed.
static void reactionStr(OStringStream &reaction, const speciesTable &, const List< specieCoeffs > &scs)
Write the string representation of the specieCoeffs list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
T remove()
Remove and return the top element.
static void setLRhs(Istream &, const speciesTable &, List< specieCoeffs > &lhs, List< specieCoeffs > &rhs)
Construct the left- and right-hand-side reaction coefficients.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A wordList with hashed indices for faster lookup by name.
string str() const
Return the string.
dimensioned< scalar > mag(const dimensioned< Type > &)
T & last()
Return the last element of the list.
void clear()
Clear the addressed list, i.e. set the size to zero.
A class for handling character strings derived from std::string.
Output to memory buffer stream.
specieCoeffs()
Construct null.
bool isPunctuation() const