Cantera  3.0.0
Loading...
Searching...
No Matches
ReactionDataDelegator Class Reference

Delegate methods of the ReactionData class to external functions. More...

#include <ReactionRateDelegator.h>

Inheritance diagram for ReactionDataDelegator:
[legend]

Detailed Description

Delegate methods of the ReactionData class to external functions.

Since
New in Cantera 3.0

Definition at line 19 of file ReactionRateDelegator.h.

Public Member Functions

bool update (const ThermoPhase &phase, const Kinetics &kin) override
 Update data container based on thermodynamic phase state.
 
void update (double T) override
 Update data container based on temperature T
 
void setType (const string &name)
 Set the type of the ReactionData class.
 
shared_ptr< ExternalHandlegetWrapper () const
 Get the external language wrapper for this ReactionData object.
 
void setWrapper (shared_ptr< ExternalHandle > wrapper)
 Set the external language wrapper for this ReactionData object.
 
virtual void update (double T)
 Update data container based on temperature T
 
virtual void update (double T, double extra)
 Update data container based on temperature T and an extra parameter.
 
virtual void update (double T, const vector< double > &extra)
 Update data container based on temperature T and a vector parameter extra
 
virtual bool update (const ThermoPhase &phase, const Kinetics &kin)=0
 Update data container based on thermodynamic phase state.
 
- Public Member Functions inherited from Delegator
string delegatorName () const
 Get the name of the user-defined class in the extension language.
 
void setDelegatorName (const string &delegatorName)
 Set the name of the user-defined class in the extension language.
 
void setDelegate (const string &name, const function< void()> &func, const string &when)
 Set delegates for member functions with the signature void().
 
void setDelegate (const string &name, const function< void(bool)> &func, const string &when)
 set delegates for member functions with the signature void(bool)
 
void setDelegate (const string &name, const function< void(double)> &func, const string &when)
 set delegates for member functions with the signature void(double)
 
void setDelegate (const string &name, const function< void(AnyMap &)> &func, const string &when)
 set delegates for member functions with the signature void(AnyMap&)
 
void setDelegate (const string &name, const function< void(const AnyMap &, const UnitStack &)> &func, const string &when)
 set delegates for member functions with the signature void(AnyMap&, UnitStack&)
 
void setDelegate (const string &name, const function< void(const string &, void *)> &func, const string &when)
 set delegates for member functions with the signature void(const string&, void*)
 
void setDelegate (const string &name, const function< void(std::array< size_t, 1 >, double *)> &func, const string &when)
 Set delegates for member functions with the signature void(double*)
 
void setDelegate (const string &name, const function< void(std::array< size_t, 1 >, double, double *)> &func, const string &when)
 Set delegates for member functions with the signature void(double, double*)
 
void setDelegate (const string &name, const function< void(std::array< size_t, 2 >, double, double *, double *)> &func, const string &when)
 Set delegates for member functions with the signature void(double, double*, double*)
 
void setDelegate (const string &name, const function< void(std::array< size_t, 3 >, double *, double *, double *)> &func, const string &when)
 Set delegates for member functions with the signature void(double*, double*, double*)
 
void setDelegate (const string &name, const function< int(double &, void *)> &func, const string &when)
 set delegates for member functions with the signature double(void*)
 
void setDelegate (const string &name, const function< int(string &, size_t)> &func, const string &when)
 Set delegates for member functions with the signature string(size_t)
 
void setDelegate (const string &name, const function< int(size_t &, const string &)> &func, const string &when)
 Set delegates for member functions with the signature size_t(string)
 
void holdExternalHandle (const string &name, const shared_ptr< ExternalHandle > &handle)
 Store a handle to a wrapper for the delegate from an external language interface.
 
shared_ptr< ExternalHandlegetExternalHandle (const string &name) const
 Get the handle for a wrapper for the delegate from the external language interface specified by name.
 
- Public Member Functions inherited from ReactionData
virtual void update (double T)
 Update data container based on temperature T
 
virtual void update (double T, double extra)
 Update data container based on temperature T and an extra parameter.
 
virtual void update (double T, const vector< double > &extra)
 Update data container based on temperature T and a vector parameter extra
 
virtual bool update (const ThermoPhase &phase, const Kinetics &kin)=0
 Update data container based on thermodynamic phase state.
 
void perturbTemperature (double deltaT)
 Perturb temperature of data container.
 
virtual void restore ()
 Restore data container after a perturbation.
 
virtual void resize (size_t nSpecies, size_t nReactions, size_t nPhases)
 Update number of species, reactions and phases.
 
