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.
This commit is contained in:
Ray Speth 2012-10-10 18:25:12 +00:00
parent ced2e6c978
commit dec608b811
2 changed files with 8 additions and 8 deletions

View file

@ -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<ReactorBase*> m_r;
std::vector<Reactor*> m_reactors;

View file

@ -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;
}