Bugfix for nonlinear simulations with immediate_reset=.true.

Merged
#107 · Created  · Last updated

Merged pull request

Merged in bugfix/avoid_double_shuffle_in_nonlinear_term (pull request #107)

d002373·Author: ·Closed by: ·2019-04-08

Description

Previously we recalculated the nonlinear term after deciding we have to reduce the time step. This introduced two bugs

  1. We didn’t center the first calculation of g1 before returning to change the time step.

  2. We shuffled the time history of the explicit source term (g1->g2->g3) both on the first call to add_explicit_terms (i.e. when we decide we need to reset) and then again on the next call once we’ve updated the time step.

This commit fixes both of these by ensuring the first calculation of g1 is completed before returning to change the time step and then skipping the recalculation of g1 after the time step has changed. We can skip this recalculation as this is an explicit term which only depends on g and the fields at the start of the time step, which do not change when we change the time step. This also provides a (very) small performance improvement.

 

Fixes #61

0 attachments

0 comments

Loading commits...