}
// differentiable Sacado scalar types
+DIFFERENTIABLE_TRILINOS_SACADO_REAL_SCALARS_FAD := {
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD@;
+ }
+DIFFERENTIABLE_TRILINOS_SACADO_REAL_SCALARS_RAD := {
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD@;
+ }
DIFFERENTIABLE_TRILINOS_SACADO_REAL_SCALARS := {
- @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES@;
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD@;
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD@;
}
// differentiable scalar types
DIFFERENTIABLE_REAL_SCALARS := {
- @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES@;
@DEAL_II_EXPAND_ADOLC_TYPES@;
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD@;
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD@;
}
// all possible scalar types
ALL_SCALAR_TYPES := {
double; float ; std::complex<double>; std::complex<float>;
- @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES@;
@DEAL_II_EXPAND_ADOLC_TYPES@;
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD@;
+ @DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD@;
}
// scalar types that have a corresponding MPI datatype and that we can
## ---------------------------------------------------------------------
##
-## Copyright (C) 2012 - 2015 by the deal.II authors
+## Copyright (C) 2012 - 2017 by the deal.II authors
##
## This file is part of the deal.II library.
##
SET(DEAL_II_EXPAND_TRILINOS_MPI_VECTOR "TrilinosWrappers::MPI::Vector")
# Note: Only CMake 3.0 and greater support line continuation with the "\" character
# Elements of string lists are naturally separated by a ";"
- SET(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES
+ SET(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD
"Sacado::Fad::DFad<double>"
"Sacado::Fad::DFad<float>"
"Sacado::Fad::DFad<Sacado::Fad::DFad<double>>"
- "Sacado::Fad::DFad<Sacado::Fad::DFad<float>>"
+ "Sacado::Fad::DFad<Sacado::Fad::DFad<float>>")
+ SET(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD
"Sacado::Rad::ADvar<double>"
"Sacado::Rad::ADvar<float>"
"Sacado::Rad::ADvar<Sacado::Fad::DFad<double>>"
IF (TRILINOS_WITH_MPI)
SET(DEAL_II_EXPAND_EPETRA_VECTOR "LinearAlgebra::EpetraWrappers::Vector")
ENDIF()
+ IF (TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD)
+ SET(DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD ${TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD})
+ ENDIF()
ENDMACRO()
RESET_CMAKE_REQUIRED()
ENDIF()
+#
+# GCC 6.3.0 has a bug that prevents the creation of complex
+# numbers templated on Sacado::Rad::ADvar types:
+#
+# include/c++/6.3.0/complex: In instantiation of ‘struct std::complex<Sacado::Rad::ADvar<double> >’:
+# include/c++/6.3.0/complex:206:16: error: ‘std::complex<_Tp>& std::complex<_Tp>::operator=(const std::complex<_Tp>&) [with _Tp = Sacado::Rad::ADvar<double>]’ declared to take const reference, but implicit declaration would take non-const
+#
+# Test whether the compiler hits this issue
+#
+DEAL_II_FIND_FILE(SACADO_TRAD_HPP Sacado_trad.hpp
+ HINTS ${Trilinos_INCLUDE_DIRS}
+ NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
+ )
+
+IF(EXISTS ${SACADO_TRAD_HPP})
+ LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS})
+ PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+
+ CHECK_CXX_SOURCE_COMPILES(
+ "
+ #include <Sacado_trad.hpp>
+ int main ()
+ {
+ Sacado::Rad::ADvar<double> sacado_rad_double; // Works
+ std::complex<Sacado::Rad::ADvar<double> > complex_sacado_rad_double; // Doesn't work
+ return 0;
+ }
+ "
+ TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD
+ )
+ RESET_CMAKE_REQUIRED()
+ENDIF()
+
#
# *Boy* Sanitize variables that are exported by TrilinosConfig.cmake...
#
CLEAR
TRILINOS_CONFIG_DIR EPETRA_CONFIG_H SACADO_CMATH_HPP ${_libraries}
TRILINOS_SUPPORTS_CPP11 TRILINOS_HAS_C99_TR1_WORKAROUND SACADO_CONFIG_H
+ TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD
)
#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS
/* cmake/configure/configure_2_trilinos.cmake */
+#cmakedefine DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD
#cmakedefine DEAL_II_TRILINOS_WITH_ROL
/*