virtual void invalidateCache ()
 Force shared data and reaction rates to be updated next time.
 

Protected Attributes

string m_rateType
 The reaction rate type.
 
shared_ptr< ExternalHandlem_wrappedSolution
 An external language's wrapper for the Solution object where this ReactionData object is being used.
 
shared_ptr< ExternalHandlem_wrappedData
 An external language's wrapper for this ReactionData object.
 
function< double(void *)> m_update
 Delegated update method taking the Solution wrapper as its argument.
 
- Protected Attributes inherited from Delegator
map< string, shared_ptr< ExternalHandle > > m_handles
 Handles to wrappers for the delegated object in external language interfaces.
 
string m_delegatorName
 Name of the class in the extension language.
 
map< string, function< void()> * > m_funcs_v
 
map< string, function< void(bool)> * > m_funcs_v_b
 
map< string, function< void(double)> * > m_funcs_v_d
 
map< string, function< void(AnyMap &)> * > m_funcs_v_AMr
 
map< string, function< void(const AnyMap &, const UnitStack &)> * > m_funcs_v_cAMr_cUSr
 
map< string, function< void(const string &, void *)> * > m_funcs_v_csr_vp
 
map< string, function< void(std::array< size_t, 1 >, double *)> * > m_funcs_v_dp
 
map< string, function< void(std::array< size_t, 1 >, double, double *)> * > m_funcs_v_d_dp
 
map< string, function< void(std::array< size_t, 2 >, double, double *, double *)> * > m_funcs_v_d_dp_dp
 
map< string, function< void(std::array< size_t, 3 >, double *, double *, double *)> * > m_funcs_v_dp_dp_dp
 
map< string, function< double(void *)> > m_base_d_vp
 
map< string, function< double(void *)> * > m_funcs_d_vp
 
map< string, function< string(size_t)> > m_base_s_sz
 
map< string, function< string(size_t)> * > m_funcs_s_sz
 
map< string, function< size_t(const string &)> > m_base_sz_csr
 
map< string, function< size_t(const string &)> * > m_funcs_sz_csr
 
- Protected Attributes inherited from ReactionData
double m_temperature_buf = -1.0
 buffered temperature
 

Additional Inherited Members

- Public Attributes inherited from ReactionData
double temperature = 1.0
 temperature
 
double logT = 0.0
 logarithm of temperature
 
double recipT = 1.0
 inverse of temperature
 
- Protected Member Functions inherited from Delegator
void install (const string &name, function< void()> &target, const function< void()> &func)
 Install a function with the signature void() as being delegatable.
 
void install (const string &name, function< void(bool)> &target, const function< void(bool)> &func)
 Install a function with the signature void(bool) as being delegatable.
 
void install (const string &name, function< void(double)> &target, const function< void(double)> &func)
 Install a function with the signature void(double) as being delegatable.
 
void install (const string &name, function< void(AnyMap &)> &target, const function< void(AnyMap &)> &func)
 Install a function with the signature void(AnyMap&) as being delegatable.
 
void install (const string &name, function< void(const AnyMap &, const UnitStack &)> &target, const function< void(const AnyMap &, const UnitStack &)> &func)
 Install a function with the signature void(const AnyMap&, const UnitStack&) as being delegatable.
 
