]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Addressed comments by WB. 12254/head
authorLuca Heltai <luca.heltai@sissa.it>
Fri, 21 May 2021 12:59:47 +0000 (14:59 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Fri, 21 May 2021 12:59:47 +0000 (14:59 +0200)
source/sundials/kinsol.cc

index bdbac290350672e21c67fe45521657040913d325..78e951b8d2ca52d32c0345ecad0164b54aa15b7d 100644 (file)
@@ -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<VectorType>);
-            AssertKINSOL(status);
-          }
+        if (!setup_jacobian)
+          setup_jacobian = [](const VectorType &, const VectorType &) {
+            return 0;
+          };
+        status = KINSetJacFn(kinsol_mem, &setup_jacobian_callback<VectorType>);
+        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<Vector<double>>;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.