]> https://gitweb.dealii.org/ - dealii.git/commitdiff
No longer support SUNDIALS versions before 3.0.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 28 Feb 2021 12:41:39 +0000 (13:41 +0100)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 1 Mar 2021 14:21:34 +0000 (15:21 +0100)
source/sundials/kinsol.cc

index 0bccafdbbcbfcd137ef8d238390713869ef9f658..cc38f809e8e2307471ec5bc2c083bca7ae4a0ed6 100644 (file)
 
 #    include <deal.II/sundials/copy.h>
 
+#    include <kinsol/kinsol_direct.h>
 #    include <sundials/sundials_config.h>
-#    if DEAL_II_SUNDIALS_VERSION_GTE(3, 0, 0)
-#      include <kinsol/kinsol_direct.h>
-#      include <sunlinsol/sunlinsol_dense.h>
-#      include <sunmatrix/sunmatrix_dense.h>
-#    else
-#      include <kinsol/kinsol_dense.h>
-#    endif
+#    include <sunlinsol/sunlinsol_dense.h>
+#    include <sunmatrix/sunmatrix_dense.h>
 
 #    include <iomanip>
 #    include <iostream>
@@ -269,32 +265,21 @@ namespace SUNDIALS
     status = KINSetRelErrFunc(kinsol_mem, data.dq_relative_error);
     AssertKINSOL(status);
 
-#    if DEAL_II_SUNDIALS_VERSION_GTE(3, 0, 0)
     SUNMatrix       J  = nullptr;
     SUNLinearSolver LS = nullptr;
-#    endif
 
     if (solve_jacobian_system)
       {
         auto KIN_mem        = static_cast<KINMem>(kinsol_mem);
         KIN_mem->kin_lsolve = t_kinsol_solve_jacobian<VectorType>;
         if (setup_jacobian)
-          {
-            KIN_mem->kin_lsetup = t_kinsol_setup_jacobian<VectorType>;
-#    if DEAL_II_SUNDIALS_VERSION_LT(3, 0, 0)
-            KIN_mem->kin_setupNonNull = true;
-#    endif
-          }
+          KIN_mem->kin_lsetup = t_kinsol_setup_jacobian<VectorType>;
       }
     else
       {
-#    if DEAL_II_SUNDIALS_VERSION_GTE(3, 0, 0)
         J      = SUNDenseMatrix(system_size, system_size);
         LS     = SUNDenseLinearSolver(u_scale, J);
         status = KINDlsSetLinearSolver(kinsol_mem, LS, J);
-#    else
-        status = KINDense(kinsol_mem, system_size);
-#    endif
         AssertKINSOL(status);
       }
 
@@ -332,10 +317,8 @@ namespace SUNDIALS
     status = KINGetNumNonlinSolvIters(kinsol_mem, &nniters);
     AssertKINSOL(status);
 
-#    if DEAL_II_SUNDIALS_VERSION_GTE(3, 0, 0)
     SUNMatDestroy(J);
     SUNLinSolFree(LS);
-#    endif
     KINFree(&kinsol_mem);
 
     return static_cast<unsigned int>(nniters);

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.