From ab509cd1cbe288efa0f7164bc453c589b14aa50d Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Fri, 21 May 2021 14:59:47 +0200 Subject: [PATCH] Addressed comments by WB. --- source/sundials/kinsol.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/source/sundials/kinsol.cc b/source/sundials/kinsol.cc index bdbac29035..78e951b8d2 100644 --- a/source/sundials/kinsol.cc +++ b/source/sundials/kinsol.cc @@ -504,12 +504,12 @@ namespace SUNDIALS // Finally, if we were given a set-up function, tell KINSOL about // it as well. The manual says that this must happen *after* // calling KINSetLinearSolver - if (setup_jacobian) - { - status = - KINSetJacFn(kinsol_mem, &setup_jacobian_callback); - AssertKINSOL(status); - } + if (!setup_jacobian) + setup_jacobian = [](const VectorType &, const VectorType &) { + return 0; + }; + status = KINSetJacFn(kinsol_mem, &setup_jacobian_callback); + AssertKINSOL(status); # endif } @@ -537,8 +537,6 @@ namespace SUNDIALS reinit_vector = [](VectorType &) { AssertThrow(false, ExcFunctionNotProvided("reinit_vector")); }; - - setup_jacobian = [](const VectorType &, const VectorType &) { return 0; }; } template class KINSOL>; -- 2.39.5