#
# This module exports
#
-# SUNDIALS_LIB_IDA
+# SUNDIALS_LIB_IDA(S)
# SUNDIALS_LIB_ARKODE
# SUNDIALS_LIB_KINSOL
# SUNDIALS_LIB_PAR
SET(SUNDIALS_DIR "" CACHE PATH "An optional hint to a SUNDIALS_DIR installation")
SET_IF_EMPTY(SUNDIALS_DIR "$ENV{SUNDIALS_DIR}")
-DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_IDA NAMES sundials_ida
+DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_IDAS NAMES sundials_idas
HINTS ${SUNDIALS_DIR}
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
)
+IF(SUNDIALS_LIB_IDAS MATCHES "-NOTFOUND")
+ DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_IDA NAMES sundials_ida
+ HINTS ${SUNDIALS_DIR}
+ PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+ )
+ SET(SUNDIALS_IDA_TYPE "IDA")
+ELSE()
+ ADD_DEFINITIONS(-DDEAL_II_WITH_SUNDIALS_IDAS)
+ SET(SUNDIALS_IDA_TYPE "IDAS")
+ENDIF()
+
DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_ARKODE NAMES sundials_arkode
HINTS ${SUNDIALS_DIR}
PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
SET(_sundials_additional_libs SUNDIALS_LIB_PAR)
DEAL_II_PACKAGE_HANDLE(SUNDIALS
LIBRARIES REQUIRED
- SUNDIALS_LIB_IDA SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
+ SUNDIALS_LIB_${SUNDIALS_IDA_TYPE} SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
${_sundials_additional_libs}
INCLUDE_DIRS REQUIRED SUNDIALS_INCLUDE_DIR
USER_INCLUDE_DIRS REQUIRED SUNDIALS_INCLUDE_DIR
CLEAR
- SUNDIALS_LIB_IDA SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL
+ SUNDIALS_LIB_${SUNDIALS_IDA_TYPE} SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL
SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
)
ELSE()
DEAL_II_PACKAGE_HANDLE(SUNDIALS
LIBRARIES REQUIRED
- SUNDIALS_LIB_IDA SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER
+ SUNDIALS_LIB_${SUNDIALS_IDA_TYPE} SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER
${_sundials_additional_libs}
INCLUDE_DIRS REQUIRED SUNDIALS_INCLUDE_DIR
USER_INCLUDE_DIRS REQUIRED SUNDIALS_INCLUDE_DIR
CLEAR
- SUNDIALS_LIB_IDA SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL
+ SUNDIALS_LIB_${SUNDIALS_IDA_TYPE} SUNDIALS_LIB_ARKODE SUNDIALS_LIB_KINSOL
SUNDIALS_LIB_SER
)
#include <deal.II/lac/vector.h>
#include <deal.II/lac/vector_memory.h>
-
+#ifdef DEAL_II_WITH_SUNDIALS_IDAS
+#include <idas/idas.h>
+#else
#include <ida/ida.h>
-#include <ida/ida_spils.h>
+#endif
+
#include <sundials/sundials_config.h>
#if DEAL_II_SUNDIALS_VERSION_LT(3,0,0)
# include <ida/ida_spgmr.h>
#include <deal.II/base/utilities.h>
#include <deal.II/sundials/copy.h>
+#ifdef DEAL_II_WITH_SUNDIALS_IDAS
+#pragma message "compiling with idas"
+#include <idas/idas_impl.h>
+#else
+#pragma message "compiling with ida"
+#include <ida/ida_impl.h>
+#endif
+
#include <iostream>
#include <iomanip>
-#include <ida/ida_impl.h>
DEAL_II_NAMESPACE_OPEN