Cantera
Loading...
Searching...
No Matches
ctreactornet Library

Generated CLib API for Cantera's ReactorNet class. More...

Collaboration diagram for ctreactornet Library:

Detailed Description

Generated CLib API for Cantera's ReactorNet class.

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

Functions

int32_t reactornet_new (int32_t reactorsLen, int32_t *reactors)
 Create a reactor network containing one or more coupled reactors.
int32_t reactornet_setInitialTime (int32_t handle, double time)
 Set the initial value of the independent variable (typically time).
int32_t reactornet_setMaxTimeStep (int32_t handle, double maxstep)
 Set the maximum integrator step.
int32_t reactornet_setRelativeTolerance (int32_t handle, double rtol)
 Set the relative tolerance for the integrator.
int32_t reactornet_setAbsoluteTolerance (int32_t handle, double atol)
 Set the scalar absolute tolerance for the integrator.
int32_t reactornet_clearAbsoluteTolerance (int32_t handle)
 Clear the user-specified scalar absolute tolerance.
int32_t reactornet_setTolerances (int32_t handle, double rtol, double atol)
 Set the relative and scalar absolute tolerances for the integrator.
int32_t reactornet_setSensitivityTolerances (int32_t handle, double rtol, double atol)
 Set the relative and absolute tolerances for integrating the sensitivity equations.
int32_t reactornet_advance (int32_t handle, double t)
 Advance the state of all reactors in the independent variable (time or space).
double reactornet_step (int32_t handle)
 Advance the state of all reactors with respect to the independent variable (time or space).
double reactornet_time (int32_t handle)
 Current value of the simulation time [s], for reactor networks that are solved in the time domain.
double reactornet_rtol (int32_t handle)
 Relative tolerance.
double reactornet_atol (int32_t handle)
 Scalar absolute integration tolerance.
double reactornet_sensitivity (int32_t handle, const char *component, int32_t p, int32_t reactor)
 Return the sensitivity of the component named component with respect to the p-th sensitivity parameter.
int32_t reactornet_neq (int32_t handle)
 Number of equations.
int32_t reactornet_getState (int32_t handle, int32_t yLen, double *y)
 Fill in the vector y with the current state of the system.
int32_t reactornet_componentName (int32_t handle, int32_t i, int32_t bufLen, char *buf)
 Return the name of the i-th component of the global state vector.
int32_t reactornet_del (int32_t handle)
 Delete ReactorNet object.
int32_t reactornet_cabinetSize ()
 Return size of ReactorNet storage.

Function Documentation

◆ reactornet_new()

int32_t reactornet_new ( int32_t reactorsLen,
int32_t * reactors )

Create a reactor network containing one or more coupled reactors.

Wraps C++ constructor: shared_ptr<ReactorNet> newReactorNet(span<shared_ptr<ReactorBase>>)

Parameters
[in]reactorsLenLength of array reserved for reactors.
reactorsMemory holding ReactorBase objects. A vector of shared pointers to the reactors to be linked together.
Returns
Handle to stored ReactorNet object or -1 for exception handling.

Definition at line 42 of file ctreactornet.cpp.

◆ reactornet_setInitialTime()

int32_t reactornet_setInitialTime ( int32_t handle,
double time )

Set the initial value of the independent variable (typically time).

Wraps C++ setter: void ReactorNet::setInitialTime(double)

Parameters
handleHandle to queried ReactorNet object.
timeUndocumented.

Definition at line 56 of file ctreactornet.cpp.

◆ reactornet_setMaxTimeStep()

int32_t reactornet_setMaxTimeStep ( int32_t handle,
double maxstep )

Set the maximum integrator step.

Wraps C++ setter: void ReactorNet::setMaxTimeStep(double)

Parameters
handleHandle to queried ReactorNet object.
maxstepUndocumented.

Definition at line 67 of file ctreactornet.cpp.

◆ reactornet_setRelativeTolerance()

int32_t reactornet_setRelativeTolerance ( int32_t handle,
double rtol )

Set the relative tolerance for the integrator.

Wraps C++ setter: void ReactorNet::setRelativeTolerance(double)

Parameters
handleHandle to queried ReactorNet object.
rtolRelative tolerance for all state variables; must be positive.

Definition at line 78 of file ctreactornet.cpp.

◆ reactornet_setAbsoluteTolerance()

int32_t reactornet_setAbsoluteTolerance ( int32_t handle,
double atol )

Set the scalar absolute tolerance for the integrator.

Wraps C++ setter: void ReactorNet::setAbsoluteTolerance(double)

Parameters
handleHandle to queried ReactorNet object.
atolScalar absolute tolerance for state variables without reactor-specific absolute tolerances; must be positive. Superseded by absolute tolerances set for individual reactors.

Definition at line 89 of file ctreactornet.cpp.

◆ reactornet_clearAbsoluteTolerance()

int32_t reactornet_clearAbsoluteTolerance ( int32_t handle)

Clear the user-specified scalar absolute tolerance.

Wraps C++ method: void ReactorNet::clearAbsoluteTolerance()

Parameters
handleHandle to queried ReactorNet object.

