Cantera 2.6.0
Public Member Functions | Private Attributes | List of all members
ReactorDelegator< R > Class Template Reference

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

#include <ReactorDelegator.h>

Inheritance diagram for ReactorDelegator< R >:
[legend]
Collaboration diagram for ReactorDelegator< R >:
[legend]

Public Member Functions

virtual void initialize (double t0) override
 
virtual void syncState () override
 
virtual void getState (double *y) override
 
virtual void updateState (double *y) override
 
virtual void updateSurfaceState (double *y) override
 
virtual void getSurfaceInitialConditions (double *y) override
 
virtual void updateConnected (bool updatePressure) override
 
virtual void eval (double t, double *LHS, double *RHS) override
 
virtual void evalWalls (double t) override
 
virtual void evalSurfaces (double *LHS, double *RHS, double *sdot) override
 
virtual std::string componentName (size_t k) override
 
virtual size_t componentIndex (const std::string &nm) const override
 
virtual size_t speciesIndex (const std::string &nm) const override
 
virtual void setNEq (size_t n) override
 Set the number of equations represented by this reactor. More...
 
virtual double vdot () const override
 Get the net rate of volume change (for example, from moving walls) [m^3/s]. More...
 
virtual void setVdot (double v) override
 Set the net rate of volume change (for example, from moving walls) [m^3/s]. More...
 
virtual double qdot () const override
 Get the net heat transfer rate (for example, through walls) into the reactor [W]. More...
 
virtual void setQdot (double q) override
 Set the net heat transfer rate (for example, through walls) into the reactor [W]. More...
 
virtual void restoreThermoState () override
 Set the state of the thermo object to correspond to the state of the reactor. More...
 
virtual void restoreSurfaceState (size_t n) override
 Set the state of the thermo object for surface n to correspond to the state of that surface. More...
 
- Public Member Functions inherited from Delegator
void setDelegate (const std::string &name, const std::function< void()> &func, const std::string &when)
 Set delegates for member functions with the signature void(). More...
 
void setDelegate (const std::string &name, const std::function< void(bool)> &func, const std::string &when)
 set delegates for member functions with the signature void(bool) More...
 
void setDelegate (const std::string &name, const std::function< void(double)> &func, const std::string &when)
 set delegates for member functions with the signature void(double) More...
 
void setDelegate (const std::string &name, const std::function< void(std::array< size_t, 1 >, double *)> &func, const std::string &when)
 Set delegates for member functions with the signature void(double*) More...
 
void setDelegate (const std::string &name, const std::function< void(std::array< size_t, 1 >, double, double *)> &func, const std::string &when)
 Set delegates for member functions with the signature void(double, double*) More...
 
void setDelegate (const std::string &name, const std::function< void(std::array< size_t, 2 >, double, double *, double *)> &func, const std::string &when)
 Set delegates for member functions with the signature void(double, double*, double*) More...
 
void setDelegate (const std::string &name, const std::function< void(std::array< size_t, 3 >, double *, double *, double *)> &func, const std::string &when)
 Set delegates for member functions with the signature void(double*, double*, double*) More...
 
void setDelegate (const std::string &name, const std::function< int(std::string &, size_t)> &func, const std::string &when)
 Set delegates for member functions with the signature string(size_t) More...
 
void setDelegate (const std::string &name, const std::function< int(size_t &, const std::string &)> &func, const std::string &when)
 Set delegates for member functions with the signature size_t(string) More...
 

Private Attributes

std::function< void(double)> m_initialize
 
std::function< void()> m_syncState
 
std::function< void(std::array< size_t, 1 >, double *)> m_getState
 
std::function< void(std::array< size_t, 1 >, double *)> m_updateState
 
std::function< void(std::array< size_t, 1 >, double *)> m_updateSurfaceState
 
std::function< void(std::array< size_t, 1 >, double *)> m_getSurfaceInitialConditions
 
std::function< void(bool)> m_updateConnected
 
std::function< void(std::array< size_t, 2 >, double, double *, double *)> m_eval
 
std::function< void(double)> m_evalWalls
 
std::function< void(std::array< size_t, 3 >, double *, double *, double *)> m_evalSurfaces
 
std::function< std::string(size_t)> m_componentName
 
std::function< size_t(const std::string &)> m_componentIndex
 
std::function< size_t(const std::string &)> m_speciesIndex
 

Additional Inherited Members

- Protected Member Functions inherited from Delegator
void install (const std::string &name, std::function< void()> &target, const std::function< void()> &func)
 Install a function with the signature void() as being delegatable. More...
 
void install (const std::string &name, std::function< void(bool)> &target, const std::function< void(bool)> &func)
 Install a function with the signature void(bool) as being delegatable. More...
 
