Skip to content

Commit

Permalink
Improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Aug 3, 2023
1 parent 748f109 commit fa74984
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 27 deletions.
5 changes: 3 additions & 2 deletions include/cantera/base/AnyMap.h
Expand Up @@ -74,7 +74,7 @@ class AnyMap;
* Elements are set using assignment, and the assignment operator has been
* overloaded for specific types so that only those types are allowed to be
* used in an AnyValue. The allowed types are:
* - AnyMap
* - `AnyMap`
* - `double`
* - `long int`
* - `bool`
Expand Down Expand Up @@ -341,7 +341,8 @@ vector<double>& AnyValue::asVector<double>(size_t nMin, size_t nMax);

//! Implicit conversion of long int to double if accessed as a vector<vector<double>>
template<>
const vector<vector<double>>& AnyValue::asVector<vector<double>>(size_t nMin, size_t nMax) const;
const vector<vector<double>>& AnyValue::asVector<vector<double>>(size_t nMin,
size_t nMax) const;

template<>
vector<vector<double>>& AnyValue::asVector<vector<double>>(size_t nMin, size_t nMax);
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/base/Units.h
Expand Up @@ -27,7 +27,7 @@ class AnyMap;
/*!
* Used for converting quantities between unit systems and checking for
* dimensional consistency. Units objects are mainly used within UnitSystem
* class to convert values from a user-specified Unit system to Cantera's
* class to convert values from a user-specified Unit system to %Cantera's
* base units (SI + kmol).
* @ingroup unitsGroup
*/
Expand Down
10 changes: 4 additions & 6 deletions include/cantera/base/stringUtils.h
Expand Up @@ -26,7 +26,7 @@ namespace Cantera
* @param sep Separator
*/
string vec2str(const vector<double>& v, const string& fmt="%g",
const string& sep=", ");
const string& sep=", ");

//! Strip non-printing characters wherever they are
/*!
Expand Down Expand Up @@ -59,7 +59,7 @@ string stripnonprint(const string& s);
* @return map of names to values
*/
Composition parseCompString(const string& ss,
const vector<string>& names=vector<string>());
const vector<string>& names=vector<string>());

//! Translate a string into one double value
/*!
Expand Down Expand Up @@ -104,8 +104,7 @@ double fpValueCheck(const string& val);
* @param oval String to be broken up
* @param v Output vector of tokens.
*/
void tokenizeString(const string& oval,
vector<string>& v);
void tokenizeString(const string& oval, vector<string>& v);

//! This function separates a string up into tokens according to the location of
//! path separators.
Expand All @@ -117,8 +116,7 @@ void tokenizeString(const string& oval,
*
* @since New in %Cantera 3.0.
*/
void tokenizePath(const string& oval,
vector<string>& v);
void tokenizePath(const string& oval, vector<string>& v);

//! Copy the contents of a string into a char array of a given length
/*!
Expand Down
7 changes: 5 additions & 2 deletions include/cantera/kinetics/InterfaceRate.h
Expand Up @@ -117,7 +117,8 @@ class InterfaceRateBase
//! Add a coverage dependency for species *sp*, with exponential dependence
//! *a*, power-law exponent *m*, and activation energy dependence *e*,
//! where *e* is in Kelvin, that is, energy divided by the molar gas constant.
virtual void addCoverageDependence(const string& sp, double a, double m, const vector<double>& e);
virtual void addCoverageDependence(const string& sp, double a, double m,
const vector<double>& e);

//! Boolean indicating whether rate uses exchange current density formulation
bool exchangeCurrentDensityFormulation() {
Expand Down Expand Up @@ -441,7 +442,9 @@ class InterfaceRate : public RateType, public InterfaceRateBase
return RateType::activationEnergy() + m_ecov * GasConstant;
}

void addCoverageDependence(const string& sp, double a, double m, const vector<double>& e) override {
void addCoverageDependence(const string& sp, double a, double m,
const vector<double>& e) override
{
InterfaceRateBase::addCoverageDependence(sp, a, m, e);
RateType::setCompositionDependence(true);
}
Expand Down
9 changes: 6 additions & 3 deletions include/cantera/kinetics/StoichManager.h
Expand Up @@ -334,7 +334,8 @@ class C_AnyN
public:
C_AnyN() = default;

C_AnyN(size_t rxn, const vector<size_t>& ic, const vector<double>& order_, const vector<double>& stoich_) :
C_AnyN(size_t rxn, const vector<size_t>& ic,
const vector<double>& order_, const vector<double>& stoich_) :
m_n(ic.size()),
m_rxn(rxn) {
m_ic.resize(m_n);
Expand Down Expand Up @@ -676,10 +677,12 @@ class StoichManagerN
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("StoichManagerN::add()", "size of order and species arrays differ");
throw CanteraError(\
"StoichManagerN::add()", "size of order and species arrays differ");
}
if (stoich.size() != k.size()) {
throw CanteraError("StoichManagerN::add()", "size of stoich and species arrays differ");
throw CanteraError(
"StoichManagerN::add()", "size of stoich and species arrays differ");
}
bool frac = false;
for (size_t n = 0; n < stoich.size(); n++) {
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/kinetics/ThirdBodyCalc.h
Expand Up @@ -21,7 +21,7 @@ class ThirdBodyCalc
public:
//! Install reaction that uses third-body effects in ThirdBodyCalc manager
void install(size_t rxnNumber, const map<size_t, double>& efficiencies,
double default_efficiency, bool mass_action) {
double default_efficiency, bool mass_action) {
m_reaction_index.push_back(rxnNumber);
m_default.push_back(default_efficiency);

Expand Down
4 changes: 2 additions & 2 deletions include/cantera/kinetics/solveSP.h
Expand Up @@ -226,8 +226,8 @@ class solveSP
* @returns the 1. / delta T to be used on the next step
*/
double calc_t(double netProdRateSolnSP[], double XMolSolnSP[],
int* label, int* label_old,
double* label_factor, int ioflag);
int* label, int* label_old,
double* label_factor, int ioflag);

