From: Luca Heltai Date: Fri, 21 May 2021 12:59:47 +0000 (+0200) Subject: Addressed comments by WB. X-Git-Tag: v9.3.0-rc1~20^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12254%2Fhead;p=dealii.git Addressed comments by WB. --- 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>;