Definition at line 100 of file ctreactornet.cpp.

◆ reactornet_setTolerances()

int32_t reactornet_setTolerances ( int32_t handle,
double rtol,
double atol )

Set the relative and scalar absolute tolerances for the integrator.

Wraps C++ method: void ReactorNet::setTolerances(double, double)

Parameters
handleHandle to queried ReactorNet object.
rtolIf positive, set the relative tolerance for all state variables; ignored if negative.
atolIf positive, set the scalar absolute tolerance for all state variables; ignored if negative. Superseded by absolute tolerances set for individual reactors.
Deprecated
Per C++ annotation: To be removed after Cantera 4.0. Use setRelativeTolerance() and setAbsoluteTolerance() instead.

Definition at line 111 of file ctreactornet.cpp.

◆ reactornet_setSensitivityTolerances()

int32_t reactornet_setSensitivityTolerances ( int32_t handle,
double rtol,
double atol )

Set the relative and absolute tolerances for integrating the sensitivity equations.

Wraps C++ method: void ReactorNet::setSensitivityTolerances(double, double)

Parameters
handleHandle to queried ReactorNet object.
rtolUndocumented.
atolUndocumented.

Definition at line 122 of file ctreactornet.cpp.

◆ reactornet_advance()

int32_t reactornet_advance ( int32_t handle,
double t )

Advance the state of all reactors in the independent variable (time or space).

Wraps C++ setter: void ReactorNet::advance(double)

Parameters
handleHandle to queried ReactorNet object.
tTime/distance to advance to (s or m).

Definition at line 133 of file ctreactornet.cpp.

◆ reactornet_step()

double reactornet_step ( int32_t handle)

Advance the state of all reactors with respect to the independent variable (time or space).

Wraps C++ getter: double ReactorNet::step()

Parameters
handleHandle to queried ReactorNet object.

Definition at line 144 of file ctreactornet.cpp.

◆ reactornet_time()

double reactornet_time ( int32_t handle)

Current value of the simulation time [s], for reactor networks that are solved in the time domain.

Wraps C++ getter: double ReactorNet::time()

Parameters
handleHandle to queried ReactorNet object.

Definition at line 154 of file ctreactornet.cpp.

◆ reactornet_rtol()

double reactornet_rtol ( int32_t handle)

Relative tolerance.

Wraps C++ getter: double ReactorNet::rtol()

Parameters
handleHandle to queried ReactorNet object.

Definition at line 164 of file ctreactornet.cpp.

◆ reactornet_atol()

double reactornet_atol ( int32_t handle)

Scalar absolute integration tolerance.

Wraps C++ getter: double ReactorNet::atol()

Parameters
handleHandle to queried ReactorNet object.

Definition at line 174 of file ctreactornet.cpp.

◆ reactornet_sensitivity()

double reactornet_sensitivity ( int32_t handle,
const char * component,
int32_t p,
int32_t reactor )

Return the sensitivity of the component named component with respect to the p-th sensitivity parameter.

Wraps C++ method: double ReactorNet::sensitivity(const string&, size_t, int)

Parameters
handleHandle to queried ReactorNet object.
componentUndocumented.
pUndocumented.
reactorUndocumented.

Definition at line 184 of file ctreactornet.cpp.

◆ reactornet_neq()

int32_t reactornet_neq ( int32_t handle)

Number of equations.

Wraps C++ getter: size_t ReactorNet::neq()

Parameters
handleHandle to queried ReactorNet object.

Definition at line 194 of file ctreactornet.cpp.

◆ reactornet_getState()

int32_t reactornet_getState ( int32_t handle,
int32_t yLen,
double * y )

Fill in the vector y with the current state of the system.

Wraps C++ getter: void ReactorNet::getState(span<double>)

Parameters
handleHandle to queried ReactorNet object.
[in]yLenLength of vector reserved for y.
yUndocumented.

Definition at line 204 of file ctreactornet.cpp.

◆ reactornet_componentName()

int32_t reactornet_componentName ( int32_t handle,
int32_t i,
int32_t bufLen,
char * buf )

Return the name of the i-th component of the global state vector.

Wraps C++ method: string ReactorNet::componentName(size_t)

Uses:

  • size_t ReactorNet::neq()
Parameters
handleHandle to queried ReactorNet object.
iUndocumented.
[in]bufLenLength of reserved array.
[out]bufReturned string value.
Returns
Actual length of string including string-terminating null byte, \0, or -1 for exception handling.

Definition at line 218 of file ctreactornet.cpp.

◆ reactornet_del()

int32_t reactornet_del ( int32_t handle)

Delete ReactorNet object.

Wraps C++ destructor: undefined

Parameters
handleHandle to ReactorNet object.
Returns
Zero for success and -1 for exception handling.

Definition at line 230 of file ctreactornet.cpp.

◆ reactornet_cabinetSize()

int32_t reactornet_cabinetSize ( )

Return size of ReactorNet storage.

Wraps C++ reserved CLib function: custom code

Returns
Size or -1 for exception handling.

Definition at line 241 of file ctreactornet.cpp.