//! Calculate the solution and residual weights
/*!
Expand Down
5 changes: 2 additions & 3 deletions include/cantera/oneD/MultiNewton.h
Expand Up @@ -43,7 +43,7 @@ class MultiNewton
* all domains between their specified lower and upper bounds.
*/
double boundStep(const double* x0, const double* step0,
const OneDim& r, int loglevel);
const OneDim& r, int loglevel);

/**
* On entry, step0 must contain an undamped Newton step for the solution x0.
Expand All @@ -65,8 +65,7 @@ class MultiNewton
* contains an initial estimate of the solution. On successful return, x1
* contains the converged solution.
*/
int solve(double* x0, double* x1, OneDim& r, MultiJac& jac,
int loglevel);
int solve(double* x0, double* x1, OneDim& r, MultiJac& jac, int loglevel);

//! Set options.
void setOptions(int maxJacAge = 5) {
Expand Down
6 changes: 2 additions & 4 deletions include/cantera/oneD/OneDim.h
Expand Up @@ -193,8 +193,7 @@ class OneDim
* the default value is used.
* @param count Set to zero to omit this call from the statistics
*/
void eval(size_t j, double* x, double* r, double rdt=-1.0,
int count = 1);
void eval(size_t j, double* x, double* r, double rdt=-1.0, int count = 1);

//! Return a pointer to the domain global point *i* belongs to.
/*!
Expand All @@ -220,8 +219,7 @@ class OneDim
* @param loglevel controls amount of printed diagnostics
* @returns size of last timestep taken
*/
double timeStep(int nsteps, double dt, double* x,
double* r, int loglevel);
double timeStep(int nsteps, double dt, double* x, double* r, int loglevel);

void resetBadValues(double* x);

Expand Down
3 changes: 1 addition & 2 deletions include/cantera/oneD/StFlow.h
Expand Up @@ -305,8 +305,7 @@ class StFlow : public Domain1D
* j-1, j, and j+1. This option is used to efficiently evaluate the
* Jacobian numerically.
*/
virtual void eval(size_t j, double* x, double* r,
integer* mask, double rdt);
virtual void eval(size_t j, double* x, double* r, integer* mask, double rdt);

//! Evaluate all residual components at the right boundary.
virtual void evalRightBoundary(double* x, double* res, int* diag,
Expand Down
3 changes: 2 additions & 1 deletion include/cantera/zeroD/Reactor.h
Expand Up @@ -80,7 +80,8 @@ class Reactor : public ReactorBase
m_chem = cflag;
}

//! Returns `true` if changes in the reactor composition due to chemical reactions are enabled.
//! Returns `true` if changes in the reactor composition due to chemical reactions
//! are enabled.
bool chemistryEnabled() const {
return m_chem;
}
Expand Down

0 comments on commit fa74984

Please sign in to comment.