33template<> ReactorNetCabinet* ReactorNetCabinet::s_storage = 0;
36template<> ReactorBaseCabinet* ReactorBaseCabinet::s_storage;
46 vector<shared_ptr<ReactorBase>> reactors_;
47 for (
int i = 0; i < reactorsLen; i++) {
48 reactors_.push_back(ReactorBaseCabinet::at(reactors[i]));
60 ReactorNetCabinet::at(handle)->setInitialTime(time);
71 ReactorNetCabinet::at(handle)->setMaxTimeStep(maxstep);
82 ReactorNetCabinet::at(handle)->setRelativeTolerance(rtol);
93 ReactorNetCabinet::at(handle)->setAbsoluteTolerance(atol);
104 ReactorNetCabinet::at(handle)->clearAbsoluteTolerance();
115 ReactorNetCabinet::at(handle)->setTolerances(rtol, atol);
126 ReactorNetCabinet::at(handle)->setSensitivityTolerances(rtol, atol);
137 ReactorNetCabinet::at(handle)->advance(t);
148 return ReactorNetCabinet::at(handle)->step();
158 return ReactorNetCabinet::at(handle)->time();
168 return ReactorNetCabinet::at(handle)->rtol();
178 return ReactorNetCabinet::at(handle)->atol();
188 return ReactorNetCabinet::at(handle)->sensitivity(component, p, reactor);
198 return static_cast<int32_t
>(ReactorNetCabinet::at(handle)->neq());
208 auto& obj = ReactorNetCabinet::at(handle);
210 span<double> y_(y, yLen);
222 string out = ReactorNetCabinet::at(handle)->componentName(i);
224 return int(out.size()) + 1;
234 ReactorNetCabinet::del(handle);
246 return ReactorNetCabinet::size();
Template for classes to hold pointers to objects.
CTREACTORNET - Generated CLib Cantera interface library.
int32_t reactornet_advance(int32_t handle, double t)
Advance the state of all reactors in the independent variable (time or space).
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_setRelativeTolerance(int32_t handle, double rtol)
Set the relative tolerance for the integrator.
int32_t reactornet_clearAbsoluteTolerance(int32_t handle)
Clear the user-specified scalar absolute tolerance.
int32_t reactornet_setAbsoluteTolerance(int32_t handle, double atol)
Set the scalar absolute tolerance for the integrator.
double reactornet_time(int32_t handle)
Current value of the simulation time [s], for reactor networks that are solved in the time domain.
int32_t reactornet_cabinetSize()
Return size of ReactorNet storage.
int32_t reactornet_del(int32_t handle)
Delete ReactorNet object.
double reactornet_rtol(int32_t handle)
Relative tolerance.
double reactornet_step(int32_t handle)
Advance the state of all reactors with respect to the independent variable (time or space).
int32_t reactornet_neq(int32_t handle)
Number of equations.
int32_t reactornet_new(int32_t reactorsLen, int32_t *reactors)
Create a reactor network containing one or more coupled reactors.
int32_t reactornet_setTolerances(int32_t handle, double rtol, double atol)
Set the relative and scalar absolute tolerances for the integrator.
int32_t reactornet_setInitialTime(int32_t handle, double time)
Set the initial value of the independent variable (typically time).
double reactornet_atol(int32_t handle)
Scalar absolute integration tolerance.
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.
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 paramete...
int32_t reactornet_setMaxTimeStep(int32_t handle, double maxstep)
Set the maximum integrator step.
size_t copyString(const string &source, char *dest, size_t length)
Copy the contents of a string into a char array of a given length.
Namespace for the Cantera kernel.
shared_ptr< ReactorNet > newReactorNet(span< shared_ptr< ReactorBase > > reactors)
Create a reactor network containing one or more coupled reactors.
T handleAllExceptions(T ctErrorCode, T otherErrorCode)
Exception handler used at language interface boundaries.
Contains declarations for string manipulation functions within Cantera.