| 335 | } |
| 336 | |
| 337 | void ReactorNet::addReactor(Reactor& r) |
| 338 | { |
| 339 | warn_deprecated("ReactorNet::addReactor", |
| 340 | "To be removed after Cantera 3.2. Replaceable by reactor net " |
| 341 | "instantiation with contents."); |
| 342 | for (auto current : m_reactors) { |
| 343 | if (current->isOde() != r.isOde()) { |
| 344 | throw CanteraError("ReactorNet::addReactor", |
| 345 | "Cannot mix Reactor types using both ODEs and DAEs ({} and {})", |
| 346 | current->type(), r.type()); |
| 347 | } |
| 348 | if (current->timeIsIndependent() != r.timeIsIndependent()) { |
| 349 | throw CanteraError("ReactorNet::addReactor", |
| 350 | "Cannot mix Reactor types using time and space as independent variables" |
| 351 | "\n({} and {})", current->type(), r.type()); |
| 352 | } |
| 353 | } |
| 354 | m_timeIsIndependent = r.timeIsIndependent(); |
| 355 | r.setNetwork(this); |
| 356 | m_reactors.push_back(&r); |
| 357 | if (!m_integ) { |
| 358 | m_integ.reset(newIntegrator(r.isOde() ? "CVODE" : "IDA")); |
| 359 | // use backward differencing, with a full Jacobian computed |
| 360 | // numerically, and use a Newton linear iterator |
| 361 | m_integ->setMethod(BDF_Method); |
| 362 | m_integ->setLinearSolverType("DENSE"); |
| 363 | } |
| 364 | updateNames(r); |
| 365 | } |
| 366 | |
| 367 | void ReactorNet::addReactor(shared_ptr<ReactorBase> reactor) |
| 368 | { |
no test coverage detected