[Reactor] Check that contents are assigned before starting integration

This commit is contained in:
Ray Speth 2015-02-28 00:24:38 +00:00
parent eca79a5332
commit ab2beb4c64

View file

@ -67,6 +67,10 @@ void Reactor::getSurfaceInitialConditions(double* y)
void Reactor::initialize(doublereal t0)
{
if (!m_thermo || !m_kin) {
throw CanteraError("Reactor::initialize", "Reactor contents not set"
" for reactor '" + m_name + "'.");
}
m_thermo->restoreState(m_state);
m_sdot.resize(m_nsp, 0.0);
m_wdot.resize(m_nsp, 0.0);