# include <boost/signals2.hpp>
# include <kinsol/kinsol.h>
-# if DEAL_II_SUNDIALS_VERSION_LT(5, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_LT(4, 1, 0)
# include <kinsol/kinsol_impl.h>
# endif
# include <nvector/nvector_serial.h>
-# if DEAL_II_SUNDIALS_VERSION_LT(5, 0, 0)
+# if DEAL_II_SUNDIALS_VERSION_LT(4, 1, 0)
template <typename VectorType>
int
setup_jacobian_callback(KINMem kinsol_mem)
if (solve_jacobian_system) // user assigned a function object to the solver
// slot
{
-# if DEAL_II_SUNDIALS_VERSION_LT(5, 0, 0)
+/* interface up to and including 4.0 */
+# if DEAL_II_SUNDIALS_VERSION_LT(4, 1, 0)
auto KIN_mem = static_cast<KINMem>(kinsol_mem);
KIN_mem->kin_lsolve = solve_with_jacobian_callback<VectorType>;
if (setup_jacobian) // user assigned a function object to the Jacobian
// set-up slot
KIN_mem->kin_lsetup = setup_jacobian_callback<VectorType>;
-# else
+
+/* interface up to and including 4.1 */
+# elif DEAL_II_SUNDIALS_VERSION_LT(5, 0, 0)
+
+ // deal.II does not currently have support for KINSOL in
+ // SUNDIALS 4.1. One could write this and update this section,
+ // but it does not seem worthwhile spending the time to
+ // interface with an old version of SUNDIAL given that the
+ // code below supports modern SUNDIAL versions just fine.
+ Assert(false, ExcNotImplemented());
+
+# else /* interface starting with SUNDIALS 5.0 */
// Set the operations we care for in the sun_linear_solver object
// and attach it to the KINSOL object. The functions that will get
// called do not actually receive the KINSOL object, just the LS