Skip to content

Commit

Permalink
Tweak docstrings and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Dec 14, 2021
1 parent 4144bff commit 285ce29
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
6 changes: 2 additions & 4 deletions include/cantera/kinetics/GasKinetics.h
Expand Up @@ -70,13 +70,12 @@ class GasKinetics : public BulkKinetics
//! reactions.
virtual void update_rates_C();

private:
protected:
//! @name Internal service methods
/*!
* These methods are for @internal use, and seek to avoid code duplication
* while evaluating terms used for rate constants, rates of progress, and
* their derivatives. Frequently used methods are defined in the header
* file and use raw data pointers to allow inlining and avoid overhead.
* their derivatives.
*/
//! @{

Expand Down Expand Up @@ -125,7 +124,6 @@ class GasKinetics : public BulkKinetics

//! @}

protected:
//! Reaction index of each falloff reaction
std::vector<size_t> m_fallindx; //!< @deprecated (legacy only)

Expand Down
34 changes: 13 additions & 21 deletions include/cantera/kinetics/ReactionData.h
Expand Up @@ -29,7 +29,7 @@ struct ReactionData
/**
* Only used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval.
* This method allows for testing of a reaction rate expression outside of
* Kinetics reaction rate evaluators. Mainly used for testing purposes.
* Kinetics reaction rate evaluators.
*/
virtual void update(double T) {
temperature = T;
Expand All @@ -41,7 +41,7 @@ struct ReactionData
/**
* Only used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval.
* This method allows for testing of a reaction rate expression outside of
* Kinetics reaction rate evaluators. Mainly used for testing purposes.
* Kinetics reaction rate evaluators.
*/
virtual void update(double T, double extra);

Expand All @@ -51,8 +51,7 @@ struct ReactionData
* @returns A boolean element indicating whether the `evalFromStruct` method
* needs to be called (assuming previously-calculated values were cached)
*/
virtual bool update(const ThermoPhase& bulk,
const Kinetics& kin) = 0;
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) = 0;

//! Update number of species and reactions
virtual void resize(size_t n_species, size_t n_reactions) {}
Expand All @@ -76,10 +75,9 @@ struct ReactionData
* The data container `ArrheniusData` holds precalculated data common to
* all `ArrheniusRate` objects.
*/
struct ArrheniusData final : public ReactionData
struct ArrheniusData : public ReactionData
{
virtual bool update(const ThermoPhase& bulk,
const Kinetics& kin);
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin);
using ReactionData::update;
};

Expand All @@ -89,12 +87,11 @@ struct ArrheniusData final : public ReactionData
* The data container `BlowersMaselData` holds precalculated data common to
* all `BlowersMaselRate` objects.
*/
struct BlowersMaselData final : public ReactionData
struct BlowersMaselData : public ReactionData
{
BlowersMaselData();

virtual bool update(const ThermoPhase& bulk,
const Kinetics& kin) override;
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) override;

virtual void update(double T) override;

Expand All @@ -121,12 +118,11 @@ struct BlowersMaselData final : public ReactionData
* The data container `FalloffData` holds precalculated data common to
* all Falloff related reaction rate classes.
*/
struct FalloffData final : public ReactionData
struct FalloffData : public ReactionData
{
FalloffData();

virtual bool update(const ThermoPhase& bulk,
const Kinetics& kin) override;
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) override;

virtual void update(double T) override;

Expand Down Expand Up @@ -156,10 +152,9 @@ struct FalloffData final : public ReactionData
* The data container `PlogData` holds precalculated data common to
* all `PlogRate` objects.
*/
struct PlogData final : public ReactionData
struct PlogData : public ReactionData
{
PlogData() : pressure(NAN), logP(0.) {}
using ReactionData::update;

virtual void update(double T) override;

Expand All @@ -169,8 +164,7 @@ struct PlogData final : public ReactionData
logP = std::log(P);
}

virtual bool update(const ThermoPhase& bulk,
const Kinetics& kin) override;
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) override;

virtual void invalidateCache() override {
ReactionData::invalidateCache();
Expand All @@ -187,10 +181,9 @@ struct PlogData final : public ReactionData
* The data container `ChebyshevData` holds precalculated data common to
* all `ChebyshevRate3` objects.
*/
struct ChebyshevData final : public ReactionData
struct ChebyshevData : public ReactionData
{
ChebyshevData() : pressure(NAN), log10P(0.) {}
using ReactionData::update;

virtual void update(double T) override;

Expand All @@ -200,8 +193,7 @@ struct ChebyshevData final : public ReactionData
log10P = std::log10(P);
}

virtual bool update(const ThermoPhase& bulk,
const Kinetics& kin) override;
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) override;

virtual void invalidateCache() override {
ReactionData::invalidateCache();
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/kinetics/ReactionRate.h
Expand Up @@ -103,7 +103,7 @@ class ReactionRate
//! @param T temperature [K]
//! Used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval.
//! This method allows for testing of a reaction rate expression outside of
//! Kinetics reaction rate evaluators. Mainly used for testing purposes.
//! Kinetics reaction rate evaluators.
double eval(double T) {
_evaluator().update(T);
return _evaluator().evalSingle(*this);
Expand All @@ -116,7 +116,7 @@ class ReactionRate
//! @param extra extra parameter used by parameterization
//! Used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval.
//! This method allows for testing of a reaction rate expression outside of
//! Kinetics reaction rate evaluators. Mainly used for testing purposes.
//! Kinetics reaction rate evaluators.
double eval(double T, double extra) {
_evaluator().update(T, extra);
return _evaluator().evalSingle(*this);
Expand Down

0 comments on commit 285ce29

Please sign in to comment.