Skip to content

Commit

Permalink
[Kinetics] Remove unnecessary specializations for getParameters
Browse files Browse the repository at this point in the history
As ReactionRate objects have consistent type names, specializations for
ElementaryReaction3::getParameters, PlogReaction3::getParameters and
ChebyshevReaction3::getParameters are no longer needed.
  • Loading branch information
ischoegl committed Aug 12, 2021
1 parent 4022e79 commit 26961c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
4 changes: 0 additions & 4 deletions include/cantera/kinetics/Reaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ class ElementaryReaction3 : public Reaction
virtual std::string type() const {
return "elementary";
}
virtual void getParameters(AnyMap& reactionNode) const;
};


Expand Down Expand Up @@ -540,7 +539,6 @@ class PlogReaction3 : public Reaction
virtual std::string type() const {
return "pressure-dependent-Arrhenius";
}
virtual void getParameters(AnyMap& reactionNode) const;
};


Expand All @@ -558,8 +556,6 @@ class ChebyshevReaction3 : public Reaction
virtual std::string type() const {
return "Chebyshev";
}

virtual void getParameters(AnyMap& reactionNode) const;
};


Expand Down
26 changes: 5 additions & 21 deletions src/kinetics/Reaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ void Reaction::getParameters(AnyMap& reactionNode) const
if (allow_nonreactant_orders) {
reactionNode["nonreactant-orders"] = true;
}

if (m_rate) {
reactionNode.update(m_rate->parameters(rate_units));
}
}

void Reaction::setParameters(const AnyMap& node, const Kinetics& kin)
Expand Down Expand Up @@ -902,12 +906,6 @@ ElementaryReaction3::ElementaryReaction3(const AnyMap& node, const Kinetics& kin
}
}

void ElementaryReaction3::getParameters(AnyMap& reactionNode) const
{
reactionNode.update(m_rate->parameters(rate_units));
Reaction::getParameters(reactionNode);
}

ThreeBodyReaction3::ThreeBodyReaction3()
{
m_third_body.reset(new ThirdBody);
Expand Down Expand Up @@ -1018,7 +1016,7 @@ void ThreeBodyReaction3::setParameters(const AnyMap& node, const Kinetics& kin)

void ThreeBodyReaction3::getParameters(AnyMap& reactionNode) const
{
ElementaryReaction3::getParameters(reactionNode);
Reaction::getParameters(reactionNode);
if (!specified_collision_partner) {
reactionNode["type"] = "three-body";
reactionNode["efficiencies"] = m_third_body->efficiencies;
Expand Down Expand Up @@ -1071,13 +1069,6 @@ PlogReaction3::PlogReaction3(const AnyMap& node, const Kinetics& kin)
}
}

void PlogReaction3::getParameters(AnyMap& reactionNode) const
{
Reaction::getParameters(reactionNode);
reactionNode["type"] = "pressure-dependent-Arrhenius";
reactionNode.update(m_rate->parameters(rate_units));
}

ChebyshevReaction3::ChebyshevReaction3()
{
setRate(newReactionRate(type()));
Expand All @@ -1101,13 +1092,6 @@ ChebyshevReaction3::ChebyshevReaction3(const AnyMap& node, const Kinetics& kin)
}
}

void ChebyshevReaction3::getParameters(AnyMap& reactionNode) const
{
reactionNode.update(m_rate->parameters(rate_units));
Reaction::getParameters(reactionNode);
reactionNode["type"] = "Chebyshev";
}

CustomFunc1Reaction::CustomFunc1Reaction()
{
setRate(newReactionRate(type()));
Expand Down

0 comments on commit 26961c9

Please sign in to comment.