From dec608b811b01d0a251f79c958f53aa7f6f4ebee Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 10 Oct 2012 18:25:12 +0000 Subject: [PATCH] Fixed ReactorNet::setInitialTime to actually set the initial integrator time Removed the optional argument to ReactorNet::initialize so that setInitialTime is the only interface for setting the integrator start time, and made initialize protected to make it clear that it does not need to be explicitly called by the user. --- include/cantera/zeroD/ReactorNet.h | 10 +++++----- src/zeroD/ReactorNet.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/cantera/zeroD/ReactorNet.h b/include/cantera/zeroD/ReactorNet.h index ffb1dfcad..c849deaaa 100644 --- a/include/cantera/zeroD/ReactorNet.h +++ b/include/cantera/zeroD/ReactorNet.h @@ -79,11 +79,6 @@ public: return m_atols; } - /** - * Initialize the reactor network. - */ - void initialize(doublereal t0 = 0.0); - /** * Advance the state of all reactors in time. * @param time Time to advance to (s). @@ -152,6 +147,11 @@ public: } protected: + /** + * Initialize the reactor network. Called automatically the first time + * advance or step is called. + */ + void initialize(); std::vector m_r; std::vector m_reactors; diff --git a/src/zeroD/ReactorNet.cpp b/src/zeroD/ReactorNet.cpp index ea309d55f..5bdf19730 100644 --- a/src/zeroD/ReactorNet.cpp +++ b/src/zeroD/ReactorNet.cpp @@ -44,7 +44,7 @@ ReactorNet::~ReactorNet() deleteIntegrator(m_integ); } -void ReactorNet::initialize(doublereal t0) +void ReactorNet::initialize() { size_t n, nv; char buf[100]; @@ -59,7 +59,7 @@ void ReactorNet::initialize(doublereal t0) "no reactors in network!"); for (n = 0; n < m_nr; n++) { if (m_r[n]->type() >= ReactorType) { - m_r[n]->initialize(t0); + m_r[n]->initialize(m_time); Reactor* r = (Reactor*)m_r[n]; m_reactors.push_back(r); nv = r->neq(); @@ -132,7 +132,7 @@ void ReactorNet::initialize(doublereal t0) sprintf(buf, "Maximum time step: %14.6g\n", m_maxstep); writelog(buf); } - m_integ->initialize(t0, *this); + m_integ->initialize(m_time, *this); m_init = true; }