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)
171 <<
"Cannot continue reading reaction data from stream"
189 if (
mag(scs[i].stoichCoeff - 1) > small)
194 if (
mag(scs[i].exponent.operator scalar() - scs[i].stoichCoeff) > small)
210 reactionStr(
reaction, species, lhs);
212 reactionStr(
reaction, species, rhs);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
T remove()
Remove and return the top element.
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.
void clear()
Clear the addressed list, i.e. set the size to zero.
bool good() const
Return true if next operation might succeed.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
Output to memory buffer stream.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
T & last()
Return the last element of the list.
A wordList with hashed indices for faster lookup by name.
bool found(const word &) const
Does the list contain the specified name.
Reaction base-class holding the specie names and coefficients.
Class to hold the specie index and its coefficients in the reaction rate expression.
specieExponent exponent
Exponent of the specie concentration.
static void setLRhs(Istream &, const speciesTable &, List< specieCoeffs > &lhs, List< specieCoeffs > &rhs)
Construct the left- and right-hand-side reaction coefficients.
scalar stoichCoeff
Stoichiometric coefficient.
specieCoeffs()
Construct null.
label index
Index of the specie.
static void reactionStr(OStringStream &reaction, const speciesTable &, const List< specieCoeffs > &scs)
Write the string representation of the specieCoeffs list.
A class for handling character strings derived from std::string.
A token holds items read from Istream.
bool isPunctuation() const
InfoProxy< token > info() const
Return info proxy.
const word & wordToken() const
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< scalar > mag(const dimensioned< Type > &)