Clean up line wrapping and indentation

This commit is contained in:
Ray Speth 2023-08-04 23:51:47 -04:00 committed by Ray Speth
parent c50b8b4faf
commit 53396d4414
100 changed files with 244 additions and 423 deletions

View File

@ -533,7 +533,7 @@ public:
* thrown if this condition is not met.
*/
vector<double> convertVector(const string& key, const string& units,
size_t nMin=npos, size_t nMax=npos) const;
size_t nMin=npos, size_t nMax=npos) const;
//! Defined to allow use with range-based for loops. Iteration automatically
//! skips over keys that start and end with double underscores.
@ -771,9 +771,8 @@ public:
return "InputFileError";
}
protected:
static string formatError(const string& message,
int line, int column,
const shared_ptr<AnyMap>& metadata);
static string formatError(const string& message, int line, int column,
const shared_ptr<AnyMap>& metadata);
static string formatError2(const string& message,
int line1, int column1, const shared_ptr<AnyMap>& metadata1,
int line2, int column2, const shared_ptr<AnyMap>& metadata2);

View File

@ -74,8 +74,7 @@ public:
//! @param rateName The name of the reaction rate type, which corresponds to the
//! name used to register the wrapper generator using registerReactionDataLinker
//! @param data The ReactionData object to be wrapped
static void wrapReactionData(const string& rateName,
ReactionDataDelegator& data);
static void wrapReactionData(const string& rateName, ReactionDataDelegator& data);
//! Create an object in an external language that wraps the specified Solution
//! object.
@ -108,8 +107,7 @@ public:
protected:
//! Functions for wrapping and linking ReactionData objects
static map<string,
function<void(ReactionDataDelegator&)>> s_ReactionData_linkers;
static map<string, function<void(ReactionDataDelegator&)>> s_ReactionData_linkers;
//! Functions for wrapping and linking Solution objects
static map<string,

View File

@ -207,8 +207,7 @@ public:
void setDefaultActivationEnergy(const string& e_units);
//! Convert `value` from the units of `src` to the units of `dest`.
double convert(double value, const string& src,
const string& dest) const;
double convert(double value, const string& src, const string& dest) const;
double convert(double value, const Units& src, const Units& dest) const;
//! Convert `value` to the specified `dest` units from the appropriate units

View File

