From a840e1218f3c283738655db40d0e0f21a4db5a12 Mon Sep 17 00:00:00 2001
From: Sam Yates <yates@cscs.ch>
Date: Wed, 6 Mar 2019 14:06:37 +0100
Subject: [PATCH] Fix times for threshold crossing interpolation (#718)

Fixes #717.

* Move time interval update step after threshold check.
---
 arbor/fvm_lowered_cell_impl.hpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arbor/fvm_lowered_cell_impl.hpp b/arbor/fvm_lowered_cell_impl.hpp
index b1cb1ff9..1bd3889d 100644
--- a/arbor/fvm_lowered_cell_impl.hpp
+++ b/arbor/fvm_lowered_cell_impl.hpp
@@ -35,7 +35,6 @@
 #include "util/strprintf.hpp"
 #include "util/transform.hpp"
 
-
 namespace arb {
 
 template <class Backend>
@@ -260,8 +259,8 @@ fvm_integration_result fvm_lowered_cell_impl<Backend>::integrate(
         // Update time and test for spike threshold crossings.
 
         PE(advance_integrate_threshold);
-        memory::copy(state_->time_to, state_->time);
         threshold_watcher_.test();
+        memory::copy(state_->time_to, state_->time);
         PL();
 
         // Check for non-physical solutions:
-- 
GitLab