void install (const std::string &name, std::function< void(double)> &target, const std::function< void(double)> &func)
 Install a function with the signature void(double) as being delegatable. More...
 
void install (const std::string &name, std::function< void(std::array< size_t, 1 >, double *)> &target, const std::function< void(std::array< size_t, 1 >, double *)> &func)
 Install a function with the signature void(double*) as being delegatable. More...
 
void install (const std::string &name, std::function< void(std::array< size_t, 1 >, double, double *)> &target, const std::function< void(std::array< size_t, 1 >, double, double *)> &func)
 Install a function with the signature void(double, double*) as being delegatable. More...
 
void install (const std::string &name, std::function< void(std::array< size_t, 2 >, double, double *, double *)> &target, const std::function< void(std::array< size_t, 2 >, double, double *, double *)> &func)
 Install a function with the signature void(double, double*, double*) as being delegatable. More...
 
void install (const std::string &name, std::function< void(std::array< size_t, 3 >, double *, double *, double *)> &target, const std::function< void(std::array< size_t, 3 >, double *, double *, double *)> &base)
 Install a function with the signature void(double*, double*, double*) as being delegatable. More...
 
void install (const std::string &name, std::function< std::string(size_t)> &target, const std::function< std::string(size_t)> &base)
 Install a function with the signature string(size_t) as being delegatable. More...
 
void install (const std::string &name, std::function< size_t(const std::string &)> &target, const std::function< size_t(const std::string &)> &base)
 Install a function with the signature size_t(string) as being delegatable. More...
 
template<typename BaseFunc , class ... Args>
std::function< void(Args ...)> makeDelegate (const std::function< void(Args ...)> &func, const std::string &when, BaseFunc base)
 Create a delegate for a function with no return value. More...
 
template<typename ReturnType , class ... Args>
std::function< ReturnType(Args ...)> makeDelegate (const std::function< int(ReturnType &, Args ...)> &func, const std::string &when, const std::function< ReturnType(Args ...)> &base)
 Create a delegate for a function with a return value. More...
 
- Protected Attributes inherited from Delegator
std::map< std::string, std::function< void()> * > m_funcs_v
 
std::map< std::string, std::function< void(bool)> * > m_funcs_v_b
 
std::map< std::string, std::function< void(double)> * > m_funcs_v_d
 
std::map< std::string, std::function< void(std::array< size_t, 1 >, double *)> * > m_funcs_v_dp
 
std::map< std::string, std::function< void(std::array< size_t, 1 >, double, double *)> * > m_funcs_v_d_dp
 
std::map< std::string, std::function< void(std::array< size_t, 2 >, double, double *, double *)> * > m_funcs_v_d_dp_dp
 
std::map< std::string, std::function< void(std::array< size_t, 3 >, double *, double *, double *)> * > m_funcs_v_dp_dp_dp
 
std::map< std::string, std::function< std::string(size_t)> > m_base_s_sz
 
std::map< std::string, std::function< std::string(size_t)> * > m_funcs_s_sz
 
std::map< std::string, std::function< size_t(const std::string &)> > m_base_sz_csr
 
std::map< std::string, std::function< size_t(const std::string &)> * > m_funcs_sz_csr
 

Detailed Description

template<class R>
class Cantera::ReactorDelegator< R >

Delegate methods of the Reactor class to external functions.

Definition at line 58 of file ReactorDelegator.h.

Constructor & Destructor Documentation

◆ ReactorDelegator()

ReactorDelegator ( )
inline

Definition at line 61 of file ReactorDelegator.h.

Member Function Documentation

◆ initialize()

virtual void initialize ( double  t0)
inlineoverridevirtual

Definition at line 98 of file ReactorDelegator.h.

◆ syncState()

virtual void syncState ( )
inlineoverridevirtual

Definition at line 102 of file ReactorDelegator.h.

◆ getState()

virtual void getState ( double *  y)
inlineoverridevirtual

Definition at line 106 of file ReactorDelegator.h.

◆ updateState()

virtual void updateState ( double *  y)
inlineoverridevirtual

Definition at line 111 of file ReactorDelegator.h.

◆ updateSurfaceState()

virtual void updateSurfaceState ( double *  y)
inlineoverridevirtual

Definition at line 116 of file ReactorDelegator.h.

◆ getSurfaceInitialConditions()

virtual void getSurfaceInitialConditions ( double *  y)
inlineoverridevirtual

Definition at line 121 of file ReactorDelegator.h.

◆ updateConnected()

virtual void updateConnected ( bool  updatePressure)
inlineoverridevirtual

Definition at line 126 of file ReactorDelegator.h.

◆ eval()

virtual void eval ( double  t,
double *  LHS,
double *  RHS 
)
inlineoverridevirtual

Definition at line 130 of file ReactorDelegator.h.

