Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Jul 24, 2022
1 parent 6a6497a commit 9d9bb5f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions include/cantera/kinetics/Reaction.h
Expand Up @@ -197,7 +197,7 @@ class Reaction
//! Flag indicating that serialization uses explicit type
bool m_explicit_type = false;

//! Flag indicating that third body collider is ambiguous
//! Flag indicating that third body requires explicit serialization
bool m_explicit_3rd = false;

//! Flag indicating that object was instantiated from reactant/product compositions
Expand Down Expand Up @@ -245,7 +245,7 @@ class ThirdBody
//! @param node AnyMap receiving serialized parameters
//! @param explicit_3rd Flag triggering explicit third body efficiency output
//! @since New in Cantera 3.0
void getParameters(AnyMap& node, bool explicit_3rd=false) const;
void getParameters(AnyMap& node, bool explicit_3rd) const;

//! Get the third-body efficiency for species *k*
double efficiency(const std::string& k) const;
Expand Down
2 changes: 1 addition & 1 deletion src/kinetics/Reaction.cpp
Expand Up @@ -38,7 +38,7 @@ Reaction::Reaction(const Composition& reactants_,
{
setRate(rate_);

// ensure safe serialization
// set flags ensuring correct serialization output
bool count = 0;
for (const auto& reac : reactants) {
if (products.count(reac.first)) {
Expand Down
8 changes: 4 additions & 4 deletions test/kinetics/kineticsFromScratch.cpp
Expand Up @@ -157,7 +157,7 @@ TEST_F(KineticsFromScratch, multiple_third_bodies4)
auto R = make_shared<Reaction>(equation, rate, tbody);
EXPECT_EQ(R->thirdBody()->name(), "O2");

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
Expand All @@ -184,7 +184,7 @@ TEST_F(KineticsFromScratch, multiple_third_bodies6)
auto R = make_shared<Reaction>(reac, prod, rate, tbody);
EXPECT_EQ(R->thirdBody()->name(), "O2");

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
Expand All @@ -202,7 +202,7 @@ TEST_F(KineticsFromScratch, multiple_third_bodies7)
auto R = make_shared<Reaction>(equation, rate, tbody);
EXPECT_EQ(R->thirdBody()->name(), "M");

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
Expand All @@ -222,7 +222,7 @@ TEST_F(KineticsFromScratch, multiple_third_bodies8)
auto R = make_shared<Reaction>(equation, rate, tbody);
EXPECT_EQ(R->thirdBody()->name(), "M");

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
Expand Down
10 changes: 5 additions & 5 deletions test/kinetics/kineticsFromYaml.cpp
Expand Up @@ -92,7 +92,7 @@ TEST(Reaction, ThreeBodyFromYaml2)
const auto& rate = std::dynamic_pointer_cast<ArrheniusRate>(R->rate());
EXPECT_DOUBLE_EQ(rate->preExponentialFactor(), 1.2e11);

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));

Expand Down Expand Up @@ -134,7 +134,7 @@ TEST(Reaction, ThreeBodyFromYaml4)
const auto& rate = std::dynamic_pointer_cast<ArrheniusRate>(R->rate());
EXPECT_DOUBLE_EQ(rate->preExponentialFactor(), 5.0e+9);

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_EQ(input.getString("type", ""), "three-body");
EXPECT_FALSE(input.hasKey("efficiencies"));
EXPECT_FALSE(input.hasKey("default-efficiency"));
Expand Down Expand Up @@ -168,7 +168,7 @@ TEST(Reaction, ThreeBodyFromYaml6)
const auto& rate = std::dynamic_pointer_cast<ArrheniusRate>(R->rate());
EXPECT_DOUBLE_EQ(rate->preExponentialFactor(), 5.0e+9);

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
Expand Down Expand Up @@ -196,7 +196,7 @@ TEST(Reaction, ThreeBodyFromYaml7)
const auto& rate = std::dynamic_pointer_cast<ArrheniusRate>(R->rate());
EXPECT_DOUBLE_EQ(rate->preExponentialFactor(), 5.0e+9);

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_EQ(input.getString("type", ""), "three-body");
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
Expand Down Expand Up @@ -454,7 +454,7 @@ TEST(Reaction, ThreeBodyBlowersMaselFromYaml)
const auto& rate = std::dynamic_pointer_cast<BlowersMaselRate>(R->rate());
EXPECT_DOUBLE_EQ(rate->preExponentialFactor(), 38.7);

AnyMap input = R->parameters();
AnyMap input = R->parameters(false);
EXPECT_EQ(input.getString("type", ""), "three-body-Blowers-Masel");
}

Expand Down

0 comments on commit 9d9bb5f

Please sign in to comment.