mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[Reactor] Fix getting sensitivities after calls to advance
Previously, values would be returned for the sensitivity at the last internal timestep of the integrator, rather than being interpolated to the user-specified integration time.
This commit is contained in:
committed by
Ingmar Schoegl
parent
222b0ebcf6
commit
e0a2f112f7
@@ -637,7 +637,7 @@ double CVodesIntegrator::sensitivity(size_t k, size_t p)
|
||||
return 0.0;
|
||||
}
|
||||
if (!m_sens_ok && m_np) {
|
||||
int flag = CVodeGetSens(m_cvode_mem, &m_time, m_yS);
|
||||
int flag = CVodeGetSensDky(m_cvode_mem, m_time, 0, m_yS);
|
||||
checkError(flag, "sensitivity", "CVodeGetSens");
|
||||
m_sens_ok = true;
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ double IdasIntegrator::sensitivity(size_t k, size_t p)
|
||||
return 0.0;
|
||||
}
|
||||
if (!m_sens_ok && m_np) {
|
||||
int flag = IDAGetSens(m_ida_mem, &m_time, m_yS);
|
||||
int flag = IDAGetSensDky(m_ida_mem, m_time, 0, m_yS);
|
||||
checkError(flag, "sensitivity", "IDAGetSens");
|
||||
m_sens_ok = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user