◆ evalWalls()

virtual void evalWalls ( double  t)
inlineoverridevirtual

Definition at line 135 of file ReactorDelegator.h.

◆ evalSurfaces()

virtual void evalSurfaces ( double *  LHS,
double *  RHS,
double *  sdot 
)
inlineoverridevirtual

Definition at line 139 of file ReactorDelegator.h.

◆ componentName()

virtual std::string componentName ( size_t  k)
inlineoverridevirtual

Definition at line 145 of file ReactorDelegator.h.

◆ componentIndex()

virtual size_t componentIndex ( const std::string &  nm) const
inlineoverridevirtual

Definition at line 149 of file ReactorDelegator.h.

◆ speciesIndex()

virtual size_t speciesIndex ( const std::string &  nm) const
inlineoverridevirtual

Definition at line 153 of file ReactorDelegator.h.

◆ setNEq()

virtual void setNEq ( size_t  n)
inlineoverridevirtual

Set the number of equations represented by this reactor.

Implements ReactorAccessor.

Definition at line 159 of file ReactorDelegator.h.

◆ vdot()

virtual double vdot ( ) const
inlineoverridevirtual

Get the net rate of volume change (for example, from moving walls) [m^3/s].

Implements ReactorAccessor.

Definition at line 163 of file ReactorDelegator.h.

◆ setVdot()

virtual void setVdot ( double  v)
inlineoverridevirtual

Set the net rate of volume change (for example, from moving walls) [m^3/s].

Implements ReactorAccessor.

Definition at line 167 of file ReactorDelegator.h.

◆ qdot()

virtual double qdot ( ) const
inlineoverridevirtual

Get the net heat transfer rate (for example, through walls) into the reactor [W].

This value is initialized and calculated as part of Reactor::evalWalls().

Implements ReactorAccessor.

Definition at line 171 of file ReactorDelegator.h.

◆ setQdot()

virtual void setQdot ( double  q)
inlineoverridevirtual

Set the net heat transfer rate (for example, through walls) into the reactor [W].

For a value set using this method to affect the calculations done by Reactor::eval, this method should be called in either a "replace" or "after" delegate for Reactor::evalWalls().

Implements ReactorAccessor.

Definition at line 175 of file ReactorDelegator.h.

◆ restoreThermoState()

virtual void restoreThermoState ( )
inlineoverridevirtual

Set the state of the thermo object to correspond to the state of the reactor.

Implements ReactorAccessor.

Definition at line 179 of file ReactorDelegator.h.

◆ restoreSurfaceState()

virtual void restoreSurfaceState ( size_t  n)
inlineoverridevirtual

Set the state of the thermo object for surface n to correspond to the state of that surface.

Implements ReactorAccessor.

Definition at line 183 of file ReactorDelegator.h.

Member Data Documentation

◆ m_initialize

std::function<void(double)> m_initialize
private

Definition at line 188 of file ReactorDelegator.h.

◆ m_syncState

std::function<void()> m_syncState
private

Definition at line 189 of file ReactorDelegator.h.

◆ m_getState

std::function<void(std::array<size_t, 1>, double*)> m_getState
private

Definition at line 190 of file ReactorDelegator.h.

◆ m_updateState

std::function<void(std::array<size_t, 1>, double*)> m_updateState
private

Definition at line 191 of file ReactorDelegator.h.

◆ m_updateSurfaceState

std::function<void(std::array<size_t, 1>, double*)> m_updateSurfaceState
private

Definition at line 192 of file ReactorDelegator.h.

◆ m_getSurfaceInitialConditions

std::function<void(std::array<size_t, 1>, double*)> m_getSurfaceInitialConditions
private

Definition at line 193 of file ReactorDelegator.h.

◆ m_updateConnected

std::function<void(bool)> m_updateConnected
private

Definition at line 194 of file ReactorDelegator.h.

◆ m_eval

std::function<void(std::array<size_t, 2>, double, double*, double*)> m_eval
private

Definition at line 195 of file ReactorDelegator.h.

◆ m_evalWalls

std::function<void(double)> m_evalWalls
private

Definition at line 196 of file ReactorDelegator.h.

◆ m_evalSurfaces

std::function<void(std::array<size_t, 3>, double*, double*, double*)> m_evalSurfaces
private

Definition at line 197 of file ReactorDelegator.h.

◆ m_componentName

std::function<std::string(size_t)> m_componentName
private

Definition at line 198 of file ReactorDelegator.h.

◆ m_componentIndex

std::function<size_t(const std::string&)> m_componentIndex
private

Definition at line 199 of file ReactorDelegator.h.

◆ m_speciesIndex

std::function<size_t(const std::string&)> m_speciesIndex
private

Definition at line 200 of file ReactorDelegator.h.


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