void install (const string &name, function< void(const string &, void *)> &target, const function< void(const string &, void *)> &func)
 Install a function with the signature `void(const string&, void*) as being delegatable.
 
void install (const string &name, function< void(std::array< size_t, 1 >, double *)> &target, const function< void(std::array< size_t, 1 >, double *)> &func)
 Install a function with the signature void(double*) as being delegatable.
 
void install (const string &name, function< void(std::array< size_t, 1 >, double, double *)> &target, const function< void(std::array< size_t, 1 >, double, double *)> &func)
 Install a function with the signature void(double, double*) as being delegatable.
 
void install (const string &name, function< void(std::array< size_t, 2 >, double, double *, double *)> &target, const function< void(std::array< size_t, 2 >, double, double *, double *)> &func)
 Install a function with the signature void(double, double*, double*) as being delegatable.
 
void install (const string &name, function< void(std::array< size_t, 3 >, double *, double *, double *)> &target, const function< void(std::array< size_t, 3 >, double *, double *, double *)> &base)
 Install a function with the signature void(double*, double*, double*) as being delegatable.
 
void install (const string &name, function< double(void *)> &target, const function< double(void *)> &func)
 Install a function with the signature double(void*) as being delegatable.
 
void install (const string &name, function< string(size_t)> &target, const function< string(size_t)> &base)
 Install a function with the signature string(size_t) as being delegatable.
 
void install (const string &name, function< size_t(const string &)> &target, const function< size_t(const string &)> &base)
 Install a function with the signature size_t(string) as being delegatable.
 
template<typename BaseFunc , class ... Args>
function< void(Args ...)> makeDelegate (const function< void(Args ...)> &func, const string &when, BaseFunc base)
 Create a delegate for a function with no return value.
 
template<typename ReturnType , class ... Args>
function< ReturnType(Args ...)> makeDelegate (const string &name, const function< int(ReturnType &, Args ...)> &func, const string &when, const function< ReturnType(Args ...)> &base)
 Create a delegate for a function with a return value.
 

Constructor & Destructor Documentation

◆ ReactionDataDelegator()

Definition at line 13 of file ReactionRateDelegator.cpp.

Member Function Documentation

◆ update() [1/6]

bool update ( const ThermoPhase phase,
const Kinetics kin 
)
overridevirtual

Update data container based on thermodynamic phase state.

This update mechanism is used by Kinetics reaction rate evaluators.

Returns
A boolean element indicating whether the evalFromStruct method needs to be called (assuming previously-calculated values were cached)

Implements ReactionData.

Definition at line 23 of file ReactionRateDelegator.cpp.

◆ update() [2/6]

void update ( double  T)
inlineoverridevirtual

Update data container based on temperature T

Only used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval. This method allows for testing of a reaction rate expression outside of Kinetics reaction rate evaluators.

Reimplemented from ReactionData.

Definition at line 26 of file ReactionRateDelegator.h.

◆ setType()

void setType ( const string &  name)
inline

Set the type of the ReactionData class.

This should match the corresponding ReactionRate class's type

Definition at line 35 of file ReactionRateDelegator.h.

◆ getWrapper()

shared_ptr< ExternalHandle > getWrapper ( ) const
inline

Get the external language wrapper for this ReactionData object.

Definition at line 40 of file ReactionRateDelegator.h.

◆ setWrapper()

void setWrapper ( shared_ptr< ExternalHandle wrapper)
inline

Set the external language wrapper for this ReactionData object.

Definition at line 45 of file ReactionRateDelegator.h.

◆ update() [3/6]

virtual void update ( double  T)
inlinevirtual

Update data container based on temperature T

Only used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval. This method allows for testing of a reaction rate expression outside of Kinetics reaction rate evaluators.

Reimplemented from ReactionData.

Definition at line 36 of file ReactionData.h.

◆ update() [4/6]

virtual void update ( double  T,
double  extra 
)
inlinevirtual

Update data container based on temperature T and an extra parameter.

Only used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval. This method allows for testing of a reaction rate expression outside of Kinetics reaction rate evaluators.

Reimplemented from ReactionData.

Definition at line 48 of file ReactionData.h.

◆ update() [5/6]

virtual void update ( double  T,
const vector< double > &  extra 
)
inlinevirtual

Update data container based on temperature T and a vector parameter extra

Only used in conjunction with MultiRateBase::evalSingle / ReactionRate::eval. This method allows for testing of a reaction rate expression outside of Kinetics reaction rate evaluators.

Warning
This method is an experimental part of the Cantera API and may be changed or removed without notice.

Reimplemented from ReactionData.

Definition at line 62 of file ReactionData.h.

◆ update() [6/6]

virtual bool update ( const ThermoPhase phase,
const Kinetics kin 
)
virtual

Update data container based on thermodynamic phase state.

This update mechanism is used by Kinetics reaction rate evaluators.

Returns
A boolean element indicating whether the evalFromStruct method needs to be called (assuming previously-calculated values were cached)

Implements ReactionData.

Member Data Documentation

◆ m_rateType

string m_rateType
protected

The reaction rate type.

Definition at line 51 of file ReactionRateDelegator.h.

◆ m_wrappedSolution

shared_ptr<ExternalHandle> m_wrappedSolution
protected

An external language's wrapper for the Solution object where this ReactionData object is being used.

Definition at line 55 of file ReactionRateDelegator.h.

◆ m_wrappedData

shared_ptr<ExternalHandle> m_wrappedData
protected

An external language's wrapper for this ReactionData object.

Definition at line 58 of file ReactionRateDelegator.h.

◆ m_update

function<double(void*)> m_update
protected

Delegated update method taking the Solution wrapper as its argument.

Definition at line 61 of file ReactionRateDelegator.h.


The documentation for this class was generated from the following files: