From: David Wells Date: Mon, 23 May 2022 02:33:13 +0000 (-0400) Subject: Fix KINSOL for SUNDIALS 6. X-Git-Tag: v9.4.0-rc1~158^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdef39c109a2fbbf5decd1b8ceb312081b98e4d5;p=dealii.git Fix KINSOL for SUNDIALS 6. --- diff --git a/source/sundials/kinsol.cc b/source/sundials/kinsol.cc index 1da1833450..dd6796bdfc 100644 --- a/source/sundials/kinsol.cc +++ b/source/sundials/kinsol.cc @@ -312,6 +312,12 @@ namespace SUNDIALS , kinsol_mem(nullptr) { set_functions_to_trigger_an_assert(); + + #if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0) + const int status = SUNContext_Create(&mpi_communicator, &kinsol_ctx); + (void)status; + AssertKINSOL(status); + #endif } @@ -325,12 +331,11 @@ namespace SUNDIALS if (kinsol_mem) { KINFree(&kinsol_mem); - -# if !DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0) - status = SUNContext_Free(&kinsol_ctx); - AssertKINSOL(status); -# endif } +# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0) + status = SUNContext_Free(&kinsol_ctx); + AssertKINSOL(status); +# endif # ifdef DEAL_II_WITH_MPI if (is_serial_vector::value == false)