Skip to content

Commit

Permalink
[Kinetics] Remove NAN sentinel from PlogRate
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Jul 12, 2022
1 parent 83fa9c0 commit 91c0e34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/cantera/kinetics/PlogRate.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ class PlogRate final : public ReactionRate
//! reaction.
std::multimap<double, ArrheniusRate> getRates() const;

virtual bool ready() const override {
return rates_.size() && !(rates_.size() > 1 && !rates_[1].ready());
}

protected:
//! log(p) to (index range) in the rates_ vector
std::map<double, std::pair<size_t, size_t>> pressures_;
Expand Down
4 changes: 1 addition & 3 deletions src/kinetics/PlogRate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ void PlogRate::getParameters(AnyMap& rateNode, const Units& rate_units) const
{
std::vector<AnyMap> rateList;
rateNode["type"] = type();
if (!rates_.size()
|| (rates_.size() > 1 && std::isnan(rates_[1].preExponentialFactor())))
{
if (!ready()) {
// object not fully set up
return;
}
Expand Down

0 comments on commit 91c0e34

Please sign in to comment.