@@ -98,29 +98,6 @@ void Reaction::validate()
9898 }
9999}
100100
101- void Reaction2::setup (const AnyMap& node, const Kinetics& kin)
102- {
103- parseReactionEquation (*this , node[" equation" ], kin);
104- // Non-stoichiometric reaction orders
105- std::map<std::string, double > orders;
106- if (node.hasKey (" orders" )) {
107- for (const auto & order : node[" orders" ].asMap <double >()) {
108- orders[order.first ] = order.second ;
109- if (kin.kineticsSpeciesIndex (order.first ) == npos) {
110- setValid (false );
111- }
112- }
113- }
114-
115- // Flags
116- id = node.getString (" id" , " " );
117- duplicate = node.getBool (" duplicate" , false );
118- allow_negative_orders = node.getBool (" negative-orders" , false );
119- allow_nonreactant_orders = node.getBool (" nonreactant-orders" , false );
120-
121- input = node;
122- }
123-
124101std::string Reaction::reactantString () const
125102{
126103 std::ostringstream result;
@@ -320,18 +297,41 @@ ChebyshevReaction::ChebyshevReaction(const Composition& reactants_,
320297 reaction_type = CHEBYSHEV_RXN;
321298}
322299
300+ void Reaction2::setParameters (const AnyMap& node, const Kinetics& kin)
301+ {
302+ parseReactionEquation (*this , node[" equation" ], kin);
303+ // Non-stoichiometric reaction orders
304+ std::map<std::string, double > orders;
305+ if (node.hasKey (" orders" )) {
306+ for (const auto & order : node[" orders" ].asMap <double >()) {
307+ orders[order.first ] = order.second ;
308+ if (kin.kineticsSpeciesIndex (order.first ) == npos) {
309+ setValid (false );
310+ }
311+ }
312+ }
313+
314+ // Flags
315+ id = node.getString (" id" , " " );
316+ duplicate = node.getBool (" duplicate" , false );
317+ allow_negative_orders = node.getBool (" negative-orders" , false );
318+ allow_nonreactant_orders = node.getBool (" nonreactant-orders" , false );
319+
320+ input = node;
321+ }
322+
323323CustomFunc1Reaction::CustomFunc1Reaction ()
324324 : Reaction2()
325325{
326326 reaction_type = CUSTOMPY_RXN;
327327}
328328
329- void CustomFunc1Reaction::setup (const AnyMap& node, const Kinetics& kin)
329+ void CustomFunc1Reaction::setParameters (const AnyMap& node, const Kinetics& kin)
330330{
331- Reaction2::setup (node, kin);
332- Units rc_units ; // @todo Not needed once `rate_units` is implemented.
331+ Reaction2::setParameters (node, kin);
332+ Units rate_units ; // @todo Not needed once `rate_units` is implemented.
333333 setRate (
334- std::shared_ptr<CustomFunc1Rate>(new CustomFunc1Rate (node, rc_units )));
334+ std::shared_ptr<CustomFunc1Rate>(new CustomFunc1Rate (node, rate_units )));
335335}
336336
337337TestReaction::TestReaction ()
@@ -340,15 +340,15 @@ TestReaction::TestReaction()
340340{
341341}
342342
343- void TestReaction::setup (const AnyMap& node, const Kinetics& kin)
343+ void TestReaction::setParameters (const AnyMap& node, const Kinetics& kin)
344344{
345- Reaction2::setup (node, kin);
345+ Reaction2::setParameters (node, kin);
346346
347347 // @todo Rate units will become available as `rate_units` after
348348 // serialization is fully implemented.
349- Units rc_units = rateCoeffUnits (*this , kin);
349+ Units rate_units = rateCoeffUnits (*this , kin);
350350 setRate (
351- std::shared_ptr<ArrheniusRate>(new ArrheniusRate (node, rc_units )));
351+ std::shared_ptr<ArrheniusRate>(new ArrheniusRate (node, rate_units )));
352352 allow_negative_pre_exponential_factor = node.getBool (" negative-A" , false );
353353}
354354
@@ -434,9 +434,9 @@ Arrhenius readArrhenius(const Reaction& R, const AnyValue& rate,
434434 const Kinetics& kin, const UnitSystem& units,
435435 int pressure_dependence=0 )
436436{
437- Units rc_units = rateCoeffUnits (R, kin, pressure_dependence);
437+ Units rate_units = rateCoeffUnits (R, kin, pressure_dependence);
438438 Arrhenius arr;
439- arr.setup (rate, units, rc_units );
439+ arr.setParameters (rate, units, rate_units );
440440 return arr;
441441}
442442
0 commit comments