(major)*1000000 + (minor)*10000 + (subminor)*100 + (patch))
#endif
+ /*
+ * SUNDIALS:
+ *
+ * Note: The following definitions will be set in sundials_config.h,
+ * so we don't repeat them here.
+ *
+ * SUNDIALS_VERSION_MAJOR
+ * SUNDIALS_VERSION_MINOR
+ * SUNDIALS_VERSION_PATCH
+ */
+
+ #define DEAL_II_SUNDIALS_VERSION_GTE(major,minor,subminor) \
+ ((SUNDIALS_VERSION_MAJOR * 10000 + \
+ SUNDIALS_VERSION_MINOR * 100 + \
+ SUNDIALS_VERSION_SUBMINOR) \
+ >= \
+ (major)*10000 + (minor)*100 + (subminor))
+
+ #define DEAL_II_SUNDIALS_VERSION_LT(major,minor,subminor) \
+ ((SUNDIALS_VERSION_MAJOR * 10000 + \
+ SUNDIALS_VERSION_MINOR * 100 + \
+ SUNDIALS_VERSION_SUBMINOR) \
+ < \
+ (major)*10000 + (minor)*100 + (subminor))
+
/*
* PETSc:
*
#include <ida/ida.h>
#include <ida/ida_spils.h>
-#include <ida/ida_spgmr.h>
-#include <ida/ida_spbcgs.h>
-#include <ida/ida_sptfqmr.h>
+#include <sundials/sundials_config.h>
+#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
+# include <ida/ida_spgmr.h>
+# include <ida/ida_spbcgs.h>
+# include <ida/ida_sptfqmr.h>
+#endif
#include <nvector/nvector_serial.h>
#include <sundials/sundials_math.h>
#include <sundials/sundials_types.h>
#include <deal.II/base/utilities.h>
#include <deal.II/sundials/copy.h>
+#include <sundials/sundials_config.h>
+
#include <iostream>
#include <iomanip>
#include <arkode/arkode_impl.h>
template<typename VectorType>
int t_arkode_solve_jacobian(ARKodeMem arkode_mem,
N_Vector b,
+#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
N_Vector,
+#endif
N_Vector ycur,
N_Vector fcur)
{
template<typename VectorType>
int t_arkode_solve_mass(ARKodeMem arkode_mem,
+#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
N_Vector b,
- N_Vector)
+ N_Vector
+#else
+ N_Vector b
+#endif
+ )
{
ARKode<VectorType> &solver = *static_cast<ARKode<VectorType> *>(arkode_mem->ark_user_data);
GrowingVectorMemory<VectorType> mem;
if (setup_jacobian)
{
ARKode_mem->ark_lsetup = t_arkode_setup_jacobian<VectorType>;
+#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
ARKode_mem->ark_setupNonNull = true;
+#endif
}
}
else
if (setup_mass)
{
ARKode_mem->ark_msetup = t_arkode_setup_mass<VectorType>;
+#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
ARKode_mem->ark_MassSetupNonNull = true;
+#endif
}
}
IDA_mem->ida_lsetup = t_dae_lsetup<VectorType>;
IDA_mem->ida_lsolve = t_dae_solve<VectorType>;
+#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
IDA_mem->ida_setupNonNull = true;
+#endif
status = IDASetMaxOrd(ida_mem, data.maximum_order);
AssertIDA(status);
#include <deal.II/base/utilities.h>
#include <deal.II/lac/block_vector.h>
#ifdef DEAL_II_WITH_TRILINOS
-#include <deal.II/lac/trilinos_parallel_block_vector.h>
-#include <deal.II/lac/trilinos_vector.h>
+# include <deal.II/lac/trilinos_parallel_block_vector.h>
+# include <deal.II/lac/trilinos_vector.h>
#endif
#ifdef DEAL_II_WITH_PETSC
-#include <deal.II/lac/petsc_parallel_block_vector.h>
-#include <deal.II/lac/petsc_parallel_vector.h>
+# include <deal.II/lac/petsc_parallel_block_vector.h>
+# include <deal.II/lac/petsc_parallel_vector.h>
#endif
#include <deal.II/base/utilities.h>
#include <deal.II/sundials/copy.h>
-#include <kinsol/kinsol_dense.h>
+#include <sundials/sundials_config.h>
+#if DEAL_II_SUNDIALS_VERSION_GTE(3,0,0)
+# include <sunmatrix/sunmatrix_dense.h>
+# include <sunlinsol/sunlinsol_dense.h>
+# include <kinsol/kinsol_direct.h>
+#else
+# include <kinsol/kinsol_dense.h>
+#endif
#include <iostream>
#include <iomanip>
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
}
}
else
{
+#if DEAL_II_SUNDIALS_VERSION_GTE(3,0,0)
+ const auto J = SUNDenseMatrix(system_size, system_size);
+ const auto LS = SUNDenseLinearSolver(u_scale, J);
+ status = KINDlsSetLinearSolver(kinsol_mem, LS, J);
+#else
status = KINDense(kinsol_mem, system_size);
+#endif
AssertKINSOL(status);
}