From: heltai Date: Mon, 10 Feb 2014 13:21:33 +0000 (+0000) Subject: Merged from trunk r32366 through r32443. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50b4adadc514415e7826e3753d334c90bddfa642;p=dealii-svn.git Merged from trunk r32366 through r32443. git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32444 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index ad2a8cacd4..3b5c724258 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -124,6 +124,7 @@ ENDFOREACH() INCLUDE(setup_custom_targets) INCLUDE(setup_finalize) INCLUDE(setup_write_config) +#INCLUDE(setup_sanity_checks) ######################################################################## diff --git a/deal.II/bundled/CMakeLists.txt b/deal.II/bundled/CMakeLists.txt index b4ff8c8bf6..68855752cc 100644 --- a/deal.II/bundled/CMakeLists.txt +++ b/deal.II/bundled/CMakeLists.txt @@ -28,10 +28,6 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED) PATTERN ".svn" EXCLUDE ) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - "${BOOST_FOLDER}/include\n" - ) - ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src) IF(DEAL_II_WITH_ZLIB) @@ -59,10 +55,6 @@ IF(FEATURE_THREADS_BUNDLED_CONFIGURED) PATTERN ".svn" EXCLUDE ) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - "${TBB_FOLDER}/include\n" - ) - ADD_SUBDIRECTORY(${TBB_FOLDER}/src) ENDIF() diff --git a/deal.II/bundled/boost-1.49.0/libs/iostreams/src/CMakeLists.txt b/deal.II/bundled/boost-1.49.0/libs/iostreams/src/CMakeLists.txt index ef8f84838c..0e7daafd8f 100644 --- a/deal.II/bundled/boost-1.49.0/libs/iostreams/src/CMakeLists.txt +++ b/deal.II/bundled/boost-1.49.0/libs/iostreams/src/CMakeLists.txt @@ -14,6 +14,8 @@ ## ## --------------------------------------------------------------------- +INCLUDE_DIRECTORIES(${BOOST_BUNDLED_INCLUDE_DIRS}) + SET(src_boost_iostreams file_descriptor.cpp gzip.cpp diff --git a/deal.II/bundled/boost-1.49.0/libs/serialization/src/CMakeLists.txt b/deal.II/bundled/boost-1.49.0/libs/serialization/src/CMakeLists.txt index b06ba8bd6e..4f35a0e7de 100644 --- a/deal.II/bundled/boost-1.49.0/libs/serialization/src/CMakeLists.txt +++ b/deal.II/bundled/boost-1.49.0/libs/serialization/src/CMakeLists.txt @@ -14,6 +14,8 @@ ## ## --------------------------------------------------------------------- +INCLUDE_DIRECTORIES(${BOOST_BUNDLED_INCLUDE_DIRS}) + SET(src_boost_serialization basic_archive.cpp basic_iarchive.cpp diff --git a/deal.II/bundled/boost-1.49.0/libs/thread/src/CMakeLists.txt b/deal.II/bundled/boost-1.49.0/libs/thread/src/CMakeLists.txt index 2e3eb8839f..c1229bb8a9 100644 --- a/deal.II/bundled/boost-1.49.0/libs/thread/src/CMakeLists.txt +++ b/deal.II/bundled/boost-1.49.0/libs/thread/src/CMakeLists.txt @@ -14,6 +14,8 @@ ## ## --------------------------------------------------------------------- +INCLUDE_DIRECTORIES(${BOOST_BUNDLED_INCLUDE_DIRS}) + IF(DEAL_II_USE_MT_POSIX) SET(src_boost_thread pthread/once.cpp diff --git a/deal.II/bundled/tbb41_20130401oss/src/CMakeLists.txt b/deal.II/bundled/tbb41_20130401oss/src/CMakeLists.txt index 8e764b44f3..fa9b0faa97 100644 --- a/deal.II/bundled/tbb41_20130401oss/src/CMakeLists.txt +++ b/deal.II/bundled/tbb41_20130401oss/src/CMakeLists.txt @@ -23,6 +23,7 @@ STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") SET(CMAKE_INCLUDE_CURRENT_DIR TRUE) INCLUDE_DIRECTORIES( + ${THREADS_BUNDLED_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/rml/include ) diff --git a/deal.II/bundled/umfpack/AMD/Source/CMakeLists.txt b/deal.II/bundled/umfpack/AMD/Source/CMakeLists.txt index 5f3231de01..df569bf230 100644 --- a/deal.II/bundled/umfpack/AMD/Source/CMakeLists.txt +++ b/deal.II/bundled/umfpack/AMD/Source/CMakeLists.txt @@ -14,6 +14,8 @@ ## ## --------------------------------------------------------------------- +INCLUDE_DIRECTORIES(${UMFPACK_BUNDLED_INCLUDE_DIRS}) + SET(src_amd amd_1.cc amd_2.cc diff --git a/deal.II/bundled/umfpack/UMFPACK/Source/CMakeLists.txt b/deal.II/bundled/umfpack/UMFPACK/Source/CMakeLists.txt index 16f03377d4..5029fc65f7 100644 --- a/deal.II/bundled/umfpack/UMFPACK/Source/CMakeLists.txt +++ b/deal.II/bundled/umfpack/UMFPACK/Source/CMakeLists.txt @@ -19,8 +19,11 @@ # (... where everything is explained contrary to this... mess) # +INCLUDE_DIRECTORIES(${UMFPACK_BUNDLED_INCLUDE_DIRS}) + # # *Shush!* +# (Remove locally in this subdirectory) # STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wall") diff --git a/deal.II/cmake/checks/check_02_system_features.cmake b/deal.II/cmake/checks/check_02_system_features.cmake index 20c158c636..259465b9f9 100644 --- a/deal.II/cmake/checks/check_02_system_features.cmake +++ b/deal.II/cmake/checks/check_02_system_features.cmake @@ -58,13 +58,7 @@ CHECK_CXX_SYMBOL_EXISTS("rand_r" "stdlib.h" HAVE_RAND_R) # # Do we have the Bessel function jn? # -# Switch the library preference back to prefer dynamic libraries if -# DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In -# this case system libraries should be linked dynamically. -# -SWITCH_LIBRARY_PREFERENCE() -FIND_LIBRARY(m_LIBRARY NAMES m) -SWITCH_LIBRARY_PREFERENCE() +FIND_SYSTEM_LIBRARY(m_LIBRARY NAMES m) MARK_AS_ADVANCED(m_LIBRARY) IF(NOT m_LIBRARY MATCHES "-NOTFOUND") @@ -72,7 +66,7 @@ IF(NOT m_LIBRARY MATCHES "-NOTFOUND") CHECK_CXX_SYMBOL_EXISTS("jn" "math.h" HAVE_JN) RESET_CMAKE_REQUIRED() IF(HAVE_JN) - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${m_LIBRARY}) + LIST(APPEND DEAL_II_LIBRARIES ${m_LIBRARY}) ENDIF() ENDIF() diff --git a/deal.II/cmake/config/CMakeLists.txt b/deal.II/cmake/config/CMakeLists.txt index 4ade81d2b2..465d18de1f 100644 --- a/deal.II/cmake/config/CMakeLists.txt +++ b/deal.II/cmake/config/CMakeLists.txt @@ -28,15 +28,6 @@ MESSAGE(STATUS "Setting up project configuration") -# -# Read in auxiliary include directories for the build directory -# configuration: -# -FILE(STRINGS - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - deal_ii_source_includes - ) - # # Configure the template-arguments file # @@ -113,8 +104,8 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES}) ENDIF() LIST(APPEND CONFIG_LIBRARIES_${_build} - ${DEAL_II_EXTERNAL_LIBRARIES_${_build}} - ${DEAL_II_EXTERNAL_LIBRARIES} + ${DEAL_II_LIBRARIES_${_build}} + ${DEAL_II_LIBRARIES} ) LIST(APPEND CONFIG_LIBRARIES ${_keyword} @@ -140,7 +131,7 @@ SET(CONFIG_INCLUDE_DIRS \${DEAL_II_PATH}/include/deal.II ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/deal.II - ${deal_ii_source_includes} + ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) CONFIGURE_FILE( @@ -236,8 +227,8 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) SET(_libs) FOREACH(_lib - ${DEAL_II_EXTERNAL_LIBRARIES_${build}} - ${DEAL_II_EXTERNAL_LIBRARIES} + ${DEAL_II_LIBRARIES_${build}} + ${DEAL_II_LIBRARIES} ) IF(_lib MATCHES "^\\s*\\/" AND NOT _lib MATCHES "\\.framework$") LIST(APPEND _libs "${_lib}") @@ -252,8 +243,8 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) SET(_paths) FOREACH(_lib $(D)/${DEAL_II_LIBRARY_RELDIR}/${CONFIG_LIBRARY_${build}} - ${DEAL_II_EXTERNAL_LIBRARIES_${build}} - ${DEAL_II_EXTERNAL_LIBRARIES} + ${DEAL_II_LIBRARIES_${build}} + ${DEAL_II_LIBRARIES} ) # @@ -351,7 +342,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) $(D)/install/deal.II ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/deal.II - ${deal_ii_source_includes} + ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) CONFIGURE_FILE( diff --git a/deal.II/cmake/configure/configure_1_bzip2.cmake b/deal.II/cmake/configure/configure_1_bzip2.cmake index 61fd319e7e..a905aad144 100644 --- a/deal.II/cmake/configure/configure_1_bzip2.cmake +++ b/deal.II/cmake/configure/configure_1_bzip2.cmake @@ -19,12 +19,11 @@ # MACRO(FEATURE_BZIP2_FIND_EXTERNAL var) - FIND_PACKAGE(BZip2) IF(BZIP2_FOUND) # - # Rename some variables: + # Rename variables: # SET(BZIP2_VERSION ${BZIP2_VERSION_STRING}) SET(BZIP2_INCLUDE_DIRS ${BZIP2_INCLUDE_DIR}) diff --git a/deal.II/cmake/configure/configure_1_lapack.cmake b/deal.II/cmake/configure/configure_1_lapack.cmake index ede31c24ba..258af871f2 100644 --- a/deal.II/cmake/configure/configure_1_lapack.cmake +++ b/deal.II/cmake/configure/configure_1_lapack.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -80,7 +80,6 @@ ENDMACRO() MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL) - REGISTER_FEATURE(LAPACK) CHECK_FOR_LAPACK_FUNCTIONS() ENDMACRO() diff --git a/deal.II/cmake/configure/configure_1_mpi.cmake b/deal.II/cmake/configure/configure_1_mpi.cmake index 1927e8ecbd..a73e27d962 100644 --- a/deal.II/cmake/configure/configure_1_mpi.cmake +++ b/deal.II/cmake/configure/configure_1_mpi.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -18,7 +18,7 @@ # Configuration for mpi support: # # We look for the C and Fortran libraries as well because they are needed -# by some external libraries: +# by some external libraries for the link interface: # MACRO(FEATURE_MPI_FIND_EXTERNAL var) @@ -137,6 +137,9 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) SET(${var} TRUE) ENDIF() + # Hide some variables: + MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY MPI_MPI_H) + # # Populate correct variables: # @@ -145,19 +148,6 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) SET(MPI_CXX_FLAGS ${MPI_CXX_COMPILE_FLAGS}) SET(MPI_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}") - # Hide some variables: - MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY MPI_MPI_H) - -ENDMACRO() - - -MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL) - # - # The user has to know the location of the mpi headers as well: - # - SET(MPI_ADD_TO_USER_INCLUDE_DIRS TRUE) - - REGISTER_FEATURE(MPI) ENDMACRO() @@ -179,3 +169,8 @@ ENDMACRO() CONFIGURE_FEATURE(MPI) + +# +# The user has to know the location of the mpi headers as well: +# +SET(MPI_USER_INCLUDE_DIRS ${MPI_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_1_threads.cmake b/deal.II/cmake/configure/configure_1_threads.cmake index c7265653bb..1d712c04b7 100644 --- a/deal.II/cmake/configure/configure_1_threads.cmake +++ b/deal.II/cmake/configure/configure_1_threads.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -30,22 +30,16 @@ MACRO(SETUP_THREADING) # Unfortunately the FindThreads macro needs a working C compiler # IF(CMAKE_C_COMPILER_WORKS) - # - # Switch the library preference back to prefer dynamic libraries if - # DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In - # this case system libraries should be linked dynamically. - # - SWITCH_LIBRARY_PREFERENCE() - # # Clear the test flags because FindThreads.cmake will use a C compiler: # CLEAR_CMAKE_REQUIRED() + SWITCH_LIBRARY_PREFERENCE() FIND_PACKAGE(Threads) + SWITCH_LIBRARY_PREFERENCE() RESET_CMAKE_REQUIRED() - SWITCH_LIBRARY_PREFERENCE() ELSE() @@ -63,7 +57,7 @@ MACRO(SETUP_THREADING) IF(NOT Threads_FOUND) # - # TODO: This is a dead end. Threading might be setup with internal TBB + # TODO: This is a dead end. Threading might be set up with internal TBB # so we have no way of returning unsuccessfully... # MESSAGE(FATAL_ERROR @@ -88,7 +82,7 @@ MACRO(SETUP_THREADING) ENDIF() ENDIF() - ADD_FLAGS(DEAL_II_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") + ADD_FLAGS(THREADS_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") # # Set up some posix thread specific configuration toggles: @@ -152,13 +146,10 @@ ENDMACRO() MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL) - REGISTER_FEATURE(TBB) - - # TODO: Refactor IF(CMAKE_BUILD_TYPE MATCHES "Debug") IF(TBB_WITH_DEBUG_LIB) - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") ENDIF() ENDIF() @@ -169,15 +160,14 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL) IF( DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) - LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") ENDIF() SETUP_THREADING() - # TODO: Refactor this mess of a configure file... - SET(THREADS_LIBRARIES ${TBB_LIBRARIES}) - SET(THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS}) + LIST(APPEND THREADS_LIBRARIES ${TBB_LIBRARIES}) + LIST(APPEND THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS}) ENDMACRO() @@ -191,15 +181,15 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED) # # We have to disable a bunch of warnings: # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-parentheses") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-long-long") + ENABLE_IF_SUPPORTED(THREADS_CXX_FLAGS "-Wno-parentheses") + ENABLE_IF_SUPPORTED(THREADS_CXX_FLAGS "-Wno-long-long") # # Add some definitions to use the header files in debug mode: # IF (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") + LIST(APPEND THREADS_USER_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") ENDIF() # @@ -209,20 +199,22 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED) IF( DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) - LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") - LIST(APPEND DEAL_II_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") + LIST(APPEND THREADS_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1") ENDIF() # # tbb uses dlopen/dlclose, so link against libdl.so as well: # - FIND_LIBRARY(dl_LIBRARY NAMES dl) + # TODO: Also necessary for external lib, use preference toggle + # + FIND_SYSTEM_LIBRARY(dl_LIBRARY NAMES dl) MARK_AS_ADVANCED(dl_LIBRARY) IF(NOT dl_LIBRARY MATCHES "-NOTFOUND") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${dl_LIBRARY}) + LIST(APPEND THREADS_LIBRARIES ${dl_LIBRARY}) ENDIF() - INCLUDE_DIRECTORIES(${TBB_FOLDER}/include) + LIST(APPEND THREADS_BUNDLED_INCLUDE_DIRS ${TBB_FOLDER}/include) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_2_metis.cmake b/deal.II/cmake/configure/configure_2_metis.cmake index 1a49a2c7c2..739c7a6274 100644 --- a/deal.II/cmake/configure/configure_2_metis.cmake +++ b/deal.II/cmake/configure/configure_2_metis.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## diff --git a/deal.II/cmake/configure/configure_2_trilinos.cmake b/deal.II/cmake/configure/configure_2_trilinos.cmake index e04bbfac41..b7b0006211 100644 --- a/deal.II/cmake/configure/configure_2_trilinos.cmake +++ b/deal.II/cmake/configure/configure_2_trilinos.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -163,8 +163,8 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) IF(DEAL_II_WITH_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11) IF(TRILINOS_HAS_C99_TR1_WORKAROUND) - LIST(APPEND DEAL_II_DEFINITIONS "HAS_C99_TR1_CMATH") - LIST(APPEND DEAL_II_USER_DEFINITIONS "HAS_C99_TR1_CMATH") + LIST(APPEND TRILINOS_DEFINITIONS "HAS_C99_TR1_CMATH") + LIST(APPEND TRILINOS_USER_DEFINITIONS "HAS_C99_TR1_CMATH") ELSE() MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " "The installation is not compatible with the C++ standard selected for " @@ -195,8 +195,7 @@ ENDMACRO() MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) - SET(TRILINOS_ADD_TO_USER_INCLUDE_DIRS TRUE) - REGISTER_FEATURE(TRILINOS) + SET(TRILINOS_USER_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS}) SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::Vector") SET(DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR "TrilinosWrappers::BlockVector") @@ -208,9 +207,9 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) # # Disable a bunch of warnings caused by Trilinos headers: # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-extra") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-overloaded-virtual") + ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-unused") + ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-extra") + ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-overloaded-virtual") ENDMACRO() diff --git a/deal.II/cmake/configure/configure_2_umfpack.cmake b/deal.II/cmake/configure/configure_2_umfpack.cmake index 56ac7e323d..f1d0d74513 100644 --- a/deal.II/cmake/configure/configure_2_umfpack.cmake +++ b/deal.II/cmake/configure/configure_2_umfpack.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -21,7 +21,7 @@ SET(FEATURE_UMFPACK_DEPENDS DEAL_II_WITH_LAPACK) MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED) - INCLUDE_DIRECTORIES( + SET(UMFPACK_BUNDLED_INCLUDE_DIRS ${UMFPACK_FOLDER}/UMFPACK/Include ${UMFPACK_FOLDER}/AMD/Include ) diff --git a/deal.II/cmake/configure/configure_3_petsc.cmake b/deal.II/cmake/configure/configure_3_petsc.cmake index 6ed8f62c24..81cdd69e30 100644 --- a/deal.II/cmake/configure/configure_3_petsc.cmake +++ b/deal.II/cmake/configure/configure_3_petsc.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -112,15 +112,13 @@ ENDMACRO() MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL) - INCLUDE_DIRECTORIES(${PETSC_INCLUDE_DIRS}) - SET(PETSC_ADD_TO_USER_INCLUDE_DIRS TRUE) - REGISTER_FEATURE(PETSC) + SET(PETSC_USER_INCLUDE_DIRS ${PETSC_INCLUDE_DIRS}) # # Disable a bunch of warnings when compiling with petsc: # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-long-long") + ENABLE_IF_SUPPORTED(PETSC_CXX_FLAGS "-Wno-long-long") SET(DEAL_II_EXPAND_PETSC_VECTOR "PETScWrappers::Vector") SET(DEAL_II_EXPAND_PETSC_BLOCKVECTOR "PETScWrappers::BlockVector") diff --git a/deal.II/cmake/configure/configure_boost.cmake b/deal.II/cmake/configure/configure_boost.cmake index de29304bbf..ec72b800a2 100644 --- a/deal.II/cmake/configure/configure_boost.cmake +++ b/deal.II/cmake/configure/configure_boost.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -105,19 +105,18 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var) ENDMACRO() -# -# The user has to know the location of the boost headers as well: -# -SET(BOOST_ADD_TO_USER_INCLUDE_DIRS TRUE) - - MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED) - INCLUDE_DIRECTORIES(${BOOST_FOLDER}/include) + SET(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include) ENDMACRO() CONFIGURE_FEATURE(BOOST) +# +# The user has to know the location of the boost headers as well: +# +SET(BOOST_USER_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS}) + # # DEAL_II_WITH_BOOST is always required. # diff --git a/deal.II/cmake/configure/configure_functionparser.cmake b/deal.II/cmake/configure/configure_functionparser.cmake index c9abde129d..4794106652 100644 --- a/deal.II/cmake/configure/configure_functionparser.cmake +++ b/deal.II/cmake/configure/configure_functionparser.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -26,7 +26,7 @@ ENDMACRO() MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_BUNDLED) - INCLUDE_DIRECTORIES(${FUNCTIONPARSER_FOLDER}) + SET(FUNCTIONPARSER_BUNDLED_INCLUDE_DIRS ${FUNCTIONPARSER_FOLDER}) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_hdf5.cmake b/deal.II/cmake/configure/configure_hdf5.cmake index 81e71ceffa..5dd027d482 100644 --- a/deal.II/cmake/configure/configure_hdf5.cmake +++ b/deal.II/cmake/configure/configure_hdf5.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -47,10 +47,10 @@ MACRO(FEATURE_HDF5_FIND_EXTERNAL var) ENDMACRO() +CONFIGURE_FEATURE(HDF5) + + # # The user has to know the location of the hdf5 headers as well: # -SET(HDF5_ADD_TO_USER_INCLUDE_DIRS TRUE) - - -CONFIGURE_FEATURE(HDF5) +SET(HDF5_USER_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_mumps.cmake b/deal.II/cmake/configure/configure_mumps.cmake index 4022f98026..a02e94d0b9 100644 --- a/deal.II/cmake/configure/configure_mumps.cmake +++ b/deal.II/cmake/configure/configure_mumps.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -21,10 +21,9 @@ SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI DEAL_II_WITH_LAPACK) +CONFIGURE_FEATURE(MUMPS) + # # The user has to know the location of the MUMPS headers as well: # -SET(MUMPS_ADD_TO_USER_INCLUDE_DIRS TRUE) - - -CONFIGURE_FEATURE(MUMPS) +SET(MUMPS_USER_INCLUDE_DIRS ${MUMPS_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_p4est.cmake b/deal.II/cmake/configure/configure_p4est.cmake index 4055c0f30c..a54643b60c 100644 --- a/deal.II/cmake/configure/configure_p4est.cmake +++ b/deal.II/cmake/configure/configure_p4est.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -75,10 +75,9 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var) ENDMACRO() +CONFIGURE_FEATURE(P4EST) + # # The user has to know the location of the P4est headers as well: # -SET(P4EST_ADD_TO_USER_INCLUDE_DIRS TRUE) - - -CONFIGURE_FEATURE(P4EST) +SET(P4EST_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIRS}) diff --git a/deal.II/cmake/configure/configure_slepc.cmake b/deal.II/cmake/configure/configure_slepc.cmake index fdb87649d0..a4b97958fc 100644 --- a/deal.II/cmake/configure/configure_slepc.cmake +++ b/deal.II/cmake/configure/configure_slepc.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -58,12 +58,6 @@ MACRO(FEATURE_SLEPC_FIND_EXTERNAL var) ENDMACRO() -# -# The user has to know the location of the SLEPC headers as well: -# -SET(SLEPC_ADD_TO_USER_INCLUDE_DIRS TRUE) - - MACRO(FEATURE_SLEPC_ERROR_MESSAGE) MESSAGE(FATAL_ERROR "\n" "Could not find the SLEPc library!\n" @@ -84,3 +78,8 @@ ENDMACRO() CONFIGURE_FEATURE(SLEPC) + +# +# The user has to know the location of the SLEPC headers as well: +# +SET(SLEPC_USER_INCLUDE_DIRS ${SLEPC_INCLUDE_DIRS}) diff --git a/deal.II/cmake/macros/macro_configure_feature.cmake b/deal.II/cmake/macros/macro_configure_feature.cmake index 240e2bfa0d..219ab2f405 100644 --- a/deal.II/cmake/macros/macro_configure_feature.cmake +++ b/deal.II/cmake/macros/macro_configure_feature.cmake @@ -209,6 +209,7 @@ MACRO(CONFIGURE_FEATURE _feature) IF(FEATURE_${_feature}_HAVE_BUNDLED) RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()") MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") + LIST(APPEND DEAL_II_FEATURES ${_feature}) SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) SET_CACHED_OPTION(${_feature} ON) ELSE() @@ -233,11 +234,10 @@ MACRO(CONFIGURE_FEATURE _feature) IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL) RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL()") - ELSE() - REGISTER_FEATURE(${_feature}) ENDIF() MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.") + LIST(APPEND DEAL_II_FEATURES ${_feature}) SET(FEATURE_${_feature}_EXTERNAL_CONFIGURED TRUE) SET_CACHED_OPTION(${_feature} ON) @@ -247,9 +247,12 @@ MACRO(CONFIGURE_FEATURE _feature) IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED) RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()") + MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") + LIST(APPEND DEAL_II_FEATURES ${_feature}) SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) SET_CACHED_OPTION(${_feature} ON) + ELSE() IF(DEAL_II_WITH_${_feature}) IF(COMMAND FEATURE_${_feature}_ERROR_MESSAGE) diff --git a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake index 8efacf6dfe..19d4883aae 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_library.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_library.cmake @@ -39,7 +39,7 @@ MACRO(DEAL_II_ADD_LIBRARY _library) ) SET_TARGET_PROPERTIES(${_library}.${_build_lowercase} PROPERTIES - LINK_FLAGS "${DEAL_II_LINKER_FLAGS};${DEAL_II_LINKER_FLAGS_${_build}}" + LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}" COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" LINKER_LANGUAGE "CXX" diff --git a/deal.II/cmake/macros/macro_filter_system_libraries.cmake b/deal.II/cmake/macros/macro_filter_system_libraries.cmake new file mode 100644 index 0000000000..49b4e75bf3 --- /dev/null +++ b/deal.II/cmake/macros/macro_filter_system_libraries.cmake @@ -0,0 +1,43 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2014 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# This macro replaces absolute paths to system libraries with the +# corresponding short name within the FEATURE_LIBRARIES(|_DEBUG|_RELEASE) +# variables +# +# Usage: +# FILTER_SYSTEM_LIBRARIES(feature) +# + +MACRO(FILTER_SYSTEM_LIBRARIES _feature) + FOREACH(_variable + ${_feature}_LIBRARIES + ${_feature}_LIBRARIES_DEBUG + ${_feature}_LIBRARIES_RELEASE + ) + IF(DEFINED ${_variable}) + SET(_tmp_${_variable} ${${_variable}}) + SET(${_variable} "") + FOREACH(_lib ${_tmp_${_variable}}) + IF(_lib MATCHES "lib(c|quadmath|gfortran|m|rt|nsl|dl|pthread).so$") + string(REGEX REPLACE ".*lib([a-z]+).so$" "\\1" _lib ${_lib}) + ENDIF() + LIST(APPEND ${_variable} ${_lib}) + ENDFOREACH() + ENDIF() + ENDFOREACH() +ENDMACRO() diff --git a/deal.II/cmake/macros/macro_find_system_library.cmake b/deal.II/cmake/macros/macro_find_system_library.cmake new file mode 100644 index 0000000000..eda5e4a83c --- /dev/null +++ b/deal.II/cmake/macros/macro_find_system_library.cmake @@ -0,0 +1,50 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2013 - 2014 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# Search for a system library. In contrast to normal libraries we do this +# purely via "-l" instead of selecting a full library path.. +# +# USAGE: +# FIND_SYSTEM_LIBRARY(variable NAMES [list of possible names]) +# + +MACRO(FIND_SYSTEM_LIBRARY) + SET(_argn ${ARGN}) + LIST(GET _argn 0 _variable) + LIST(REMOVE_AT _argn 0 1) + + if("${_variable}" MATCHES "^${_variable}$") + FOREACH(_arg ${_argn}) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES "-l${_arg}") + CHECK_CXX_COMPILER_FLAG("" ${_variable}) + RESET_CMAKE_REQUIRED() + + IF(${_variable}) + UNSET(${_variable} CACHE) + SET(${_variable} ${_arg} CACHE STRING "A system library.") + SET(${_variable} ${_arg}) + BREAK() + ELSE() + UNSET(${_variable} CACHE) + ENDIF() + ENDFOREACH() + + IF(NOT _variable) + SET(${_variable} "${_variable}-NOTFOUND") + ENDIF() + ENDIF() +ENDMACRO() diff --git a/deal.II/cmake/macros/macro_register_feature.cmake b/deal.II/cmake/macros/macro_register_feature.cmake index 5c590280ee..1f6ed329a0 100644 --- a/deal.II/cmake/macros/macro_register_feature.cmake +++ b/deal.II/cmake/macros/macro_register_feature.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2013 by the deal.II authors +## Copyright (C) 2013 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -24,9 +24,9 @@ # # This macro will add # -# _LIBRARIES -# _INCLUDE_DIRS(|_DEBUG|_RELEASE) -# _USER_INCLUDE_DIRS(|_DEBUG|_RELEASE) +# _LIBRARIES (respecting general, optimized, debug keyword) +# _LIBRARIES(_DEBUG|_RELEASE) +# _(|BUNDLED_|USER_)INCLUDE_DIRS # _DEFINITIONS(|_DEBUG|_RELEASE) # _USER_DEFINITIONS(|_DEBUG|_RELEASE) # _CXX_FLAGS(|_DEBUG|_RELEASE) @@ -35,38 +35,14 @@ # to the corresponding DEAL_II_* variables # - MACRO(REGISTER_FEATURE _feature) - # variables for include directories: - FOREACH(_var ${_feature}_INCLUDE_DIRS ${_feature}_INCLUDE_PATH) - IF(DEFINED ${_var}) - INCLUDE_DIRECTORIES(${${_var}}) - IF(${_feature}_ADD_TO_USER_INCLUDE_DIRS) - LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${${_var}}) - ENDIF() - ENDIF() - ENDFOREACH() - - # variables for linker flags: - FOREACH(_var ${_feature}_LINKER_FLAGS ${_feature}_LINK_FLAGS) - IF(DEFINED ${_var}) - ADD_FLAGS(DEAL_II_LINKER_FLAGS "${${_var}}") - ENDIF() - ENDFOREACH() - - # variables for compiler flags: - FOREACH(_var ${_feature}_CXX_FLAGS ${_feature}_COMPILE_FLAGS) - IF(DEFINED ${_var}) - ADD_FLAGS(DEAL_II_CXX_FLAGS "${${_var}}") - ENDIF() - ENDFOREACH() IF(DEFINED ${_feature}_LIBRARIES) # # Add ${_feature}_LIBRARIES to - # DEAL_II_EXTERNAL_LIBRARIES - # DEAL_II_EXTERNAL_LIBRARIES_DEBUG - # DEAL_II_EXTERNAL_LIBRARIES_RELEASE + # DEAL_II_LIBRARIES + # DEAL_II_LIBRARIES_DEBUG + # DEAL_II_LIBRARIES_RELEASE # depending on the "optmized", "debug" or "general" keyword # SET(_toggle "general") @@ -77,14 +53,34 @@ MACRO(REGISTER_FEATURE _feature) SET(_toggle "${_tmp}") ELSE() IF("${_toggle}" STREQUAL "general") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${_tmp}) + LIST(APPEND DEAL_II_LIBRARIES ${_tmp}) ELSEIF("${_toggle}" STREQUAL "debug") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${_tmp}) + LIST(APPEND DEAL_II_LIBRARIES_DEBUG ${_tmp}) ELSEIF("${_toggle}" STREQUAL "optimized") - LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${_tmp}) + LIST(APPEND DEAL_II_LIBRARIES_RELEASE ${_tmp}) ENDIF() ENDIF() ENDFOREACH() ENDIF() + FOREACH(_var + LIBRARIES_DEBUG LIBRARIES_RELEASE + INCLUDE_DIRS BUNDLED_INCLUDE_DIRS USER_INCLUDE_DIRS + DEFINITIONS DEFINITIONS_DEBUG DEFINITIONS_RELEASE + USER_DEFINITIONS USER_DEFINITIONS_DEBUG USER_DEFINITIONS_RELEASE + ) + IF(DEFINED ${_feature}_${_var}) + LIST(APPEND DEAL_II_${_var} ${${_feature}_${_var}}) + ENDIF() + ENDFOREACH() + + FOREACH(_var + CXX_FLAGS CXX_FLAGS_DEBUG CXX_FLAGS_RELEASE + LINKER_FLAGS LINKER_FLAGS_DEBUG LINKER_FLAGS_RELEASE + ) + IF(DEFINED ${_feature}_${_var}) + ADD_FLAGS(DEAL_II_${_var} "${${_feature}_${_var}}") + ENDIF() + ENDFOREACH() + ENDMACRO() diff --git a/deal.II/cmake/modules/FindDEALII_LAPACK.cmake b/deal.II/cmake/modules/FindDEALII_LAPACK.cmake index 378851f71c..b16cf25b13 100644 --- a/deal.II/cmake/modules/FindDEALII_LAPACK.cmake +++ b/deal.II/cmake/modules/FindDEALII_LAPACK.cmake @@ -50,18 +50,9 @@ FIND_PACKAGE(LAPACK) SET(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup}) MARK_AS_ADVANCED( - atlas_LIBRARY - atlcblas_LIBRARY - atllapack_LIBRARY - blas_LIBRARY - eigen_blas_LIBRARY - f77blas_LIBRARY - gslcblas_LIBRARY - lapack_LIBRARY - m_LIBRARY - ptf77blas_LIBRARY - ptlapack_LIBRARY - refblas_LIBRARY + atlas_LIBRARY atlcblas_LIBRARY atllapack_LIBRARY blas_LIBRARY + eigen_blas_LIBRARY f77blas_LIBRARY gslcblas_LIBRARY lapack_LIBRARY + m_LIBRARY ptf77blas_LIBRARY ptlapack_LIBRARY refblas_LIBRARY reflapack_LIBRARY ) @@ -94,28 +85,19 @@ IF(LAPACK_FOUND) # If CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES is not available, do it # unconditionally for the most common case (gfortran). # - # Switch the library preference back to prefer dynamic libraries if - # DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In - # this case system libraries should be linked dynamically. - # SET(_fortran_libs ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}) SET_IF_EMPTY(_fortran_libs gfortran m quadmath c) - SWITCH_LIBRARY_PREFERENCE() FOREACH(_lib ${_fortran_libs}) - FIND_LIBRARY(${_lib}_LIBRARY - NAMES ${_lib} - HINTS - ${CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES} - ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) + FIND_SYSTEM_LIBRARY(${_lib}_LIBRARY NAMES ${_lib}) MARK_AS_ADVANCED(${_lib}_LIBRARY) IF(NOT ${_lib}_LIBRARY MATCHES "-NOTFOUND") LIST(APPEND BLAS_LIBRARIES ${${_lib}_LIBRARY}) LIST(APPEND LAPACK_LIBRARIES ${${_lib}_LIBRARY}) ENDIF() + ENDFOREACH() - SWITCH_LIBRARY_PREFERENCE() # # Filter out spurious "FALSE" in the library lists: diff --git a/deal.II/cmake/modules/FindPETSC.cmake b/deal.II/cmake/modules/FindPETSC.cmake index 1a4f3122c4..df83255e4d 100644 --- a/deal.II/cmake/modules/FindPETSC.cmake +++ b/deal.II/cmake/modules/FindPETSC.cmake @@ -123,13 +123,18 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND") # Link line: # - FILE(STRINGS "${PETSC_PETSCVARIABLES}" _external_link_line + FILE(STRINGS "${PETSC_PETSCVARIABLES}" PETSC_EXTERNAL_LINK_LINE REGEX "^PETSC_WITH_EXTERNAL_LIB =.*") - SEPARATE_ARGUMENTS(_external_link_line) + SEPARATE_ARGUMENTS(PETSC_EXTERNAL_LINK_LINE) + + IF(NOT "${PETSC_EXTERNAL_LINK_LINE}" STREQUAL "${PETSC_EXTERNAL_LINK_LINE_SAVED}") + SET(_new_petsc_external_link_line TRUE) + ENDIF() + SET(PETSC_EXTERNAL_LINK_LINE_SAVED "${PETSC_EXTERNAL_LINK_LINE}" CACHE INTERNAL "" FORCE) SET(_hints) SET(_petsc_libraries) - FOREACH(_token ${_external_link_line}}) + FOREACH(_token ${PETSC_EXTERNAL_LINK_LINE}}) IF(_token MATCHES "^-L") # Build up hints with the help of all tokens passed with -L: STRING(REGEX REPLACE "^-L" "" _token "${_token}") @@ -137,7 +142,17 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND") ELSEIF(_token MATCHES "^-l") # Search for every library that was specified with -l: STRING(REGEX REPLACE "^-l" "" _token "${_token}") - IF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s)") + + IF(_new_petsc_external_link_line) + UNSET(PETSC_LIBRARY_${_token} CACHE) + ENDIF() + + IF(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread)$") + FIND_SYSTEM_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token}) + IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND") + LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}}) + ENDIF() + ELSEIF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s)") FIND_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token} HINTS ${_hints} @@ -145,19 +160,13 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND") IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND") LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}}) ENDIF() - # - # Remove from cache, so that updating PETSC search paths will - # find a (possibly) new link interface - # - UNSET(PETSC_LIBRARY_${_token} CACHE) ENDIF() + ENDIF() ENDFOREACH() ENDIF() - - FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG PETSC_LIBRARY PETSC_INCLUDE_DIR_ARCH diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake index 877e550f65..b6526cf4a3 100644 --- a/deal.II/cmake/modules/FindTRILINOS.cmake +++ b/deal.II/cmake/modules/FindTRILINOS.cmake @@ -51,10 +51,10 @@ FIND_PACKAGE(TRILINOS_CONFIG NO_SYSTEM_ENVIRONMENT_PATH ) -IF(NOT "${TRILINOS_CONFIG}" STREQUAL "${TRILINOS_CONFIG_SAVED}") +IF(NOT "${TRILINOS_CONFIG_DIR}" STREQUAL "${TRILINOS_CONFIG_DIR_SAVED}") SET(_new_trilinos_config TRUE) ENDIF() -SET(TRILINOS_CONFIG_SAVED "${TRILINOS_CONFIG}" CACHE INTERNAL "" FORCE) +SET(TRILINOS_CONFIG_DIR_SAVED "${TRILINOS_CONFIG_DIR}" CACHE INTERNAL "" FORCE) # @@ -204,17 +204,15 @@ IF(TRILINOS_FOUND) " TRILINOS_HAS_C99_TR1_WORKAROUND ) - RESET_CMAKE_REQUIRED() - MARK_AS_ADVANCED(TRILINOS_DIR) ELSE() SET(TRILINOS_LIBRARIES) SET(TRILINOS_INCLUDE_DIRS) - SET(TRILINOS_CONFIG_SAVED "" CACHE INTERNAL "" FORCE) + UNSET(TRILINOS_CONFIG_DIR_SAVED CACHE) SET(TRILINOS_DIR "" CACHE PATH "An optional hint to a Trilinos installation" diff --git a/deal.II/cmake/modules/FindUMFPACK.cmake b/deal.II/cmake/modules/FindUMFPACK.cmake index 71f9361e1a..b4048cf40d 100644 --- a/deal.II/cmake/modules/FindUMFPACK.cmake +++ b/deal.II/cmake/modules/FindUMFPACK.cmake @@ -105,6 +105,20 @@ FIND_UMFPACK_LIBRARY(CCOLAMD ccolamd) FIND_UMFPACK_LIBRARY(CAMD camd) FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig) +# +# Test whether libsuitesparseconfig.xxx can be used for shared library +# linkage. If not, exclude it from the command line. +# +LIST(APPEND CMAKE_REQUIRED_LIBRARIES + "-shared" + ${SuiteSparse_config_LIBRARY} + ) +CHECK_CXX_SOURCE_COMPILES("extern int SuiteSparse_version (int[3]); + void foo(int bar[3]) { SuiteSparse_version(bar);}" + LAPACK_SUITESPARSECONFIG_WITH_PIC + ) +RESET_CMAKE_REQUIRED() + IF(EXISTS ${UMFPACK_INCLUDE_DIR}/umfpack.h) FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MAJOR_STRING REGEX "#define.*UMFPACK_MAIN_VERSION") @@ -161,8 +175,10 @@ IF(UMFPACK_FOUND) ${COLAMD_LIBRARY} ${CAMD_LIBRARY} ${AMD_LIBRARY} - ${SuiteSparse_config_LIBRARY} ) + IF(LAPACK_SUITESPARSECONFIG_WITH_PIC OR NOT BUILD_SHARED_LIBS) + LIST(APPEND UMFPACK_LIBRARIES ${SuiteSparse_config_LIBRARY}) + ENDIF() # # For good measure: @@ -179,9 +195,7 @@ IF(UMFPACK_FOUND) # lib does not record its dependence on librt.so as evidenced # by ldd :-( ): # - SWITCH_LIBRARY_PREFERENCE() - FIND_LIBRARY(rt_LIBRARY NAMES rt) - SWITCH_LIBRARY_PREFERENCE() + FIND_SYSTEM_LIBRARY(rt_LIBRARY NAMES rt) MARK_AS_ADVANCED(rt_LIBRARY) IF(NOT rt_LIBRARY MATCHES "-NOTFOUND") LIST(APPEND UMFPACK_LIBRARIES ${rt_LIBRARY}) diff --git a/deal.II/cmake/setup_compiler_flags.cmake b/deal.II/cmake/setup_compiler_flags.cmake index d8eb42447c..0514c8f624 100644 --- a/deal.II/cmake/setup_compiler_flags.cmake +++ b/deal.II/cmake/setup_compiler_flags.cmake @@ -66,11 +66,13 @@ # Check the user provided CXX flags: # -IF( NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}" - OR NOT "${DEAL_II_LINKER_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_LINKER_FLAGS_SAVED}") +IF(NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}" + OR NOT "${DEAL_II_LINKER_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_LINKER_FLAGS_SAVED}") MESSAGE(STATUS "") # Rerun this test if cxx flags changed: UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE) +ELSE() + SET(DEAL_II_HAVE_USABLE_CXX_FLAGS TRUE CACHE INTERNAL "") ENDIF() SET(CACHED_DEAL_II_CXX_FLAGS_SAVED "${DEAL_II_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE) SET(CACHED_DEAL_II_LINKER_FLAGS_SAVED "${DEAL_II_LINKER_FLAGS_SAVED}" CACHE INTERNAL "" FORCE) diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake index 4baa99b615..22e0d65c08 100644 --- a/deal.II/cmake/setup_finalize.cmake +++ b/deal.II/cmake/setup_finalize.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -38,7 +38,7 @@ ENDFOREACH() # # Sanity check: The variables defined in DEAL_II_REMOVED_FLAGS must not be -# used during the comfiguration stage: +# used during the configuration stage: # FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) IF(NOT "${_flag}" STREQUAL "") @@ -52,18 +52,48 @@ FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) ENDFOREACH() # -# Deduplicate entries in DEAL_II_USER_INCLUDE_DIRS +# Deduplicate entries in *_INCLUDE_DIRS and *_LIBRARIES # -REMOVE_DUPLICATES(DEAL_II_USER_INCLUDE_DIRS) +FOREACH(_feature DEAL_II ${DEAL_II_FEATURES}) + FOREACH(_suffix INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS) + REMOVE_DUPLICATES(${_feature}_${_suffix}) + ENDFOREACH() + FOREACH(_suffix LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG) + REMOVE_DUPLICATES(${_feature}_${_suffix} REVERSE) + ENDFOREACH() +ENDFOREACH() # -# Deduplicate entries in DEAL_II_EXTERNAL_LIBRARIES(_...) -# in reverse order: +# Save base configuration into variables BASE_* for later use in +# setup_write_config.cmake: # -REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES REVERSE) +FOREACH(_suffix + CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG + DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG + USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG + LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG + INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS + LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG + ) + SET(BASE_${_suffix} ${DEAL_II_${_suffix}}) +ENDFOREACH() -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES_${_build} REVERSE) +# +# Register features: +# +FOREACH(_feature ${DEAL_II_FEATURES}) + FILTER_SYSTEM_LIBRARIES(${_feature}) + REGISTER_FEATURE(${_feature}) +ENDFOREACH() + +# +# Deduplicate entries one more time :-] +# +FOREACH(_suffix INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS) + REMOVE_DUPLICATES(DEAL_II_${_suffix}) +ENDFOREACH() +FOREACH(_suffix LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG) + REMOVE_DUPLICATES(DEAL_II_${_suffix} REVERSE) ENDFOREACH() # @@ -78,15 +108,10 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES}) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${_build_lowercase} ) ENDFOREACH() -FILE(WRITE - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_source_includes - "" - ) # # Cleanup deal.IITargets.cmake in the build directory: # -FILE(WRITE +FILE(REMOVE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake - "" ) diff --git a/deal.II/cmake/setup_sanity_checks.cmake b/deal.II/cmake/setup_sanity_checks.cmake new file mode 100644 index 0000000000..f8091b7507 --- /dev/null +++ b/deal.II/cmake/setup_sanity_checks.cmake @@ -0,0 +1,72 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2014 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + + +######################################################################## +# # +# Sanity checks: # +# # +######################################################################## + +# +# A quick test whether we're able to successfully link with the given +# compiler and linker flags and the given library link interface: +# + +MESSAGE(STATUS "") +MESSAGE(STATUS "Sanity checks.") + +FOREACH(_build ${DEAL_II_BUILD_TYPES}) + + FOREACH(_var + CXX_FLAGS CXX_FLAGS_${_build} + LINKER_FLAGS LINKER_FLAGS_${_build} + LIBRARIES LIBRARIES_${_build} + ) + IF(NOT "${DEAL_II_${_var}}" STREQUAL "${CACHED_DEAL_II_${_var}_${_build}}") + UNSET(DEAL_II_SANITY_CHECK_${_build} CACHE) + SET(CACHED_DEAL_II_${_var}_${_build} "${DEAL_II_${_var}}" CACHE INTERNAL "" FORCE) + ENDIF() + ENDFOREACH() + + RESET_CMAKE_REQUIRED() + ADD_FLAGS(CMAKE_REQUIRED_FLAGS + "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" + ) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES + "${DEAL_II_LINKER_FLAGS} ${DEAL_II_CXX_LINKER_${_build}}" + ) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES + ${DEAL_II_LIBRARIES} + ${DEAL_II_LIBRARIES_${_build}} + ) + CHECK_CXX_SOURCE_COMPILES("int main(){ return 0; }" + DEAL_II_SANITY_CHECK_${_build} + ) + RESET_CMAKE_REQUIRED() + + IF(NOT DEAL_II_SANITY_CHECK_${_build}) + UNSET(DEAL_II_SANITY_CHECK_${_build} CACHE) + MESSAGE(FATAL_ERROR " + Configuration error: Cannot compile and link with the current set of + compiler flags, linker flags and libraries! + + Please check the test output given at the end of + CMakeFiles/CMakeError.log and consult detailed.log for the current + configuration.\n\n" + ) + ENDIF() +ENDFOREACH() diff --git a/deal.II/cmake/setup_write_config.cmake b/deal.II/cmake/setup_write_config.cmake index f3062a3907..1afca5ff20 100644 --- a/deal.II/cmake/setup_write_config.cmake +++ b/deal.II/cmake/setup_write_config.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -76,31 +76,51 @@ ENDIF() _both("#\n") _detailed( -"# Compiler flags used for this build: -# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS} +"# Base configuration (prior to feature configuration): +# DEAL_II_CXX_FLAGS: ${BASE_CXX_FLAGS} " ) IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n") + _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${BASE_CXX_FLAGS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n") + _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${BASE_CXX_FLAGS_DEBUG}\n") ENDIF() -_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n") +_detailed("# DEAL_II_LINKER_FLAGS: ${BASE_LINKER_FLAGS}\n") IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n") + _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${BASE_LINKER_FLAGS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n") + _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${BASE_LINKER_FLAGS_DEBUG}\n") ENDIF() -_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n") +_detailed("# DEAL_II_DEFINITIONS: ${BASE_DEFINITIONS}\n") IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n") + _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${BASE_DEFINITIONS_RELEASE}\n") ENDIF() IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n") + _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${BASE_DEFINITIONS_DEBUG}\n") +ENDIF() + +_detailed("# DEAL_II_USER_DEFINITIONS: ${BASE_DEFINITIONS}\n") +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_USER_DEFINITIONS_REL: ${BASE_DEFINITIONS_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_USER_DEFINITIONS_DEB: ${BASE_DEFINITIONS_DEBUG}\n") +ENDIF() + +_detailed("# DEAL_II_INCLUDE_DIRS ${BASE_INCLUDE_DIRS}\n") +_detailed("# DEAL_II_USER_INCLUDE_DIRS: ${BASE_USER_INCLUDE_DIRS}\n") +_detailed("# DEAL_II_BUNDLED_INCLUDE_DIRS: ${BASE_BUNDLED_INCLUDE_DIRS}\n") + +_detailed("# DEAL_II_LIBRARIES: ${BASE_LIBRARIES}\n") +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_LIBRARIES_RELEASE: ${BASE_LIBRARIES_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_LIBRARIES_DEBUG: ${BASE_LIBRARIES_DEBUG}\n") ENDIF() _detailed("#\n") @@ -134,50 +154,14 @@ ENDFOREACH() FOREACH(_var ${_features}) IF(${${_var}}) - # FEATURE is enabled + + # + # The feature is enabled: + # STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var}) IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED) _both("# ${_var} set up with external dependencies\n") - - # - # Print out version number: - # - IF(DEFINED ${_feature}_VERSION) - _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") - ENDIF() - - # - # Special version numbers: - # - IF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) - _detailed("# TBB_VERSION = ${TBB_VERSION}\n") - ENDIF() - IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION) - _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n") - ENDIF() - - # - # Print out ${_feature}_DIR: - # - IF(NOT "${${_feature}_DIR}" STREQUAL "") - _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") - ENDIF() - - # - # Print the feature configuration: - # - FOREACH(_var2 - CXX_COMPILER C_COMPILER Fortran_COMPILER LIBRARIES INCLUDE_DIRS - USER_INCLUDE_DIRS DEFINITIONS USER_DEFINITIONS CXX_FLAGS - LINKER_FLAGS - ) - IF(DEFINED ${_feature}_${_var2}) - _detailed("# ${_feature}_${_var2} = ${${_feature}_${_var2}}\n") - ENDIF() - ENDFOREACH() - ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED) - IF(DEAL_II_FORCE_BUNDLED_${_feature}) _both("# ${_var} set up with bundled packages (forced)\n") ELSE() @@ -186,6 +170,47 @@ FOREACH(_var ${_features}) ELSE() _both("# ${_var} = ${${_var}}\n") ENDIF() + + # + # Print out version number: + # + IF(DEFINED ${_feature}_VERSION) + _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") + ENDIF() + + # + # Special version numbers: + # + IF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) + _detailed("# TBB_VERSION = ${TBB_VERSION}\n") + ENDIF() + IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION) + _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n") + ENDIF() + + # + # Print out ${_feature}_DIR: + # + IF(NOT "${${_feature}_DIR}" STREQUAL "") + _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") + ENDIF() + + # + # Print the feature configuration: + # + FOREACH(_var2 + C_COMPILER CXX_COMPILER Fortran_COMPILER + CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG + DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG + USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG + LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG + INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS + LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG + ) + IF(DEFINED ${_feature}_${_var2}) + _detailed("# ${_feature}_${_var2} = ${${_feature}_${_var2}}\n") + ENDIF() + ENDFOREACH() ELSE() # FEATURE is disabled _both("# ( ${_var} = ${${_var}} )\n") diff --git a/deal.II/doc/developers/cmake-internals.html b/deal.II/doc/developers/cmake-internals.html index 3517b168bb..48146dc0c2 100644 --- a/deal.II/doc/developers/cmake-internals.html +++ b/deal.II/doc/developers/cmake-internals.html @@ -343,18 +343,19 @@ RESET_CMAKE_REQUIRED() FATAL_ERROR must be avoided (the only exception is the REQUIRED keyword).
  • - If successful, the following uncached variables might be set: - + If the feature is successfully found, a subset of the following + uncached variables might be set:
     FEATURE_FOUND
    -FEATURE_LIBRARIES
    +FEATURE_LIBRARIES (with optimized, debug, release keywords)
    +FEATURE_LIBRARIES(_DEBUG|_RELEASE)
     FEATURE_INCLUDE_DIRS
    -FEATURE_LINKER_FLAGS
    +FEATURE_LINKER_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_CXX_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_DEFINITIONS(|_DEBUG|_RELEASE)
     
     FEATURE_VERSION
    -FEATURE_VERSION_MAJOR
    -FEATURE_VERSION_MINOR
    -FEATURE_VERSION_SUBMINOR
    +FEATURE_VERSION(_MAJOR|_MINOR|_SUBMINOR)
     
    There are obviously valid exceptions from this rule, though. @@ -363,6 +364,11 @@ There are obviously valid exceptions from this rule, though. "global" variables prefixed by FEATURE_ may be altered. Do not set DEAL_II_* or CMAKE_* variables directly! + +
  • + The find module must define a macro FEATURE_CLEAR that + unsets all cached variables, so that a subsequent call to the find + module starts a completely fresh features search.
  • A hint with FEATURE_DIR can be set up for convenience. It is best to start the Find module by @@ -400,11 +406,15 @@ SET(FEATURE_DIR "" CACHE PATH "An optional hint to a FEATURE directory") module is used to determine whether an external dependency can be resolved or not. Depending on the current state of DEAL_II_WITH_<FEATURE> (see - here) the variables + here) the + configuration variables
     FEATURE_LIBRARIES
    -FEATURE_INCLUDE_DIRS
    -FEATURE_LINKER_FLAGS
    +FEATURE_LIBRARIES(|_DEBUG|_RELEASE)
    +FEATURE_(|USER_|BUNDLED_)INCLUDE_DIRS
    +FEATURE_LINKER_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_CXX_FLAGS(|_DEBUG|_RELEASE)
    +FEATURE_DEFINITIONS(|_DEBUG|_RELEASE)
     
    are appended to the set of global variables and DEAL_II_WITH_<FEATURE> is set to @@ -458,7 +468,7 @@ FEATURE_<FEATURE>_ERROR_MESSAGE() (macro)
  • - In ./bundled/CMakeLists.txt: + In ./bundled/configure_bundled.cmake:
     FEATURE_<FEATURE>_HAVE_BUNDLED         (a boolean)
       - which should either be set to TRUE if all necessary libraries of the
    @@ -492,6 +502,15 @@ DEAL_II_FORCE_BUNDLED_<FEATURE>        (an option)
       LIST(APPEND ...), flags with ADD_FLAGS(...)
       (or if it is necessary to guard them with
       ENABLE_IF_SUPPORTED(...).)
    +

    +

    + Feature configuration must not be added directly to this variables but + to corresponding <FEATURE>_* variables, instead. + Feature configuration variables get appended to the below list of global + configuration variables automatically. +

    + +
    • The general (internal) logic for variables applies: @@ -503,27 +522,32 @@ DEAL_II_FORCE_BUNDLED_<FEATURE> (an option)
  • - For internal use, for setting necessary linker flags for the deal.II library: + For internal and external use, used to keep track of external + libraries, the deal.II library and user + programs have to be linked against:
      -
    • DEAL_II_LINKER_FLAGS -
    • DEAL_II_LINKER_FLAGS_DEBUG -
    • DEAL_II_LINKER_FLAGS_RELEASE +
    • DEAL_II_LIBRARIES +
    • DEAL_II_LIBRARIES_DEBUG +
    • DEAL_II_LIBRARIES_RELEASE
  • - For internal use, for setting necessary compiler flags, e.g. - -std=c++11 (if available): + For internal use, for setting necessary include dirs for the compilation of the + deal.II library:
      -
    • DEAL_II_CXX_FLAGS -
    • DEAL_II_CXX_FLAGS_DEBUG -
    • DEAL_II_CXX_FLAGS_RELEASE +
    • DEAL_II_INCLUDE_DIRS
    -
  • - For internal use, for setting necessary include dirs for the compilation of the - deal.II library: + Used to keep track of external include dirs, necessary for the + compilation of user programs:
      -
    • INCLUDE_DIRECTORIES(...) +
    • DEAL_II_USER_INCLUDE_DIRS +
    +
  • + Include dirs from bundled packages necessary for the compilation fo + the library and user projects out of the build directory: +
      +
    • DEAL_II_BUNDLED_INCLUDE_DIRS
  • @@ -535,17 +559,6 @@ DEAL_II_FORCE_BUNDLED_<FEATURE> (an option)
  • DEAL_II_DEFINITIONS_DEBUG
  • DEAL_II_DEFINITIONS_RELEASE - -
  • - For internal and external use, used to keep track of external - libraries, the deal.II library and user - programs have to be linked against: -
      -
    • DEAL_II_EXTERNAL_LIBRARIES -
    • DEAL_II_EXTERNAL_LIBRARIES_DEBUG -
    • DEAL_II_EXTERNAL_LIBRARIES_RELEASE -
    -
  • For external use, used to keep track of external preprocessor definitions, necessary for the compilation of user programs: @@ -556,11 +569,22 @@ DEAL_II_FORCE_BUNDLED_<FEATURE> (an option)
  • - Used to keep track of external include dirs, necessary for the - compilation of user programs: + For internal and external use, for setting necessary compiler flags, + e.g. -std=c++11 (if available):
      -
    • DEAL_II_USER_INCLUDE_DIRS +
    • DEAL_II_CXX_FLAGS +
    • DEAL_II_CXX_FLAGS_DEBUG +
    • DEAL_II_CXX_FLAGS_RELEASE
    + +
  • + For internal use, for setting necessary linker flags for the deal.II library: +
      +
    • DEAL_II_LINKER_FLAGS +
    • DEAL_II_LINKER_FLAGS_DEBUG +
    • DEAL_II_LINKER_FLAGS_RELEASE +
    +

    diff --git a/deal.II/doc/doxygen/headers/glossary.h b/deal.II/doc/doxygen/headers/glossary.h index 2e3fda1ce7..a110179809 100644 --- a/deal.II/doc/doxygen/headers/glossary.h +++ b/deal.II/doc/doxygen/headers/glossary.h @@ -632,7 +632,7 @@ * is a vector of expension coefficients. Because we don't know their values * yet (we will compute them as the solution of a linear or nonlinear system), * they are called "unknowns" or "degrees of freedom". The second meaning of - * the term con be explained as follows: A mathematical description of finite + * the term can be explained as follows: A mathematical description of finite * element problem is often to say that we are looking for a finite * dimensional function $u_h \in V_h$ that satisfies some set of equations * (e.g. $a(u_h,\varphi_h)=(f,\varphi_h)$ for all test functions $\varphi_h\in diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 73d5cb20e9..6a14027983 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -15,7 +15,7 @@ // --------------------------------------------------------------------- /** -// * @page changes_after_8_1 Changes after Version 8.1 +@page changes_after_8_1 Changes after Version 8.1

    This is the list of changes made after the release of @@ -40,6 +40,28 @@ inconvenience this causes.

      +
    1. Changed: The various classes generating graphical output, such + as DataOut or DataOutStack, are all derived from a common interface + class DataOutInterface which, in turn was derived from DataOutBase + through private inheritance. Because we frequently also + access the (public) members of this private base class this has tripped + up most every compiler we know of at one point or another. Furthermore, + because DataOutBase was a class that only defined static member functions + and had not member variables, there was really no reason for this + construct. +
      + For these reasons, DataOutBase is now just a regular namespace and the + inheritance is gone. For the most part, this should not lead to any + incompatibilities except in cases where you accessed members of + DataOutBase through their derived classes. For example, it was possible + to write DataOut@<2@>::Patch@<2,2@> even though the + Patch class is actually declared in DataOutBase. Since + the inheritance is now gone, this is no longer possible and one + actually has to write DataOutBase::Patch instead. Using this form + turns out to be compatible also with older versions of deal.II. +
      + (Wolfgang Bangerth, 2014/02/01) +
    @@ -102,8 +124,60 @@ inconvenience this causes.

    Specific improvements

      +
    1. Changed: DerivativeApproximation used to be a class that only had + static members. It is now a namespace. +
      + (Wolfgang Bangerth, 2014/02/08) + +
    2. New: ThreadLocalStorage::clear() clears out all objects allocated on the + current and all other threads. +
      + (Wolfgang Bangerth, 2014/02/06) + +
    3. Fixed: A configuration error on Debian Testing where accidentally a + non-pic libSuiteSparse_config.a was picked up when building a shared + library up resulting in a link error. +
      + (Matthias Maier, 2014/02/04) + +
    4. Changed: GridTools::transform() can now deal with meshes with hanging nodes. +
      + (Timo Heister, 2014/02/04) +
    5. + +
    6. Fixed: Calling FEValuesViews::Vector::get_function_curls() computed + wrong results in some cases (see https://code.google.com/p/dealii/issues/detail?id=182). + This is now fixed. +
      + (Christoph Heiniger, Wolfgang Bangerth, 2014/02/03) + +
    7. Added: The class LAPACKFullMatrix now implements interfaces to + matrix-matrix multiplication. Also, LAPACKFullMatrix::apply_lu_factorization + now also operates on multiple right hand sides in form of another + LAPACKFullMatrix. +
      + (Martin Kronbichler, 2014/02/03) + +
    8. Added: A sanity check for the full link interface at configure time. + Hopefully this prevents some people from compiling the whole library just + to hit a link error. +
      + (Matthias Maier, 2014/02/01) + +
    9. Fixed: The build system does no longer record full paths to system + libraries but uses the appropriate short names instead. +
      + (Matthias Maier, 2014/02/01) + +
    10. Reworked: External feature setup. Disabling a feature now cleans up + associated internal, cached variables. A per-feature linkage test now spots + common linking inconsistencies early in the configuration stage (and not + just after a complete compilation). +
      + (Matthias Maier, 2014/02/01) +
    11. New/fixed: The ParameterHandler::print_parameters_section - method not worked for XML output. There is now a flag + method did not work for XML output. There is now a flag include_top_level_elements which prints all higher subsection elements, default is false. For XML output setting this flag to true is required diff --git a/deal.II/doc/publications/index.html b/deal.II/doc/publications/index.html index f33462423a..3dc872d59a 100644 --- a/deal.II/doc/publications/index.html +++ b/deal.II/doc/publications/index.html @@ -315,6 +315,15 @@ Pressurized Fractures
      Comput. Methods Appl. Mech. Engrg., vol. 271, pp. 69-85, 2014.
    12. + +
    13. J. Willems +
      + Robust Multilevel Methods for General Symmetric Positive Definite Operators + +
      + SIAM J. Numer. Anal. 52 (2014), no. 1, 103-124. +
    14. +
    @@ -417,7 +426,7 @@ Pressurized Fractures
    Adaptive Finite Element Methods for Elliptic Problems with Discontinuous Coefficients
    - SIAM J. Numer. Anal. 51 (2013), no. 6, 3106--3134. + SIAM J. Numer. Anal. 51 (2013), no. 6, 3106-3134.
  • A. Bonito, R. Glowinski @@ -454,7 +463,7 @@ Pressurized Fractures
    Time-discrete higher order ALE formulations: Stability
    - SIAM J. Numer. Anal., 51(1), 577--608, 2013. + SIAM J. Numer. Anal., 51(1), 577-608, 2013.
  • A. Bonito, J. E. Pasciak diff --git a/deal.II/examples/step-13/step-13.cc b/deal.II/examples/step-13/step-13.cc index cd1f9525b7..189f1f7077 100644 --- a/deal.II/examples/step-13/step-13.cc +++ b/deal.II/examples/step-13/step-13.cc @@ -1,7 +1,7 @@ /* --------------------------------------------------------------------- * $Id$ * - * Copyright (C) 2001 - 2013 by the deal.II authors + * Copyright (C) 2001 - 2014 by the deal.II authors * * This file is part of the deal.II library. * @@ -343,15 +343,14 @@ namespace Step13 // program we shall generate output (from this we will then also generate // the suffix of the filename to which we write). // - // Regarding the output format, the DataOutInterface class - // (which is a base class of DataOut through which we will - // access its fields) provides an enumeration field - // OutputFormat, which lists names for all supported output + // Regarding the output format, the DataOutBase namespace + // provides an enumeration field + // DataOutBase::OutputFormat which lists names for all supported output // formats. At the time of writing of this program, the supported graphics // formats are represented by the enum values ucd, // gnuplot, povray, eps, // gmv, tecplot, tecplot_binary, - // dx, and vtk, but this list will certainly + // dx, vtk, etc, but this list will certainly // grow over time. Now, within various functions of that base class, you // can use values of this type to get information about these graphics // formats (for example the default suffix used for files of each format), @@ -372,21 +371,21 @@ namespace Step13 class SolutionOutput : public EvaluationBase { public: - SolutionOutput (const std::string &output_name_base, - const typename DataOut::OutputFormat output_format); + SolutionOutput (const std::string &output_name_base, + const DataOutBase::OutputFormat output_format); virtual void operator () (const DoFHandler &dof_handler, const Vector &solution) const; private: - const std::string output_name_base; - const typename DataOut::OutputFormat output_format; + const std::string output_name_base; + const DataOutBase::OutputFormat output_format; }; template SolutionOutput:: - SolutionOutput (const std::string &output_name_base, - const typename DataOut::OutputFormat output_format) + SolutionOutput (const std::string &output_name_base, + const DataOutBase::OutputFormat output_format) : output_name_base (output_name_base), output_format (output_format) @@ -396,7 +395,7 @@ namespace Step13 // After the description above, the function generating the actual output // is now relatively straightforward. The only particularly interesting // feature over previous example programs is the use of the - // DataOut::default_suffix function, returning the usual + // DataOutBase::default_suffix function, returning the usual // suffix for files of a given format (e.g. ".eps" for encapsulated // postscript files, ".gnuplot" for Gnuplot files), and of the generic // DataOut::write function with a second argument, which @@ -1489,7 +1488,7 @@ namespace Step13 // Also generate an evaluator which writes out the solution: Evaluation::SolutionOutput postprocessor2 (std::string("solution-")+solver_name, - DataOut::gnuplot); + DataOutBase::gnuplot); // Take these two evaluation objects and put them in a list... std::list *> postprocessor_list; diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index 23590f9d8b..bcb7d493ed 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -1,7 +1,7 @@ /* --------------------------------------------------------------------- * $Id$ * - * Copyright (C) 2002 - 2013 by the deal.II authors + * Copyright (C) 2002 - 2014 by the deal.II authors * * This file is part of the deal.II library. * @@ -875,7 +875,7 @@ namespace Step14 << std::ends; std::ofstream out (filename.str().c_str()); - data_out.write (out, DataOut::gnuplot); + data_out.write (out, DataOutBase::gnuplot); } @@ -2399,7 +2399,7 @@ namespace Step14 << std::ends; std::ofstream out (filename.str().c_str()); - data_out.write (out, DataOut::gnuplot); + data_out.write (out, DataOutBase::gnuplot); } diff --git a/deal.II/examples/step-2/doc/intro.dox b/deal.II/examples/step-2/doc/intro.dox index 3c2412609a..61b5a33244 100644 --- a/deal.II/examples/step-2/doc/intro.dox +++ b/deal.II/examples/step-2/doc/intro.dox @@ -16,7 +16,7 @@ function, in the form $u_h(\mathbf x) = \sum_{j=0}^{N-1} U_j \varphi_j(\mathbf x)$. Here, $U_j$ is a vector of expansion coefficients. Because we don't know their values yet (we will compute them as the solution of a linear or nonlinear system), they are called "unknowns" or "degrees of freedom". The -second meaning of the term con be explained as follows: A mathematical +second meaning of the term can be explained as follows: A mathematical description of finite element problem is often to say that we are looking for a finite dimensional function $u_h \in V_h$ that satisfies some set of equations (e.g. $a(u_h,\varphi_h)=(f,\varphi_h)$ for all test functions $\varphi_h\in diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index e3fca00b1e..52dda1eb45 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -273,7 +273,7 @@ Step6::~Step6 () // The next function is setting up all the variables that describe the linear // finite element problem, such as the DoF handler, the matrices, and // vectors. The difference to what we did in step-5 is only that we now also -// have to take care of handing node constraints. These constraints are +// have to take care of hanging node constraints. These constraints are // handled almost transparently by the library, i.e. you only need to know // that they exist and how to get them, but you do not have to know how they // are formed or what exactly is done with them. diff --git a/deal.II/include/deal.II/algorithms/newton.templates.h b/deal.II/include/deal.II/algorithms/newton.templates.h index b1380d6e4e..16c6b74483 100644 --- a/deal.II/include/deal.II/algorithms/newton.templates.h +++ b/deal.II/include/deal.II/algorithms/newton.templates.h @@ -80,7 +80,17 @@ namespace Algorithms inverse_derivative->notify(e); } - + + template + double + Newton::threshold(const double thr) + { + const double t = assemble_threshold; + assemble_threshold = thr; + return t; + } + + template void Newton::operator() (NamedData &out, const NamedData &in) diff --git a/deal.II/include/deal.II/base/data_out_base.h b/deal.II/include/deal.II/base/data_out_base.h index 0d9ee2bbf3..ea0a249a98 100644 --- a/deal.II/include/deal.II/base/data_out_base.h +++ b/deal.II/include/deal.II/base/data_out_base.h @@ -44,7 +44,6 @@ DEAL_II_NAMESPACE_OPEN class ParameterHandler; class XDMFEntry; -class DataOutFilter; /** * This is a base class for output of data on meshes of very general @@ -142,11 +141,9 @@ class DataOutFilter; * *

    DataOutBaseInterface

    * - * This class has an interface that is not usually called by a user - * directly; also, it consists of static functions - * only. Usually, derived classes will inherit this class - * protected to hide this interface to the users of thes - * classes. + * The members of this namespace are not usually called from user code + * directly. Rather, classes that use the functions declared here + * are typically derived from DataOutInterface. * * The interface of this class basically consists of the declaration of a data * type describing a patch and a bunch of functions taking a list of patches @@ -216,9 +213,8 @@ class DataOutFilter; * @ingroup output * @author Wolfgang Bangerth, Guido Kanschat 1999, 2000, 2001, 2002, 2005, 2006. */ -class DataOutBase +namespace DataOutBase { -public: /** * Data structure describing a patch of data in dim space * dimensions. @@ -1108,7 +1104,7 @@ public: * understand. */ static const unsigned int format_version = 3; - + private: /** * Dummy entry to suppress compiler warnings when copying an empty @@ -1461,11 +1457,11 @@ public: * contrib/dx. */ template - static void write_dx (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const DXFlags &flags, - std::ostream &out); + void write_dx (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const DXFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in eps format. @@ -1513,11 +1509,11 @@ public: * class. See there for more and detailed information. */ template - static void write_eps (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const EpsFlags &flags, - std::ostream &out); + void write_eps (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const EpsFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in @@ -1530,11 +1526,11 @@ public: * space is interpolated to (bi-,tri-)linear elements. */ template - static void write_gmv (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const GmvFlags &flags, - std::ostream &out); + void write_gmv (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const GmvFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in gnuplot @@ -1597,11 +1593,11 @@ public: * cut-surface are plotted. */ template - static void write_gnuplot (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const GnuplotFlags &flags, - std::ostream &out); + void write_gnuplot (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const GnuplotFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream for the @@ -1651,11 +1647,11 @@ public: * included in the povray options. */ template - static void write_povray (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const PovrayFlags &flags, - std::ostream &out); + void write_povray (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const PovrayFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in @@ -1665,11 +1661,11 @@ public: * manuals. */ template - static void write_tecplot (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const TecplotFlags &flags, - std::ostream &out); + void write_tecplot (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const TecplotFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in @@ -1693,7 +1689,7 @@ public: * manuals. */ template - static void write_tecplot_binary ( + void write_tecplot_binary ( const std::vector > &patches, const std::vector &data_names, const std::vector > &vector_data_ranges, @@ -1716,11 +1712,11 @@ public: * patch to the same value. */ template - static void write_ucd (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const UcdFlags &flags, - std::ostream &out); + void write_ucd (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const UcdFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in VTK @@ -1742,11 +1738,11 @@ public: * latter file format instead, by using the write_vtu() function. */ template - static void write_vtk (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const VtkFlags &flags, - std::ostream &out); + void write_vtk (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const VtkFlags &flags, + std::ostream &out); /** @@ -1773,11 +1769,11 @@ public: * The use of this function is explained in step-40. */ template - static void write_vtu (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const VtkFlags &flags, - std::ostream &out); + void write_vtu (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const VtkFlags &flags, + std::ostream &out); /** * This writes the header for the xml based vtu file format. This @@ -1785,8 +1781,8 @@ public: * DataOutInterface::write_vtu_footer() and DataOutInterface::write_vtu_main() * by DataOutBase::write_vtu(). */ - static void write_vtu_header (std::ostream &out, - const VtkFlags &flags); + void write_vtu_header (std::ostream &out, + const VtkFlags &flags); /** * This writes the footer for the xml based vtu file format. This @@ -1794,7 +1790,7 @@ public: * DataOutInterface::write_vtu_header() and DataOutInterface::write_vtu_main() * by DataOutBase::write_vtu(). */ - static void write_vtu_footer (std::ostream &out); + void write_vtu_footer (std::ostream &out); /** * This writes the main part for the xml based vtu file format. This @@ -1803,11 +1799,11 @@ public: * by DataOutBase::write_vtu(). */ template - static void write_vtu_main (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const VtkFlags &flags, - std::ostream &out); + void write_vtu_main (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const VtkFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in SVG format. @@ -1827,15 +1823,15 @@ public: * the data values at the vertices taken from the specified data * vector. A colorbar can be drawn to encode the coloring. * - * @note Yet only implemented for two dimensions with an additional - * dimension reserved for data information. + * @note This function is so far only implemented for two dimensions + * with an additional dimension reserved for data information. */ - template - static void write_svg (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const SvgFlags &flags, - std::ostream &out); + template + void write_svg (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const SvgFlags &flags, + std::ostream &out); /** * Write the given list of patches to the output stream in deal.II @@ -1878,7 +1874,7 @@ public: * the ending .d2. */ template - static void write_deal_II_intermediate ( + void write_deal_II_intermediate ( const std::vector > &patches, const std::vector &data_names, const std::vector > &vector_data_ranges, @@ -1890,10 +1886,10 @@ public: * the mesh and solution values. */ template - static void write_hdf5_parallel (const std::vector > &patches, - const DataOutFilter &data_filter, - const std::string &filename, - MPI_Comm comm); + void write_hdf5_parallel (const std::vector > &patches, + const DataOutFilter &data_filter, + const std::string &filename, + MPI_Comm comm); /** * Write the data in data_filter to HDF5 file(s). If write_mesh_file @@ -1903,12 +1899,12 @@ public: * contain both mesh data and solution values. */ template - static void write_hdf5_parallel (const std::vector > &patches, - const DataOutFilter &data_filter, - const bool write_mesh_file, - const std::string &mesh_filename, - const std::string &solution_filename, - MPI_Comm comm); + void write_hdf5_parallel (const std::vector > &patches, + const DataOutFilter &data_filter, + const bool write_mesh_file, + const std::string &mesh_filename, + const std::string &solution_filename, + MPI_Comm comm); /** * DataOutFilter is an intermediate data format that reduces the amount of @@ -1917,10 +1913,10 @@ public: * see, for example, DataOutBase::write_hdf5_parallel(). */ template - static void write_filtered_data (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - DataOutFilter &filtered_data); + void write_filtered_data (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + DataOutFilter &filtered_data); /** * Given an input stream that contains data written by @@ -1934,7 +1930,6 @@ public: * to either reset the stream to its previous position, or close and * reopen it. */ - static std::pair determine_intermediate_format_dimensions (std::istream &input); @@ -1943,9 +1938,7 @@ public: * string. If the string does not match any known format, an * exception is thrown. * - * Since this function does not need data from this object, it is - * static and can thus be called without creating an object of this - * class. Its main purpose is to allow a program to use any + * The main purpose of this function is to allow a program to use any * implemented output format without the need to extend the * program's parser each time a new format is implemented. * @@ -1953,14 +1946,14 @@ public: * it to the ParameterHandler class, use the function * get_output_format_names(). */ - static OutputFormat parse_output_format (const std::string &format_name); + OutputFormat parse_output_format (const std::string &format_name); /** * Return a list of implemented output formats. The different names * are separated by vertical bar signs (`|') as used by the * ParameterHandler classes. */ - static std::string get_output_format_names (); + std::string get_output_format_names (); /** * Provide a function which tells us which suffix a file with a @@ -1981,17 +1974,7 @@ public: *
  • deal_II_intermediate: .d2. * */ - static std::string default_suffix (const OutputFormat output_format); - - /** - * Determine an estimate for the memory consumption (in bytes) of - * this object. Since sometimes the size of objects can not be - * determined exactly (for example: what is the memory consumption - * of an STL std::map type with a certain number of - * elements?), this is only an estimate. however often quite close - * to the true value. - */ - static std::size_t memory_consumption (); + std::string default_suffix (const OutputFormat output_format); /** @addtogroup Exceptions * @{ */ @@ -2020,151 +2003,13 @@ public: << " for output"); //@} -private: - /** - * Write the coordinates of nodes in the desired format. - */ - template - static void write_nodes (const std::vector > &patches, - STREAM &out); - - /** - * Write the node numbers of a cell in the desired format. - */ - template - static void write_cells (const std::vector > &patches, - STREAM &out); - - /** - * Write data in the desired format. - */ - template - static void write_data (const std::vector > &patches, - const unsigned int n_data_sets, - const bool double_precision, - STREAM &out); - - - /** - * This function projects a three-dimensional point (Point<3> point) - * onto a two-dimensional image plane, specified by the position of - * the camera viewing system (Point<3> camera_position), camera - * direction (Point<3> camera_position), camera horizontal (Point<3> - * camera_horizontal, necessary for the correct alignment of the - * later images), and the focus of the camera (float camera_focus). - * - * For SVG output. - */ - static Point<2> svg_project_point(Point<3> point, - Point<3> camera_position, - Point<3> camera_direction, - Point<3> camera_horizontal, - float camera_focus); - /** - * Function to compute the gradient parameters for a triangle with - * given values for the vertices. - * - * Used for svg output. - */ - static Point<6> svg_get_gradient_parameters(Point<3> points[]); - - /** - * Class holding the data of one cell of a patch in two space - * dimensions for output. It is the projection of a cell in - * three-dimensional space (two coordinates, one height value) to - * the direction of sight. - */ - class SvgCell - { - public: - - // Center of the cell (three-dimensional) - Point<3> center; - - /** - * Vector of vertices of this cell (three-dimensional) - */ - Point<3> vertices[4]; - - /** - * Depth into the picture, which is defined as the distance from - * an observer at an the origin in direction of the line of sight. - */ - float depth; - - /** - * Vector of vertices of this cell (projected, two-dimensional). - */ - Point<2> projected_vertices[4]; - - // Center of the cell (projected, two-dimensional) - Point<2> projected_center; - - /** - * Comparison operator for sorting. - */ - bool operator < (const SvgCell &) const; - }; - - - /** - * Class holding the data of one cell of a patch in two space - * dimensions for output. It is the projection of a cell in - * three-dimensional space (two coordinates, one height value) to - * the direction of sight. - */ - class EpsCell2d - { - public: - - /** - * Vector of vertices of this cell. - */ - Point<2> vertices[4]; - - /** - * Data value from which the actual colors will be computed by the - * colorization function stated in the EpsFlags class. - */ - float color_value; - - /** - * Depth into the picture, which is defined as the distance from - * an observer at an the origin in direction of the line of sight. - */ - float depth; - - /** - * Comparison operator for sorting. - */ - bool operator < (const EpsCell2d &) const; - }; - - - /** - * This is a helper function for the write_gmv() function. There, - * the data in the patches needs to be copied around as output is - * one variable globally at a time, rather than all data on each - * vertex at a time. This copying around can be done detached from - * the main thread, and is thus moved into this separate function. - * - * Note that because of the similarity of the formats, this function - * is also used by the Vtk and Tecplot output functions. - */ - template - static void - write_gmv_reorder_data_vectors (const std::vector > &patches, - Table<2,double> &data_vectors); - - - -}; +} /** - * This class is the interface to the DataOutBase class, as already its name + * This class is the interface to the functions in the DataOutBase namespace, as already its name * might suggest. It does not offer much functionality apart from a way to * access the implemented formats and a way to dynamically dispatch what output * format to chose. @@ -2278,36 +2123,9 @@ private: * @author Wolfgang Bangerth, 1999 */ template -class DataOutInterface : private DataOutBase +class DataOutInterface { public: - /* - * Import a few names that were - * previously in this class and have then - * moved to the base class. Since the - * base class is inherited from - * privately, we need to re-import these - * symbols to make sure that references - * to DataOutInterface::XXX - * remain valid. - */ - using DataOutBase::OutputFormat; - using DataOutBase::default_format; - using DataOutBase::dx; - using DataOutBase::gnuplot; - using DataOutBase::povray; - using DataOutBase::eps; - using DataOutBase::tecplot; - using DataOutBase::tecplot_binary; - using DataOutBase::vtk; - using DataOutBase::vtu; - using DataOutBase::deal_II_intermediate; - using DataOutBase::parse_output_format; - using DataOutBase::get_output_format_names; - using DataOutBase::determine_intermediate_format_dimensions; - - using DataOutBase::Patch; - /** * Constructor. */ @@ -2630,7 +2448,7 @@ public: * the mesh and solution data were written to a single file. See * write_xdmf_file() for an example of usage. */ - XDMFEntry create_xdmf_entry (const DataOutFilter &data_filter, + XDMFEntry create_xdmf_entry (const DataOutBase::DataOutFilter &data_filter, const std::string &h5_filename, const double cur_time, MPI_Comm comm) const; @@ -2640,7 +2458,7 @@ public: * the mesh and solution data were written to separate files. See * write_xdmf_file() for an example of usage. */ - XDMFEntry create_xdmf_entry (const DataOutFilter &data_filter, + XDMFEntry create_xdmf_entry (const DataOutBase::DataOutFilter &data_filter, const std::string &h5_mesh_filename, const std::string &h5_solution_filename, const double cur_time, @@ -2674,7 +2492,8 @@ public: * single HDF5 file containing both the mesh and solution values. @deprecated: use write_hdf5_parallel(DataOutFilter, ...) instead */ - void write_hdf5_parallel (const std::string &filename, MPI_Comm comm) const DEAL_II_DEPRECATED; + void write_hdf5_parallel (const std::string &filename, + MPI_Comm comm) const DEAL_II_DEPRECATED; /** * Write the data in data_filter to a single HDF5 file containing both @@ -2689,7 +2508,8 @@ public: * data_out.write_hdf5_parallel(data_filter, "solution.h5", MPI_COMM_WORLD); * @endcode */ - void write_hdf5_parallel (const DataOutFilter &data_filter, const std::string &filename, MPI_Comm comm) const; + void write_hdf5_parallel (const DataOutBase::DataOutFilter &data_filter, + const std::string &filename, MPI_Comm comm) const; /** * Write the data in data_filter to HDF5 file(s). If write_mesh_file @@ -2698,7 +2518,8 @@ public: * is true and the filenames are the same, the resulting file will * contain both mesh data and solution values. */ - void write_hdf5_parallel (const DataOutFilter &data_filter, const bool write_mesh_file, const std::string &mesh_filename, const std::string &solution_filename, MPI_Comm comm) const; + void write_hdf5_parallel (const DataOutBase::DataOutFilter &data_filter, + const bool write_mesh_file, const std::string &mesh_filename, const std::string &solution_filename, MPI_Comm comm) const; /** * DataOutFilter is an intermediate data format that reduces the amount of @@ -2706,7 +2527,7 @@ public: * can then later be used again to write data in a concrete file format; * see, for example, DataOutBase::write_hdf5_parallel(). */ - void write_filtered_data (DataOutFilter &filtered_data) const; + void write_filtered_data (DataOutBase::DataOutFilter &filtered_data) const; /** @@ -2724,64 +2545,64 @@ public: * format is default_format. */ void write (std::ostream &out, - const OutputFormat output_format = default_format) const; + const DataOutBase::OutputFormat output_format = DataOutBase::default_format) const; /** * Set the default format. The value set here is used anytime, * output for format default_format is requested. */ - void set_default_format (const OutputFormat default_format); + void set_default_format (const DataOutBase::OutputFormat default_format); /** * Set the flags to be used for output in OpenDX format. */ - void set_flags (const DXFlags &dx_flags); + void set_flags (const DataOutBase::DXFlags &dx_flags); /** * Set the flags to be used for output in UCD format. */ - void set_flags (const UcdFlags &ucd_flags); + void set_flags (const DataOutBase::UcdFlags &ucd_flags); /** * Set the flags to be used for output in GNUPLOT format. */ - void set_flags (const GnuplotFlags &gnuplot_flags); + void set_flags (const DataOutBase::GnuplotFlags &gnuplot_flags); /** * Set the flags to be used for output in POVRAY format. */ - void set_flags (const PovrayFlags &povray_flags); + void set_flags (const DataOutBase::PovrayFlags &povray_flags); /** * Set the flags to be used for output in EPS output. */ - void set_flags (const EpsFlags &eps_flags); + void set_flags (const DataOutBase::EpsFlags &eps_flags); /** * Set the flags to be used for output in GMV format. */ - void set_flags (const GmvFlags &gmv_flags); + void set_flags (const DataOutBase::GmvFlags &gmv_flags); /** * Set the flags to be used for output in Tecplot format. */ - void set_flags (const TecplotFlags &tecplot_flags); + void set_flags (const DataOutBase::TecplotFlags &tecplot_flags); /** * Set the flags to be used for output in VTK format. */ - void set_flags (const VtkFlags &vtk_flags); + void set_flags (const DataOutBase::VtkFlags &vtk_flags); /** * Set the flags to be used for output in SVG format. */ - void set_flags (const SvgFlags &svg_flags); + void set_flags (const DataOutBase::SvgFlags &svg_flags); /** * Set the flags to be used for output in deal.II intermediate * format. */ - void set_flags (const Deal_II_IntermediateFlags &deal_II_intermediate_flags); + void set_flags (const DataOutBase::Deal_II_IntermediateFlags &deal_II_intermediate_flags); /** * A function that returns the same string as the respective @@ -2792,7 +2613,7 @@ public: * calling this function. */ std::string - default_suffix (const OutputFormat output_format = default_format) const; + default_suffix (const DataOutBase::OutputFormat output_format = DataOutBase::default_format) const; /** * Declare parameters for all output formats by declaring @@ -2840,7 +2661,7 @@ protected: * functions to know what they shall print. */ virtual - const std::vector > & + const std::vector > & get_patches () const = 0; /** @@ -2887,73 +2708,73 @@ private: * default_format is requested. It can be changed by the * set_format function or in a parameter file. */ - OutputFormat default_fmt; + DataOutBase::OutputFormat default_fmt; /** * Flags to be used upon output of OpenDX data. Can be changed by * using the set_flags function. */ - DXFlags dx_flags; + DataOutBase::DXFlags dx_flags; /** * Flags to be used upon output of UCD data. Can be changed by using * the set_flags function. */ - UcdFlags ucd_flags; + DataOutBase::UcdFlags ucd_flags; /** * Flags to be used upon output of GNUPLOT data. Can be changed by * using the set_flags function. */ - GnuplotFlags gnuplot_flags; + DataOutBase::GnuplotFlags gnuplot_flags; /** * Flags to be used upon output of POVRAY data. Can be changed by * using the set_flags function. */ - PovrayFlags povray_flags; + DataOutBase::PovrayFlags povray_flags; /** * Flags to be used upon output of EPS data in one space * dimension. Can be changed by using the set_flags * function. */ - EpsFlags eps_flags; + DataOutBase::EpsFlags eps_flags; /** * Flags to be used upon output of gmv data in one space * dimension. Can be changed by using the set_flags * function. */ - GmvFlags gmv_flags; + DataOutBase::GmvFlags gmv_flags; /** * Flags to be used upon output of Tecplot data in one space * dimension. Can be changed by using the set_flags * function. */ - TecplotFlags tecplot_flags; + DataOutBase::TecplotFlags tecplot_flags; /** * Flags to be used upon output of vtk data in one space * dimension. Can be changed by using the set_flags * function. */ - VtkFlags vtk_flags; + DataOutBase::VtkFlags vtk_flags; /** * Flags to be used upon output of svg data in one space * dimension. Can be changed by using the set_flags * function. */ - SvgFlags svg_flags; + DataOutBase::SvgFlags svg_flags; /** * Flags to be used upon output of deal.II intermediate data in one * space dimension. Can be changed by using the set_flags * function. */ - Deal_II_IntermediateFlags deal_II_intermediate_flags; + DataOutBase::Deal_II_IntermediateFlags deal_II_intermediate_flags; }; @@ -3077,7 +2898,7 @@ protected: * It returns the patches as read the last time a stream was given * to the read() function. */ - virtual const std::vector > & + virtual const std::vector > & get_patches () const; /** @@ -3117,7 +2938,7 @@ private: * Arrays holding the set of patches as well as the names of output * variables, all of which we read from an input stream. */ - std::vector > patches; + std::vector > patches; std::vector dataset_names; /** @@ -3200,45 +3021,47 @@ public: /* -------------------- inline functions ------------------- */ -inline -bool -DataOutBase::EpsFlags::RgbValues::is_grey () const +namespace DataOutBase { - return (red == green) && (red == blue); -} - + inline + bool + EpsFlags::RgbValues::is_grey () const + { + return (red == green) && (red == blue); + } -/* -------------------- template functions ------------------- */ -/** - * Output operator for an object of type - * DataOutBase::Patch. This operator dumps the intermediate - * graphics format represented by the patch data structure. It may - * later be converted into regular formats for a number of graphics - * programs. - * - * @author Wolfgang Bangerth, 2005 - */ -template -std::ostream & -operator << (std::ostream &out, - const DataOutBase::Patch &patch); + /* -------------------- template functions ------------------- */ + /** + * Output operator for an object of type + * DataOutBase::Patch. This operator dumps the intermediate + * graphics format represented by the patch data structure. It may + * later be converted into regular formats for a number of graphics + * programs. + * + * @author Wolfgang Bangerth, 2005 + */ + template + std::ostream & + operator << (std::ostream &out, + const Patch &patch); -/** - * Input operator for an object of type - * DataOutBase::Patch. This operator reads the intermediate - * graphics format represented by the patch data structure, using the - * format in which it was written using the operator<<. - * - * @author Wolfgang Bangerth, 2005 - */ -template -std::istream & -operator >> (std::istream &in, - DataOutBase::Patch &patch); + /** + * Input operator for an object of type + * DataOutBase::Patch. This operator reads the intermediate + * graphics format represented by the patch data structure, using the + * format in which it was written using the operator<<. + * + * @author Wolfgang Bangerth, 2005 + */ + template + std::istream & + operator >> (std::istream &in, + Patch &patch); +} DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/include/deal.II/base/function.h b/deal.II/include/deal.II/base/function.h index 616f6de210..19ddcd716d 100644 --- a/deal.II/include/deal.II/base/function.h +++ b/deal.II/include/deal.II/base/function.h @@ -193,7 +193,7 @@ public: * values already has the right size, i.e. the same size as the * points array. * - * Be default, this function repeatedly calls value() for each point + * By default, this function repeatedly calls value() for each point * separately, to fill the output array. */ virtual void value_list (const std::vector > &points, @@ -207,7 +207,7 @@ public: * all elements be vectors with the same number of components as this * function has. * - * Be default, this function repeatedly calls vector_value() for each + * By default, this function repeatedly calls vector_value() for each * point separately, to fill the output array. */ virtual void vector_value_list (const std::vector > &points, diff --git a/deal.II/include/deal.II/base/function_parser.h b/deal.II/include/deal.II/base/function_parser.h index 7f1429eae4..eab0bbea85 100644 --- a/deal.II/include/deal.II/base/function_parser.h +++ b/deal.II/include/deal.II/base/function_parser.h @@ -94,7 +94,7 @@ template class Vector; // Define the expressions of the individual components of a // vector valued function with two components: std::vector expressions(1); - expressions[0] = "x cm + y m + PI cm; + expressions[0] = "x cm + y m + PI cm"; // Generate an empty function for these two components. FunctionParser<2> vector_function; diff --git a/deal.II/include/deal.II/base/smartpointer.h b/deal.II/include/deal.II/base/smartpointer.h index f61e2b3681..d2435f1883 100644 --- a/deal.II/include/deal.II/base/smartpointer.h +++ b/deal.II/include/deal.II/base/smartpointer.h @@ -472,7 +472,15 @@ SmartPointer::memory_consumption () const - +// The following function is not strictly necessary but is an optimization +// for places where you call swap(p1,p2) with SmartPointer objects p1, p2. +// Unfortunately, MS Visual Studio (at least up to the 2013 edition) trips +// over it when calling std::swap(v1,v2) where v1,v2 are std::vectors of +// SmartPointer objects: it can't determine whether it should call std::swap +// or dealii::swap on the individual elements (see bug #184 on our Google Code +// site. Consequently, just take this function out of the competition for this +// compiler. +#ifndef _MSC_VER /** * Global function to swap the contents of two smart pointers. As both * objects to which the pointers point retain to be subscribed to, we @@ -484,7 +492,7 @@ void swap (SmartPointer &t1, SmartPointer &t2) { t1.swap (t2); } - +#endif /** diff --git a/deal.II/include/deal.II/base/thread_local_storage.h b/deal.II/include/deal.II/base/thread_local_storage.h index dccaa2f61f..70d71b75ed 100644 --- a/deal.II/include/deal.II/base/thread_local_storage.h +++ b/deal.II/include/deal.II/base/thread_local_storage.h @@ -1,7 +1,7 @@ // --------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2011 - 2013 by the deal.II authors +// Copyright (C) 2011 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -84,7 +84,7 @@ namespace Threads /** * Copy constructor. Initialize each thread local object * with the corresponding object of the given object. - **/ + */ ThreadLocalStorage (const ThreadLocalStorage &t); /** @@ -132,17 +132,37 @@ namespace Threads ThreadLocalStorage &operator = (const T &t); /** - * Returns a reference to the internal implementation. + * Remove the thread-local objects stored for all threads that have + * created one with this object (i.e., that have called get() + * at least once on this thread. This includes the current thread. If you + * call get() subsequently on this or any other thread, new objects will + * again be created. + * + * If deal.II has been configured to not use multithreading, then this function + * does not do anything at all. Note that this of course has different semantics + * as in the multithreading context the objects are deleted and created again + * (possible by copying from a sample object, if the appropriate constructor + * of this class was called), whereas in the multithreaded context the object + * is simply not touched at all. At the same time, the purpose of this function + * is to release memory other threads may have allocated for their own thread + * local objects after which every use of this object will require some kind + * of initialization. This is necessary both in the multithreaded or + * non-multithreaded case. + */ + void clear (); + + /** + * Returns a reference to the internal Threading Building Blocks + * implementation. This function is really only useful if deal.II + * has been configured with multithreading and has no useful + * purpose otherwise. */ #ifdef DEAL_II_WITH_THREADS tbb::enumerable_thread_specific & #else T & #endif - get_implementation() - { - return data; - } + get_implementation(); private: #ifdef DEAL_II_WITH_THREADS @@ -225,6 +245,31 @@ namespace Threads get() = t; return *this; } + + + template + inline +#ifdef DEAL_II_WITH_THREADS + tbb::enumerable_thread_specific & +#else + T & +#endif + ThreadLocalStorage::get_implementation() + { + return data; + } + + + + template + inline + void + ThreadLocalStorage::clear () + { +#ifdef DEAL_II_WITH_THREADS + data.clear (); +#endif + } } // end of implementation of namespace Threads /** diff --git a/deal.II/include/deal.II/dofs/dof_accessor.h b/deal.II/include/deal.II/dofs/dof_accessor.h index 038443436e..1c56c862d5 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.h @@ -1208,6 +1208,14 @@ public: */ typedef DH Container; + /** + * A type for an iterator over the faces of a cell. This is + * what the face() function returns. + */ + typedef + TriaIterator > + face_iterator; + /** * @name Constructors and initialization */ @@ -1284,10 +1292,10 @@ public: /** * Return an iterator to the @p ith face of this cell. * - * This function is not implemented in 1D, and maps to - * DoFAccessor::line in 2D. + * This function is not implemented in 1D, and returns + * DoFAccessor::line in 2D and DoFAccessor::quad in 3d. */ - TriaIterator > + face_iterator face (const unsigned int i) const; /** @@ -1748,12 +1756,12 @@ private: }; -template +template inline bool -DoFAccessor::is_level_cell() +DoFAccessor::is_level_cell() { - return lda; + return level_dof_access; } diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index 9b689af2ab..ec4b975442 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -38,18 +38,18 @@ DEAL_II_NAMESPACE_OPEN /*------------------------- Functions: DoFAccessor ---------------------------*/ -template +template inline -DoFAccessor::DoFAccessor () +DoFAccessor::DoFAccessor () { Assert (false, ExcInvalidObject()); } -template +template inline -DoFAccessor::DoFAccessor ( +DoFAccessor::DoFAccessor ( const Triangulation *tria, const int level, const int index, @@ -64,19 +64,19 @@ DoFAccessor::DoFAccessor ( -template +template template -DoFAccessor::DoFAccessor (const InvalidAccessor &) +DoFAccessor::DoFAccessor (const InvalidAccessor &) { Assert (false, ExcInvalidObject()); } -template -template +template +template inline -DoFAccessor::DoFAccessor (const DoFAccessor &other) +DoFAccessor::DoFAccessor (const DoFAccessor &other) : BaseClass(other), dof_handler(0) { @@ -90,10 +90,10 @@ DoFAccessor::DoFAccessor (const DoFAccessor & -template -template +template +template inline -DoFAccessor::DoFAccessor (const DoFAccessor &other) +DoFAccessor::DoFAccessor (const DoFAccessor &other) : BaseClass(other), dof_handler(const_cast(other.dof_handler)) { @@ -101,10 +101,10 @@ DoFAccessor::DoFAccessor (const DoFAccessor +template inline void -DoFAccessor::set_dof_handler (DH *dh) +DoFAccessor::set_dof_handler (DH *dh) { Assert (dh != 0, ExcInvalidObject()); this->dof_handler = dh; @@ -112,20 +112,20 @@ DoFAccessor::set_dof_handler (DH *dh) -template +template inline const DH & -DoFAccessor::get_dof_handler () const +DoFAccessor::get_dof_handler () const { return *this->dof_handler; } -template +template inline void -DoFAccessor::copy_from ( +DoFAccessor::copy_from ( const TriaAccessorBase &da) { Assert (this->dof_handler != 0, ExcInvalidObject()); @@ -134,11 +134,11 @@ DoFAccessor::copy_from ( -template -template +template +template inline void -DoFAccessor::copy_from (const DoFAccessor &a) +DoFAccessor::copy_from (const DoFAccessor &a) { BaseClass::copy_from (a); set_dof_handler (a.dof_handler); @@ -146,11 +146,11 @@ DoFAccessor::copy_from (const DoFAccessor & -template -template +template +template inline bool -DoFAccessor::operator == (const DoFAccessor &a) const +DoFAccessor::operator == (const DoFAccessor &a) const { Assert (structdim == dim2, ExcCantCompareIterators()); Assert (this->dof_handler == a.dof_handler, ExcCantCompareIterators()); @@ -159,11 +159,11 @@ DoFAccessor::operator == (const DoFAccessor &a) -template -template +template +template inline bool -DoFAccessor::operator != (const DoFAccessor &a) const +DoFAccessor::operator != (const DoFAccessor &a) const { Assert (structdim == dim2, ExcCantCompareIterators()); Assert (this->dof_handler == a.dof_handler, ExcCantCompareIterators()); @@ -172,10 +172,10 @@ DoFAccessor::operator != (const DoFAccessor &a) -template +template inline -TriaIterator > -DoFAccessor::child (const unsigned int i) const +TriaIterator > +DoFAccessor::child (const unsigned int i) const { Assert (static_cast(this->level()) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -183,15 +183,15 @@ DoFAccessor::child (const unsigned int i) const TriaIterator > t = TriaAccessor::child(i); - TriaIterator > q (*t, this->dof_handler); + TriaIterator > q (*t, this->dof_handler); return q; } -template +template inline -TriaIterator > -DoFAccessor::parent () const +TriaIterator > +DoFAccessor::parent () const { Assert (static_cast(this->level()) < this->dof_handler->levels.size(), ExcMessage ("DoFHandler not initialized")); @@ -206,7 +206,7 @@ DoFAccessor::parent () const else previous_level = 0; - TriaIterator > q (this->tria, + TriaIterator > q (this->tria, previous_level, this->parent_index (), this->dof_handler); @@ -1421,9 +1421,9 @@ namespace internal } } - template + template static - void set_mg_dof_indices (const dealii::DoFAccessor<1,DH,lda> &, + void set_mg_dof_indices (const dealii::DoFAccessor<1,DH,level_dof_access> &, const int, const std::vector &, const unsigned int) @@ -1433,9 +1433,9 @@ namespace internal - template + template static - void set_mg_dof_indices (dealii::DoFAccessor<2, DH,lda> &accessor, + void set_mg_dof_indices (dealii::DoFAccessor<2, DH,level_dof_access> &accessor, const int level, const std::vector &dof_indices, const unsigned int fe_index) @@ -1459,9 +1459,9 @@ namespace internal - template + template static - void set_mg_dof_indices (const dealii::DoFAccessor<3, DH,lda> &, + void set_mg_dof_indices (const dealii::DoFAccessor<3, DH,level_dof_access> &, const int, const std::vector &, const unsigned int) @@ -1475,10 +1475,10 @@ namespace internal -template +template inline types::global_dof_index -DoFAccessor::dof_index (const unsigned int i, +DoFAccessor::dof_index (const unsigned int i, const unsigned int fe_index) const { // access the respective DoF @@ -1491,20 +1491,20 @@ DoFAccessor::dof_index (const unsigned int i, } -template +template inline types::global_dof_index -DoFAccessor::mg_dof_index (const int level, +DoFAccessor::mg_dof_index (const int level, const unsigned int i) const { return this->dof_handler->template get_dof_index (level, this->present_index, 0, i); } -template +template inline void -DoFAccessor::set_dof_index (const unsigned int i, +DoFAccessor::set_dof_index (const unsigned int i, const types::global_dof_index index, const unsigned int fe_index) const { @@ -1520,10 +1520,10 @@ DoFAccessor::set_dof_index (const unsigned int i, -template +template inline unsigned int -DoFAccessor::n_active_fe_indices () const +DoFAccessor::n_active_fe_indices () const { // access the respective DoF return @@ -1536,10 +1536,10 @@ DoFAccessor::n_active_fe_indices () const -template +template inline unsigned int -DoFAccessor::nth_active_fe_index (const unsigned int n) const +DoFAccessor::nth_active_fe_index (const unsigned int n) const { // access the respective DoF return @@ -1553,10 +1553,10 @@ DoFAccessor::nth_active_fe_index (const unsigned int n) const -template +template inline bool -DoFAccessor::fe_index_is_active (const unsigned int fe_index) const +DoFAccessor::fe_index_is_active (const unsigned int fe_index) const { // access the respective DoF return @@ -1570,10 +1570,10 @@ DoFAccessor::fe_index_is_active (const unsigned int fe_index) const -template +template inline types::global_dof_index -DoFAccessor::vertex_dof_index (const unsigned int vertex, +DoFAccessor::vertex_dof_index (const unsigned int vertex, const unsigned int i, const unsigned int fe_index) const { @@ -1586,10 +1586,10 @@ DoFAccessor::vertex_dof_index (const unsigned int vertex, } -template +template inline types::global_dof_index -DoFAccessor::mg_vertex_dof_index (const int level, +DoFAccessor::mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const unsigned int fe_index) const @@ -1602,10 +1602,10 @@ DoFAccessor::mg_vertex_dof_index (const int level, } -template +template inline void -DoFAccessor::set_vertex_dof_index (const unsigned int vertex, +DoFAccessor::set_vertex_dof_index (const unsigned int vertex, const unsigned int i, const types::global_dof_index index, const unsigned int fe_index) const @@ -1619,10 +1619,10 @@ DoFAccessor::set_vertex_dof_index (const unsigned int vertex, } -template +template inline void -DoFAccessor::set_mg_vertex_dof_index (const int level, +DoFAccessor::set_mg_vertex_dof_index (const int level, const unsigned int vertex, const unsigned int i, const types::global_dof_index index, @@ -1636,10 +1636,10 @@ DoFAccessor::set_mg_vertex_dof_index (const int level, } -template +template inline void -DoFAccessor::set_mg_dof_index (const int level, +DoFAccessor::set_mg_dof_index (const int level, const unsigned int i, const types::global_dof_index index) const { @@ -1674,10 +1674,10 @@ namespace internal } -template +template inline const FiniteElement & -DoFAccessor::get_fe (const unsigned int fe_index) const +DoFAccessor::get_fe (const unsigned int fe_index) const { Assert (fe_index_is_active (fe_index) == true, ExcMessage ("This function can only be called for active fe indices")); @@ -1691,8 +1691,8 @@ namespace internal { namespace DoFAccessor { - template - void get_dof_indices (const dealii::DoFAccessor<1,DH,lda> &accessor, + template + void get_dof_indices (const dealii::DoFAccessor<1,DH,level_dof_access> &accessor, std::vector &dof_indices, const unsigned int fe_index) { @@ -1708,8 +1708,8 @@ namespace internal - template - void get_dof_indices (const dealii::DoFAccessor<2,DH,lda> &accessor, + template + void get_dof_indices (const dealii::DoFAccessor<2,DH,level_dof_access> &accessor, std::vector &dof_indices, const unsigned int fe_index) { @@ -1743,8 +1743,8 @@ namespace internal - template - void get_dof_indices (const dealii::DoFAccessor<3,DH,lda> &accessor, + template + void get_dof_indices (const dealii::DoFAccessor<3,DH,level_dof_access> &accessor, std::vector &dof_indices, const unsigned int fe_index) { @@ -1799,8 +1799,8 @@ namespace internal - template - void get_mg_dof_indices (const dealii::DoFAccessor<1, DH,lda> &accessor, + template + void get_mg_dof_indices (const dealii::DoFAccessor<1, DH,level_dof_access> &accessor, const int level, std::vector &dof_indices, const unsigned int fe_index) @@ -1825,8 +1825,8 @@ namespace internal - template - void get_mg_dof_indices (const dealii::DoFAccessor<2, DH,lda> &accessor, + template + void get_mg_dof_indices (const dealii::DoFAccessor<2, DH,level_dof_access> &accessor, const int level, std::vector &dof_indices, const unsigned int fe_index) @@ -1854,8 +1854,8 @@ namespace internal - template - void get_mg_dof_indices (const dealii::DoFAccessor<3, DH,lda> &accessor, + template + void get_mg_dof_indices (const dealii::DoFAccessor<3, DH,level_dof_access> &accessor, const int level, std::vector &dof_indices, const unsigned int fe_index) @@ -1890,10 +1890,10 @@ namespace internal } -template +template inline void -DoFAccessor::get_dof_indices (std::vector &dof_indices, +DoFAccessor::get_dof_indices (std::vector &dof_indices, const unsigned int fe_index) const { Assert (this->dof_handler != 0, ExcNotInitialized()); @@ -1953,9 +1953,9 @@ DoFAccessor::get_dof_indices (std::vector +template inline -void DoFAccessor::get_mg_dof_indices (const int level, +void DoFAccessor::get_mg_dof_indices (const int level, std::vector &dof_indices, const unsigned int fe_index) const { @@ -2005,9 +2005,9 @@ void DoFAccessor::get_mg_dof_indices (const int level, } -template +template inline -void DoFAccessor::set_mg_dof_indices (const int level, +void DoFAccessor::set_mg_dof_indices (const int level, const std::vector &dof_indices, const unsigned int fe_index) { @@ -2061,9 +2061,9 @@ namespace internal { namespace DoFAccessor { - template + template inline - typename dealii::internal::DoFHandler::Iterators::quad_iterator + typename dealii::internal::DoFHandler::Iterators::quad_iterator get_quad(const dealii::Triangulation *tria, unsigned int index, DH *dof_handler) @@ -2071,57 +2071,57 @@ namespace internal } - template + template inline - typename dealii::internal::DoFHandler::Iterators, lda>::quad_iterator + typename dealii::internal::DoFHandler::Iterators, level_dof_access>::quad_iterator get_quad(const dealii::Triangulation<2,2> *, unsigned int, dealii::DoFHandler<2,2> *) { Assert(false, ExcNotImplemented()); - return typename dealii::internal::DoFHandler::Iterators, lda>::line_iterator(); + return typename dealii::internal::DoFHandler::Iterators, level_dof_access>::line_iterator(); } - template + template inline - typename dealii::internal::DoFHandler::Iterators, lda>::quad_iterator + typename dealii::internal::DoFHandler::Iterators, level_dof_access>::quad_iterator get_quad(const dealii::Triangulation<2,3> *, unsigned int, dealii::DoFHandler<2,3> *) { Assert(false, ExcNotImplemented()); - return typename dealii::internal::DoFHandler::Iterators, lda>::line_iterator(); + return typename dealii::internal::DoFHandler::Iterators, level_dof_access>::line_iterator(); } - template + template inline - typename dealii::internal::DoFHandler::Iterators, lda>::quad_iterator + typename dealii::internal::DoFHandler::Iterators, level_dof_access>::quad_iterator get_quad(const dealii::Triangulation<2,2> *, unsigned int, dealii::hp::DoFHandler<2,2> *) { Assert(false, ExcNotImplemented()); - return typename dealii::internal::DoFHandler::Iterators, lda>::line_iterator(); + return typename dealii::internal::DoFHandler::Iterators, level_dof_access>::line_iterator(); } - template + template inline - typename dealii::internal::DoFHandler::Iterators, lda>::quad_iterator + typename dealii::internal::DoFHandler::Iterators, level_dof_access>::quad_iterator get_quad(const dealii::Triangulation<2,3> *, unsigned int, dealii::hp::DoFHandler<2,3> *) { Assert(false, ExcNotImplemented()); - return typename dealii::internal::DoFHandler::Iterators, lda>::line_iterator(); + return typename dealii::internal::DoFHandler::Iterators, level_dof_access>::line_iterator(); } } } -template +template inline -typename dealii::internal::DoFHandler::Iterators::line_iterator -DoFAccessor::line (const unsigned int i) const +typename dealii::internal::DoFHandler::Iterators::line_iterator +DoFAccessor::line (const unsigned int i) const { // if we are asking for a particular line and this object refers to // a line, then the only valid index is i==0 and we should return @@ -2131,7 +2131,7 @@ DoFAccessor::line (const unsigned int i) const Assert (i==0, ExcMessage ("You can only ask for line zero if the " "current object is a line itself.")); return - typename dealii::internal::DoFHandler::Iterators::cell_iterator + typename dealii::internal::DoFHandler::Iterators::cell_iterator (&this->get_triangulation(), this->level(), this->index(), @@ -2143,7 +2143,7 @@ DoFAccessor::line (const unsigned int i) const Assert (DH::dimension > 1, ExcImpossibleInDim(DH::dimension)); // checking of 'i' happens in line_index(i) - return typename dealii::internal::DoFHandler::Iterators::line_iterator + return typename dealii::internal::DoFHandler::Iterators::line_iterator (this->tria, 0, // only sub-objects are allowed, which have no level this->line_index(i), @@ -2151,10 +2151,10 @@ DoFAccessor::line (const unsigned int i) const } -template +template inline -typename dealii::internal::DoFHandler::Iterators::quad_iterator -DoFAccessor::quad (const unsigned int i) const +typename dealii::internal::DoFHandler::Iterators::quad_iterator +DoFAccessor::quad (const unsigned int i) const { // if we are asking for a // particular quad and this object @@ -2178,7 +2178,7 @@ DoFAccessor::quad (const unsigned int i) const Assert (DH::dimension > 2, ExcImpossibleInDim(DH::dimension)); // checking of 'i' happens in quad_index(i) - return typename dealii::internal::DoFHandler::Iterators::quad_iterator + return typename dealii::internal::DoFHandler::Iterators::quad_iterator (this->tria, 0, // only sub-objects are allowed, which have no level this->quad_index(i), @@ -2189,18 +2189,18 @@ DoFAccessor::quad (const unsigned int i) const /*------------------------- Functions: DoFAccessor<0,1,spacedim> ---------------------------*/ -template