diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml index e104da607..138e6d2ad 100644 --- a/.github/workflows/ci_docker.yml +++ b/.github/workflows/ci_docker.yml @@ -5,6 +5,7 @@ jobs: run-tests: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: container_version: [v0.9.0, nightly] container: dolfinx/dolfinx:${{ matrix.container_version }} diff --git a/src/festim/stepsize.py b/src/festim/stepsize.py index 1e9ff35e0..a94910f03 100644 --- a/src/festim/stepsize.py +++ b/src/festim/stepsize.py @@ -141,7 +141,7 @@ def modify_value(self, value, nb_iterations, t=None): if updated_value > time_to_milestone and not np.isclose( t, next_milestone, atol=0 ): - updated_value = next_milestone + updated_value = time_to_milestone return updated_value diff --git a/test/test_stepsize.py b/test/test_stepsize.py index 5f8bf346b..3556c5661 100644 --- a/test/test_stepsize.py +++ b/test/test_stepsize.py @@ -169,23 +169,21 @@ def test_next_milestone(milestones, current_time, expected_value): assert expected_value == next_milestone -def test_overshoot_milestone(nb_its=1, target=4): +def test_overshoot_milestone(): """Test that stepsize is modified when going to overshoot a milestone. """ my_stepsize = F.Stepsize(initial_value=0.1) - my_stepsize.growth_factor = 2.0 - my_stepsize.target_nb_iterations = target + my_stepsize.growth_factor = 1 + my_stepsize.target_nb_iterations = 4 my_stepsize.milestones = [1.3] - current_value = 0.5 - new_value = my_stepsize.modify_value( - value=current_value, nb_iterations=nb_its, t=0.9 - ) + current_value = 100000 + new_value = my_stepsize.modify_value(value=current_value, nb_iterations=1, t=1) - expected_value = 1.3 + expected_value = 1.3 - 1 assert new_value == expected_value