Assert(explicit_function || implicit_function,
ExcFunctionNotProvided("explicit_function || implicit_function"));
- auto explicit_function_callback =
- [](realtype tt, N_Vector yy, N_Vector yp, void *user_data) -> int {
+ auto explicit_function_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype tt,
+# else
+ realtype tt,
+# endif
+ N_Vector yy,
+ N_Vector yp,
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
};
- auto implicit_function_callback =
- [](realtype tt, N_Vector yy, N_Vector yp, void *user_data) -> int {
+ auto implicit_function_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype tt,
+# else
+ realtype tt,
+# endif
+ N_Vector yy,
+ N_Vector yp,
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
auto jacobian_times_vector_callback = [](N_Vector v,
N_Vector Jv,
- realtype t,
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
N_Vector y,
N_Vector fy,
void *user_data,
*src_fy);
};
- auto jacobian_times_vector_setup_callback =
- [](realtype t, N_Vector y, N_Vector fy, void *user_data) -> int {
+ auto jacobian_times_vector_setup_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ N_Vector y,
+ N_Vector fy,
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
AssertARKode(status);
if (jacobian_preconditioner_solve)
{
- auto solve_with_jacobian_callback = [](realtype t,
- N_Vector y,
- N_Vector fy,
- N_Vector r,
- N_Vector z,
- realtype gamma,
- realtype delta,
- int lr,
- void *user_data) -> int {
+ auto solve_with_jacobian_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ N_Vector y,
+ N_Vector fy,
+ N_Vector r,
+ N_Vector z,
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype gamma,
+ sunrealtype delta,
+# else
+ realtype gamma,
+ realtype delta,
+# endif
+ int lr,
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
lr);
};
- auto jacobian_solver_setup_callback = [](realtype t,
- N_Vector y,
- N_Vector fy,
- booleantype jok,
- booleantype *jcurPtr,
- realtype gamma,
- void *user_data) -> int {
+ auto jacobian_solver_setup_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ N_Vector y,
+ N_Vector fy,
+ booleantype jok,
+ booleantype *jcurPtr,
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype gamma,
+# else
+ realtype gamma,
+# endif
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
AssertARKode(status);
auto mass_matrix_times_vector_setup_callback =
- [](realtype t, void *mtimes_data) -> int {
+ [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ void *mtimes_data) -> int {
Assert(mtimes_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(mtimes_data);
solver.mass_times_setup, solver.pending_exception, t);
};
- auto mass_matrix_times_vector_callback =
- [](N_Vector v, N_Vector Mv, realtype t, void *mtimes_data) -> int {
+ auto mass_matrix_times_vector_callback = [](N_Vector v,
+ N_Vector Mv,
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ void *mtimes_data) -> int {
Assert(mtimes_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(mtimes_data);
if (mass_preconditioner_solve)
{
- auto mass_matrix_solver_setup_callback =
- [](realtype t, void *user_data) -> int {
+ auto mass_matrix_solver_setup_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
solver.mass_preconditioner_setup, solver.pending_exception, t);
};
- auto solve_with_mass_matrix_callback = [](realtype t,
- N_Vector r,
- N_Vector z,
- realtype delta,
- int lr,
- void *user_data) -> int {
+ auto solve_with_mass_matrix_callback = [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype t,
+# else
+ realtype t,
+# endif
+ N_Vector r,
+ N_Vector z,
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype delta,
+# else
+ realtype delta,
+# endif
+ int lr,
+ void *user_data) -> int {
Assert(user_data != nullptr, ExcInternalError());
ARKode<VectorType> &solver =
*static_cast<ARKode<VectorType> *>(user_data);
status = IDAInit(
ida_mem,
- [](realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data)
- -> int {
+ [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype tt,
+# else
+ realtype tt,
+# endif
+ N_Vector yy,
+ N_Vector yp,
+ N_Vector rr,
+ void *user_data) -> int {
IDA<VectorType> &solver = *static_cast<IDA<VectorType> *>(user_data);
auto *src_yy = internal::unwrap_nvector_const<VectorType>(yy);
# if DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
LS = SUNLinSolNewEmpty();
# else
- LS = SUNLinSolNewEmpty(ida_ctx);
+ LS = SUNLinSolNewEmpty(ida_ctx);
# endif
LS->content = this;
SUNMatrix /*ignored*/,
N_Vector x,
N_Vector b,
- realtype tol) -> int {
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype tol
+# else
+ realtype tol
+# endif
+ ) -> int {
IDA<VectorType> &solver = *static_cast<IDA<VectorType> *>(LS->content);
auto *src_b = internal::unwrap_nvector_const<VectorType>(b);
# if DEAL_II_SUNDIALS_VERSION_LT(6, 0, 0)
J = SUNMatNewEmpty();
# else
- J = SUNMatNewEmpty(ida_ctx);
+ J = SUNMatNewEmpty(ida_ctx);
# endif
J->content = this;
// calling IDASetLinearSolver
status = IDASetJacFn(
ida_mem,
- [](realtype tt,
- realtype cj,
- N_Vector yy,
- N_Vector yp,
- N_Vector /* residual */,
- SUNMatrix /* ignored */,
- void *user_data,
- N_Vector /* tmp1 */,
- N_Vector /* tmp2 */,
- N_Vector /* tmp3 */) -> int {
+ [](
+# if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+ sunrealtype tt,
+ sunrealtype cj,
+# else
+ realtype tt,
+ realtype cj,
+# endif
+ N_Vector yy,
+ N_Vector yp,
+ N_Vector /* residual */,
+ SUNMatrix /* ignored */,
+ void *user_data,
+ N_Vector /* tmp1 */,
+ N_Vector /* tmp2 */,
+ N_Vector /* tmp3 */) -> int {
Assert(user_data != nullptr, ExcInternalError());
IDA<VectorType> &solver = *static_cast<IDA<VectorType> *>(user_data);