17 const std::vector<std::string> & names,
22 mooseError(
"GeochemistryFormattedOutput::reaction called with stoichiometric matrix having ",
26 const unsigned num_cols = stoi.
n();
27 if (num_cols != names.size())
28 mooseError(
"GeochemistryFormattedOutput::reaction called with stoichiometric matrix having ",
30 " columns, but names has size ",
33 ss << std::setprecision(precision);
34 bool printed_something =
false;
35 for (
unsigned i = 0; i < num_cols; ++i)
36 if (stoi(row, i) > stoi_tol)
38 if (!printed_something)
40 ss << stoi(row, i) <<
"*" << names[i];
41 printed_something =
true;
44 ss <<
" + " << stoi(row, i) <<
"*" << names[i];
46 else if (stoi(row, i) < -stoi_tol)
48 if (!printed_something)
50 ss <<
"-" << -stoi(row, i) <<
"*" << names[i];
51 printed_something =
true;
54 ss <<
" - " << -stoi(row, i) <<
"*" << names[i];
void mooseError(Args &&... args)