Go to the documentation of this file.
6 #ifndef CT_REACTORNET_H
7 #define CT_REACTORNET_H
112 return *m_reactors[n];
172 doublereal* ydot, doublereal* p,
Array2D* j);
178 virtual void eval(doublereal t, doublereal* y,
179 doublereal* ydot, doublereal* p);
181 virtual void getState(doublereal* y);
238 m_integ->setMaxSteps(nmax);
245 return m_integ->maxSteps();
268 return m_integ->lastOrder();
271 std::vector<Reactor*> m_reactors;
272 std::unique_ptr<Integrator> m_integ;
282 doublereal m_rtol, m_rtolsens;
283 doublereal m_atols, m_atolsens;
288 int m_maxErrTestFails;
doublereal time()
Current value of the simulation time.
void setAdvanceLimits(const double *limits)
Set absolute step size limits during advance.
virtual int lastOrder()
Returns the order used for last solution step of the ODE integrator The function is intended for inte...
A class for 2D arrays stored in column-major (Fortran-compatible) form.
void setVerbose(bool v=true)
Enable or disable verbose logging while setting up and integrating the reactor network.
void reinitialize()
Reinitialize the integrator.
virtual void eval(doublereal t, doublereal *y, doublereal *ydot, doublereal *p)
Evaluate the right-hand-side function.
void updateState(doublereal *y)
Update the state of all the reactors in the network to correspond to the values in the solution vecto...
doublereal m_maxstep
Maximum integrator internal timestep. Default of 0.0 means infinity.
double maxTimeStep()
Get the maximum time step.
double step()
Advance the state of all reactors in time.
doublereal atol()
Absolute integration tolerance.
doublereal rtol()
Relative tolerance.
void setNeedsReinit()
Called to trigger integrator reinitialization before further integration.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
void addReactor(Reactor &r)
Add the reactor r to this reactor network.
virtual int maxSteps()
Returns the maximum number of internal integration time-steps the integrator will take before reachin...
doublereal rtolSensitivity() const
Relative sensitivity tolerance.
Class Reactor is a general-purpose class for stirred reactors.
virtual void getDerivative(int k, double *dky)
Return k-th derivative at the current time.
doublereal atolSensitivity() const
Absolute sensitivity tolerance.
virtual void getEstimate(double time, int k, double *yest)
Estimate a future state based on current derivatives.
bool verbose() const
Returns true if verbose logging output is enabled.
void initialize()
Initialize the reactor network.
size_t globalComponentIndex(const std::string &component, size_t reactor=0)
Return the index corresponding to the component named component in the reactor with index reactor in ...
vector_fp m_sens_params
Values for the problem parameters for which sensitivities are computed This is the array which is per...
bool getAdvanceLimits(double *limits)
Retrieve absolute step size limits during advance.
void setTolerances(double rtol, double atol)
Set the relative and absolute tolerances for the integrator.
void setMaxTimeStep(double maxstep)
Set the maximum time step.
virtual size_t nparams()
Number of sensitivity parameters.
bool suppressErrors() const
Get current state of error suppression.
Abstract base class for ODE system integrators.
virtual size_t neq()
Number of equations.
size_t registerSensitivityParameter(const std::string &name, double value, double scale)
Used by Reactor and Wall objects to register the addition of sensitivity parameters so that the React...
void advance(doublereal time)
Advance the state of all reactors in time.
virtual void getState(doublereal *y)
Fill in the vector y with the current state of the system.
void evalJacobian(doublereal t, doublereal *y, doublereal *ydot, doublereal *p, Array2D *j)
Evaluate the Jacobian matrix for the reactor network.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
std::vector< size_t > m_start
m_start[n] is the starting point in the state vector for reactor n
void setMaxErrTestFails(int nmax)
Set the maximum number of error test failures permitted by the CVODES integrator in a single time ste...
void setInitialTime(double time)
Set initial time.
std::vector< std::string > m_paramNames
Names corresponding to each sensitivity parameter.
void setSensitivityTolerances(double rtol, double atol)
Set the relative and absolute tolerances for integrating the sensitivity equations.
const std::string & sensitivityParameterName(size_t p)
The name of the p-th sensitivity parameter added to this ReactorNet.
A class representing a network of connected reactors.
bool m_integrator_init
True if integrator initialization is current.
Reactor & reactor(int n)
Return a reference to the n-th reactor in this network.
double sensitivity(const std::string &component, size_t p, int reactor=0)
Return the sensitivity of the component named component with respect to the p-th sensitivity paramete...
Namespace for the Cantera kernel.
double sensitivity(size_t k, size_t p)
Return the sensitivity of the k-th solution component with respect to the p-th sensitivity parameter.
Integrator & integrator()
Return a reference to the integrator.
std::string componentName(size_t i) const
Return the name of the i-th component of the global state vector.
Virtual base class for ODE right-hand-side function evaluators.
virtual void setMaxSteps(int nmax)
Set the maximum number of internal integration time-steps the integrator will take before reaching th...
bool hasAdvanceLimits()
Check whether ReactorNet object uses advance limits.