@ -80,8 +80,7 @@ public:
* @param args Arguments which will be used to interpolate the format string
*/
template <typename... Args>
CanteraError(const string& procedure, const string& msg,
const Args&... args)
CanteraError(const string& procedure, const string& msg, const Args&... args)
: procedure_(procedure)
{
if (sizeof...(args) == 0) {
@ -202,8 +201,7 @@ public:
//! Alternative constructor taking same arguments as CanteraError
template <typename... Args>
NotImplementedError(const string& func, const string& msg,
const Args&... args) :
NotImplementedError(const string& func, const string& msg, const Args&... args) :
CanteraError(func, msg, args...) {}
virtual string getClass() const {

View File

@ -224,8 +224,7 @@ void _warn_deprecated(const string& method, const string& extra="");
* @param args arguments for the format string
*/
template <typename... Args>
void warn_deprecated(const string& method, const string& msg,
const Args&... args) {
void warn_deprecated(const string& method, const string& msg, const Args&... args) {
if (sizeof...(args) == 0) {
_warn_deprecated(method, msg);
} else {
@ -236,8 +235,7 @@ void warn_deprecated(const string& method, const string& msg,
//! @cond
//! helper function passing generic warning to global handler
void _warn(const string& warning,
const string& method, const string& extra);
void _warn(const string& warning, const string& method, const string& extra);
//! @endcond
@ -266,8 +264,7 @@ void warn(const string& warning, const string& method,
* @param args arguments for the format string
*/
template <typename... Args>
void warn_user(const string& method, const string& msg,
const Args&... args) {
void warn_user(const string& method, const string& msg, const Args&... args) {
if (sizeof...(args) == 0) {
_warn("Cantera", method, msg);
} else {

View File

@ -25,8 +25,7 @@ namespace Cantera
* @param fmt Format to be used (printf style) for each element
* @param sep Separator
*/
string vec2str(const vector<double>& v, const string& fmt="%g",
const string& sep=", ");
string vec2str(const vector<double>& v, const string& fmt="%g", const string& sep=", ");
//! Strip non-printing characters wherever they are
/*!

View File

@ -79,8 +79,7 @@ inline double dot5(const V& x, const V& y)
* @return The return is hard-coded to return a double.
*/
template<class InputIter, class InputIter2>
inline double dot(InputIter x_begin, InputIter x_end,
InputIter2 y_begin)
inline double dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
{
return std::inner_product(x_begin, x_end, y_begin, 0.0);
}

View File

@ -1512,8 +1512,7 @@ protected:
* @return 0.0 if the stoichiometries are not multiples of one another
* Otherwise, it returns the ratio of the stoichiometric coefficients.
*/
double checkDuplicateStoich(map<int, double>& r1,
map<int, double>& r2) const;
double checkDuplicateStoich(map<int, double>& r1, map<int, double>& r2) const;
//! @name Stoichiometry management
//!

View File

@ -327,8 +327,7 @@ unique_ptr<Reaction> newReaction(const AnyMap& rxn_node,
//! Create Reaction objects for each item (an AnyMap) in `items`. The species
//! involved in these reactions must exist in the phases associated with the
//! Kinetics object `kinetics`.
vector<shared_ptr<Reaction>> getReactions(const AnyValue& items,
Kinetics& kinetics);
vector<shared_ptr<Reaction>> getReactions(const AnyValue& items, Kinetics& kinetics);
//! Parse reaction equation
void parseReactionEquation(Reaction& R, const string& equation,

View File

@ -95,8 +95,7 @@ public:
* Add a reaction to the path. Increment the flow from this reaction, the
* total flow, and the flow associated with this label.
*/
void addReaction(size_t rxnNumber, double value,
const string& label = "");
void addReaction(size_t rxnNumber, double value, const string& label = "");
//! Upstream node.
const SpeciesNode* begin() const {

View File

@ -363,31 +363,27 @@ public:
}
}
void incrementSpecies(const double* input,
double* output) const {
void incrementSpecies(const double* input, double* output) const {
double x = input[m_rxn];
for (size_t n = 0; n < m_n; n++) {
output[m_ic[n]] += m_stoich[n]*x;
}
}
void decrementSpecies(const double* input,
double* output) const {
void decrementSpecies(const double* input, double* output) const {
double x = input[m_rxn];
for (size_t n = 0; n < m_n; n++) {
output[m_ic[n]] -= m_stoich[n]*x;
}
}
void incrementReaction(const double* input,
double* output) const {
void incrementReaction(const double* input, double* output) const {
for (size_t n = 0; n < m_n; n++) {
output[m_rxn] += m_stoich[n]*input[m_ic[n]];
}
}
void decrementReaction(const double* input,
double* output) const {
void decrementReaction(const double* input, double* output) const {
for (size_t n = 0; n < m_n; n++) {
output[m_rxn] -= m_stoich[n]*input[m_ic[n]];
}
@ -677,7 +673,7 @@ public:
void add(size_t rxn, const vector<size_t>& k, const vector<double>& order,
const vector<double>& stoich) {
if (order.size() != k.size()) {
throw CanteraError(\
throw CanteraError(
"StoichManagerN::add()", "size of order and species arrays differ");
}
if (stoich.size() != k.size()) {

View File

@ -35,8 +35,7 @@ namespace Cantera
* @returns the value of of the interpolated function at x.
* @ingroup mathUtils
*/
double linearInterp(double x, const vector<double>& xpts,
const vector<double>& fpts);
double linearInterp(double x, const vector<double>& xpts, const vector<double>& fpts);
//! Numerical integration of a function using the trapezoidal rule.
/*!

View File

@ -322,8 +322,7 @@ public:
* @param[in] rdt Reciprocal of the timestep (`rdt=0` implies steady-
* state.)
*/
virtual void eval(size_t j, double* x, double* r,
integer* mask, double rdt=0.0) {
virtual void eval(size_t j, double* x, double* r, integer* mask, double rdt=0.0) {
throw NotImplementedError("Domain1D::eval");
}

View File

@ -34,8 +34,7 @@ public:
//! Compute the undamped Newton step. The residual function is evaluated
//! at `x`, but the Jacobian is not recomputed.
void step(double* x, double* step,
OneDim& r, MultiJac& jac, int loglevel);
void step(double* x, double* step, OneDim& r, MultiJac& jac, int loglevel);
/**
* Return the factor by which the undamped Newton step 'step0'
@ -52,9 +51,8 @@ public:
* successful, the new solution after taking the damped step is returned in
* x1, and the undamped step at x1 is returned in step1.
*/
int dampStep(const double* x0, const double* step0,
double* x1, double* step1, double& s1,
OneDim& r, MultiJac& jac, int loglevel, bool writetitle);
int dampStep(const double* x0, const double* step0, double* x1, double* step1,
double& s1, OneDim& r, MultiJac& jac, int loglevel, bool writetitle);
//! Compute the weighted 2-norm of `step`.
double norm2(const double* x, const double* step, OneDim& r) const;

View File

@ -138,8 +138,7 @@ public:
* @param loglevel Level of diagnostic output
* @deprecated To be removed after %Cantera 3.0; loglevel is deprecated.
*/
void save(const string& fname, const string& id,
const string& desc, int loglevel);
void save(const string& fname, const string& id, const string& desc, int loglevel);
/**
* Save current simulation data to a container file or CSV format.
@ -168,9 +167,8 @@ public:
* if not specified (default=""), the native basis of the underlying
* ThermoPhase manager is used - @see nativeState (CSV only)
*/
void save(const string& fname, const string& name,
const string& desc, bool overwrite=false, int compression=0,
const string& basis="");
void save(const string& fname, const string& name, const string& desc,
bool overwrite=false, int compression=0, const string& basis="");
/**
* Save the residual of the current solution to a container file.

View File

@ -80,20 +80,16 @@ public:
* - m_t[0] = tt;
*
*/
void updateProperties(const double* tt,
double* cp_R, double* h_RT,
void updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const;
void updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
double* s_R) const;
size_t nCoeffs() const { return 4; }
void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const;
void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const;
virtual void getParameters(AnyMap& thermo) const;

View File

@ -422,8 +422,7 @@ public:
* If blank, an empty phase will be created.
* @param id id attribute containing the name of the phase.
*/
explicit DebyeHuckel(const string& inputFile="",
const string& id="");
explicit DebyeHuckel(const string& inputFile="", const string& id="");
//! @name Utilities
//! @{
@ -623,8 +622,7 @@ public:
virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
virtual void getParameters(AnyMap& phaseNode) const;
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
//! Return the Debye Huckel constant as a function of temperature
//! and pressure (Units = sqrt(kg/gmol))

View File

@ -258,8 +258,7 @@ public:
* @param id ID of the phase in the input file. Defaults to the
* empty string.
*/
explicit IdealGasPhase(const string& inputFile="",
const string& id="");
explicit IdealGasPhase(const string& inputFile="", const string& id="");
virtual string type() const {
return "ideal-gas";

View File

@ -76,8 +76,7 @@ public:
* about the phase. If blank, an empty phase will be created.
* @param id id of the phase within the input file
*/
explicit IdealMolalSoln(const string& inputFile="",
const string& id="");
explicit IdealMolalSoln(const string& inputFile="", const string& id="");
virtual string type() const {
return "ideal-molal-solution";

View File

@ -53,8 +53,7 @@ public:
* @param id The name of this phase. This is used to look up
* the phase in the input file.
*/
explicit IdealSolidSolnPhase(const string& infile="",
const string& id="");
explicit IdealSolidSolnPhase(const string& infile="", const string& id="");
virtual string type() const {
return "ideal-condensed";
@ -526,8 +525,7 @@ public:
virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
virtual void getParameters(AnyMap& phaseNode) const;
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
virtual void setToEquilState(const double* mu_RT);
//! Set the form for the standard and generalized concentrations

View File

@ -79,8 +79,7 @@ public:
* @param id name (ID) of the phase in the input file. If empty, the
* first phase definition in the input file will be used.
*/
explicit IonsFromNeutralVPSSTP(const string& inputFile="",
const string& id="");
explicit IonsFromNeutralVPSSTP(const string& inputFile="", const string& id="");
//! @}
//! @name Utilities
@ -179,7 +178,8 @@ public:
* This is the mapping between ion species and neutral molecule for
* quick invert.
*/
void getDissociationCoeffs(vector<double>& fm_neutralMolec_ions, vector<double>& charges, vector<size_t>& neutMolIndex) const;
void getDissociationCoeffs(vector<double>& fm_neutralMolec_ions,
vector<double>& charges, vector<size_t>& neutMolIndex) const;
//! Return the current value of the neutral mole fraction vector
/*!

View File

@ -553,8 +553,7 @@ public:
virtual void initThermo();
virtual void getParameters(AnyMap& phaseNode) const;
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
//! @}

View File

@ -435,8 +435,7 @@ public:
const AnyMap& rootNode=AnyMap());
virtual void initThermo();
virtual void getParameters(AnyMap& phaseNode) const;
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
//! Set the Lattice mole fractions using a string
/*!

View File

@ -221,8 +221,7 @@ public:
* @param id name (ID) of the phase in the input file. If empty, the
* first phase definition in the input file will be used.
*/
explicit MargulesVPSSTP(const string& inputFile="",
const string& id="");
explicit MargulesVPSSTP(const string& inputFile="", const string& id="");
virtual string type() const {
return "Margules";
@ -360,7 +359,8 @@ public:
//! @name Derivatives of Thermodynamic Variables needed for Applications
//! @{
virtual void getdlnActCoeffds(const double dTds, const double* const dXds, double* dlnActCoeffds) const;
virtual void getdlnActCoeffds(const double dTds, const double* const dXds,
double* dlnActCoeffds) const;
virtual void getdlnActCoeffdlnX_diag(double* dlnActCoeffdlnX_diag) const;
virtual void getdlnActCoeffdlnN_diag(double* dlnActCoeffdlnN_diag) const;
virtual void getdlnActCoeffdlnN(const size_t ld, double* const dlnActCoeffdlnN);

View File

@ -507,8 +507,7 @@ public:
* @param molalities Input vector of molalities of the solutes.
* Length: m_kk.
*/
void setState_TPM(double t, double p,
const double* const molalities);
void setState_TPM(double t, double p, const double* const molalities);
//! Set the temperature (K), pressure (Pa), and molalities.
/*!

View File

@ -119,8 +119,7 @@ public:
* Temperature Polynomial:
* tt[0] = temp (Kelvin)
*/
virtual void updateProperties(const double* tt,
double* cp_R, double* h_RT,
virtual void updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const;
virtual void updatePropertiesTemp(const double temp,
@ -130,10 +129,8 @@ public:
virtual size_t nCoeffs() const;
virtual void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const;
virtual void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const;
virtual void getParameters(AnyMap& thermo) const;

View File

@ -94,8 +94,7 @@ public:
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void update(double T, double* cp_R,
double* h_RT, double* s_R) const;
virtual void update(double T, double* cp_R, double* h_RT, double* s_R) const;
//! Minimum temperature.
/*!
@ -149,11 +148,8 @@ public:
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
*/
virtual void reportParams(size_t index, int& type,
double* const c,
double& minTemp,
double& maxTemp,
double& refPressure) const;
virtual void reportParams(size_t index, int& type, double* const c, double& minTemp,
double& maxTemp, double& refPressure) const;
//! Report the 298 K Heat of Formation of the standard state of one species
//! (J kmol-1)

View File

@ -97,8 +97,7 @@ public:
virtual void updateProperties(const double* tt,
double* cp_R, double* h_RT, double* s_R) const;
virtual void updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
virtual void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
double* s_R) const;
//! This utility function reports back the type of parameterization and all
@ -119,10 +118,8 @@ public:
* - coeffs[2] is max temperature
* - coeffs[3+i] from i =0,9 are the coefficients themselves
*/
virtual void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const;
virtual void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const;
virtual void getParameters(AnyMap& thermo) const;

View File

@ -82,12 +82,10 @@ public:
virtual void updateTemperaturePoly(double T, double* T_poly) const;
//! @copydoc Nasa9Poly1::updateProperties
virtual void updateProperties(const double* tt,
double* cp_R, double* h_RT,
virtual void updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const;
virtual void updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
virtual void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
double* s_R) const;
virtual size_t nCoeffs() const;
@ -111,10 +109,8 @@ public:
* coeffs[index+1] = maxTempZone
* coeffs[index+2+i] from i =0,9 are the coefficients themselves
*/
virtual void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const;
virtual void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const;
virtual void getParameters(AnyMap& thermo) const;

View File

@ -121,18 +121,15 @@ public:
*s_R = s;
}
virtual void updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
virtual void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
double* s_R) const {
double tPoly[6];
updateTemperaturePoly(temp, tPoly);
updateProperties(tPoly, cp_R, h_RT, s_R);
}
virtual void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const {
virtual void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const {
n = 0;
type = NASA1;
tlow = m_lowT;

View File

@ -60,8 +60,7 @@ public:
* coeffs]. This is the coefficient order used in the
* standard NASA format.
*/
NasaPoly2(double tlow, double thigh, double pref,
const double* coeffs) :
NasaPoly2(double tlow, double thigh, double pref, const double* coeffs) :
SpeciesThermoInterpType(tlow, thigh, pref),
m_midT(coeffs[0]),
mnp_low(tlow, coeffs[0], pref, coeffs + 8),
@ -125,10 +124,8 @@ public:
size_t nCoeffs() const { return 15; }
void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const {
void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const {
mnp_high.reportParameters(n, type, coeffs[0], thigh, pref, coeffs + 1);
mnp_low.reportParameters(n, type, tlow, coeffs[0], pref, coeffs + 8);
type = NASA2;

View File

@ -28,8 +28,7 @@ public:
* @param id ID of the phase in the input file. If empty, the
* first phase definition in the input file will be used.
*/
explicit PengRobinson(const string& infile="",
const string& id="");
explicit PengRobinson(const string& infile="", const string& id="");
virtual string type() const {
return "Peng-Robinson";
@ -154,8 +153,7 @@ public:
virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
//! Set the pure fluid interaction parameters for a species
/*!

View File

@ -69,8 +69,7 @@ public:
* @param id ID of the phase in the input file. Defaults to the
* empty string.
*/
explicit PlasmaPhase(const string& inputFile="",
const string& id="");
explicit PlasmaPhase(const string& inputFile="", const string& id="");
virtual string type() const {
return "plasma";

View File

@ -239,8 +239,7 @@ public:
* @param id name (ID) of the phase in the input file. If empty, the
* first phase definition in the input file will be used.
*/
explicit RedlichKisterVPSSTP(const string& inputFile="",
const string& id="");
explicit RedlichKisterVPSSTP(const string& inputFile="", const string& id="");
virtual string type() const {
return "Redlich-Kister";
@ -365,7 +364,8 @@ public:
//! @name Derivatives of Thermodynamic Variables needed for Applications
//! @{
virtual void getdlnActCoeffds(const double dTds, const double* const dXds, double* dlnActCoeffds) const;
virtual void getdlnActCoeffds(const double dTds, const double* const dXds,
double* dlnActCoeffds) const;
virtual void getdlnActCoeffdlnX_diag(double* dlnActCoeffdlnX_diag) const;
virtual void getdlnActCoeffdlnN_diag(double* dlnActCoeffdlnN_diag) const;
virtual void getdlnActCoeffdlnN(const size_t ld, double* const dlnActCoeffdlnN);

View File

@ -26,8 +26,7 @@ public:
* @param id name (ID) of the phase in the input file. If empty, the
* first phase definition in the input file will be used.
*/
explicit RedlichKwongMFTP(const string& infile="",
const string& id="");
explicit RedlichKwongMFTP(const string& infile="", const string& id="");
virtual string type() const {
return "Redlich-Kwong";
@ -123,8 +122,7 @@ public:
virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
//! Set the pure fluid interaction parameters for a species
/*!

View File

@ -122,8 +122,7 @@ public:
* - `t[4] = log(t)`
* - `t[5] = 1.0/t;
*/
virtual void updateProperties(const double* tt,
double* cp_R, double* h_RT,
virtual void updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const {
double A = m_coeff[0];
double Bt = m_coeff[1]*tt[0];
@ -138,18 +137,15 @@ public:
*s_R = A*tt[4] + Bt + 0.5*Ct2 + 1.0/3.0*Dt3 - 0.5*Etm2 + G;
}
virtual void updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
virtual void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
double* s_R) const {
double tPoly[6];
updateTemperaturePoly(temp, tPoly);
updateProperties(tPoly, cp_R, h_RT, s_R);
}
virtual void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const {
virtual void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const {
n = 0;
type = SHOMATE;
tlow = m_lowT;
@ -295,8 +291,7 @@ public:
}
//! @copydoc ShomatePoly::updateProperties
virtual void updateProperties(const double* tt,
double* cp_R, double* h_RT,
virtual void updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const {
double T = 1000 * tt[0];
if (T <= m_midT) {
@ -319,10 +314,8 @@ public:
virtual size_t nCoeffs() const { return 15; }
virtual void reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const {
virtual void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const {
msp_low.reportParameters(n, type, tlow, coeffs[0], pref, coeffs + 1);
msp_high.reportParameters(n, type, coeffs[0], thigh, pref, coeffs + 8);
type = SHOMATE2;

View File

@ -185,8 +185,7 @@ public:
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
* @param s_R Vector of Dimensionless entropies. (length m_kk).
*/
virtual void updateProperties(const double* tt,
double* cp_R, double* h_RT,
virtual void updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const;
//! Compute the reference-state property of one species
@ -222,9 +221,8 @@ public:
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
*/
virtual void reportParameters(size_t& index, int& type,
double& minTemp, double& maxTemp,
double& refPressure,
virtual void reportParameters(size_t& index, int& type, double& minTemp,
double& maxTemp, double& refPressure,
double* const coeffs) const;
//! Return the parameters of the species thermo object such that an

View File

@ -96,8 +96,7 @@ public:
* @param id name of the phase id in the file.
* If this is blank, the first phase in the file is used.
*/
explicit StoichSubstance(const string& infile="",
const string& id="");
explicit StoichSubstance(const string& infile="", const string& id="");
virtual string type() const {
return "fixed-stoichiometry";
@ -225,8 +224,7 @@ public:
//! @}
virtual void initThermo();
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
};
}

View File

@ -1424,8 +1424,7 @@ private:
* are being calculated.
* @param doUV True if solving for UV, false for HP.
*/
void setState_HPorUV(double h, double p,
double tol=1e-9, bool doUV = false);
void setState_HPorUV(double h, double p, double tol=1e-9, bool doUV = false);
//! Carry out work in SP and SV calculations.
/*!
@ -1688,8 +1687,7 @@ public:
* @param name Name of the species
* @param speciesNode Mapping to be populated with parameters
*/
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const {}
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const {}
//! Access input data associated with the phase description
const AnyMap& input() const;

View File

@ -73,8 +73,7 @@ public:
* @param inputFile String name of the input file
* @param id string id of the phase name
*/
explicit WaterSSTP(const string& inputFile="",
const string& id="");
explicit WaterSSTP(const string& inputFile="", const string& id="");
virtual string type() const {
return "liquid-water-IAPWS95";

View File

@ -81,9 +81,8 @@ public:
*
* @param fluxes Vector of species molar fluxes due to diffusional driving force
*/
virtual void getMolarFluxes(const double* const state1,
const double* const state2, const double delta,
double* const fluxes);
virtual void getMolarFluxes(const double* const state1, const double* const state2,
const double delta, double* const fluxes);
// new methods added in this class

View File

@ -102,8 +102,7 @@ public:
* @param delta Distance from state 1 to state 2 (m).
* @param fluxes Output mass fluxes of the species. (length = m_nsp)
*/
virtual void getMassFluxes(const double* state1,
const double* state2, double delta,
virtual void getMassFluxes(const double* state1, const double* state2, double delta,
double* fluxes);
virtual void init(ThermoPhase* thermo, int mode=0, int log_level=0);

View File

@ -55,7 +55,8 @@ public:
* @param thermo ThermoPhase object
* @param log_level log level
*/
virtual Transport* newTransport(const string& model, ThermoPhase* thermo, int log_level=0);
virtual Transport* newTransport(const string& model, ThermoPhase* thermo,
int log_level=0);
//! Build a new transport manager using the default transport manager
//! in the phase description and return a base class pointer to it

View File

@ -250,8 +250,7 @@ public:
//! coefficient
//! @returns the index of this parameter in the vector of sensitivity
//! parameters (global across all reactors)
size_t registerSensitivityParameter(const string& name, double value,
double scale);
size_t registerSensitivityParameter(const string& name, double value, double scale);
//! The name of the p-th sensitivity parameter added to this ReactorNet.
const string& sensitivityParameterName(size_t p) const {

View File

@ -23,8 +23,7 @@ using namespace Cantera;
using std::cout;
using std::endl;
void write_csv(const string& name, const vector<string>& names,
const Array2D& data)
void write_csv(const string& name, const vector<string>& names, const Array2D& data)
{
std::ofstream s(name);
for (size_t i = 0; i < data.nRows(); i++) {

View File

@ -95,8 +95,7 @@ void timeit_matrix(Eigen::SparseMatrix<double> (Kinetics::*function)(),
statistics(times, loops, runs);
}
void benchmark(const string& mech, const string& phase,
const string& fuel)
void benchmark(const string& mech, const string& phase, const string& fuel)
{
auto sol = newSolution(mech, phase, "none");
auto& gas = *(sol->thermo());

View File

@ -973,8 +973,7 @@ AnyValue& AnyValue::operator=(AnyMap&& value) {
return *this;
}
std::unordered_map<string, const AnyMap*> AnyValue::asMap(
const string& name) const
std::unordered_map<string, const AnyMap*> AnyValue::asMap(const string& name) const
{
std::unordered_map<string, const AnyMap*> mapped;
for (const auto& item : asVector<AnyMap>()) {
@ -1032,8 +1031,7 @@ const AnyMap& AnyValue::getMapWhere(const string& key, const string& value) cons
}
}
AnyMap& AnyValue::getMapWhere(const string& key, const string& value,
bool create)
AnyMap& AnyValue::getMapWhere(const string& key, const string& value, bool create)
{
if (is<vector<AnyMap>>()) {
if (value == "") {
@ -1529,8 +1527,7 @@ long int AnyMap::getInt(const string& key, long int default_) const
return (hasKey(key)) ? m_data.at(key).asInt() : default_;
}
const string& AnyMap::getString(const string& key,
const string& default_) const
const string& AnyMap::getString(const string& key, const string& default_) const
{
return (hasKey(key)) ? m_data.at(key).asString() : default_;
}
@ -1556,7 +1553,7 @@ double AnyMap::convert(const string& key, const string& dest,
}
vector<double> AnyMap::convertVector(const string& key, const string& dest,
size_t nMin, size_t nMax) const
size_t nMin, size_t nMax) const
{
return units().convert(at(key).asVector<AnyValue>(nMin, nMax), dest);
}
@ -1771,8 +1768,7 @@ AnyMap AnyMap::fromYamlString(const string& yaml) {
return amap;
}
AnyMap AnyMap::fromYamlFile(const string& name,
const string& parent_name)
AnyMap AnyMap::fromYamlFile(const string& name, const string& parent_name)
{
string fullName;
// See if a file with this name exists in a path relative to the parent file
@ -1885,9 +1881,8 @@ void formatInputFile(fmt::memory_buffer& b, const shared_ptr<AnyMap>& metadata,
}
}
string InputFileError::formatError(const string& message,
int lineno, int column,
const shared_ptr<AnyMap>& metadata)
string InputFileError::formatError(const string& message, int lineno, int column,
const shared_ptr<AnyMap>& metadata)
{
if (!metadata) {
return message;
@ -1900,11 +1895,10 @@ string InputFileError::formatError(const string& message,
return to_string(b);
}
string InputFileError::formatError2(const string& message,
int line1, int column1,
const shared_ptr<AnyMap>& metadata1,
int line2, int column2,
const shared_ptr<AnyMap>& metadata2)
string InputFileError::formatError2(const string& message, int line1, int column1,
const shared_ptr<AnyMap>& metadata1,
int line2, int column2,
const shared_ptr<AnyMap>& metadata2)
{
if (!metadata1 || !metadata2) {
return message;
@ -1929,8 +1923,7 @@ string InputFileError::formatError2(const string& message,
return to_string(b);
}
void warn_deprecated(const string& source, const AnyBase& node,
const string& message)
void warn_deprecated(const string& source, const AnyBase& node, const string& message)
{
if (!node.m_metadata) {
warn_deprecated(source, message);

View File

@ -535,8 +535,7 @@ void UnitSystem::setDefaultActivationEnergy(const string& e_units)
m_explicit_activation_energy = true;
}
double UnitSystem::convert(double value, const string& src,
const string& dest) const
double UnitSystem::convert(double value, const string& src, const string& dest) const
{
return convert(value, Units(src), Units(dest));
}
@ -656,13 +655,13 @@ double UnitSystem::convertRateCoeff(const AnyValue& v, const Units& dest) const
}
vector<double> UnitSystem::convert(const vector<AnyValue>& vals,
const string& dest) const
const string& dest) const
{
return convert(vals, Units(dest));
}
vector<double> UnitSystem::convert(const vector<AnyValue>& vals,
const Units& dest) const
const Units& dest) const
{
vector<double> out;
for (const auto& val : vals) {
@ -703,8 +702,7 @@ double UnitSystem::convertActivationEnergy(double value, const string& src,
return value;
}
double UnitSystem::convertActivationEnergyTo(double value,
const string& dest) const
double UnitSystem::convertActivationEnergyTo(double value, const string& dest) const
{
return convertActivationEnergyTo(value, Units(dest));
}
@ -724,8 +722,7 @@ double UnitSystem::convertActivationEnergyTo(double value,
}
}
double UnitSystem::convertActivationEnergyFrom(double value,
const string& src) const
double UnitSystem::convertActivationEnergyFrom(double value, const string& src) const
{
Units usrc(src);
if (usrc.convertible(Units("J/kmol"))) {
@ -740,8 +737,7 @@ double UnitSystem::convertActivationEnergyFrom(double value,
}
}
double UnitSystem::convertActivationEnergy(const AnyValue& v,
const string& dest) const
double UnitSystem::convertActivationEnergy(const AnyValue& v, const string& dest) const
{
try {
auto [value, units] = split_unit(v);

View File

@ -132,8 +132,7 @@ void Application::ApplicationDestroy()
}
}
void Application::warn_deprecated(const string& method,
const string& extra)
void Application::warn_deprecated(const string& method, const string& extra)
{
if (m_fatal_deprecation_warnings) {
throw CanteraError(method, "Deprecated: " + extra);
@ -144,9 +143,7 @@ void Application::warn_deprecated(const string& method,
warnlog("Deprecation", fmt::format("{}: {}", method, extra));
}
void Application::warn(const string& warning,
const string& method,
const string& extra)
void Application::warn(const string& warning, const string& method, const string& extra)
{
if (m_fatal_warnings) {
throw CanteraError(method, extra);

View File

@ -339,8 +339,7 @@ public:
//! @param warning Warning type; see Logger::warn()
//! @param method Name of method triggering the warning
//! @param extra Additional information printed for the warning
void warn(const string& warning,
const string& method, const string& extra="");
void warn(const string& warning, const string& method, const string& extra="");
//! Globally disable printing of (user) warnings. Used primarily to
//! prevent certain tests from failing.

View File

@ -59,8 +59,7 @@ void _warn_deprecated(const string& method, const string& extra)
app()->warn_deprecated(method, extra);
}
void _warn(const string& warning,
const string& method, const string& extra)
void _warn(const string& warning, const string& method, const string& extra)
{
app()->warn(warning, method, extra);
}

View File

@ -30,8 +30,7 @@ namespace ba = boost::algorithm;
namespace Cantera
{
string vec2str(const vector<double>& v, const string& fmt,
const string& sep)
string vec2str(const vector<double>& v, const string& fmt, const string& sep)
{
char buf[64];
std::stringstream o;

View File

@ -163,8 +163,7 @@ void ChemEquil::update(const ThermoPhase& s)
}
}
int ChemEquil::setInitialMoles(ThermoPhase& s, vector<double>& elMoleGoal,
int loglevel)
int ChemEquil::setInitialMoles(ThermoPhase& s, vector<double>& elMoleGoal, int loglevel)
{
MultiPhase mp;
mp.addPhase(&s, 1.0);
@ -672,8 +671,8 @@ int ChemEquil::equilibrate(ThermoPhase& s, const char* XYstr,
}
int ChemEquil::dampStep(ThermoPhase& mix, vector<double>& oldx,
double oldf, vector<double>& grad, vector<double>& step, vector<double>& x,
int ChemEquil::dampStep(ThermoPhase& mix, vector<double>& oldx, double oldf,
vector<double>& grad, vector<double>& step, vector<double>& x,
double& f, vector<double>& elmols, double xval, double yval)
{
// Carry out a delta damping approach on the dimensionless element

View File

@ -238,8 +238,7 @@ void MultiPhase::getChemPotentials(double* mu) const
}
}
void MultiPhase::getValidChemPotentials(double not_mu,
double* mu, bool standard) const
void MultiPhase::getValidChemPotentials(double not_mu, double* mu, bool standard) const
{
updatePhases();
// iterate over the phases
@ -421,8 +420,7 @@ void MultiPhase::setState_TP(const double T, const double Pres)
updatePhases();
}
void MultiPhase::setState_TPMoles(const double T, const double Pres,
const double* n)
void MultiPhase::setState_TPMoles(const double T, const double Pres, const double* n)
{
m_temp = T;
m_press = Pres;
@ -469,9 +467,8 @@ double MultiPhase::volume() const
return sum;
}
double MultiPhase::equilibrate_MultiPhaseEquil(int XY, double err,
int maxsteps, int maxiter,
int loglevel)
double MultiPhase::equilibrate_MultiPhaseEquil(int XY, double err, int maxsteps,
int maxiter, int loglevel)
{
bool strt = false;
double dta = 0.0;

View File

@ -152,8 +152,7 @@ MultiPhaseEquil::MultiPhaseEquil(MultiPhase* mix, bool start, int loglevel) : m_
// has all non-zero mole numbers for the included species.
}
double MultiPhaseEquil::equilibrate(int XY, double err,
int maxsteps, int loglevel)
double MultiPhaseEquil::equilibrate(int XY, double err, int maxsteps, int loglevel)
{
int i;
m_iter = 0;
@ -398,8 +397,7 @@ void MultiPhaseEquil::unsort(vector<double>& x)
}
}
void MultiPhaseEquil::step(double omega, vector<double>& deltaN,
int loglevel)
void MultiPhaseEquil::step(double omega, vector<double>& deltaN, int loglevel)
{
if (omega < 0.0) {
throw CanteraError("MultiPhaseEquil::step","negative omega");

View File

@ -26,8 +26,7 @@ vcs_MultiPhaseEquil::vcs_MultiPhaseEquil(MultiPhase* mix, int printLvl) :
{
}
int vcs_MultiPhaseEquil::equilibrate_TV(int XY, double xtarget,
int estimateEquil,
int vcs_MultiPhaseEquil::equilibrate_TV(int XY, double xtarget, int estimateEquil,
int printLvl, double err,
int maxsteps, int loglevel)
{
@ -123,11 +122,9 @@ int vcs_MultiPhaseEquil::equilibrate_TV(int XY, double xtarget,
"No convergence for V");
}
int vcs_MultiPhaseEquil::equilibrate_HP(double Htarget,
int XY, double Tlow, double Thigh,
int estimateEquil,
int printLvl, double err,
int maxsteps, int loglevel)
int vcs_MultiPhaseEquil::equilibrate_HP(double Htarget, int XY, double Tlow,
double Thigh, int estimateEquil, int printLvl, double err, int maxsteps,
int loglevel)
{
int maxiter = 100;
int iSuccess;
@ -239,11 +236,8 @@ int vcs_MultiPhaseEquil::equilibrate_HP(double Htarget,
"No convergence for T");
}
int vcs_MultiPhaseEquil::equilibrate_SP(double Starget,
double Tlow, double Thigh,
int estimateEquil,
int printLvl, double err,
int maxsteps, int loglevel)
int vcs_MultiPhaseEquil::equilibrate_SP(double Starget, double Tlow, double Thigh,
int estimateEquil, int printLvl, double err, int maxsteps, int loglevel)
{
int maxiter = 100;
int strt = estimateEquil;
@ -365,9 +359,8 @@ int vcs_MultiPhaseEquil::equilibrate_SP(double Starget,
"No convergence for T");
}
int vcs_MultiPhaseEquil::equilibrate(int XY, int estimateEquil,
int printLvl, double err,
int maxsteps, int loglevel)
int vcs_MultiPhaseEquil::equilibrate(int XY, int estimateEquil, int printLvl,
double err, int maxsteps, int loglevel)
{
double xtarget;
if (XY == TP) {
@ -410,8 +403,7 @@ int vcs_MultiPhaseEquil::equilibrate(int XY, int estimateEquil,
}
}
int vcs_MultiPhaseEquil::equilibrate_TP(int estimateEquil,
int printLvl, double err,
int vcs_MultiPhaseEquil::equilibrate_TP(int estimateEquil, int printLvl, double err,
int maxsteps, int loglevel)
{
int maxit = maxsteps;

View File

@ -600,7 +600,8 @@ void vcs_VolPhase::setCreationMoleNumbers(const double* const n_k,
}
}
const vector<double>& vcs_VolPhase::creationMoleNumbers(vector<size_t> &creationGlobalRxnNumbers) const
const vector<double>& vcs_VolPhase::creationMoleNumbers(
vector<size_t> &creationGlobalRxnNumbers) const
{
creationGlobalRxnNumbers = creationGlobalRxnNumbers_;
return creationMoleNumbers_;

View File

@ -23,7 +23,8 @@ namespace Cantera
namespace {
void printProgress(const vector<string>& spName, const vector<double>& soln, const vector<double>& ff)
void printProgress(const vector<string>& spName, const vector<double>& soln,
const vector<double>& ff)
{
double sum = 0.0;
plogf(" --- Summary of current progress:\n");

View File

@ -36,8 +36,7 @@ void Group::validate()
}
}
std::ostream& Group::fmt(std::ostream& s,
const vector<string>& esymbols) const
std::ostream& Group::fmt(std::ostream& s, const vector<string>& esymbols) const
{
s << "(";
bool first = true;

View File

@ -541,9 +541,8 @@ void InterfaceKinetics::resizeSpecies()
m_phi.resize(nPhases(), 0.0);
}
void InterfaceKinetics::advanceCoverages(double tstep, double rtol,
double atol, double maxStepSize,
size_t maxSteps, size_t maxErrTestFails)
void InterfaceKinetics::advanceCoverages(double tstep, double rtol, double atol,
double maxStepSize, size_t maxSteps, size_t maxErrTestFails)
{
if (m_integrator == 0) {
vector<InterfaceKinetics*> k{this};

View File

@ -214,8 +214,7 @@ void InterfaceRateBase::getCoverageDependencies(AnyMap& dependencies,
}
}
void InterfaceRateBase::addCoverageDependence(const string& sp,
double a, double m,
void InterfaceRateBase::addCoverageDependence(const string& sp, double a, double m,
const vector<double>& e)
{
if (std::find(m_cov.begin(), m_cov.end(), sp) == m_cov.end()) {

View File

@ -197,8 +197,7 @@ pair<size_t, size_t> Kinetics::checkDuplicates(bool throw_err) const
return {npos, npos};
}
double Kinetics::checkDuplicateStoich(map<int, double>& r1,
map<int, double>& r2) const
double Kinetics::checkDuplicateStoich(map<int, double>& r1, map<int, double>& r2) const
{
std::unordered_set<int> keys; // species keys (k+1 or -k-1)
for (auto& [speciesKey, stoich] : r1) {
@ -278,8 +277,7 @@ size_t Kinetics::kineticsSpeciesIndex(const string& nm) const
return npos;
}
size_t Kinetics::kineticsSpeciesIndex(const string& nm,
const string& ph) const
size_t Kinetics::kineticsSpeciesIndex(const string& nm, const string& ph) const
{
warn_deprecated("Kinetics::kineticsSpeciesIndex(species_name, phase_name)",
"To be removed after Cantera 3.0. Use kineticsSpeciesIndex(species_name).\n"

View File

@ -155,8 +155,7 @@ shared_ptr<Kinetics> newKinetics(const vector<shared_ptr<ThermoPhase>>& phases,
}
unique_ptr<Kinetics> newKinetics(const vector<ThermoPhase*>& phases,
const string& filename,
const string& phase_name)
const string& filename, const string& phase_name)
{
warn_deprecated("newKinetics(vector<ThermoPhase*>&, const string&, const string&)",
"To be removed after Cantera 3.0; superseded by\nnewKinetics"

View File

@ -973,8 +973,7 @@ void parseReactionEquation(Reaction& R, const string& equation,
}
}
vector<shared_ptr<Reaction>> getReactions(const AnyValue& items,
Kinetics& kinetics)
vector<shared_ptr<Reaction>> getReactions(const AnyValue& items, Kinetics& kinetics)
{
vector<shared_ptr<Reaction>> all_reactions;
for (const auto& node : items.asVector<AnyMap>()) {

View File

@ -47,8 +47,7 @@ Path::Path(SpeciesNode* begin, SpeciesNode* end)
end->addPath(this);
}
void Path::addReaction(size_t rxnNumber, double value,
const string& label)
void Path::addReaction(size_t rxnNumber, double value, const string& label)
{
m_rxn[rxnNumber] += value;
m_total += value;
@ -126,8 +125,7 @@ void ReactionPathDiagram::add(ReactionPathDiagram& d)
}
}
void ReactionPathDiagram::findMajorPaths(double athreshold, size_t lda,
double* a)
void ReactionPathDiagram::findMajorPaths(double athreshold, size_t lda, double* a)
{
double netmax = 0.0;
for (size_t n = 0; n < nNodes(); n++) {

View File

@ -319,9 +319,8 @@ void solveSP::evalSurfLarge(const double* CSolnSP)
}
}
void solveSP::fun_eval(double* resid, const double* CSoln,
const double* CSolnOld, const bool do_time,
const double deltaT)
void solveSP::fun_eval(double* resid, const double* CSoln, const double* CSolnOld,
const bool do_time, const double deltaT)
{
size_t k;
double lenScale = 1.0E-9;
@ -426,8 +425,7 @@ void solveSP::fun_eval(double* resid, const double* CSoln,
}
}
void solveSP::resjac_eval(DenseMatrix& jac,
double resid[], double CSoln[],
void solveSP::resjac_eval(DenseMatrix& jac, double resid[], double CSoln[],
const double CSolnOld[], const bool do_time,
const double deltaT)
{
@ -572,10 +570,8 @@ void solveSP::calcWeights(double wtSpecies[], double wtResid[],
}
}
double solveSP::calc_t(double netProdRateSolnSP[],
double XMolSolnSP[],
int* label, int* label_old,
double* label_factor, int ioflag)
double solveSP::calc_t(double netProdRateSolnSP[], double XMolSolnSP[], int* label,
int* label_old, double* label_factor, int ioflag)
{
double inv_timeScale = 1.0E-10;
size_t kindexSP = 0;

View File

@ -25,8 +25,7 @@ int FuncEval::evalNoThrow(double t, double* y, double* ydot)
}
return -1; // unrecoverable error
} catch (...) {
string msg = "FuncEval::eval_nothrow: unhandled exception"
" of unknown type\n";
string msg = "FuncEval::eval_nothrow: unhandled exception of unknown type\n";
if (suppressErrors()) {
m_errors.push_back(msg);
} else {
@ -58,8 +57,7 @@ int FuncEval::evalDaeNoThrow(double t, double* y, double* ydot, double* r)
}
return -1; // unrecoverable error
} catch (...) {
string msg = "FuncEval::eval_nothrow: unhandled exception"
" of unknown type\n";
string msg = "FuncEval::eval_nothrow: unhandled exception of unknown type\n";
if (suppressErrors()) {
m_errors.push_back(msg);
} else {

View File

@ -10,8 +10,7 @@
namespace Cantera
{
double linearInterp(double x, const vector<double>& xpts,
const vector<double>& fpts)
double linearInterp(double x, const vector<double>& xpts, const vector<double>& fpts)
{
if (x <= xpts[0]) {
return fpts[0];
@ -22,8 +21,8 @@ double linearInterp(double x, const vector<double>& xpts,
auto loc = lower_bound(xpts.begin(), xpts.end(), x);
int iloc = int(loc - xpts.begin()) - 1;
double ff = fpts[iloc] +
(x - xpts[iloc])*(fpts[iloc + 1]
- fpts[iloc])/(xpts[iloc + 1] - xpts[iloc]);
(x - xpts[iloc])*(fpts[iloc + 1]
- fpts[iloc])/(xpts[iloc + 1] - xpts[iloc]);
return ff;
}

View File

@ -32,8 +32,7 @@ public:
* Newton step between specified lower and upper bounds. This function only
* considers one domain.
*/
double bound_step(const double* x, const double* step,
Domain1D& r, int loglevel)
double bound_step(const double* x, const double* step, Domain1D& r, int loglevel)
{
size_t np = r.nPoints();
size_t nv = r.nComponents();
@ -99,8 +98,7 @@ double bound_step(const double* x, const double* step,
* The second term, @f$ \epsilon_{a,n} @f$, is the absolute error tolerance for
* component n.
*/
double norm_square(const double* x,
const double* step, Domain1D& r)
double norm_square(const double* x, const double* step, Domain1D& r)
{
double sum = 0.0;
double f2max = 0.0;
@ -144,8 +142,7 @@ void MultiNewton::resize(size_t sz)
m_stp1.resize(m_n);
}
double MultiNewton::norm2(const double* x,
const double* step, OneDim& r) const
double MultiNewton::norm2(const double* x, const double* step, OneDim& r) const
{
double sum = 0.0;
size_t nd = r.nDomains();
@ -157,8 +154,7 @@ double MultiNewton::norm2(const double* x,
return sqrt(sum);
}
void MultiNewton::step(double* x, double* step,
OneDim& r, MultiJac& jac, int loglevel)
void MultiNewton::step(double* x, double* step, OneDim& r, MultiJac& jac, int loglevel)
{
r.eval(npos, x, step);
for (size_t n = 0; n < r.size(); n++) {
@ -191,8 +187,8 @@ void MultiNewton::step(double* x, double* step,
}
}
double MultiNewton::boundStep(const double* x0,
const double* step0, const OneDim& r, int loglevel)
double MultiNewton::boundStep(const double* x0, const double* step0, const OneDim& r,
int loglevel)
{
double fbound = 1.0;
for (size_t i = 0; i < r.nDomains(); i++) {
@ -284,8 +280,7 @@ int MultiNewton::dampStep(const double* x0, const double* step0,
}
}
int MultiNewton::solve(double* x0, double* x1,
OneDim& r, MultiJac& jac, int loglevel)
int MultiNewton::solve(double* x0, double* x1, OneDim& r, MultiJac& jac, int loglevel)
{
clock_t t0 = clock();
int m = 0;

View File

@ -379,8 +379,7 @@ void OneDim::init()
m_init = true;
}
double OneDim::timeStep(int nsteps, double dt, double* x,
double* r, int loglevel)
double OneDim::timeStep(int nsteps, double dt, double* x, double* r, int loglevel)
{
// set the Jacobian age parameter to the transient value
newton().setOptions(m_ts_jac_age);

View File

@ -58,7 +58,8 @@ Sim1D::Sim1D(vector<Domain1D*>& domains) :
m_steps = { 10 };
}
void Sim1D::setInitialGuess(const string& component, vector<double>& locs, vector<double>& vals)
void Sim1D::setInitialGuess(const string& component, vector<double>& locs,
vector<double>& vals)
{
for (size_t dom=0; dom<nDomains(); dom++) {
Domain1D& d = domain(dom);
@ -125,9 +126,8 @@ void Sim1D::save(const string& fname, const string& id,
}
}
void Sim1D::save(const string& fname, const string& name,
const string& desc, bool overwrite, int compression,
const string& basis)
void Sim1D::save(const string& fname, const string& name, const string& desc,
bool overwrite, int compression, const string& basis)
{
size_t dot = fname.find_last_of(".");
string extension = (dot != npos) ? toLowerCopy(fname.substr(dot+1)) : "";

View File

@ -348,8 +348,7 @@ void StFlow::_finalize(const double* x)
}
}
void StFlow::eval(size_t jg, double* xg,
double* rg, integer* diagg, double rdt)
void StFlow::eval(size_t jg, double* xg, double* rg, integer* diagg, double rdt)
{
// if evaluating a Jacobian, and the global point is outside the domain of
// influence for this domain, then skip evaluating the residual

View File

@ -18,8 +18,7 @@ Refiner::Refiner(Domain1D& domain) :
m_active.resize(m_nv, true);
}
void Refiner::setCriteria(double ratio, double slope,
double curve, double prune)
void Refiner::setCriteria(double ratio, double slope, double curve, double prune)
{
if (ratio < 2.0) {
throw CanteraError("Refiner::setCriteria",
@ -41,8 +40,7 @@ void Refiner::setCriteria(double ratio, double slope,
m_prune = prune;
}
int Refiner::analyze(size_t n, const double* z,
const double* x)
int Refiner::analyze(size_t n, const double* z, const double* x)
{
if (n >= m_npmax) {
throw CanteraError("Refiner::analyze", "max number of grid points reached ({}).", m_npmax);
@ -226,8 +224,7 @@ void Refiner::show()
}
}
int Refiner::getNewGrid(int n, const double* z,
int nn, double* zn)
int Refiner::getNewGrid(int n, const double* z, int nn, double* zn)
{
int nnew = static_cast<int>(m_loc.size());
if (nnew + n > nn) {

View File

@ -60,10 +60,8 @@ void ConstCpPoly::updatePropertiesTemp(const double temp,
*s_R = m_s0_R + m_cp0_R * (logt - m_logt0);
}
void ConstCpPoly::reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const
void ConstCpPoly::reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const
{
n = 0;
type = CONSTANT_CP;

View File

@ -339,8 +339,7 @@ void DebyeHuckel::setDefaultIonicRadius(double value)
}
}
void DebyeHuckel::setBeta(const string& sp1, const string& sp2,
double value)
void DebyeHuckel::setBeta(const string& sp1, const string& sp2, double value)
{
size_t k1 = speciesIndex(sp1);
if (k1 == npos) {
@ -477,8 +476,7 @@ void DebyeHuckel::getParameters(AnyMap& phaseNode) const
phaseNode["activity-data"] = std::move(activityNode);
}
void DebyeHuckel::getSpeciesParameters(const string& name,
AnyMap& speciesNode) const
void DebyeHuckel::getSpeciesParameters(const string& name, AnyMap& speciesNode) const
{
MolalityVPSSTP::getSpeciesParameters(name, speciesNode);
size_t k = speciesIndex(name);

View File

@ -325,8 +325,7 @@ double HMWSoln::satPressure(double t) {
return pres;
}
static void check_nParams(const string& method, size_t nParams,
size_t m_formPitzerTemp)
static void check_nParams(const string& method, size_t nParams, size_t m_formPitzerTemp)
{
if (m_formPitzerTemp == PITZER_TEMP_CONSTANT && nParams != 1) {
throw CanteraError(method, "'constant' temperature model requires one"

View File

@ -34,8 +34,7 @@ double cCut_default = .05;
namespace Cantera
{
IdealMolalSoln::IdealMolalSoln(const string& inputFile,
const string& id_) :
IdealMolalSoln::IdealMolalSoln(const string& inputFile, const string& id_) :
IMS_X_o_cutoff_(X_o_cutoff_default),
IMS_gamma_o_min_(gamma_o_min_default),
IMS_gamma_k_min_(gamma_k_min_default),

View File

@ -288,8 +288,7 @@ void LatticePhase::getParameters(AnyMap& phaseNode) const
phaseNode["site-density"].setQuantity(m_site_density, "kmol/m^3");
}
void LatticePhase::getSpeciesParameters(const string& name,
AnyMap& speciesNode) const
void LatticePhase::getSpeciesParameters(const string& name, AnyMap& speciesNode) const
{
ThermoPhase::getSpeciesParameters(name, speciesNode);
size_t k = speciesIndex(name);

View File

@ -231,8 +231,7 @@ double MolalityVPSSTP::osmoticCoefficient() const
return oc;
}
void MolalityVPSSTP::setState_TPM(double t, double p,
const double* const molalities)
void MolalityVPSSTP::setState_TPM(double t, double p, const double* const molalities)
{
setMolalities(molalities);
setState_TP(t, p);

View File

@ -131,10 +131,8 @@ size_t Mu0Poly::nCoeffs() const
return 2*m_numIntervals + 4;
}
void Mu0Poly::reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const
void Mu0Poly::reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const
{
n = 0;
type = MU0_INTERP;

View File

@ -91,8 +91,7 @@ void MultiSpeciesThermo::update_single(size_t k, double t, double* cp_R,
}
}
void MultiSpeciesThermo::update(double t, double* cp_R,
double* h_RT, double* s_R) const
void MultiSpeciesThermo::update(double t, double* cp_R, double* h_RT, double* s_R) const
{
auto iter = m_sp.begin();
auto jter = m_tpoly.begin();
@ -115,9 +114,8 @@ int MultiSpeciesThermo::reportType(size_t index) const
return -1;
}
void MultiSpeciesThermo::reportParams(size_t index, int& type,
double* const c, double& minTemp_, double& maxTemp_,
double& refPressure_) const
void MultiSpeciesThermo::reportParams(size_t index, int& type, double* const c,
double& minTemp_, double& maxTemp_, double& refPressure_) const
{
const SpeciesThermoInterpType* sp = provideSTIT(index);
size_t n;

View File

@ -55,8 +55,7 @@ void Nasa9Poly1::updateTemperaturePoly(double T, double* T_poly) const
T_poly[6] = std::log(T);
}
void Nasa9Poly1::updateProperties(const double* tt,
double* cp_R, double* h_RT,
void Nasa9Poly1::updateProperties(const double* tt, double* cp_R, double* h_RT,
double* s_R) const
{
@ -80,8 +79,7 @@ void Nasa9Poly1::updateProperties(const double* tt,
*s_R = sdivR;
}
void Nasa9Poly1::updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
void Nasa9Poly1::updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
double* s_R) const
{
double tPoly[7];
@ -89,10 +87,8 @@ void Nasa9Poly1::updatePropertiesTemp(const double temp,
updateProperties(tPoly, cp_R, h_RT, s_R);
}
void Nasa9Poly1::reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const
void Nasa9Poly1::reportParameters(size_t& n, int& type, double& tlow, double& thigh,
double& pref, double* const coeffs) const
{
n = 0;
type = NASA9;

View File

@ -114,9 +114,7 @@ void Nasa9PolyMultiTempRegion::updateTemperaturePoly(double T, double* T_poly) c
}
void Nasa9PolyMultiTempRegion::updateProperties(const double* tt,
double* cp_R,
double* h_RT,
double* s_R) const
double* cp_R, double* h_RT, double* s_R) const
{
m_currRegion = 0;
for (size_t i = 1; i < m_regionPts.size(); i++) {
@ -130,8 +128,7 @@ void Nasa9PolyMultiTempRegion::updateProperties(const double* tt,
}
void Nasa9PolyMultiTempRegion::updatePropertiesTemp(const double temp,
double* cp_R, double* h_RT,
double* s_R) const
double* cp_R, double* h_RT, double* s_R) const
{
// Now find the region
m_currRegion = 0;
@ -151,9 +148,7 @@ size_t Nasa9PolyMultiTempRegion::nCoeffs() const
}
void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type,
double& tlow, double& thigh,
double& pref,
double* const coeffs) const
double& tlow, double& thigh, double& pref, double* const coeffs) const
{
n = 0;
type = NASA9MULTITEMP;

View File

@ -188,11 +188,8 @@ double PDSS::satPressure(double t)
throw NotImplementedError("PDSS::satPressure");
}
void PDSS::reportParams(size_t& kindex, int& type,
double* const c,
double& minTemp_,
double& maxTemp_,
double& refPressure_) const
void PDSS::reportParams(size_t& kindex, int& type, double* const c, double& minTemp_,
double& maxTemp_, double& refPressure_) const
{
warn_deprecated("PDSS:reportParams", "To be removed after Cantera 3.0. "
"Use getParameters(AnyMap&) instead.");

View File

@ -647,10 +647,8 @@ void PDSS_HKFT::convertDGFormation()
m_Mu0_tr_pr = dg + totalSum;
}
void PDSS_HKFT::reportParams(size_t& kindex, int& type,
double* const c,
double& minTemp_,
double& maxTemp_,
void PDSS_HKFT::reportParams(size_t& kindex, int& type, double* const c,
double& minTemp_, double& maxTemp_,
double& refPressure_) const
{
// Fill in the first part

View File

@ -26,8 +26,7 @@ PengRobinson::PengRobinson(const string& infile, const string& id_)
initThermoFile(infile, id_);
}
void PengRobinson::setSpeciesCoeffs(const string& species, double a, double b,
double w)
void PengRobinson::setSpeciesCoeffs(const string& species, double a, double b, double w)
{
size_t k = speciesIndex(species);
if (k == npos) {
@ -421,8 +420,7 @@ void PengRobinson::initThermo()
}
}
void PengRobinson::getSpeciesParameters(const string& name,
AnyMap& speciesNode) const
void PengRobinson::getSpeciesParameters(const string& name, AnyMap& speciesNode) const
{
MixtureFugacityTP::getSpeciesParameters(name, speciesNode);
size_t k = speciesIndex(name);

View File

@ -753,9 +753,8 @@ double Phase::sum_xlogx() const
return m_mmw * sumxlogx + std::log(m_mmw);
}
size_t Phase::addElement(const string& symbol, double weight,
int atomic_number, double entropy298,
int elem_type)
size_t Phase::addElement(const string& symbol, double weight, int atomic_number,
double entropy298, int elem_type)
{
// Look up the atomic weight if not given
if (weight == 0.0) {

View File

@ -17,8 +17,7 @@ using namespace std;
namespace Cantera
{
RedlichKisterVPSSTP::RedlichKisterVPSSTP(const string& inputFile,
const string& id_)
RedlichKisterVPSSTP::RedlichKisterVPSSTP(const string& inputFile, const string& id_)
{
initThermoFile(inputFile, id_);
}

View File

@ -68,8 +68,8 @@ void RedlichKwongMFTP::setSpeciesCoeffs(const string& species,
b_vec_Curr_[k] = b;
}
void RedlichKwongMFTP::setBinaryCoeffs(const string& species_i,
const string& species_j, double a0, double a1)
void RedlichKwongMFTP::setBinaryCoeffs(const string& species_i, const string& species_j,
double a0, double a1)
{
size_t ki = speciesIndex(species_i);
if (ki == npos) {
@ -590,7 +590,8 @@ double RedlichKwongMFTP::liquidVolEst(double TKelvin, double& presGuess) const
return v;
}
double RedlichKwongMFTP::densityCalc(double TKelvin, double presPa, int phaseRequested, double rhoguess)
double RedlichKwongMFTP::densityCalc(double TKelvin, double presPa, int phaseRequested,
double rhoguess)
{
// It's necessary to set the temperature so that m_a_current is set correctly.
setTemperature(TKelvin);

View File

@ -170,8 +170,7 @@ void SingleSpeciesTP::getCp_R_ref(double* cpr) const
// ------------------ Setting the State ------------------------
void SingleSpeciesTP::setState_HP(double h, double p,
double tol)
void SingleSpeciesTP::setState_HP(double h, double p, double tol)
{
double dt;
setPressure(p);
@ -186,8 +185,7 @@ void SingleSpeciesTP::setState_HP(double h, double p,
"no convergence. dt = {}", dt);
}
void SingleSpeciesTP::setState_UV(double u, double v,
double tol)
void SingleSpeciesTP::setState_UV(double u, double v, double tol)
{
double dt;
if (v == 0.0) {
@ -206,8 +204,7 @@ void SingleSpeciesTP::setState_UV(double u, double v,
"no convergence. dt = {}\nu = {} v = {}", dt, u, v);
}
void SingleSpeciesTP::setState_SP(double s, double p,
double tol)
void SingleSpeciesTP::setState_SP(double s, double p, double tol)
{
double dt;
setPressure(p);
@ -222,8 +219,7 @@ void SingleSpeciesTP::setState_SP(double s, double p,
"no convergence. dt = {}", dt);
}
void SingleSpeciesTP::setState_SV(double s, double v,
double tol)
void SingleSpeciesTP::setState_SV(double s, double v, double tol)
{
double dt;
if (v == 0.0) {

View File

@ -67,8 +67,7 @@ double SpeciesThermoInterpType::reportHf298(double* const h298) const
throw NotImplementedError("SpeciesThermoInterpType::reportHf298");
}
void SpeciesThermoInterpType::modifyOneHf298(const size_t k,
const double Hf298New)
void SpeciesThermoInterpType::modifyOneHf298(const size_t k, const double Hf298New)
{
throw NotImplementedError("SpeciesThermoInterpType::modifyOneHf298");
}

View File

@ -765,9 +765,8 @@ double ThermoPhase::stoichAirFuelRatio(const Composition& fuelComp,
return stoichAirFuelRatio(fuel.data(), ox.data(), basis);
}
double ThermoPhase::stoichAirFuelRatio(const string& fuelComp,
const string& oxComp,
ThermoBasis basis) const
double ThermoPhase::stoichAirFuelRatio(const string& fuelComp, const string& oxComp,
ThermoBasis basis) const
{
return stoichAirFuelRatio(
parseCompString(fuelComp.find(":") != string::npos ? fuelComp : fuelComp+":1.0"),
@ -878,9 +877,8 @@ double ThermoPhase::equivalenceRatio(const Composition& fuelComp,
return equivalenceRatio(fuel.data(), ox.data(), basis);
}
double ThermoPhase::equivalenceRatio(const string& fuelComp,
const string& oxComp,
ThermoBasis basis) const
double ThermoPhase::equivalenceRatio(const string& fuelComp, const string& oxComp,
ThermoBasis basis) const
{
return equivalenceRatio(
parseCompString(fuelComp.find(":") != string::npos ? fuelComp : fuelComp+":1.0"),
@ -982,10 +980,8 @@ double ThermoPhase::mixtureFraction(const Composition& fuelComp,
return mixtureFraction(fuel.data(), ox.data(), basis, element);
}
double ThermoPhase::mixtureFraction(const string& fuelComp,
const string& oxComp,
ThermoBasis basis,
const string& element) const
double ThermoPhase::mixtureFraction(const string& fuelComp, const string& oxComp,
ThermoBasis basis, const string& element) const
{
return mixtureFraction(
parseCompString(fuelComp.find(":") != string::npos ? fuelComp : fuelComp+":1.0"),
@ -993,10 +989,8 @@ double ThermoPhase::mixtureFraction(const string& fuelComp,
basis, element);
}
double ThermoPhase::mixtureFraction(const double* fuelComp,
const double* oxComp,
ThermoBasis basis,
const string& element) const
double ThermoPhase::mixtureFraction(const double* fuelComp, const double* oxComp,
ThermoBasis basis, const string& element) const
{
vector<double> fuel, ox;
if (basis == ThermoBasis::molar) { // convert input compositions to mass fractions
@ -1075,8 +1069,7 @@ const MultiSpeciesThermo& ThermoPhase::speciesThermo(int k) const
}
void ThermoPhase::initThermoFile(const string& inputFile,
const string& id)
void ThermoPhase::initThermoFile(const string& inputFile, const string& id)
{
if (inputFile.empty()) {
// No input file specified - nothing to set up
@ -1303,7 +1296,8 @@ void ThermoPhase::getdlnActCoeffdlnN(const size_t ld, double* const dlnActCoeffd
return;
}
void ThermoPhase::getdlnActCoeffdlnN_numderiv(const size_t ld, double* const dlnActCoeffdlnN)
void ThermoPhase::getdlnActCoeffdlnN_numderiv(const size_t ld,
double* const dlnActCoeffdlnN)
{
double deltaMoles_j = 0.0;
double pres = pressure();

View File

@ -93,8 +93,7 @@ double WaterProps::density_T(double T, double P, int ifunc)
return rho;
}
double WaterProps::relEpsilon(double T, double P_pascal,
int ifunc)
double WaterProps::relEpsilon(double T, double P_pascal, int ifunc)
{
static const double U1 = 3.4279E2;
static const double U2 = -5.0866E-3;

View File

@ -73,7 +73,7 @@ double WaterPropsIAPWS::pressure() const
}
double WaterPropsIAPWS::density(double temperature, double pressure,
int phase, double rhoguess)
int phase, double rhoguess)
{
if (fabs(pressure - P_c) / P_c < 1.e-8 &&
fabs(temperature - T_c) / T_c < 1.e-8) {
@ -132,8 +132,7 @@ double WaterPropsIAPWS::density(double temperature, double pressure,
return density_retn;
}
double WaterPropsIAPWS::density_const(double pressure,
int phase, double rhoguess) const
double WaterPropsIAPWS::density_const(double pressure, int phase, double rhoguess) const
{
double temperature = T_c / tau;
double deltaGuess = 0.0;

View File

@ -410,8 +410,7 @@ double MMCollisionInt::cstar(double ts, double deltastar)
return quadInterp(log(ts), &m_logTemp[i1], values.data());
}
void MMCollisionInt::fit_omega22(int degree, double deltastar,
double* o22)
void MMCollisionInt::fit_omega22(int degree, double deltastar, double* o22)
{
int n = m_nmax - m_nmin + 1;
vector<double> values(n);
@ -433,8 +432,7 @@ void MMCollisionInt::fit_omega22(int degree, double deltastar,
}
}
void MMCollisionInt::fit(int degree, double deltastar,
double* a, double* b, double* c)
void MMCollisionInt::fit(int degree, double deltastar, double* a, double* b, double* c)
{
int n = m_nmax - m_nmin + 1;
vector<double> values(n);

View File

@ -41,8 +41,7 @@ public:
double astar(double ts, double deltastar);
double bstar(double ts, double deltastar);
double cstar(double ts, double deltastar);
void fit(int degree, double deltastar,
double* astar, double* bstar, double* cstar);
void fit(int degree, double deltastar, double* astar, double* bstar, double* cstar);
void fit_omega22(int degree, double deltastar, double* om22);
double omega11(double ts, double deltastar) {
return omega22(ts, deltastar)/astar(ts, deltastar);

View File

@ -253,8 +253,8 @@ void MultiTransport::getSpeciesFluxes(size_t ndim, const double* const grad_T,
}
}
void MultiTransport::getMassFluxes(const double* state1, const double* state2, double delta,
double* fluxes)
void MultiTransport::getMassFluxes(const double* state1, const double* state2,
double delta, double* fluxes)
{
double* x1 = m_spwork1.data();
double* x2 = m_spwork2.data();

View File

@ -373,8 +373,7 @@ double ReactorNet::sensitivity(size_t k, size_t p)
return m_integ->sensitivity(k, p) / denom;
}
void ReactorNet::evalJacobian(double t, double* y,
double* ydot, double* p, Array2D* j)
void ReactorNet::evalJacobian(double t, double* y, double* ydot, double* p, Array2D* j)
{
//evaluate the unperturbed ydot
eval(t, y, ydot, p);

View File

@ -21,8 +21,7 @@ public:
}
void SetUp() {
string Xref = "H:1.0, R1A:1.0, R1B:1.0, R2:1.0, "
"R3:1.0, R4:1.0, R5:1.0, R6:1.0";
string Xref = "H:1.0, R1A:1.0, R1B:1.0, R2:1.0, R3:1.0, R4:1.0, R5:1.0, R6:1.0";
soln_->thermo()->setState_TPX(900.0, 101325 * 8.0, Xref);
}

View File

@ -15,7 +15,8 @@ public:
ck_tran.init(phase.get(), CK_Mode);
}
void check_viscosity_poly(const string& speciek, const vector<double>& visc_coeff_expected, int cmode) {
void check_viscosity_poly(const string& speciek,
const vector<double>& visc_coeff_expected, int cmode) {
size_t k = phase->speciesIndex(speciek);
vector<double> coeffs (cmode == CK_Mode ? 4 : 5);
if (cmode == CK_Mode) {
@ -28,7 +29,8 @@ public:
}
}
void check_cond_poly(const string& speciek, const vector<double>& cond_coeff_expected, int cmode) {
void check_cond_poly(const string& speciek,
const vector<double>& cond_coeff_expected, int cmode) {
MixTransport tran;
tran.init(phase.get(), cmode);
size_t k = phase->speciesIndex(speciek);
@ -43,7 +45,8 @@ public:
}
}
void check_bindiff_poly(const string& speciek, const string& speciej, const vector<double>& bindiff_coeff_expected, int cmode) {
void check_bindiff_poly(const string& speciek, const string& speciej,
const vector<double>& bindiff_coeff_expected, int cmode) {
size_t k = phase->speciesIndex(speciek);
size_t j = phase->speciesIndex(speciej);
vector<double> coeffs (cmode == CK_Mode ? 4 : 5);