13 ReactionDataDelegator::ReactionDataDelegator()
17 throw NotImplementedError(
"ReactionDataDelegator::update");
27 auto soln = kin.
root();
30 "Phase must be instantiated as a Solution to use extensible "
33 if (soln->getExternalHandle(wrapperType)) {
40 return needsUpdate != 0.0;
43 ReactionRateDelegator::ReactionRateDelegator()
51 install(
"setParameters", m_setParameters,
52 [
this](
const AnyMap& node,
const UnitStack& units) {
54 install(
"getParameters", m_getParameters,
57 [](
const string& equation,
void* soln) {
58 throw NotImplementedError(
"ReactionRateDelegator::validate"); });
72 auto soln = kin.
root();
75 "Phase must be instantiated as a Solution to use extensible "
79 auto wrappedSoln = soln->getExternalHandle(wrapperType);
85 m_validate(equation, wrappedSoln->get());
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Base class for exceptions thrown by Cantera classes.
virtual string getMessage() const
Method overridden by derived classes to format the error message.
void install(const string &name, function< void()> &target, const function< void()> &func)
Install a function with the signature void() as being delegatable.
static void wrapReactionData(const string &rateName, ReactionDataDelegator &data)
Create an object in an external language that wraps the specified ReactionData object.
static string getSolutionWrapperType(const string &userType)
Get the Solution wrapper type corresponding to the specified user-defined reaction rate type.
static shared_ptr< ExternalHandle > wrapSolution(const string &wrapperType, shared_ptr< Solution > soln)
Create an object in an external language that wraps the specified Solution object.
Public interface for kinetics managers.
shared_ptr< Solution > root() const
Get the Solution object containing this Kinetics object and associated ThermoPhase objects.
A class template handling ReactionRate specializations.
An error indicating that an unimplemented function has been called.
Delegate methods of the ReactionData class to external functions.
shared_ptr< ExternalHandle > m_wrappedSolution
An external language's wrapper for the Solution object where this ReactionData object is being used.
virtual void update(double T)
Update data container based on temperature T
string m_rateType
The reaction rate type.
function< double(void *)> m_update
Delegated update method taking the Solution wrapper as its argument.
void setType(const string &name)
Set the type of the ReactionData class.
Delegate methods of the ReactionRate class to external functions.
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
void validate(const string &equation, const Kinetics &kin) override
Validate the reaction rate expression.
string m_rateType
The name of the reaction rate type.
function< double(void *)> m_evalFromStruct
Delegated evalFromStruct method taking a pointer to the corresponding ReactionData wrapper object.
virtual void setParameters(const AnyMap &node, const UnitStack &units)
Set parameters.
AnyMap m_input
Input data used for specific models.
virtual void getParameters(AnyMap &node) const
Get parameters.
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.