Bugfix/avoid resetting istep last in timestep change
David Dickinson
Branch: bugfix/avoid_resetting_istep_last_in_timestep_change
Branch: 8.1-RC
Merged
Merged pull request
Merged in bugfix/avoid_resetting_istep_last_in_timestep_change (pull request #488)
Make sure nstep_measure is at least 2
Don't reset istep_last when reading parameters in nonlinear_terms
This avoids an issue whereby each time we change the timestep we reset istep_last to zero, therefore misidentifying repeat calls to add_explicit on the same iteration.
This fixes a potential bug where we wrongly shuffle the explicit sources in cases where we have to reduce the time step and immediate_reset is true. Saves recalculation of the nonlinear source following a time step change with immediate_reset true. This should also avoid us changing the time step more than once per iteration