From: Jean-Paul Pelteret Date: Fri, 5 Oct 2018 13:54:53 +0000 (+0200) Subject: Move a check that's only valid when an AD tape exists X-Git-Tag: v9.1.0-rc1~630^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5f0788ebe8a8ded831338c639b7bf0f04a3cb0d;p=dealii.git Move a check that's only valid when an AD tape exists --- diff --git a/source/differentiation/ad/ad_helpers.cc b/source/differentiation/ad/ad_helpers.cc index c50a2d92c3..befa9e89ad 100644 --- a/source/differentiation/ad/ad_helpers.cc +++ b/source/differentiation/ad/ad_helpers.cc @@ -521,8 +521,6 @@ namespace Differentiation ExcMessage("Invalid tape index")); Assert(tape_index < numbers::max_tape_index, ExcMessage("Tape index exceeds maximum allowable value")); - Assert(is_registered_tape(tape_index), - ExcMessage("Tape number not registered")); active_tape_index = tape_index; reset_registered_independent_variables(); @@ -531,6 +529,8 @@ namespace Differentiation // current data structure have not been marked as dependents if (read_mode == true) { + Assert(is_registered_tape(tape_index), + ExcMessage("Tape number not registered")); reset_registered_dependent_variables(true); Assert(n_registered_dependent_variables() == n_dependent_variables(),