MCPcopy Create free account
hub / github.com/Cantera/cantera / setSolution

Method setSolution

src/zeroD/ReactorBase.cpp:61–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void 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
83void ReactorBase::setThermo(ThermoPhase& thermo)
84{

Callers

nothing calls this directly

Calls 6

CanteraErrorClass · 0.85
removeSpeciesLockMethod · 0.80
addSpeciesLockMethod · 0.80
warn_deprecatedFunction · 0.50
thermoMethod · 0.45
kineticsMethod · 0.45

Tested by

no test coverage detected