| 59 | } |
| 60 | |
| 61 | void ReactorBase::setSolution(shared_ptr<Solution> sol) |
| 62 | { |
| 63 | warn_deprecated("ReactorBase::setSolution", |
| 64 | "After Cantera 3.2, a change of reactor contents after instantiation " |
| 65 | "will be disabled."); |
| 66 | if (!sol || !(sol->thermo())) { |
| 67 | throw CanteraError("ReactorBase::setSolution", |
| 68 | "Missing or incomplete Solution object."); |
| 69 | } |
| 70 | if (m_solution) { |
| 71 | m_solution->thermo()->removeSpeciesLock(); |
| 72 | } |
| 73 | m_solution = sol; |
| 74 | m_solution->thermo()->addSpeciesLock(); |
| 75 | setThermo(*sol->thermo()); |
| 76 | try { |
| 77 | setKinetics(*sol->kinetics()); |
| 78 | } catch (NotImplementedError&) { |
| 79 | // kinetics not used (example: Reservoir) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | void ReactorBase::setThermo(ThermoPhase& thermo) |
| 84 | { |
nothing calls this directly
no test coverage detected