6 #ifndef CT_REACTORNET_H
7 #define CT_REACTORNET_H
26 virtual ~ReactorNet();
38 void setInitialTime(doublereal time) {
44 void setMaxTimeStep(
double maxstep) {
49 void setTolerances(doublereal rtol, doublereal atol) {
59 void setSensitivityTolerances(doublereal rtol, doublereal atol) {
85 void initialize(doublereal t0 = 0.0);
91 void advance(doublereal time);
93 double step(doublereal time);
97 void addReactor(ReactorBase* r,
bool iown =
false);
99 ReactorBase& reactor(
int n) {
103 bool verbose()
const {
106 void setVerbose(
bool v =
true) {
111 Integrator& integrator() {
115 void updateState(doublereal* y);
117 double sensitivity(
size_t k,
size_t p) {
118 return m_integ->sensitivity(k, p)/m_integ->solution(k);
121 double sensitivity(std::string species,
size_t p,
int reactor=0) {
122 size_t k = globalComponentIndex(species, reactor);
123 return sensitivity(k, p);
126 void evalJacobian(doublereal t, doublereal* y,
127 doublereal* ydot, doublereal* p, Array2D* j);
132 virtual size_t neq() {
135 virtual void eval(doublereal t, doublereal* y,
136 doublereal* ydot, doublereal* p);
137 virtual void getInitialConditions(doublereal t0,
size_t leny,
139 virtual size_t nparams() {
143 size_t globalComponentIndex(std::string species,
size_t reactor=0);
145 void connect(
size_t i,
size_t j) {
146 m_connect[j*m_nr + i] = 1;
147 m_connect[i*m_nr + j] = 1;
150 bool connected(
size_t i,
size_t j) {
151 return (m_connect[m_nr*i + j] == 1);
156 std::vector<ReactorBase*> m_r;
157 std::vector<Reactor*> m_reactors;
164 std::vector<size_t> m_size;
166 doublereal m_rtol, m_rtolsens;
167 doublereal m_atols, m_atolsens;
168 doublereal m_maxstep;
171 std::vector<size_t> m_nparams;
175 std::vector<bool> m_iown;