From: heltai
Date: Sat, 1 Feb 2014 12:33:32 +0000 (+0000)
Subject: Merged from trunk: r32262 through r32365.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afd1f8d0ef2aa418aaacdad88d7fc5ed6d0be0b1;p=dealii-svn.git
Merged from trunk: r32262 through r32365.
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32366 0785d39b-7218-0410-832d-ea1e28bc413d
---
diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt
index c48544e743..ad2a8cacd4 100644
--- a/deal.II/CMakeLists.txt
+++ b/deal.II/CMakeLists.txt
@@ -123,6 +123,7 @@ ENDFOREACH()
#
INCLUDE(setup_custom_targets)
INCLUDE(setup_finalize)
+INCLUDE(setup_write_config)
########################################################################
diff --git a/deal.II/cmake/checks/check_01_cxx_features.cmake b/deal.II/cmake/checks/check_01_cxx_features.cmake
index fa1540fae4..f464702949 100644
--- a/deal.II/cmake/checks/check_01_cxx_features.cmake
+++ b/deal.II/cmake/checks/check_01_cxx_features.cmake
@@ -51,7 +51,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
# Set CMAKE_REQUIRED_FLAGS for the unit tests
MESSAGE(STATUS "Using C++11 flag \"${DEAL_II_CXX11_FLAG}\"")
- PUSH_TEST_FLAG("${DEAL_II_CXX11_FLAG}")
+ PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}")
CHECK_CXX_SOURCE_COMPILES(
"
@@ -103,7 +103,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
# that as well.
#
IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
- PUSH_TEST_FLAG("-pthread")
+ PUSH_CMAKE_REQUIRED("-pthread")
CHECK_CXX_SOURCE_RUNS(
"
#include
@@ -111,7 +111,8 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
int main(){ std::thread t(f,1); t.join(); return 0; }
"
DEAL_II_HAVE_CXX11_THREAD)
- POP_TEST_FLAG()
+ RESET_CMAKE_REQUIRED()
+ PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}")
ELSE()
# Just export it ;-)
SET(DEAL_II_HAVE_CXX11_THREAD TRUE CACHE BOOL "")
@@ -146,7 +147,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11)
#
# On Mac OS-X 10.9 with recent gcc compilers in C++11 mode linking to
# some standard C library functions, notably toupper and tolower, fail
- # due to unresolved references to this functions.
+ # due to unresolved references to these functions.
#
# Thanks to Denis Davydov for the testcase.
#
@@ -252,7 +253,8 @@ IF(DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11)
" -DDEAL_II_WITH_CXX11=FALSE,\n"
"or use a different compiler, instead. (If the compiler flag for C++11 "
"support differs from \"-std=c++0x\" or \"-std=c++11\", a suitable "
- "compiler flag has to be specified manually.\n\n"
+ "compiler flag has to be specified manually via\n"
+ " -DDEAL_II_CXX11_FLAG=\"...\"\n\n"
)
ENDIF()
@@ -264,14 +266,14 @@ IF(DEAL_II_WITH_CXX11)
ADD_FLAGS(DEAL_II_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
MESSAGE(STATUS "DEAL_II_WITH_CXX11 successfully set up")
- PUSH_TEST_FLAG("${DEAL_II_CXX11_FLAG}")
+ PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}")
CHECK_CXX_SOURCE_COMPILES(
"
#include
int main(){ std::is_trivially_copyable bob; }
"
DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
- POP_TEST_FLAG()
+ RESET_CMAKE_REQUIRED()
ELSE()
MESSAGE(STATUS "DEAL_II_WITH_CXX11 disabled")
ENDIF()
diff --git a/deal.II/cmake/checks/check_03_compiler_bugs.cmake b/deal.II/cmake/checks/check_03_compiler_bugs.cmake
index 364bad027e..c913deb19c 100644
--- a/deal.II/cmake/checks/check_03_compiler_bugs.cmake
+++ b/deal.II/cmake/checks/check_03_compiler_bugs.cmake
@@ -29,8 +29,8 @@
#
# - Wolfgang Bangerth, Matthias Maier, rewritten 2012
#
-PUSH_TEST_FLAG("-Wreturn-type")
-PUSH_TEST_FLAG("-Werror")
+PUSH_CMAKE_REQUIRED("-Wreturn-type")
+PUSH_CMAKE_REQUIRED("-Werror")
CHECK_CXX_COMPILER_BUG(
"
const double foo() { return 1.; }
@@ -38,8 +38,7 @@ CHECK_CXX_COMPILER_BUG(
"
DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG
)
-POP_TEST_FLAG()
-POP_TEST_FLAG()
+RESET_CMAKE_REQUIRED()
IF(DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG)
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-return-type)
diff --git a/deal.II/cmake/configure/configure_1_mpi.cmake b/deal.II/cmake/configure/configure_1_mpi.cmake
index 647ea4a81c..1927e8ecbd 100644
--- a/deal.II/cmake/configure/configure_1_mpi.cmake
+++ b/deal.II/cmake/configure/configure_1_mpi.cmake
@@ -52,6 +52,7 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
"not be autodetected"
)
ENDIF()
+
FIND_PACKAGE(MPI)
IF(NOT MPI_CXX_FOUND AND DEAL_II_WITH_MPI)
@@ -136,6 +137,14 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
SET(${var} TRUE)
ENDIF()
+ #
+ # Populate correct variables:
+ #
+ SET(MPI_LIBRARIES ${MPI_CXX_LIBRARIES})
+ SET(MPI_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH})
+ 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)
@@ -146,9 +155,9 @@ MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL)
#
# The user has to know the location of the mpi headers as well:
#
- SET(MPI_CXX_ADD_TO_USER_INCLUDE_DIRS TRUE)
+ SET(MPI_ADD_TO_USER_INCLUDE_DIRS TRUE)
- REGISTER_FEATURE(MPI_CXX)
+ REGISTER_FEATURE(MPI)
ENDMACRO()
diff --git a/deal.II/cmake/configure/configure_1_threads.cmake b/deal.II/cmake/configure/configure_1_threads.cmake
index edd2b4cd20..c7265653bb 100644
--- a/deal.II/cmake/configure/configure_1_threads.cmake
+++ b/deal.II/cmake/configure/configure_1_threads.cmake
@@ -154,6 +154,7 @@ 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")
@@ -173,6 +174,11 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
ENDIF()
SETUP_THREADING()
+
+ # TODO: Refactor this mess of a configure file...
+ SET(THREADS_LIBRARIES ${TBB_LIBRARIES})
+ SET(THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS})
+
ENDMACRO()
diff --git a/deal.II/cmake/macros/macro_push_test_flag.cmake b/deal.II/cmake/macros/macro_push_cmake_required.cmake
similarity index 93%
rename from deal.II/cmake/macros/macro_push_test_flag.cmake
rename to deal.II/cmake/macros/macro_push_cmake_required.cmake
index 905ce92e16..180df5981d 100644
--- a/deal.II/cmake/macros/macro_push_test_flag.cmake
+++ b/deal.II/cmake/macros/macro_push_cmake_required.cmake
@@ -19,10 +19,10 @@
# CMAKE_REQUIRED_FLAGS
#
# Usage:
-# PUSH_TEST_FLAG("flag")
+# PUSH_CMAKE_REQUIRED("flag")
#
-MACRO(PUSH_TEST_FLAG _flag)
+MACRO(PUSH_CMAKE_REQUIRED _flag)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${_flag}")
STRING(STRIP "${CMAKE_REQUIRED_FLAGS}" CMAKE_REQUIRED_FLAGS)
diff --git a/deal.II/cmake/macros/macro_register_feature.cmake b/deal.II/cmake/macros/macro_register_feature.cmake
index 22dffc44de..5c590280ee 100644
--- a/deal.II/cmake/macros/macro_register_feature.cmake
+++ b/deal.II/cmake/macros/macro_register_feature.cmake
@@ -15,26 +15,24 @@
## ---------------------------------------------------------------------
#
-# This macro is used for the feature configuration in deal.II
+# This macro is used for the feature configuration in deal.II. It adds
+# individual FEATURE_* configuration variables to the corresponding
+# DEAL_II_* variables
#
# Usage:
# REGISTER_FEATURE(feature)
#
-# This macro will
+# This macro will add
#
-# - add ${feature}_INCLUDE_DIRS and ${feature}_INCLUDE_PATH
-# to the list of (internal) include directories
-# - and if ${feature}_ADD_TO_USER_INCLUDE_DIRS is defined also to
-# DEAL_II_USER_INCLUDE_DIRS
+# _LIBRARIES
+# _INCLUDE_DIRS(|_DEBUG|_RELEASE)
+# _USER_INCLUDE_DIRS(|_DEBUG|_RELEASE)
+# _DEFINITIONS(|_DEBUG|_RELEASE)
+# _USER_DEFINITIONS(|_DEBUG|_RELEASE)
+# _CXX_FLAGS(|_DEBUG|_RELEASE)
+# _LINKER_FLAGS(|_DEBUG|_RELEASE)
#
-# - add ${feature}_LINKER_FLAGS and ${feature}_LINK_FLAGS to
-# DEAL_II_LINKER_FLAGS
-#
-# - add ${feature}_CXX_FLAGS and ${feature}_COMPILE_FLAGS to
-# DEAL_II_CXX_FLAGS
-#
-# - add ${feature}_LIBRARIES to the list of deal.II libraries depending
-# on general, optimized or debug keyword
+# to the corresponding DEAL_II_* variables
#
diff --git a/deal.II/cmake/macros/macro_pop_test_flag.cmake b/deal.II/cmake/macros/macro_remove_duplicates.cmake
similarity index 56%
rename from deal.II/cmake/macros/macro_pop_test_flag.cmake
rename to deal.II/cmake/macros/macro_remove_duplicates.cmake
index 045fe43e2f..d0ec688fdd 100644
--- a/deal.II/cmake/macros/macro_pop_test_flag.cmake
+++ b/deal.II/cmake/macros/macro_remove_duplicates.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.
##
@@ -15,21 +15,21 @@
## ---------------------------------------------------------------------
#
-# A small macro used in the platform checks to remove the right most flag in
-# CMAKE_REQUIRED_FLAGS
-#
-# We assume that the flags in CMAKE_REQUIRED_FLAGS are space separated
+# Remove duplicate entries from a list. Optionally do this in reverse
+# order, keeping the rightmost element
#
# Usage:
-# POP_TEST_FLAG()
+# REMOVE_DUPLICATES(list [REVERSE])
#
-MACRO(POP_TEST_FLAG)
- SET(CMAKE_REQUIRED_FLAGS " ${CMAKE_REQUIRED_FLAGS}")
- STRING(REGEX REPLACE " [^ ]+$" ""
- CMAKE_REQUIRED_FLAGS
- "${CMAKE_REQUIRED_FLAGS}"
- )
- STRING(STRIP "${CMAKE_REQUIRED_FLAGS}" CMAKE_REQUIRED_FLAGS)
+MACRO(REMOVE_DUPLICATES _list)
+ IF(NOT "${${_list}}" STREQUAL "")
+ IF("${ARGN}" STREQUAL "REVERSE")
+ LIST(REVERSE ${_list})
+ ENDIF()
+ LIST(REMOVE_DUPLICATES ${_list})
+ IF("${ARGN}" STREQUAL "REVERSE")
+ LIST(REVERSE ${_list})
+ ENDIF()
+ ENDIF()
ENDMACRO()
-
diff --git a/deal.II/cmake/macros/macro_reset_cmake_required.cmake b/deal.II/cmake/macros/macro_reset_cmake_required.cmake
index 53a4818786..02254b27a2 100644
--- a/deal.II/cmake/macros/macro_reset_cmake_required.cmake
+++ b/deal.II/cmake/macros/macro_reset_cmake_required.cmake
@@ -25,6 +25,6 @@
MACRO(RESET_CMAKE_REQUIRED)
SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED})
SET(CMAKE_REQUIRED_INCLUDES)
- SET(CMAKE_REQUIRED_LIBRARIES)
+ SET(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED})
ENDMACRO()
diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake
index 8857da9f82..877e550f65 100644
--- a/deal.II/cmake/modules/FindTRILINOS.cmake
+++ b/deal.II/cmake/modules/FindTRILINOS.cmake
@@ -183,7 +183,7 @@ IF(TRILINOS_FOUND)
ENDIF()
LIST(APPEND CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIRS})
- PUSH_TEST_FLAG("${DEAL_II_CXX11_FLAG}")
+ PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}")
CHECK_CXX_SOURCE_COMPILES(
"
@@ -196,7 +196,7 @@ IF(TRILINOS_FOUND)
#
# Try whether exporting HAS_C99_TR1_CMATH helps:
#
- PUSH_TEST_FLAG("-DHAS_C99_TR1_CMATH")
+ PUSH_CMAKE_REQUIRED("-DHAS_C99_TR1_CMATH")
CHECK_CXX_SOURCE_COMPILES(
"
#include
diff --git a/deal.II/cmake/setup_cached_variables.cmake b/deal.II/cmake/setup_cached_variables.cmake
index c4fc91f1dd..51a3f0bc45 100644
--- a/deal.II/cmake/setup_cached_variables.cmake
+++ b/deal.II/cmake/setup_cached_variables.cmake
@@ -282,7 +282,7 @@ FOREACH(_flag ${DEAL_II_USED_FLAGS})
# file).
#
SET(${_flag}_SAVED ${${_flag}})
- SET(${_flag})
+ SET(${_flag} "")
ENDFOREACH()
FOREACH(_variable
@@ -304,9 +304,13 @@ ENDFOREACH()
# Finally, read in CXXFLAGS and LDFLAGS from environment and prepend them
# to the saved variables:
#
-
-SET(CMAKE_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_SAVED}")
+# Also strip leading and trailing whitespace from linker flags to make
+# old cmake versions happy
+#
+SET(DEAL_II_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${DEAL_II_CXX_FLAGS_SAVED}")
+STRING(STRIP "${DEAL_II_CXX_FLAGS_SAVED}" DEAL_II_CXX_FLAGS_SAVED)
SET(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}")
+STRING(STRIP "${DEAL_II_LINKER_FLAGS_SAVED}" DEAL_II_LINKER_FLAGS_SAVED)
UNSET(ENV{CXXFLAGS})
UNSET(ENV{LDFLAGS})
@@ -353,7 +357,7 @@ It is not possible to install into the build directory. Please set
CMAKE_INSTALL_PREFIX to a designated install directory different than
CMAKE_BINARY_DIR.
(Please note that you can use deal.II directly out of a build directory
-if this is what you tried to do.)
+without the need to install it, if this is what you tried to do.)
"
)
ENDIF()
diff --git a/deal.II/cmake/setup_compiler_flags.cmake b/deal.II/cmake/setup_compiler_flags.cmake
index 848f601042..d8eb42447c 100644
--- a/deal.II/cmake/setup_compiler_flags.cmake
+++ b/deal.II/cmake/setup_compiler_flags.cmake
@@ -66,12 +66,14 @@
# Check the user provided CXX flags:
#
-IF(NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_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)
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)
# Initialize all CMAKE_REQUIRED_* variables a this point:
RESET_CMAKE_REQUIRED()
@@ -82,11 +84,12 @@ CHECK_CXX_SOURCE_COMPILES(
IF(NOT DEAL_II_HAVE_USABLE_CXX_FLAGS)
UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
- MESSAGE(FATAL_ERROR "\n"
- "Configuration error: Cannot compile with the user supplied CXX flags:\n"
- "${DEAL_II_CXX_FLAGS_SAVED}\n"
- "Please check the CMake variable DEAL_II_CXX_FLAGS and the\n"
- "environment variable CXXFLAGS\n\n"
+ MESSAGE(FATAL_ERROR "
+Configuration error: Cannot compile with the user supplied flags:
+CXX flags: ${DEAL_II_CXX_FLAGS_SAVED}
+LD flags: ${DEAL_II_LINKER_FLAGS_SAVED}
+Please check the CMake variables DEAL_II_CXX_FLAGS, DEAL_II_LINKER_FLAGS
+and the environment variables CXXFLAGS, LDFLAGS.\n\n"
)
ENDIF()
diff --git a/deal.II/cmake/setup_compiler_flags_gnu.cmake b/deal.II/cmake/setup_compiler_flags_gnu.cmake
index e0607ae195..59c4a24508 100644
--- a/deal.II/cmake/setup_compiler_flags_gnu.cmake
+++ b/deal.II/cmake/setup_compiler_flags_gnu.cmake
@@ -171,7 +171,7 @@ IF (CMAKE_BUILD_TYPE MATCHES "Debug")
#
# Enable test coverage
#
- ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fno-elide-constructors")
+ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-fno-elide-constructors")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs")
ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs")
ENDIF()
diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake
index fea5613d55..4baa99b615 100644
--- a/deal.II/cmake/setup_finalize.cmake
+++ b/deal.II/cmake/setup_finalize.cmake
@@ -54,25 +54,16 @@ ENDFOREACH()
#
# Deduplicate entries in DEAL_II_USER_INCLUDE_DIRS
#
-IF(NOT "${DEAL_II_USER_INCLUDE_DIRS}" STREQUAL "")
- LIST(REMOVE_DUPLICATES DEAL_II_USER_INCLUDE_DIRS)
-ENDIF()
+REMOVE_DUPLICATES(DEAL_II_USER_INCLUDE_DIRS)
#
# Deduplicate entries in DEAL_II_EXTERNAL_LIBRARIES(_...)
# in reverse order:
#
-IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES}" STREQUAL "")
- LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES)
- LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES)
- LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES)
-ENDIF()
+REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES REVERSE)
+
FOREACH(_build ${DEAL_II_BUILD_TYPES})
- IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES_${_build}}" STREQUAL "")
- LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${_build})
- LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES_${_build})
- LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${_build})
- ENDIF()
+ REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES_${_build} REVERSE)
ENDFOREACH()
#
@@ -99,259 +90,3 @@ FILE(WRITE
${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
""
)
-
-
-########################################################################
-# #
-# And write a nice configuration summary to file: #
-# #
-########################################################################
-
-SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log")
-SET(_log_summary "${CMAKE_BINARY_DIR}/summary.log")
-FILE(REMOVE ${_log_detailed} ${_log_summary})
-
-MACRO(_both)
- # Write to both log files:
- FILE(APPEND ${_log_detailed} "${ARGN}")
- FILE(APPEND ${_log_summary} "${ARGN}")
-ENDMACRO()
-MACRO(_detailed)
- # Only write to detailed.log:
- FILE(APPEND ${_log_detailed} "${ARGN}")
-ENDMACRO()
-MACRO(_summary)
- # Only write to summary.log:
- FILE(APPEND ${_log_summary} "${ARGN}")
-ENDMACRO()
-
-_both(
-"###
-#
-# ${DEAL_II_PACKAGE_NAME} configuration:
-# CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
-# BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}
-# CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}
-# CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR} (Version ${DEAL_II_PACKAGE_VERSION})
-# CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}
-# CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}
-# ${CMAKE_CXX_COMPILER}
-"
- )
-
-IF(CMAKE_C_COMPILER_WORKS)
- _detailed("# CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n")
-ENDIF()
-IF(CMAKE_Fortran_COMPILER_WORKS)
- _detailed("# CMAKE_Fortran_COMPILER: ${CMAKE_Fortran_COMPILER}\n")
-ENDIF()
-_detailed("# CMAKE_GENERATOR: ${CMAKE_GENERATOR}\n")
-
-IF(CMAKE_CROSSCOMPILING)
- _both(
- "#\n# CROSSCOMPILING!\n"
- )
-ENDIF()
-
-IF(DEAL_II_STATIC_EXECUTABLE)
- _both(
- "#\n# STATIC LINKAGE!\n"
- )
-ENDIF()
-
-_both("#\n")
-
-_detailed(
-"# Compiler flags used for this build:
-# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS}
-"
- )
-IF(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n")
-ENDIF()
-IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n")
-ENDIF()
-
-_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n")
-IF(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n")
-ENDIF()
-IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n")
-ENDIF()
-
-_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n")
-IF(CMAKE_BUILD_TYPE MATCHES "Release")
- _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n")
-ENDIF()
-IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n")
-ENDIF()
-
-_detailed("#\n")
-
-IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
- _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
-ENDIF()
-_both("# Configured Features (")
-IF(DEFINED DEAL_II_ALLOW_BUNDLED)
- _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ")
-ENDIF()
-IF(DEAL_II_FORCE_AUTODETECTION)
- _both("!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, ")
-ENDIF()
-_both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n")
-
-
-#
-# Cache for quicker access to avoid the O(n^2) complexity of a loop over
-# _all_ defined variables.
-#
-GET_CMAKE_PROPERTY(_variables VARIABLES)
-FOREACH(_var ${_variables})
- IF(_var MATCHES "DEAL_II_WITH")
- LIST(APPEND _features "${_var}")
- ELSEIF(_var MATCHES "DEAL_II_COMPONENT")
- LIST(APPEND _components "${_var}")
- ELSEIF(_var MATCHES "(MPI_CXX_COMPILER|MPI_CXX_COMPILE_FLAGS|MPI_CXX_LINK_FLAGS)")
- LIST(APPEND _features_config ${_var})
- ELSEIF(_var MATCHES "(LIBRARIES|INCLUDE_PATH|INCLUDE_DIRS|LINKER_FLAGS)")
- LIST(APPEND _features_config ${_var})
- ENDIF()
-ENDFOREACH()
-
-FOREACH(_var ${_features})
- IF(${${_var}})
- # 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")
- ELSEIF(_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(DEFINED ${_feature}_DIR)
- _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n")
- ENDIF()
-
- #
- # Print the feature configuration:
- #
- FOREACH(_var2 ${_features_config})
- IF( # MPI:
- _var2 MATCHES "^${_feature}_CXX_(COMPILER|COMPILE_FLAGS|LINK_FLAGS|LIBRARIES|INCLUDE_PATH)$" OR
- # Boost:
- ( _feature MATCHES "BOOST" AND _var2 MATCHES "^BOOST_(LIBRARIES|INCLUDE_DIRS)$" ) OR
- # TBB:
- ( _feature MATCHES "THREADS" AND _var2 MATCHES "^TBB_(LIBRARIES|INCLUDE_DIRS)$" ) OR
- # Generic:
- ( (NOT _var2 MATCHES "^(MPI|Boost)") AND
- _var2 MATCHES "^${_feature}_(INCLUDE_DIRS|LIBRARIES|LINKER_FLAGS)$" )
- )
- _detailed("# ${_var2} = ${${_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()
- _both("# ${_var} set up with bundled packages\n")
- ENDIF()
- ELSE()
- _both("# ${_var} = ${${_var}}\n")
- ENDIF()
- ELSE()
- # FEATURE is disabled
- _both("# ( ${_var} = ${${_var}} )\n")
- ENDIF()
-ENDFOREACH()
-
-_both(
- "#\n# Component configuration:\n"
- )
-FOREACH(_var ${_components})
- IF(_var MATCHES "DEAL_II_COMPONENT")
- IF(${${_var}})
- _both("# ${_var}\n")
- STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var})
- LIST(APPEND _components ${_component})
- ELSE()
- _both("# ( ${_var} = ${${_var}} )\n")
- ENDIF()
- ENDIF()
-ENDFOREACH()
-
-_summary(
-"#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log
-#\n# Run $ "
- )
-IF(CMAKE_GENERATOR MATCHES "Ninja")
- _summary("ninja info")
-ELSE()
-_summary("make help")
-ENDIF()
-_summary(" to print a help message with a list of top level targets\n")
-
-_both("#\n###")
-
-
-########################################################################
-# #
-# Dump the cache into config.cmake: #
-# #
-########################################################################
-
-SET(_config_cmake "${CMAKE_BINARY_DIR}/config.cmake")
-FILE(WRITE ${_config_cmake}
-"#
-# This is a raw CMake cache dump of this build directory suitable as an
-# initial cache file: Use this file to preseed a CMake cache in an empty
-# build directory by (note that it is still necessary to declare a source
-# directory):
-# $ cmake -C [...]/config.cmake ../deal.II
-#
-# If you want to have a clean configuration file have a look at
-# doc/users/config.sample
-#\n"
- )
-
-FUNCTION(_config _var)
- # It is absolutely beyond my comprehension why on earth there is
- # hardcoded logic built into CMake to throw an error if one uses
- # uppercase variants of FindPACKAGE call variables...
- IF(NOT _var MATCHES "BOOST_DIR")
- UNSET(${_var})
- ENDIF()
- #
- # We have to get down to the raw entry in the cache, therefore clear the
- # current value (and do it in a function to get private scope):
- #
- FILE(APPEND ${_config_cmake}
- "SET(${_var} \"${${_var}}\" CACHE STRING \"\")\n"
- )
-ENDFUNCTION()
-
-GET_CMAKE_PROPERTY(_variables CACHE_VARIABLES)
-FOREACH(_var
- CMAKE_C_COMPILER
- CMAKE_CXX_COMPILER
- CMAKE_Fortran_COMPILER
- ${_variables}
- )
- _config(${_var})
-ENDFOREACH()
diff --git a/deal.II/cmake/setup_write_config.cmake b/deal.II/cmake/setup_write_config.cmake
new file mode 100644
index 0000000000..f3062a3907
--- /dev/null
+++ b/deal.II/cmake/setup_write_config.cmake
@@ -0,0 +1,268 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2012 - 2013 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.
+##
+## ---------------------------------------------------------------------
+
+
+########################################################################
+# #
+# Write a nice configuration summary to file: #
+# #
+########################################################################
+
+SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log")
+SET(_log_summary "${CMAKE_BINARY_DIR}/summary.log")
+FILE(REMOVE ${_log_detailed} ${_log_summary})
+
+MACRO(_both)
+ # Write to both log files:
+ FILE(APPEND ${_log_detailed} "${ARGN}")
+ FILE(APPEND ${_log_summary} "${ARGN}")
+ENDMACRO()
+MACRO(_detailed)
+ # Only write to detailed.log:
+ FILE(APPEND ${_log_detailed} "${ARGN}")
+ENDMACRO()
+MACRO(_summary)
+ # Only write to summary.log:
+ FILE(APPEND ${_log_summary} "${ARGN}")
+ENDMACRO()
+
+_both(
+"###
+#
+# ${DEAL_II_PACKAGE_NAME} configuration:
+# CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
+# BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}
+# CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}
+# CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR} (Version ${DEAL_II_PACKAGE_VERSION})
+# CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}
+# CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}
+# ${CMAKE_CXX_COMPILER}
+"
+ )
+
+IF(CMAKE_C_COMPILER_WORKS)
+ _detailed("# CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n")
+ENDIF()
+IF(CMAKE_Fortran_COMPILER_WORKS)
+ _detailed("# CMAKE_Fortran_COMPILER: ${CMAKE_Fortran_COMPILER}\n")
+ENDIF()
+_detailed("# CMAKE_GENERATOR: ${CMAKE_GENERATOR}\n")
+
+IF(CMAKE_CROSSCOMPILING)
+ _both(
+ "#\n# CROSSCOMPILING!\n"
+ )
+ENDIF()
+
+IF(DEAL_II_STATIC_EXECUTABLE)
+ _both(
+ "#\n# STATIC LINKAGE!\n"
+ )
+ENDIF()
+
+_both("#\n")
+
+_detailed(
+"# Compiler flags used for this build:
+# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS}
+"
+ )
+IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n")
+ENDIF()
+IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n")
+ENDIF()
+
+_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n")
+IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n")
+ENDIF()
+IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n")
+ENDIF()
+
+_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n")
+IF(CMAKE_BUILD_TYPE MATCHES "Release")
+ _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n")
+ENDIF()
+IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n")
+ENDIF()
+
+_detailed("#\n")
+
+IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+ _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n")
+ENDIF()
+_both("# Configured Features (")
+IF(DEFINED DEAL_II_ALLOW_BUNDLED)
+ _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ")
+ENDIF()
+IF(DEAL_II_FORCE_AUTODETECTION)
+ _both("!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, ")
+ENDIF()
+_both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n")
+
+
+#
+# Cache for quicker access to avoid the O(n^2) complexity of a loop over
+# _all_ defined variables.
+#
+
+GET_CMAKE_PROPERTY(_variables VARIABLES)
+FOREACH(_var ${_variables})
+ IF(_var MATCHES "DEAL_II_WITH")
+ LIST(APPEND _features "${_var}")
+ ELSEIF(_var MATCHES "DEAL_II_COMPONENT")
+ LIST(APPEND _components "${_var}")
+ ENDIF()
+ENDFOREACH()
+
+FOREACH(_var ${_features})
+ IF(${${_var}})
+ # 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()
+ _both("# ${_var} set up with bundled packages\n")
+ ENDIF()
+ ELSE()
+ _both("# ${_var} = ${${_var}}\n")
+ ENDIF()
+ ELSE()
+ # FEATURE is disabled
+ _both("# ( ${_var} = ${${_var}} )\n")
+ ENDIF()
+ENDFOREACH()
+
+_both(
+ "#\n# Component configuration:\n"
+ )
+FOREACH(_var ${_components})
+ IF(_var MATCHES "DEAL_II_COMPONENT")
+ IF(${${_var}})
+ _both("# ${_var}\n")
+ STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var})
+ LIST(APPEND _components ${_component})
+ ELSE()
+ _both("# ( ${_var} = ${${_var}} )\n")
+ ENDIF()
+ ENDIF()
+ENDFOREACH()
+
+_summary(
+"#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log
+#\n# Run $ "
+ )
+IF(CMAKE_GENERATOR MATCHES "Ninja")
+ _summary("ninja info")
+ELSE()
+_summary("make help")
+ENDIF()
+_summary(" to print a help message with a list of top level targets\n")
+
+_both("#\n###")
+
+
+########################################################################
+# #
+# Dump the cache into config.cmake: #
+# #
+########################################################################
+
+SET(_config_cmake "${CMAKE_BINARY_DIR}/config.cmake")
+FILE(WRITE ${_config_cmake}
+"#
+# This is a raw CMake cache dump of this build directory suitable as an
+# initial cache file: Use this file to preseed a CMake cache in an empty
+# build directory by (note that it is still necessary to declare a source
+# directory):
+# $ cmake -C [...]/config.cmake ../deal.II
+#
+# If you want to have a clean configuration file have a look at
+# doc/users/config.sample
+#\n"
+ )
+
+FUNCTION(_config _var)
+ # It is absolutely beyond my comprehension why on earth there is
+ # hardcoded logic built into CMake to throw an error if one uses
+ # uppercase variants of FindPACKAGE call variables...
+ IF(NOT _var MATCHES "BOOST_DIR")
+ UNSET(${_var})
+ ENDIF()
+ #
+ # We have to get down to the raw entry in the cache, therefore clear the
+ # current value (and do it in a function to get private scope):
+ #
+ FILE(APPEND ${_config_cmake}
+ "SET(${_var} \"${${_var}}\" CACHE STRING \"\")\n"
+ )
+ENDFUNCTION()
+
+GET_CMAKE_PROPERTY(_variables CACHE_VARIABLES)
+FOREACH(_var
+ CMAKE_C_COMPILER
+ CMAKE_CXX_COMPILER
+ CMAKE_Fortran_COMPILER
+ ${_variables}
+ )
+ _config(${_var})
+ENDFOREACH()
diff --git a/deal.II/doc/developers/cmake-internals.html b/deal.II/doc/developers/cmake-internals.html
index aea4a22765..3517b168bb 100644
--- a/deal.II/doc/developers/cmake-internals.html
+++ b/deal.II/doc/developers/cmake-internals.html
@@ -292,13 +292,13 @@ CHECK_CXX_COMPILER_FLAG(flag variable)
Necessary compiler flags can easily set in the string variable
- CMAKE_REQUIRED_FLAGS. There are two small macros
- that do this job nicely:
+ CMAKE_REQUIRED_FLAGS. There is a small macro that does this
+ job nicely:
@@ -334,10 +335,12 @@ xx: =============================== OUTPUT END ============================
-
Parallelize testsuite configuration
+
Parallelizing testsuite configuration
- If you have set up a good portion of the testsuite you'll notice that a
+ If you have set up the testsuite (or at least a few hundred tests by
+ providing a sufficiently general regular expression
+ as TEST_PICKUP_REGEX) you'll notice that a
reconfiguration of the build directory takes a noticeable time (in the
order of minutes instead of seconds) with
Reconfiguring testsuite subprojects.
@@ -348,11 +351,69 @@ xx: =============================== OUTPUT END ============================
variable.
- Alternatively, you can use Ninja.
+ Alternatively, you can use Ninja as your build tool instead
+ of make.
+
+
Generating coverage information
+
+
+ The testsuite can also be used to provide coverage information,
+ i.e., data that shows which lines of the library are executed how many
+ times by running through all of the tests in the testsuite. This is of
+ interest in finding places in the library that are not covered by
+ the testsuite and, consequently, are prone to the inadvertent
+ introduction of bugs since existing functionality is not subject to
+ existing tests.
+
+
+
+ To run the testsuite in this mode, essentially, you have to do three
+ things:
+
+
+ build the library with appropriate profiling flags
+
+
+ run all or some tests (built with the same profiling flags)
+
+
+ gather all information and convert them to a viewable format.
+
+
+ In order to achieve the first two, configure the library with
+
+ You can then build the library and run the tests as usual.
+
+
+
+ For the last point, one can in principal use whatever tool one
+ wants. That said, the deal.II ctest driver already has builtin
+ functionality to gather all profiling files and submit them to cdash
+ where we already gather testsuite results
+ (see below). You can do so by invoking
+
- if the p4est library isn't picked up automatically. Note the presence
- of /FAST at the end of the path necessary when using
- the ./p4est-setup.sh script to select the release
- version of p4est. Obviously, you
- can also add additional flags to cmake as described in
- the general ReadMe file.
+ if the p4est library isn't picked up automatically.
diff --git a/deal.II/doc/license/adjust.pl b/deal.II/doc/license/adjust.pl
deleted file mode 100644
index d36541a325..0000000000
--- a/deal.II/doc/license/adjust.pl
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/perl
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2012 - 2013 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.
-##
-## ---------------------------------------------------------------------
-
-my $header=1;
-
-print << 'EOT'
-//----------------------------------------------------------------------
-// $Id$
-//
-// Copyright (C) 1998 - 2013 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.
-//
-//----------------------------------------------------------------------
-EOT
- ;
-
-while(<>)
-{
- $header=0 unless m/\/\//;
- next if $header;
- print;
-}
diff --git a/deal.II/doc/license/replace.sh b/deal.II/doc/license/replace.sh
deleted file mode 100755
index 5b87905cd3..0000000000
--- a/deal.II/doc/license/replace.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2012 - 2013 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.
-##
-## ---------------------------------------------------------------------
-
-FILE=$1
-
-FIRST_YEAR=$(grep Copyright $FILE | perl -pi -e 's/.*?(\d{4}).*/\1/')
-if [ "$FIRST_YEAR" = "2013" ] || (! [[ "$FIRST_YEAR" =~ "^[0-9]+$" ]])
-then
- YEAR="2013"
-else if
- YEAR="$FIRST_YEAR - 2013"
-fi
-
-sed -e "s/@YEAR@/$YEAR/" doc/license/header-template > /tmp/foobar22.temp
-
-header_lines=1
-on_whitespace=true
-whitespace_detected=false
-while read line
-do
- if $on_whitespace && [[ $line =~ "^$" ]]
- then
- whitespace_detected=true
- header_lines=$[$header_lines+1]
- continue
- else
- on_whitespace=false
- fi
-
- if ! [[ $line =~ "^//.*$" ]]
- then
- break
- else
- header_lines=$[$header_lines+1]
- fi
-done < $FILE
-
-if $whitespace_detected
-then
- echo "$FILE --> whitespace"
- echo "$FILE --> $header_lines"
-else
- if [ $header_lines -lt 10 ]
- then
- echo "$FILE --> $header_lines"
- fi
-fi
-
-tail -n+$header_lines $FILE >> /tmp/foobar22.temp
-
-cp /tmp/foobar22.temp $FILE
-
diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h
index c58ef940bd..73d5cb20e9 100644
--- a/deal.II/doc/news/changes.h
+++ b/deal.II/doc/news/changes.h
@@ -50,6 +50,24 @@ inconvenience this causes.
+
Changed: It was possible to call DoFAccessor::set_active_fe_index()
+ on non-active cells. However, this made no sense: Since degrees of
+ freedoms only exist on active cells
+ for hp::DoFHandler (i.e., there is currently no implementation
+ of multilevel hp::DoFHandler objects), it does not make sense
+ to assign active FE indices to non-active cells since they
+ do not have finite element spaces associated with them without
+ having any degrees of freedom.
+
+ The same of course is true for asking for the finite element active
+ on a non-active cell, i.e. using the functions
+ DoFAccessor::active_fe_index() and
+ DoFAccessor::get_fe(). All of these functions now produce exceptions on
+ non-active cells.
+
+ (Wolfgang Bangerth, 2014/01/24)
+
+
New: deal.II now links with the
BOOST
Iostreams library (at least if the libz and libbz2 libraries
@@ -84,6 +102,67 @@ inconvenience this causes.
Specific improvements
+
New/fixed: The ParameterHandler::print_parameters_section
+ method not worked 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
+ to ensure that the output is a valid XML document,
+ starting with one root element ParameterHandler and
+ compatible with read_input_from_xml and the parameterGUI.
+
+ (Martin Steigemann, 2014/02/01)
+
+
New: There is now a method to copy the content from a
+ PETScWrappers::MPI::Vector and TrilinosWrappers::MPI::Vector to
+ deal.II's parallel distributed vector.
+
+ (Ben Thompson, Martin Kronbichler, 2014/01/31)
+
+
Fixed: The SolutionTransfer class had all sorts of problems when
+ used with hp::DoFHandler that made its results at least questionable.
+ Several parts of this class have been rewritten to make the results
+ more predictable and, likely, more correct.
+
+ (Wolfgang Bangerth, 2014/01/26)
+
+
Fixed: A regression where a single whitespace accidentally added to
+ DEAL_II_LINKER_FLAGS internally prevented cmake-2.8.8 from configuring
+ sucessfully.
+
+ (Matthias Maier, Krysztof Bzowski, 2014/01/26)
+
+
Fixed: SparsityPattern::max_entries_per_row() forgot to consider
+ the last row of the matrix and consequently sometimes returned
+ wrong values. This is now fixed.
+
+ (Martin Kronbichler, 2014/01/22)
+
+
+
Improved: In rare cases when the vector of error indicators
+ has entries equal to zero the adjust_interesting_range method
+ produces a negative lower bound. As a result the
+ parallel::distributed::GridRefinement::refine_and_coarsen_fixed_*
+ methods flagged the wrong number of cells for coarsening and refinement.
+ This is now changed by adjusting the lower bound in adjust_interesting_range
+ only, if not equal to zero.
+
+ (Martin Steigemann, 2014/01/22)
+
+
+
Changed: It was previously possible to set the
+ active_fe_index on non-active cells of an hp::DoFHandler.
+ However, this was prone to mistakes because it may lead to the assumption
+ that a finite element space out of the ones described by the hp::FECollection
+ associated with this hp::DoFHandler was actually associated with such
+ a cell. Since we do not actually distribute degrees of freedom for such
+ hp::DoFHandler objects on non-active cells, this is not the case. Consequently,
+ it no longer has any effect to assign active FE indices to non-active cells:
+ these values are simply reset later on.
+
+ (Wolfgang Bangerth, 2014/01/20)
+
+
Fixed: The method DoFTools::extract_constant_modes only worked for
elements where the constant function 1 is represented by all ones. This
is now fixed by querying the element for its constant modes on each cell.
@@ -105,13 +184,14 @@ inconvenience this causes.
space. Doing so now raises an exception.
However, there are legitimate cases where one may want to interpolate
- from children to a parent's finite element space. Since in the hp
+ from children to a parent's finite element space or the other way around.
+ Since in the hp
case no finite element space is naturally associated with an inactive
cell, it is now possible to pass an explicit finite element index
- argument to the function specifying which element of an hp::FECollection
+ argument to these functions specifying which element of an hp::FECollection
object describes the space onto which you want to interpolate.
- (Wolfgang Bangerth, 2014/01/18)
+ (Mihai Alexe, Wolfgang Bangerth, 2014/01/18)
Fixed: The methods IndexSet::do_compress() and
diff --git a/deal.II/doc/publications/index.html b/deal.II/doc/publications/index.html
index 8850757a45..f33462423a 100644
--- a/deal.II/doc/publications/index.html
+++ b/deal.II/doc/publications/index.html
@@ -132,7 +132,7 @@
Older Releases
-
+
Wolfgang Bangerth, Timo Heister, Luca Heltai, Guido Kanschat, Martin Kronbichler, Matthias Maier, and Toby D. Young
@@ -288,12 +288,32 @@
International Journal of Heat and Mass Transfer, vol. 71, pp. 183-188, 2014.
+
+ M. Hintermüller, A. Schiela, W. Wollner
+
+ The length of the primal-dual path in
+ Moreau-Yosida-based path-following for state constrained
+ optimal control
+
+
+ SIAM J. Optim., vol. 24, pp. 108-126, 2014.
+
+
T. Wick, G. Singh, M.F. Wheeler
Pressurized-Fracture propagation using a phase-field approach coupled to a reservoir simulator
- SPE 168597-MS, SPE HFTC Proc. 2014.
+ SPE 168597-MS, SPE HFTC Proc., 2014.
+
+
+
M.F. Wheeler, T. Wick, W. Wollner
+
+ An Augmented-Lagrangian Method for the Phase-Field Approach for
+Pressurized Fractures
+
+
+ Comput. Methods Appl. Mech. Engrg., vol. 271, pp. 69-85, 2014.
M. R. Opmeer, T. Reis, W. Wollner
+
+ Finite-Rank ADI Iteration for Operator Lyapunov Equations
+
+ SIAM J. Control Optim., vol. 51, pp. 4084-4117, 2013.
+
+
T. Povall
Single Crystal Plasticity at Finite Strains: A Computational Investigation of Hardening Relations
@@ -1266,7 +1293,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with
DOI:
10.1103/PhysRevB.88.125308
-
+
R. Hartmann
@@ -1289,17 +1316,6 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with
arXiv:1209.2811 [math.NA], 2012.
-
- M. Hintermüller, A. Schiela, W. Wollner
-
- The length of the primal-dual path in
- Moreau-Yosida-based path-following for state constrained
- optimal control
-
-
- IGB-Report 57, Karl-Franzens-University Graz, Austria, 2012.
-
-
M. Hinze, M. Kunkel, A. Steinbrecher, T. Stykel
Model order reduction of coupled circuit-device systems
diff --git a/deal.II/examples/step-1/doc/intro.dox b/deal.II/examples/step-1/doc/intro.dox
index d4f763a4ba..d4b8e8a85c 100644
--- a/deal.II/examples/step-1/doc/intro.dox
+++ b/deal.II/examples/step-1/doc/intro.dox
@@ -111,6 +111,17 @@ end of the results section of this program, where we also provide a few links
to other useful pieces of information.
+
Video lectures on tutorial programs
+
+This and several of the other tutorial programs are also discussed and
+demonstrated in Wolfgang
+Bangerth's video lectures on deal.II and computational science. In
+particular, you can see the steps he executes to run this and other
+programs, and you will get a much better idea of the tools that can be
+used to work with deal.II.
+
+
What this program does
Let's come back to step-1, the current program.
@@ -148,7 +159,7 @@ that we typically train mathematicians, engineers, or scientists in but that
is important when you start writing software of more than a few hundred
lines. Remember: Producing software is not the same as just writing code.
-To make your life easier on this journey let us point to two resources that
+To make your life easier on this journey let us point to three resources that
are worthwhile browsing through before you start any large-scale programming:
- The Best
+ Practices for Scientific Computing that gives an introduction to
+ many of the ways by which you can make sure you are an efficient
+ programmer writing programs that work.
+
As a general recommendation: If you expect to spend more than a few days
writing software in the future, do yourself the favor of learning tools that
can make your life more productive, in particular debuggers and integrated
development environments. You will find that you will get the time spent
learning these tools back severalfold soon by being more productive!
+Several of the video lectures referenced above show how to use tools
+such as integrated development environments or debuggers.
diff --git a/deal.II/examples/step-1/doc/results.dox b/deal.II/examples/step-1/doc/results.dox
index 751a3910b8..7cd2eebf64 100644
--- a/deal.II/examples/step-1/doc/results.dox
+++ b/deal.II/examples/step-1/doc/results.dox
@@ -1,7 +1,6 @@
Results
-The program has, after having been run, produced two grids, which look
-like this:
+Running the program produces graphics of two grids (grid-1.eps and grid-2.eps). They look like this:
diff --git a/deal.II/examples/step-1/step-1.cc b/deal.II/examples/step-1/step-1.cc
index 96da272b2b..eab42734ff 100644
--- a/deal.II/examples/step-1/step-1.cc
+++ b/deal.II/examples/step-1/step-1.cc
@@ -75,6 +75,7 @@ void first_grid ()
std::ofstream out ("grid-1.eps");
GridOut grid_out;
grid_out.write_eps (triangulation, out);
+ std::cout << "Grid written to grid-1.eps" << std::endl;
}
@@ -190,6 +191,7 @@ void second_grid ()
GridOut grid_out;
grid_out.write_eps (triangulation, out);
+ std::cout << "Grid written to grid-2.eps" << std::endl;
// At this point, all objects created in this function will be destroyed in
// reverse order. Unfortunately, we defined the boundary object after the
diff --git a/deal.II/examples/step-17/doc/results.dox b/deal.II/examples/step-17/doc/results.dox
index 9720ab3172..cb545b7eee 100644
--- a/deal.II/examples/step-17/doc/results.dox
+++ b/deal.II/examples/step-17/doc/results.dox
@@ -1,18 +1,26 @@
Results
-If the program above is compiled and run on a single processor machine, it
-should generate results that are very similar to those that we already got
-with step-8. However, it becomes more interesting if we run it on a cluster of
-computers. Most clusters have some kind of scheduling system, all of which
-have different calling syntaxes - on my system, I have to use the command
-bsub with a whole host of options to run a job in parallel - so
-that the exact command line syntax varies. If you have found out how to run a
-job on your system, you should get output like this for a job on 8 processors,
-and with a few more refinement cycles than in the code above (these
-results were generated in 2004 with older versions of deal.II and a
-version of METIS that generated different partitionings; consequently,
-the numbers you get today are slightly different):
+If the program above is compiled and run on a single processor
+machine, it should generate results that are very similar to those
+that we already got with step-8. However, it becomes more interesting
+if we run it on a multicore machine or a cluster of computers. The
+most basic way to run MPI programs is using a command line like
+@code
+ mpirun -np 32 ./step-17
+@endcode
+to run the step-17 executable with 32 processors.
+
+The command line above is the appropriate way of starting the program
+on a multicore machine when using MPI for parallelization. On the
+other hand, most clusters are shared resources and have some kind of
+scheduling system that distributes jobs onto available processors. All
+of these scheduling systems have their own calling syntax - on my system, I have to use the command
+qsub with a whole host of options to run a job in parallel - so
+that the exact command line syntax varies.
+
+Whether directly or through a scheduler, if you run this program on 8
+processors, you should get output like the following:
@code
Cycle 0:
Number of active cells: 64
@@ -84,8 +92,10 @@ Cycle 16:
471186+470686+475694)
Solver converged in 2251 iterations.
@endcode
-
-
+(This run uses a few more refinement cycles than the code available in
+the examples/ directory. The run also used a version of METIS from
+2004 that generated different partitionings; consequently,
+the numbers you get today are slightly different.)
As can be seen, we can easily get to almost four million unknowns. In fact, the
code's runtime with 8 processes was less than 7 minutes up to (and including)
diff --git a/deal.II/examples/step-2/step-2.cc b/deal.II/examples/step-2/step-2.cc
index b3c9d2debb..5f43d944ab 100644
--- a/deal.II/examples/step-2/step-2.cc
+++ b/deal.II/examples/step-2/step-2.cc
@@ -47,7 +47,7 @@
// resulting from the distribution of degrees of freedom on the grid. That
// class can be found here:
#include
-// We will also need to use an intermediate sparsity patter structure, which
+// We will also need to use an intermediate sparsity pattern structure, which
// is found in this file:
#include
diff --git a/deal.II/examples/step-32/doc/results.dox b/deal.II/examples/step-32/doc/results.dox
index ca0d584e14..d26392b17d 100644
--- a/deal.II/examples/step-32/doc/results.dox
+++ b/deal.II/examples/step-32/doc/results.dox
@@ -38,10 +38,19 @@ cluster at Texas A&M University.
Results for a 2d circular shell testcase
+Next, we will run step-32 with the parameter file in the directory. Here we
+are using 50 processors. The command to launch is (note that step-32.prm is
+the default):
-If we run the program as shown above (with the parameter file in the
-directory), the output will look roughly
-like this when run on 50 processors:
+
+
+$ mpirun -n 50 ./step-32
+
+
+
+Note that running a job on a cluster typically requires going through a job
+scheduler, which we won't discuss here. The output will look roughly like
+this:
diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc
index d6ed24c0e9..f2bc57d2d2 100644
--- a/deal.II/examples/step-4/step-4.cc
+++ b/deal.II/examples/step-4/step-4.cc
@@ -172,9 +172,9 @@ template
double RightHandSide::value (const Point &p,
const unsigned int /*component*/) const
{
- double return_value = 0;
+ double return_value = 0.0;
for (unsigned int i=0; iprevious_residual_norm
to the most negative value
+ // representable with double precision numbers so that the
+ // comparison whether the current residual is less than that of the
+ // previous step will always fail in the first step.
template
void
PlasticityContactProblem::solve_newton ()
@@ -1701,7 +1705,8 @@ namespace Step42
TrilinosWrappers::MPI::Vector locally_relevant_tmp_vector(locally_relevant_dofs, mpi_communicator);
TrilinosWrappers::MPI::Vector distributed_solution(locally_owned_dofs, mpi_communicator);
- double residual_norm, previous_residual_norm;
+ double residual_norm;
+ double previous_residual_norm = -std::numeric_limits::max();
const double correct_sigma = sigma_0;
diff --git a/deal.II/include/deal.II/base/event.h b/deal.II/include/deal.II/base/event.h
index a62e98643d..1cf7b27e73 100644
--- a/deal.II/include/deal.II/base/event.h
+++ b/deal.II/include/deal.II/base/event.h
@@ -202,7 +202,7 @@ namespace Algorithms
const unsigned int n = flags.size();
const unsigned int m = event.flags.size();
- const unsigned int n_min = std::min(n, m);
+ const unsigned int n_min = (n((index),0,(range)))
diff --git a/deal.II/include/deal.II/base/index_set.h b/deal.II/include/deal.II/base/index_set.h
index 166a642a23..2ed89bee18 100644
--- a/deal.II/include/deal.II/base/index_set.h
+++ b/deal.II/include/deal.II/base/index_set.h
@@ -1,7 +1,7 @@
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2009 - 2013 by the deal.II authors
+// Copyright (C) 2009 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
@@ -743,17 +743,12 @@ IndexSet::nth_index_in_set (const unsigned int n) const
range_end = ranges.end();
}
- std::vector::const_iterator
+ const std::vector::const_iterator
p = Utilities::lower_bound(range_begin, range_end, r,
Range::nth_index_compare);
- if (p != ranges.end())
- return p->begin + (n-p->nth_index_in_set);
- else
- {
- Assert (false, ExcInternalError());
- return numbers::invalid_dof_index;
- }
+ Assert (p != ranges.end(), ExcInternalError());
+ return p->begin + (n-p->nth_index_in_set);
}
diff --git a/deal.II/include/deal.II/base/parameter_handler.h b/deal.II/include/deal.II/base/parameter_handler.h
index 2e1ce3b072..a45d621ef1 100644
--- a/deal.II/include/deal.II/base/parameter_handler.h
+++ b/deal.II/include/deal.II/base/parameter_handler.h
@@ -1769,7 +1769,7 @@ public:
/**
* Print all parameters with the given style to out. Presently
- * only Text and LaTeX are implemented.
+ * only Text, LaTeX and XML are implemented.
*
* In Text format, the output is formatted in such a way that it
* is possible to use it for later input again. This is most useful to
@@ -1782,6 +1782,10 @@ public:
* well as the documenting string given to the declare_entry() function
* if available.
*
+ * In XML format, the output starts with one root element
+ * ParameterHandler in order to get a valid XML document
+ * and all subsections under it.
+ *
* In Text format, the output contains the same information but
* in a format so that the resulting file can be input into a latex
* document such as a manual for the code for which this object handles
@@ -1817,12 +1821,18 @@ public:
* by entering and leaving subsections through the enter_subsection() and
* leave_subsection() functions.
*
+ * If include_top_level_elements is true, also
+ * the higher subsection elements are printed. In XML format
+ * this is required to get a valid XML document and output starts
+ * with one root element ParameterHandler.
+ *
* In most cases, you will not want to use this function directly, but
* have it called recursively by the previous function.
*/
void print_parameters_section (std::ostream &out,
const OutputStyle style,
- const unsigned int indent_level);
+ const unsigned int indent_level,
+ const bool include_top_level_elements = false);
/**
* Print parameters to a logstream. This function allows to print all
diff --git a/deal.II/include/deal.II/base/symmetric_tensor.h b/deal.II/include/deal.II/base/symmetric_tensor.h
index 93ffc6296a..66814824fe 100644
--- a/deal.II/include/deal.II/base/symmetric_tensor.h
+++ b/deal.II/include/deal.II/base/symmetric_tensor.h
@@ -1,7 +1,7 @@
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2005 - 2013 by the deal.II authors
+// Copyright (C) 2005 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
@@ -1061,6 +1061,17 @@ namespace internal
{
namespace SymmetricTensorAccessors
{
+ template
+ Accessor::
+ Accessor ()
+ :
+ tensor (*static_cast(0)),
+ previous_indices ()
+ {
+ Assert (false, ExcMessage ("You can't call the default constructor of this class."));
+ }
+
+
template
Accessor::
Accessor (tensor_type &tensor,
@@ -1071,6 +1082,15 @@ namespace internal
{}
+ template
+ Accessor::
+ Accessor (const Accessor &a)
+ :
+ tensor (a.tensor),
+ previous_indices (a.previous_indices)
+ {}
+
+
template
Accessor
@@ -1082,6 +1102,18 @@ namespace internal
+ template
+ Accessor::
+ Accessor ()
+ :
+ tensor (*static_cast(0)),
+ previous_indices ()
+ {
+ Assert (false, ExcMessage ("You can't call the default constructor of this class."));
+ }
+
+
+
template
Accessor::
Accessor (tensor_type &tensor,
@@ -1093,6 +1125,16 @@ namespace internal
+ template
+ Accessor::
+ Accessor (const Accessor &a)
+ :
+ tensor (a.tensor),
+ previous_indices (a.previous_indices)
+ {}
+
+
+
template
typename Accessor::reference
Accessor::operator[] (const unsigned int i)
diff --git a/deal.II/include/deal.II/distributed/tria.h b/deal.II/include/deal.II/distributed/tria.h
index ce0a862fb2..b00a01b224 100644
--- a/deal.II/include/deal.II/distributed/tria.h
+++ b/deal.II/include/deal.II/distributed/tria.h
@@ -514,17 +514,20 @@ namespace parallel
* Save the refinement information from the coarse mesh into the given
* file. This file needs to be reachable from all nodes in the computation
* on a shared network file system. See the SolutionTransfer class
- * on how to store solution vectors into this file.
+ * on how to store solution vectors into this file. Additional cell-based data can be saved
+ * using register_data_attach().
*/
void save(const char *filename) const;
/**
* Load the refinement information saved with save() back in. The mesh
- * must contain the same coarse mesh that was used in save(). You do not
+ * must contain the same coarse mesh that was used in save() before calling
+ * this function. You do not
* need to load with the same number of MPI processes that you saved
* with. Rather, if a mesh is loaded with a different number of MPI
* processes than used at the time of saving, the mesh is repartitioned
- * appropriately.
+ * appropriately. Cell-based data that was saved with register_data_attach()
+ * can be read in with notify_ready_to_unpack() after calling load().
*/
void load(const char *filename);
diff --git a/deal.II/include/deal.II/dofs/dof_accessor.h b/deal.II/include/deal.II/dofs/dof_accessor.h
index 885eeff0ee..038443436e 100644
--- a/deal.II/include/deal.II/dofs/dof_accessor.h
+++ b/deal.II/include/deal.II/dofs/dof_accessor.h
@@ -1,7 +1,7 @@
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1998 - 2013 by the deal.II authors
+// Copyright (C) 1998 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
@@ -1448,7 +1448,7 @@ public:
* cells.
*
* In principle, it works as follows: if the cell pointed to by this
- * object is terminal, then the dof values are set in the global
+ * object is terminal (i.e., has no children), then the dof values are set in the global
* data vector by calling the set_dof_values() function; otherwise,
* the values are prolonged to each of the children and this
* function is called for each of them.
@@ -1467,6 +1467,22 @@ public:
* requirements are not taken care of and must be enforced by the
* user afterward.
*
+ * If the cell is part of a hp::DoFHandler object, cells only have an
+ * associated finite element space if they are active. However, this
+ * function is supposed to also work on inactive cells
+ * with children. Consequently, it carries a third argument that can be
+ * used in the hp context that denotes the finite element space we are
+ * supposed to interpret the input vector of this function in.
+ * If the cell is active, this function
+ * then interpolates the input vector interpreted as an element of the space described
+ * by the fe_indexth element of the hp::FECollection associated
+ * with the hp::DoFHandler of which this cell is a part of, and interpolates
+ * it into the space that is associated with this cell. On the other hand, if the cell
+ * is not active, then we first perform this interpolation from this cell
+ * to its children using the given fe_index until we end
+ * up on an active cell, at which point we follow the procedure outlined
+ * at the beginning of the paragraph.
+ *
* It is assumed that both vectors already have the right size
* beforehand. This function relies on the existence of a natural
* interpolation property of finite element spaces of a cell to its
@@ -1477,17 +1493,10 @@ public:
* element class for a description of what the prolongation matrices
* represent in this case.
*
- * Unlike the set_dof_values() function, this function is associated
- * to cells rather than to lines, quads, and hexes, since
- * interpolation is presently only provided for cells by the finite
- * element objects.
- *
- * The output vector may be either a Vector, Vector,
- * or a BlockVector, or a PETSc vector if deal.II is
- * compiled to support these libraries. It is in the responsibility
- * of the caller to assure that the types of the numbers stored in
- * input and output vectors are compatible and with similar
- * accuracy.
+ * @note Unlike the get_dof_values() function, this function is only available
+ * on cells, rather than on lines, quads, and hexes, since interpolation
+ * is presently only provided for cells by the finite element
+ * classes.
*/
template
void set_dof_values_by_interpolation (const Vector &local_values,
@@ -1651,18 +1660,47 @@ public:
* this iterator. For non-hp DoF handlers, this is of course always
* the same element, independent of the cell we are presently on,
* but for hp DoF handlers, this may change from cell to cell.
+ *
+ * @note Since degrees of freedoms only exist on active cells
+ * for hp::DoFHandler (i.e., there is currently no implementation
+ * of multilevel hp::DoFHandler objects), it does not make sense
+ * to query the finite element on non-active cells since they
+ * do not have finite element spaces associated with them without
+ * having any degrees of freedom. Consequently, this function will
+ * produce an exception when called on non-active cells.
*/
const FiniteElement &
get_fe () const;
/**
- * Returns the index inside the hp::FECollection of the
- * FiniteElement used for this cell.
+ * Returns the index inside the hp::FECollection of the
+ * FiniteElement used for this cell. This function is
+ * only useful if the DoF handler object associated with
+ * the current cell is an hp::DoFHandler.
+ *
+ * @note Since degrees of freedoms only exist on active cells
+ * for hp::DoFHandler (i.e., there is currently no implementation
+ * of multilevel hp::DoFHandler objects), it does not make sense
+ * to query active FE indices on non-active cells since they
+ * do not have finite element spaces associated with them without
+ * having any degrees of freedom. Consequently, this function will
+ * produce an exception when called on non-active cells.
*/
unsigned int active_fe_index () const;
/**
- * Sets the index of the FiniteElement used for this cell.
+ * Sets the index of the FiniteElement used for this cell. This
+ * determines which element in an hp::FECollection to use. This function is
+ * only useful if the DoF handler object associated with
+ * the current cell is an hp::DoFHandler.
+ *
+ * @note Since degrees of freedoms only exist on active cells
+ * for hp::DoFHandler (i.e., there is currently no implementation
+ * of multilevel hp::DoFHandler objects), it does not make sense
+ * to assign active FE indices to non-active cells since they
+ * do not have finite element spaces associated with them without
+ * having any degrees of freedom. Consequently, this function will
+ * produce an exception when called on non-active cells.
*/
void set_active_fe_index (const unsigned int i);
/**
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 2c9af2dcc0..9b689af2ab 100644
--- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h
+++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h
@@ -3439,6 +3439,13 @@ inline
const FiniteElement &
DoFCellAccessor::get_fe () const
{
+ Assert ((dynamic_cast*>
+ (this->dof_handler) != 0)
+ ||
+ (this->has_children() == false),
+ ExcMessage ("In hp::DoFHandler objects, finite elements are only associated "
+ "with active cells. Consequently, you can not ask for the "
+ "active finite element on cells with children."));
return dealii::internal::DoFAccessor::get_fe (this->dof_handler->get_fe(), active_fe_index());
}
@@ -3449,6 +3456,14 @@ inline
unsigned int
DoFCellAccessor::active_fe_index () const
{
+ Assert ((dynamic_cast*>
+ (this->dof_handler) != 0)
+ ||
+ (this->has_children() == false),
+ ExcMessage ("You can not ask for the active_fe_index on a cell that has "
+ "children because no degrees of freedom are assigned "
+ "to this cell and, consequently, no finite element "
+ "is associated with it."));
return dealii::internal::DoFCellAccessor::Implementation::active_fe_index (*this);
}
@@ -3459,6 +3474,13 @@ inline
void
DoFCellAccessor::set_active_fe_index (const unsigned int i)
{
+ Assert ((dynamic_cast*>
+ (this->dof_handler) != 0)
+ ||
+ (this->has_children() == false),
+ ExcMessage ("You can not set the active_fe_index on a cell that has "
+ "children because no degrees of freedom will be assigned "
+ "to this cell."));
dealii::internal::DoFCellAccessor::Implementation::set_active_fe_index (*this, i);
}
diff --git a/deal.II/include/deal.II/fe/fe_q_hierarchical.h b/deal.II/include/deal.II/fe/fe_q_hierarchical.h
index 54fe8b4e63..fd6602c5b1 100644
--- a/deal.II/include/deal.II/fe/fe_q_hierarchical.h
+++ b/deal.II/include/deal.II/fe/fe_q_hierarchical.h
@@ -310,6 +310,8 @@ public:
std::vector >
hp_vertex_dof_identities (const FiniteElement &fe_other) const;
+ /*@}*/
+
/**
* Return the matrix interpolating from a face of one
* element to the face of the neighboring element. The
diff --git a/deal.II/include/deal.II/grid/filtered_iterator.h b/deal.II/include/deal.II/grid/filtered_iterator.h
index c6a4c56f84..6356cd160a 100644
--- a/deal.II/include/deal.II/grid/filtered_iterator.h
+++ b/deal.II/include/deal.II/grid/filtered_iterator.h
@@ -357,7 +357,7 @@ namespace IteratorFilters
* @endcode
* Note that by the @p set_to_next_positive call the first cell with
* a set user flag was assigned to the @p begin iterator. For the
- * @{end} iterator, no such call was necessary, since the past-the-end
+ * #end iterator, no such call was necessary, since the past-the-end
* iterator always satisfies all predicates.
*
* The same can be achieved by the following snippet, though harder to read:
diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h
index 433ff1856b..87a8552b8f 100644
--- a/deal.II/include/deal.II/grid/tria.h
+++ b/deal.II/include/deal.II/grid/tria.h
@@ -485,7 +485,7 @@ namespace internal
* typedef quad_iterator cell_iterator;
* typedef active_quad_iterator active_cell_iterator;
*
-* typedef line_iterator face_iterator;
+ * typedef line_iterator face_iterator;
* typedef active_line_iterator active_face_iterator;
* @endcode
*
diff --git a/deal.II/include/deal.II/hp/mapping_collection.h b/deal.II/include/deal.II/hp/mapping_collection.h
index 512a6872b4..117d76bee0 100644
--- a/deal.II/include/deal.II/hp/mapping_collection.h
+++ b/deal.II/include/deal.II/hp/mapping_collection.h
@@ -148,16 +148,15 @@ namespace hp
{
private:
/**
- * A static MappingQ1
- * object. We can't use the one
- * in ::StaticMappingQ1 since
- * we can't make sure that the
- * constructor for that object
- * is run before the
- * constructor for the present
- * static object.
+ * A static MappingQ1 object. We can't use the one in ::StaticMappingQ1
+ * since we can't make sure that the constructor for that object is run
+ * before we want to use the object (when constructing mapping_collection
+ * below). Therefore we create a helper function which returns a
+ * reference to a static object that will be constructed the first time
+ * this function is called.
*/
- static MappingQ1 mapping_q1;
+ static
+ MappingQ1& return_static_mapping_q1();
public:
/**
diff --git a/deal.II/include/deal.II/lac/chunk_sparse_matrix.h b/deal.II/include/deal.II/lac/chunk_sparse_matrix.h
index e9ef398417..10d3831d8c 100644
--- a/deal.II/include/deal.II/lac/chunk_sparse_matrix.h
+++ b/deal.II/include/deal.II/lac/chunk_sparse_matrix.h
@@ -118,7 +118,7 @@ namespace ChunkSparseMatrixIterators
* Return a reference to the matrix into which this accessor points. Note
* that in the present case, this is a constant reference.
*/
- MatrixType &get_matrix () const;
+ const MatrixType &get_matrix () const;
private:
/**
@@ -791,11 +791,8 @@ public:
const size_type j) const;
/**
- * Return the main diagonal
- * element in the ith
- * row. This function throws an
- * error if the matrix is not
- * quadratic.
+ * Return the main diagonal element in the ith row. This function
+ * throws an error if the matrix is not quadratic.
*
* This function is considerably faster than the operator()(), since for
* quadratic matrices, the diagonal entry may be the first to be stored in
@@ -810,6 +807,21 @@ public:
*/
number &diag_element (const size_type i);
+ /**
+ * Extracts a copy of the values and indices in the given matrix row.
+ *
+ * The user is expected to pass the length of the arrays column_indices and
+ * values, which gives a means for checking that we do not write to
+ * unallocated memory. This method is motivated by a similar method in
+ * Trilinos row matrices and gives faster access to entries in the matrix as
+ * compared to iterators which are quite slow for this matrix type.
+ */
+ void extract_row_copy (const size_type row,
+ const size_type array_length,
+ size_type &row_length,
+ size_type *column_indices,
+ number *values) const;
+
//@}
/**
* @name Matrix vector multiplications
@@ -1650,7 +1662,7 @@ namespace ChunkSparseMatrixIterators
template
inline
- typename Accessor::MatrixType &
+ const typename Accessor::MatrixType &
Accessor::get_matrix () const
{
return *matrix;
diff --git a/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h b/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
index 62f8409c8f..188a020e40 100644
--- a/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
+++ b/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
@@ -596,6 +596,60 @@ ChunkSparseMatrix::add (const number factor,
}
+
+template
+void
+ChunkSparseMatrix::extract_row_copy (const size_type row,
+ const size_type array_length,
+ size_type &row_length,
+ size_type *column_indices,
+ number *values) const
+{
+ AssertIndexRange(cols->row_length(row), array_length+1);
+ AssertIndexRange(row, m());
+ const unsigned int chunk_size = cols->get_chunk_size();
+ const size_type reduced_row = row/chunk_size;
+
+ SparsityPattern::iterator it = cols->sparsity_pattern.begin(reduced_row),
+ itend = cols->sparsity_pattern.end(reduced_row);
+ const number *val_ptr = &val[(it-cols->sparsity_pattern.begin(0))*chunk_size*chunk_size
+ +(row%chunk_size)*chunk_size];
+
+ // find out if we did padding and if this row is affected by it
+ if (cols->n_cols() % chunk_size == 0)
+ {
+ for ( ; it < itend; ++it)
+ {
+ for (unsigned int c=0; ccolumn()*chunk_size+c;
+ }
+ val_ptr += chunk_size*chunk_size;
+ }
+ row_length = chunk_size * (cols->sparsity_pattern.row_length(reduced_row));
+ }
+ else
+ {
+ const unsigned int last_chunk_size = cols->n_cols() % chunk_size;
+ row_length = 0;
+ for ( ; it < itend; ++it)
+ {
+ const unsigned int next_chunk_size =
+ (it->column()==cols->sparsity_pattern.n_cols()-1) ?
+ last_chunk_size : chunk_size;
+ for (unsigned int c=0; ccolumn()*chunk_size+c;
+ }
+ val_ptr += chunk_size*chunk_size;
+ }
+ }
+}
+
+
+
template
template
void
diff --git a/deal.II/include/deal.II/lac/matrix_block.h b/deal.II/include/deal.II/lac/matrix_block.h
index f6542c8bcf..591f899180 100644
--- a/deal.II/include/deal.II/lac/matrix_block.h
+++ b/deal.II/include/deal.II/lac/matrix_block.h
@@ -1,7 +1,7 @@
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2007 - 2013 by the deal.II authors
+// Copyright (C) 2007 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
@@ -388,7 +388,8 @@ private:
*/
BlockIndices column_indices;
- friend void internal::reinit<>(MatrixBlock &, const BlockSparsityPattern &);
+ template
+ friend void internal::reinit(MatrixBlock &, const BlockSparsityPattern &);
};
diff --git a/deal.II/include/deal.II/lac/parallel_block_vector.h b/deal.II/include/deal.II/lac/parallel_block_vector.h
index 7ffd04094b..3778ba590b 100644
--- a/deal.II/include/deal.II/lac/parallel_block_vector.h
+++ b/deal.II/include/deal.II/lac/parallel_block_vector.h
@@ -24,13 +24,16 @@
#include
#include
+#include
+#include
+
+
#include
#include
DEAL_II_NAMESPACE_OPEN
-
namespace parallel
{
namespace distributed
@@ -171,6 +174,31 @@ namespace parallel
BlockVector &
operator= (const Vector &V);
+#ifdef DEAL_II_WITH_PETSC
+ /**
+ * Copy the content of a PETSc vector into the calling vector. This
+ * function assumes that the vectors layouts have already been
+ * initialized to match.
+ *
+ * This operator is only available if deal.II was configured with PETSc.
+ */
+ BlockVector &
+ operator = (const PETScWrappers::MPI::BlockVector &petsc_vec);
+#endif
+
+#ifdef DEAL_II_WITH_TRILINOS
+ /**
+ * Copy the content of a Trilinos vector into the calling vector. This
+ * function assumes that the vectors layouts have already been
+ * initialized to match.
+ *
+ * This operator is only available if deal.II was configured with
+ * Trilinos.
+ */
+ BlockVector &
+ operator = (const TrilinosWrappers::MPI::BlockVector &trilinos_vec);
+#endif
+
/**
* Reinitialize the BlockVector to contain num_blocks blocks of
* size block_size each.
@@ -594,6 +622,42 @@ namespace parallel
+#ifdef DEAL_II_WITH_PETSC
+
+ template
+ inline
+ BlockVector &
+ BlockVector::operator = (const PETScWrappers::MPI::BlockVector &petsc_vec)
+ {
+ AssertDimension(this->n_blocks(), petsc_vec.n_blocks());
+ for (unsigned int i=0; in_blocks(); ++i)
+ this->block(i) = petsc_vec.block(i);
+
+ return *this;
+ }
+
+#endif
+
+
+
+#ifdef DEAL_II_WITH_TRILINOS
+
+ template
+ inline
+ BlockVector &
+ BlockVector::operator = (const TrilinosWrappers::MPI::BlockVector &trilinos_vec)
+ {
+ AssertDimension(this->n_blocks(), trilinos_vec.n_blocks());
+ for (unsigned int i=0; in_blocks(); ++i)
+ this->block(i) = trilinos_vec.block(i);
+
+ return *this;
+ }
+
+#endif
+
+
+
template
inline
void
diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h
index 7ccb1f9743..126737eba7 100644
--- a/deal.II/include/deal.II/lac/parallel_vector.h
+++ b/deal.II/include/deal.II/lac/parallel_vector.h
@@ -33,6 +33,27 @@
DEAL_II_NAMESPACE_OPEN
+#ifdef DEAL_II_WITH_PETSC
+namespace PETScWrappers
+{
+ namespace MPI
+ {
+ class Vector;
+ }
+}
+#endif
+
+#ifdef DEAL_II_WITH_TRILINOS
+namespace TrilinosWrappers
+{
+ namespace MPI
+ {
+ class Vector;
+ }
+}
+#endif
+
+
namespace parallel
{
namespace distributed
@@ -275,6 +296,31 @@ namespace parallel
Vector &
operator = (const Vector &in_vector);
+#ifdef DEAL_II_WITH_PETSC
+ /**
+ * Copy the content of a PETSc vector into the calling vector. This
+ * function assumes that the vectors layouts have already been
+ * initialized to match.
+ *
+ * This operator is only available if deal.II was configured with PETSc.
+ */
+ Vector &
+ operator = (const PETScWrappers::MPI::Vector &petsc_vec);
+#endif
+
+#ifdef DEAL_II_WITH_TRILINOS
+ /**
+ * Copy the content of a Trilinos vector into the calling vector. This
+ * function assumes that the vectors layouts have already been
+ * initialized to match.
+ *
+ * This operator is only available if deal.II was configured with
+ * Trilinos.
+ */
+ Vector &
+ operator = (const TrilinosWrappers::MPI::Vector &trilinos_vec);
+#endif
+
/**
* This method copies the local range from another vector with the same
* local range, but possibly different layout of ghost indices.
diff --git a/deal.II/include/deal.II/lac/parallel_vector.templates.h b/deal.II/include/deal.II/lac/parallel_vector.templates.h
index 624168b2e7..252c5b926c 100644
--- a/deal.II/include/deal.II/lac/parallel_vector.templates.h
+++ b/deal.II/include/deal.II/lac/parallel_vector.templates.h
@@ -20,6 +20,10 @@
#include
#include
+#include
+
+#include
+#include
DEAL_II_NAMESPACE_OPEN
@@ -204,6 +208,82 @@ namespace parallel
+#ifdef DEAL_II_WITH_PETSC
+
+ template
+ Vector &
+ Vector::operator = (const PETScWrappers::MPI::Vector &petsc_vec)
+ {
+ Assert(petsc_vec.locally_owned_elements() == locally_owned_elements(),
+ StandardExceptions::ExcInvalidState());
+
+ // get a representation of the vector and copy it
+ PetscScalar *start_ptr;
+ int ierr = VecGetArray (static_cast(petsc_vec), &start_ptr);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ const size_type vec_size = local_size();
+ std::copy (start_ptr, start_ptr + vec_size, begin());
+
+ // restore the representation of the vector
+ ierr = VecRestoreArray (static_cast(petsc_vec), &start_ptr);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ // spread ghost values between processes?
+ if (vector_is_ghosted || petsc_vec.has_ghost_elements())
+ update_ghost_values();
+
+ // return a pointer to this object per normal c++ operator overloading
+ // semantics
+ return *this;
+ }
+
+#endif
+
+
+
+#ifdef DEAL_II_WITH_TRILINOS
+
+ template
+ Vector &
+ Vector::operator = (const TrilinosWrappers::MPI::Vector &trilinos_vec)
+ {
+ if (trilinos_vec.has_ghost_elements() == false)
+ {
+ Assert(trilinos_vec.locally_owned_elements() == locally_owned_elements(),
+ StandardExceptions::ExcInvalidState());
+ }
+ else
+ // ghosted trilinos vector must contain the local range of this vector
+ // which is contiguous
+ {
+ Assert((trilinos_vec.locally_owned_elements() & locally_owned_elements())
+ == locally_owned_elements(),
+ StandardExceptions::ExcInvalidState());
+ }
+
+ // create on trilinos data
+ const std::size_t start_index =
+ trilinos_vec.vector_partitioner().NumMyElements() > 0 ?
+ trilinos_vec.vector_partitioner().
+ LID(static_cast(this->local_range().first)) : 0;
+ const VectorView in_view (local_size(), trilinos_vec.begin()+start_index);
+ static_cast&>(vector_view) =
+ static_cast&>(in_view);
+
+ // spread ghost values between processes?
+ if (vector_is_ghosted || trilinos_vec.has_ghost_elements())
+ update_ghost_values();
+
+ // return a pointer to this object per normal c++ operator overloading
+ // semantics
+ return *this;
+ }
+
+#endif
+
+
+
template
void
Vector::copy_from (const Vector &c,
diff --git a/deal.II/include/deal.II/lac/petsc_full_matrix.h b/deal.II/include/deal.II/lac/petsc_full_matrix.h
index 176e9d5fc3..c800efccd2 100644
--- a/deal.II/include/deal.II/lac/petsc_full_matrix.h
+++ b/deal.II/include/deal.II/lac/petsc_full_matrix.h
@@ -50,26 +50,52 @@ namespace PETScWrappers
class FullMatrix : public MatrixBase
{
public:
+
/**
* Declare type for container size.
*/
typedef types::global_dof_index size_type;
+
+ /**
+ * Default constructor. Create an empty matrix.
+ */
+ FullMatrix ();
+
+
/**
- * Create a full matrix of dimensions
- * @p m times @p n.
+ * Create a full matrix of dimensions @p m times @p n.
*/
FullMatrix (const size_type m,
const size_type n);
+
/**
- * Return a reference to the MPI
- * communicator object in use with this
- * matrix. Since this is a sequential
- * matrix, it returns the MPI_COMM_SELF
- * communicator.
+ * Throw away the present matrix and generate one that has the
+ * same properties as if it were created by the constructor of
+ * this class with the same argument list as the present function.
+ */
+ void reinit (const size_type m,
+ const size_type n);
+
+
+ /**
+ * Return a reference to the MPI communicator object in use with
+ * this matrix. Since this is a sequential matrix, it returns the
+ * MPI_COMM_SELF communicator.
*/
virtual const MPI_Comm &get_mpi_communicator () const;
+
+ private:
+
+ /**
+ * Do the actual work for the respective reinit() function and the
+ * matching constructor, i.e. create a matrix. Getting rid of the
+ * previous matrix is left to the caller.
+ */
+ void do_reinit (const size_type m,
+ const size_type n);
+
};
/*@}*/
diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h
index ad8f01b418..ded75613d4 100644
--- a/deal.II/include/deal.II/lac/slepc_solver.h
+++ b/deal.II/include/deal.II/lac/slepc_solver.h
@@ -174,7 +174,7 @@ namespace SLEPcWrappers
/**
* Same as above, but here a composite method for solving the
* system $A x=\lambda B x$ with real matrices $A, B$ and
- * imaginary eigenpairs $x, \lamda$.
+ * imaginary eigenpairs $x, \lambda$.
*/
template
void
diff --git a/deal.II/include/deal.II/lac/sparse_matrix.h b/deal.II/include/deal.II/lac/sparse_matrix.h
index 4efc719c17..2fae863171 100644
--- a/deal.II/include/deal.II/lac/sparse_matrix.h
+++ b/deal.II/include/deal.II/lac/sparse_matrix.h
@@ -145,7 +145,7 @@ namespace SparseMatrixIterators
* Return a reference to the matrix into which this accessor points. Note
* that in the present case, this is a constant reference.
*/
- MatrixType &get_matrix () const;
+ const MatrixType &get_matrix () const;
private:
/**
@@ -2086,7 +2086,7 @@ namespace SparseMatrixIterators
template
inline
- typename Accessor::MatrixType &
+ const typename Accessor::MatrixType &
Accessor::get_matrix () const
{
return *matrix;
diff --git a/deal.II/include/deal.II/lac/sparsity_pattern.h b/deal.II/include/deal.II/lac/sparsity_pattern.h
index 414e6ea92b..e53b7184c6 100644
--- a/deal.II/include/deal.II/lac/sparsity_pattern.h
+++ b/deal.II/include/deal.II/lac/sparsity_pattern.h
@@ -429,22 +429,6 @@ public:
*/
SparsityPattern (const SparsityPattern &);
- /**
- * Initialize a rectangular matrix.
- *
- * @arg m number of rows
- * @arg n number of columns
- * @arg max_per_row maximum number of nonzero entries per row
- * @arg optimize_diagonal This parameter is ignored.
- *
- * @deprecated Use the constructor without the last argument since
- * it is ignored.
- */
- SparsityPattern (const size_type m,
- const size_type n,
- const unsigned int max_per_row,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
-
/**
* Initialize a rectangular matrix.
*
@@ -456,22 +440,6 @@ public:
const size_type n,
const unsigned int max_per_row);
- /**
- * Initialize a rectangular matrix.
- *
- * @arg m number of rows
- * @arg n number of columns
- * @arg row_lengths possible number of nonzero entries for each row. This
- * vector must have one entry for each row.
- * @arg optimize_diagonal This argument is ignored.
- *
- * @deprecated Use the constructor without the last argument since
- * it is ignored.
- */
- SparsityPattern (const size_type m,
- const size_type n,
- const std::vector &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Initialize a rectangular matrix.
@@ -496,21 +464,6 @@ public:
SparsityPattern (const size_type n,
const unsigned int max_per_row);
- /**
- * Initialize a quadratic matrix.
- *
- * @arg m number of rows and columns
- * @arg row_lengths possible number of nonzero entries for each row. This
- * vector must have one entry for each row.
- * @arg optimize_diagonal This argument is ignored.
- *
- * @deprecated Use the constructor without the last argument since
- * it is ignored.
- */
- SparsityPattern (const size_type m,
- const std::vector &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
-
/**
* Initialize a quadratic matrix.
*
@@ -559,22 +512,6 @@ public:
*/
SparsityPattern &operator = (const SparsityPattern &);
- /**
- * Reallocate memory and set up data structures for a new matrix with m
- * rows and n columns, with at most max_per_row
- * nonzero entries per row.
- *
- * This function simply maps its operations to the other reinit
- * function.
- *
- * @deprecated The last argument of this function is ignored. Use the
- * version of this function without the last argument.
- */
- void reinit (const size_type m,
- const size_type n,
- const unsigned int max_per_row,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
-
/**
* Reallocate memory and set up data structures for a new matrix with m
* rows and n columns, with at most max_per_row
@@ -587,27 +524,6 @@ public:
const size_type n,
const unsigned int max_per_row);
- /**
- * Reallocate memory for a matrix of size m x n. The number of
- * entries for each row is taken from the array row_lengths which
- * has to give this number of each row i=1...m.
- *
- * If m*n==0 all memory is freed, resulting in a total
- * reinitialization of the object. If it is nonzero, new memory is only
- * allocated if the new size extends the old one. This is done to save time
- * and to avoid fragmentation of the heap.
- *
- * If the number of rows equals the number of columns and the last parameter
- * is true, diagonal elements are stored first in each row to allow
- * optimized access in relaxation methods of SparseMatrix.
- *
- * @deprecated The last argument of this function is ignored. Use the
- * version of this function without the last argument.
- */
- void reinit (const size_type m,
- const size_type n,
- const std::vector &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Reallocate memory for a matrix of size m x n. The number of
@@ -627,16 +543,6 @@ public:
const size_type n,
const std::vector &row_lengths);
- /**
- * Same as above, but with a VectorSlice argument instead.
- *
- * @deprecated The last argument of this function is ignored. Use the
- * version of this function without the last argument.
- */
- void reinit (const size_type m,
- const size_type n,
- const VectorSlice > &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Same as above, but with a VectorSlice argument instead.
@@ -659,91 +565,6 @@ public:
*/
void compress ();
- /**
- * This function can be used as a replacement for reinit(), subsequent calls
- * to add() and a final call to close() if you know exactly in advance the
- * entries that will form the matrix sparsity pattern.
- *
- * The first two parameters determine the size of the matrix. For the two
- * last ones, note that a sparse matrix can be described by a sequence of
- * rows, each of which is represented by a sequence of pairs of column
- * indices and values. In the present context, the begin() and end()
- * parameters designate iterators (of forward iterator type) into a
- * container, one representing one row. The distance between begin() and
- * end() should therefore be equal to n_rows(). These iterators may be
- * iterators of std::vector, std::list, pointers into a
- * C-style array, or any other iterator satisfying the requirements of a
- * forward iterator. The objects pointed to by these iterators (i.e. what we
- * get after applying operator* or operator-> to one of
- * these iterators) must be a container itself that provides functions
- * begin and end designating a range of iterators that
- * describe the contents of one line. Dereferencing these inner iterators
- * must either yield a pair of an unsigned integer as column index and a
- * value of arbitrary type (such a type would be used if we wanted to
- * describe a sparse matrix with one such object), or simply an unsigned
- * integer (of we only wanted to describe a sparsity pattern). The function
- * is able to determine itself whether an unsigned integer or a pair is what
- * we get after dereferencing the inner iterators, through some template
- * magic.
- *
- * While the order of the outer iterators denotes the different rows of the
- * matrix, the order of the inner iterator denoting the columns does not
- * matter, as they are sorted internal to this function anyway.
- *
- * Since that all sounds very complicated, consider the following example
- * code, which may be used to fill a sparsity pattern:
- * @code
- * std::vector > column_indices (n_rows);
- * for (unsigned int row=0; rowbegin and end (namely
- * std::vectors), and the inner iterators dereferenced yield
- * unsigned integers as column indices. Note that we could have replaced
- * each of the two std::vector occurrences by std::list,
- * and the inner one by std::set as well.
- *
- * Another example would be as follows, where we initialize a whole matrix,
- * not only a sparsity pattern:
- * @code
- * std::vector > entries (n_rows);
- * for (unsigned int row=0; rowstd::vector could
- * be replaced by std::list, and the inner std::map could be replaced by std::vector >, or a list or set of such pairs, as they all return
- * iterators that point to such pairs.
- *
- * @deprecated The last argument of this function is ignored. Use the
- * version of this function without the last argument.
- */
- template
- void copy_from (const size_type n_rows,
- const size_type n_cols,
- const ForwardIterator begin,
- const ForwardIterator end,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* This function can be used as a replacement for reinit(), subsequent calls
@@ -827,19 +648,6 @@ public:
const ForwardIterator begin,
const ForwardIterator end);
- /**
- * Copy data from an object of type CompressedSparsityPattern,
- * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern.
- * Previous content of this object is lost, and the sparsity pattern is in
- * compressed mode afterwards.
- *
- * @deprecated The last argument of this function is ignored. Use the
- * version of this function without the last argument.
- */
- template
- void copy_from (const CompressedSparsityType &csp,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
-
/**
* Copy data from an object of type CompressedSparsityPattern,
* CompressedSetSparsityPattern or CompressedSimpleSparsityPattern. Although
@@ -851,19 +659,6 @@ public:
template
void copy_from (const CompressedSparsityType &csp);
- /**
- * Take a full matrix and use its nonzero entries to generate a sparse
- * matrix entry pattern for this object.
- *
- * Previous content of this object is lost, and the sparsity pattern is in
- * compressed mode afterwards.
- *
- * @deprecated The last argument of this function is ignored. Use the
- * version of this function without the last argument.
- */
- template
- void copy_from (const FullMatrix &matrix,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Take a full matrix and use its nonzero entries to generate a sparse
@@ -906,6 +701,10 @@ public:
const bool indices_are_sorted = false);
// @}
+
+
+
+
/**
* @name Iterators
*/
@@ -949,31 +748,6 @@ public:
*/
iterator end (const size_type r) const;
- /**
- * STL-like iterator with the first entry of row r.
- *
- * Note that if the given row is empty, i.e. does not contain any nonzero
- * entries, then the iterator returned by this function equals
- * end(r). Note also that the iterator may not be dereferencable in
- * that case.
- *
- * @deprecated Use the iterators provided by the begin() and end()
- * functions instead.
- */
- row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
-
- /**
- * Final iterator of row r. It points to the first element past the
- * end of line @p r, or past the end of the entire sparsity pattern.
- *
- * Note that the end iterator is not necessarily dereferencable. This is in
- * particular the case if it is the end iterator for the last row of a
- * matrix.
- *
- * @deprecated Use the iterators provided by the begin() and end()
- * functions instead.
- */
- row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
// @}
/**
@@ -1038,15 +812,6 @@ public:
*/
unsigned int row_length (const size_type row) const;
- /**
- * Determine whether the matrix uses the special convention for quadratic
- * matrices that the diagonal entries are stored first in each row.
- *
- * @deprecated The function always returns true if the matrix is
- * square and false if it is not.
- */
- bool optimize_diagonal () const DEAL_II_DEPRECATED;
-
/**
* Return whether this object stores only those entries that have been added
* explicitly, or if the sparsity pattern contains elements that have been
@@ -1215,6 +980,255 @@ public:
* @name Deprecated functions
*/
// @{
+
+ /**
+ * Initialize a rectangular matrix.
+ *
+ * @arg m number of rows
+ * @arg n number of columns
+ * @arg max_per_row maximum number of nonzero entries per row
+ * @arg optimize_diagonal This parameter is ignored.
+ *
+ * @deprecated Use the constructor without the last argument since
+ * it is ignored.
+ */
+ SparsityPattern (const size_type m,
+ const size_type n,
+ const unsigned int max_per_row,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * Initialize a rectangular matrix.
+ *
+ * @arg m number of rows
+ * @arg n number of columns
+ * @arg row_lengths possible number of nonzero entries for each row. This
+ * vector must have one entry for each row.
+ * @arg optimize_diagonal This argument is ignored.
+ *
+ * @deprecated Use the constructor without the last argument since
+ * it is ignored.
+ */
+ SparsityPattern (const size_type m,
+ const size_type n,
+ const std::vector &row_lengths,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * Initialize a quadratic matrix.
+ *
+ * @arg m number of rows and columns
+ * @arg row_lengths possible number of nonzero entries for each row. This
+ * vector must have one entry for each row.
+ * @arg optimize_diagonal This argument is ignored.
+ *
+ * @deprecated Use the constructor without the last argument since
+ * it is ignored.
+ */
+ SparsityPattern (const size_type m,
+ const std::vector &row_lengths,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+
+ /**
+ * Reallocate memory for a matrix of size m x n. The number of
+ * entries for each row is taken from the array row_lengths which
+ * has to give this number of each row i=1...m.
+ *
+ * If m*n==0 all memory is freed, resulting in a total
+ * reinitialization of the object. If it is nonzero, new memory is only
+ * allocated if the new size extends the old one. This is done to save time
+ * and to avoid fragmentation of the heap.
+ *
+ * If the number of rows equals the number of columns and the last parameter
+ * is true, diagonal elements are stored first in each row to allow
+ * optimized access in relaxation methods of SparseMatrix.
+ *
+ * @deprecated The last argument of this function is ignored. Use the
+ * version of this function without the last argument.
+ */
+ void reinit (const size_type m,
+ const size_type n,
+ const std::vector &row_lengths,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+
+ /**
+ * Same as above, but with a VectorSlice argument instead.
+ *
+ * @deprecated The last argument of this function is ignored. Use the
+ * version of this function without the last argument.
+ */
+ void reinit (const size_type m,
+ const size_type n,
+ const VectorSlice > &row_lengths,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * Reallocate memory and set up data structures for a new matrix with m
+ * rows and n columns, with at most max_per_row
+ * nonzero entries per row.
+ *
+ * This function simply maps its operations to the other reinit
+ * function.
+ *
+ * @deprecated The last argument of this function is ignored. Use the
+ * version of this function without the last argument.
+ */
+ void reinit (const size_type m,
+ const size_type n,
+ const unsigned int max_per_row,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * This function can be used as a replacement for reinit(), subsequent calls
+ * to add() and a final call to close() if you know exactly in advance the
+ * entries that will form the matrix sparsity pattern.
+ *
+ * The first two parameters determine the size of the matrix. For the two
+ * last ones, note that a sparse matrix can be described by a sequence of
+ * rows, each of which is represented by a sequence of pairs of column
+ * indices and values. In the present context, the begin() and end()
+ * parameters designate iterators (of forward iterator type) into a
+ * container, one representing one row. The distance between begin() and
+ * end() should therefore be equal to n_rows(). These iterators may be
+ * iterators of std::vector, std::list, pointers into a
+ * C-style array, or any other iterator satisfying the requirements of a
+ * forward iterator. The objects pointed to by these iterators (i.e. what we
+ * get after applying operator* or operator-> to one of
+ * these iterators) must be a container itself that provides functions
+ * begin and end designating a range of iterators that
+ * describe the contents of one line. Dereferencing these inner iterators
+ * must either yield a pair of an unsigned integer as column index and a
+ * value of arbitrary type (such a type would be used if we wanted to
+ * describe a sparse matrix with one such object), or simply an unsigned
+ * integer (of we only wanted to describe a sparsity pattern). The function
+ * is able to determine itself whether an unsigned integer or a pair is what
+ * we get after dereferencing the inner iterators, through some template
+ * magic.
+ *
+ * While the order of the outer iterators denotes the different rows of the
+ * matrix, the order of the inner iterator denoting the columns does not
+ * matter, as they are sorted internal to this function anyway.
+ *
+ * Since that all sounds very complicated, consider the following example
+ * code, which may be used to fill a sparsity pattern:
+ * @code
+ * std::vector > column_indices (n_rows);
+ * for (unsigned int row=0; rowbegin and end (namely
+ * std::vectors), and the inner iterators dereferenced yield
+ * unsigned integers as column indices. Note that we could have replaced
+ * each of the two std::vector occurrences by std::list,
+ * and the inner one by std::set as well.
+ *
+ * Another example would be as follows, where we initialize a whole matrix,
+ * not only a sparsity pattern:
+ * @code
+ * std::vector > entries (n_rows);
+ * for (unsigned int row=0; rowstd::vector could
+ * be replaced by std::list, and the inner std::map could be replaced by std::vector >, or a list or set of such pairs, as they all return
+ * iterators that point to such pairs.
+ *
+ * @deprecated The last argument of this function is ignored. Use the
+ * version of this function without the last argument.
+ */
+ template
+ void copy_from (const size_type n_rows,
+ const size_type n_cols,
+ const ForwardIterator begin,
+ const ForwardIterator end,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * Copy data from an object of type CompressedSparsityPattern,
+ * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern.
+ * Previous content of this object is lost, and the sparsity pattern is in
+ * compressed mode afterwards.
+ *
+ * @deprecated The last argument of this function is ignored. Use the
+ * version of this function without the last argument.
+ */
+ template
+ void copy_from (const CompressedSparsityType &csp,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+
+ /**
+ * Take a full matrix and use its nonzero entries to generate a sparse
+ * matrix entry pattern for this object.
+ *
+ * Previous content of this object is lost, and the sparsity pattern is in
+ * compressed mode afterwards.
+ *
+ * @deprecated The last argument of this function is ignored. Use the
+ * version of this function without the last argument.
+ */
+ template
+ void copy_from (const FullMatrix &matrix,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * STL-like iterator with the first entry of row r.
+ *
+ * Note that if the given row is empty, i.e. does not contain any nonzero
+ * entries, then the iterator returned by this function equals
+ * end(r). Note also that the iterator may not be dereferencable in
+ * that case.
+ *
+ * @deprecated Use the iterators provided by the begin() and end()
+ * functions instead.
+ */
+ row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
+
+ /**
+ * Final iterator of row r. It points to the first element past the
+ * end of line @p r, or past the end of the entire sparsity pattern.
+ *
+ * Note that the end iterator is not necessarily dereferencable. This is in
+ * particular the case if it is the end iterator for the last row of a
+ * matrix.
+ *
+ * @deprecated Use the iterators provided by the begin() and end()
+ * functions instead.
+ */
+ row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
+
+ /**
+ * Determine whether the matrix uses the special convention for quadratic
+ * matrices that the diagonal entries are stored first in each row.
+ *
+ * @deprecated The function always returns true if the matrix is
+ * square and false if it is not.
+ */
+ bool optimize_diagonal () const DEAL_II_DEPRECATED;
+
/**
* @deprecated This function is deprecated. Use SparsityTools::partition
* instead.
@@ -1293,6 +1307,8 @@ public:
*/
const size_type *get_column_numbers () const DEAL_II_DEPRECATED;
+// @}
+
BOOST_SERIALIZATION_SPLIT_MEMBER()
/** @addtogroup Exceptions
* @name Exceptions
diff --git a/deal.II/include/deal.II/lac/tridiagonal_matrix.h b/deal.II/include/deal.II/lac/tridiagonal_matrix.h
index 8b31214933..bf88c4113f 100644
--- a/deal.II/include/deal.II/lac/tridiagonal_matrix.h
+++ b/deal.II/include/deal.II/lac/tridiagonal_matrix.h
@@ -50,6 +50,8 @@ template
class TridiagonalMatrix
{
public:
+ ///@name Constructors
+ //@{
/**
* Declare type for container size.
*/
diff --git a/deal.II/include/deal.II/lac/trilinos_vector.h b/deal.II/include/deal.II/lac/trilinos_vector.h
index 9e7896532b..951d660755 100644
--- a/deal.II/include/deal.II/lac/trilinos_vector.h
+++ b/deal.II/include/deal.II/lac/trilinos_vector.h
@@ -497,15 +497,14 @@ namespace TrilinosWrappers
void Vector::reinit (const Epetra_Map ¶llel_partitioner,
const dealii::Vector &v)
{
- if (vector.get() != 0 && vector->Map().SameAs(parallel_partitioner))
+ if (vector.get() == 0 || vector->Map().SameAs(parallel_partitioner) == false)
vector.reset (new Epetra_FEVector(parallel_partitioner));
has_ghosts = vector->Map().UniqueGIDs()==false;
const int size = parallel_partitioner.NumMyElements();
- // Need to copy out values, since the
- // deal.II might not use doubles, so
+ // Need to copy out values, since the deal.II might not use doubles, so
// that a direct access is not possible.
for (int i=0; i::
reinit(const DH &dof_handler,
const ConstraintMatrix &constraints_in,
const Quad &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
MappingQ1 mapping;
std::vector dof_handlers;
@@ -1490,7 +1490,7 @@ reinit(const Mapping &mapping,
const DH &dof_handler,
const ConstraintMatrix &constraints_in,
const Quad &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
std::vector dof_handlers;
std::vector constraints;
@@ -1515,7 +1515,7 @@ void MatrixFree::
reinit(const std::vector &dof_handler,
const std::vector &constraint,
const std::vector &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
MappingQ1 mapping;
std::vector locally_owned_set =
@@ -1534,7 +1534,7 @@ void MatrixFree::
reinit(const std::vector &dof_handler,
const std::vector &constraint,
const Quad &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
MappingQ1 mapping;
std::vector quads;
@@ -1555,7 +1555,7 @@ reinit(const Mapping &mapping,
const std::vector &dof_handler,
const std::vector &constraint,
const Quad &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
std::vector quads;
quads.push_back(quad);
@@ -1575,7 +1575,7 @@ reinit(const Mapping &mapping,
const std::vector &dof_handler,
const std::vector &constraint,
const std::vector &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
std::vector locally_owned_set =
internal::MatrixFree::extract_locally_owned_index_sets
@@ -1626,7 +1626,7 @@ reinit(const Mapping &mapping,
const std::vector &constraint,
const std::vector &locally_owned_set,
const std::vector &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
// find out whether we use a hp Quadrature or a standard quadrature
std::vector > quad_hp;
diff --git a/deal.II/include/deal.II/matrix_free/matrix_free.templates.h b/deal.II/include/deal.II/matrix_free/matrix_free.templates.h
index 359deb1d8f..25dab92538 100644
--- a/deal.II/include/deal.II/matrix_free/matrix_free.templates.h
+++ b/deal.II/include/deal.II/matrix_free/matrix_free.templates.h
@@ -109,7 +109,7 @@ internal_reinit(const Mapping &mapping,
const std::vector &constraint,
const std::vector &locally_owned_set,
const std::vector > &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
if (additional_data.initialize_indices == true)
{
@@ -231,7 +231,7 @@ internal_reinit(const Mapping &mapping,
const std::vector &constraint,
const std::vector &locally_owned_set,
const std::vector > &quad,
- const MatrixFree::AdditionalData additional_data)
+ const typename MatrixFree::AdditionalData additional_data)
{
if (additional_data.initialize_indices == true)
{
diff --git a/deal.II/include/deal.II/numerics/matrix_tools.h b/deal.II/include/deal.II/numerics/matrix_tools.h
index 27b47c9ba2..f9191796a3 100644
--- a/deal.II/include/deal.II/numerics/matrix_tools.h
+++ b/deal.II/include/deal.II/numerics/matrix_tools.h
@@ -1,7 +1,7 @@
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1998 - 2013 by the deal.II authors
+// Copyright (C) 1998 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
@@ -164,19 +164,20 @@ namespace TrilinosWrappers
* basis functions, the roughness of the coefficient @p a, as well as
* the degree of the given @p Mapping (if any).
*
- * Note, that for system elements the mass matrix and the laplace matrix is
- * implemented such that each components couple only with itself, i.e. there
- * is no coupling of shape functions belonging to different components. If the
- * degrees of freedom have been sorted according to their vector component
- * (e.g., using DoFRenumbering::component_wise()), then the resulting matrices
- * will be block diagonal.
+ * Note, that for vector-valued elements the mass matrix and the
+ * laplace matrix is implemented in such a way that each component
+ * couples only with itself, i.e. there is no coupling of shape
+ * functions belonging to different components. If the degrees of
+ * freedom have been sorted according to their vector component (e.g.,
+ * using DoFRenumbering::component_wise()), then the resulting
+ * matrices will be block diagonal.
*
- * If the finite element for which the mass matrix or the laplace
- * matrix is to be built has more than one component, this function
- * accepts a single coefficient as well as a vector valued coefficient
- * function. For the latter case make sure that the number of
- * components coincides with the number of components of the system
- * finite element.
+ * If the finite element for which the mass matrix or the Laplace
+ * matrix is to be built has more than one component, the functions
+ * accept a single coefficient as well as a vector valued coefficient
+ * function. For the latter case, the number of components must
+ * coincide with the number of components of the system finite
+ * element.
*
*
*
Matrices on the boundary
@@ -227,15 +228,18 @@ namespace TrilinosWrappers
namespace MatrixCreator
{
/**
- * Assemble the mass matrix. If no coefficient is given, it is assumed to be
- * unity.
+ * Assemble the mass matrix. If no coefficient is given (i.e., if
+ * the pointer to a function object is zero as it is by default),
+ * the coefficient is taken as being constant and equal to one.
*
* If the library is configured to use multithreading, this function works
* in parallel.
*
- * The optional argument @p constraints allows to apply constraints on the
- * resulting matrix directly. Be careful when combining several matrices and
- * using inhomogeneous constraints.
+ * The optional argument @p constraints allows to apply constraints
+ * on the resulting matrix directly. Note, however, that this
+ * becomes difficult when you have inhomogeneous constraints and
+ * later want to add several such matrices, for example in time
+ * dependent settings such as the main loop of step-26.
*
* See the general doc of this class for more information.
*/
@@ -259,15 +263,19 @@ namespace MatrixCreator
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
- * Assemble the mass matrix and a right hand side vector. If no coefficient
- * is given, it is assumed to be unity.
+ * Assemble the mass matrix and a right hand side vector. If no
+ * coefficient is given (i.e., if the pointer to a function object
+ * is zero as it is by default), the coefficient is taken as being
+ * constant and equal to one.
*
* If the library is configured to use multithreading, this function works
* in parallel.
*
* The optional argument @p constraints allows to apply constraints on the
- * resulting matrix directly. Be careful when combining several matrices and
- * using inhomogeneous constraints.
+ * resulting matrix directly. Note, however, that this
+ * becomes difficult when you have inhomogeneous constraints and
+ * later want to add several such matrices, for example in time
+ * dependent settings such as the main loop of step-26.
*
* See the general doc of this class for more information.
*/
@@ -457,15 +465,18 @@ namespace MatrixCreator
std::vector component_mapping = std::vector());
/**
- * Assemble the Laplace matrix. If no coefficient is given, it is assumed to
- * be constant one.
+ * Assemble the Laplace matrix. If no coefficient is given (i.e., if
+ * the pointer to a function object is zero as it is by default),
+ * the coefficient is taken as being constant and equal to one.
*
* If the library is configured to use multithreading, this function works
* in parallel.
*
* The optional argument @p constraints allows to apply constraints on the
- * resulting matrix directly. Be careful when combining several matrices and
- * using inhomogeneous constraints.
+ * resulting matrix directly. Note, however, that this
+ * becomes difficult when you have inhomogeneous constraints and
+ * later want to add several such matrices, for example in time
+ * dependent settings such as the main loop of step-26.
*
* See the general doc of this class for more information.
*/
@@ -496,8 +507,10 @@ namespace MatrixCreator
* in parallel.
*
* The optional argument @p constraints allows to apply constraints on the
- * resulting matrix directly. Be careful when combining several matrices and
- * using inhomogeneous constraints.
+ * resulting matrix directly. Note, however, that this
+ * becomes difficult when you have inhomogeneous constraints and
+ * later want to add several such matrices, for example in time
+ * dependent settings such as the main loop of step-26.
*
* See the general doc of this class for more information.
*/
diff --git a/deal.II/include/deal.II/numerics/solution_transfer.h b/deal.II/include/deal.II/numerics/solution_transfer.h
index b37133426a..3c2dd0dbb0 100644
--- a/deal.II/include/deal.II/numerics/solution_transfer.h
+++ b/deal.II/include/deal.II/numerics/solution_transfer.h
@@ -136,7 +136,7 @@ DEAL_II_NAMESPACE_OPEN
*
Solution transfer with only refinement. Assume that we have got a
* solution vector on the current (original) grid.
* Each entry of this vector belongs to one of the
- * DoFs of the discretisation. If we now refine the grid then the calling of
+ * DoFs of the discretization. If we now refine the grid then the calling of
* DoFHandler::distribute_dofs() will change at least some of the
* DoF indices. Hence we need to store the DoF indices of all active cells
* before the refinement. A pointer for each active cell
@@ -198,8 +198,36 @@ DEAL_II_NAMESPACE_OPEN
* refine_interpolate(in, out)) only be called once.
*
*
+ *
+ *
Implementation in the context of hp finite elements
+ *
+ * In the case of hp::DoFHandlers, it is not defined which of the finite elements
+ * that are part of the hp::FECollection associated with the DoF handler, should
+ * be considered on cells that are not active (i.e., that have children). This
+ * is because degrees of freedom are only allocated for active cells and, in fact,
+ * it is not allowed to set an active_fe_index on non-active cells using
+ * DoFAccessor::set_active_fe_index().
+ *
+ * It is, thus, not entirely natural what should happen if, for example, a few cells
+ * are coarsened away. This class then implements the following algorithm:
+ * - If a cell is refined, then the values of the solution vector(s) are saved before
+ * refinement on the to-be-refined cell and in the space associated with this
+ * cell. These values are then interpolated to the finite element spaces of the
+ * children post-refinement. This may lose information if, for example, the old
+ * cell used a Q2 space and the children use Q1 spaces, or the information may
+ * be prolonged if the mother cell used a Q1 space and the children are Q2s.
+ * - If cells are to be coarsened, then the values from the child cells are
+ * interpolated to the mother cell using the largest of the child cell spaces.
+ * For example, if the children of a cell use Q1, Q2 and Q3 spaces, then the
+ * values from the children are interpolated into a Q3 space on the mother cell.
+ * After refinement, this Q3 function on the mother cell is then interpolated into
+ * the space the user has selected for this cell (which may be different from
+ * Q3, in this example, if the user has set the active_fe_index for a different
+ * space post-refinement and before calling hp::DoFHandler::distribute_dofs()).
+ *
+ *
* @ingroup numerics
- * @author Ralf Hartmann, 1999
+ * @author Ralf Hartmann, 1999, Oliver Kayser-Herold and Wolfgang Bangerth, 2006, 2014
*/
template, class DH=DoFHandler >
class SolutionTransfer
diff --git a/deal.II/source/base/parameter_handler.cc b/deal.II/source/base/parameter_handler.cc
index 8742ec4c08..f448fa2b50 100644
--- a/deal.II/source/base/parameter_handler.cc
+++ b/deal.II/source/base/parameter_handler.cc
@@ -1858,18 +1858,82 @@ ParameterHandler::print_parameters (std::ostream &out,
void
ParameterHandler::print_parameters_section (std::ostream &out,
const OutputStyle style,
- const unsigned int indent_level)
+ const unsigned int indent_level,
+ const bool include_top_level_elements)
{
AssertThrow (out, ExcIO());
const boost::property_tree::ptree ¤t_section
= entries->get_child (get_current_path());
+ unsigned int overall_indent_level = indent_level;
+
switch (style)
{
+ case XML:
+ {
+ if (include_top_level_elements)
+ {
+ // call the writer
+ // function and exit as
+ // there is nothing
+ // further to do down in
+ // this function
+ //
+ // XML has a requirement that
+ // there can only be one
+ // single top-level entry,
+ // but a section has multiple
+ // entries and sections. we
+ // work around this by
+ // creating a tree just for
+ // this purpose with the
+ // single top-level node
+ // "ParameterHandler" and
+ // assign the full path of
+ // down to the current section
+ // under it
+ boost::property_tree::ptree single_node_tree;
+
+ // if there is no subsection selected,
+ // add the whole tree of entries,
+ // otherwise add a root element
+ // and the selected subsection under it
+ if (subsection_path.size() == 0)
+ {
+ single_node_tree.add_child("ParameterHandler",
+ *entries);
+ }
+ else
+ {
+ std::string path ("ParameterHandler");
+
+ single_node_tree.add_child(path,
+ boost::property_tree::ptree());
+
+ path += path_separator + get_current_path ();
+ single_node_tree.add_child (path, current_section);
+ };
+
+ write_xml (out, single_node_tree);
+ }
+ else
+ Assert (false, ExcNotImplemented());
+
+ break;
+ }
case Text:
case ShortText:
{
+ // if there are top level elements to print, do it
+ if (include_top_level_elements && (subsection_path.size() > 0))
+ for (unsigned int i=0; i doc_lines
= Utilities::
break_text_into_lines (p->second.get("documentation"),
- 78 - indent_level*2 - 2);
+ 78 - overall_indent_level*2 - 2);
for (unsigned int i=0; ifirst)
<< std::setw(longest_name-demangle(p->first).length()+1) << " "
@@ -2043,6 +2107,15 @@ ParameterHandler::print_parameters_section (std::ostream &out,
case Description:
{
+ // if there are top level elements to print, do it
+ if (include_top_level_elements && (subsection_path.size() > 0))
+ for (unsigned int i=0; isecond.get("value");
// print name and value
- out << std::setw(indent_level*2) << ""
+ out << std::setw(overall_indent_level*2) << ""
<< "set "
<< demangle(p->first)
<< std::setw(longest_name-demangle(p->first).length()+1) << " "
@@ -2076,12 +2149,12 @@ ParameterHandler::print_parameters_section (std::ostream &out,
const std::vector description_str
= Utilities::break_text_into_lines (p->second.get
("pattern_description"),
- 78 - indent_level*2 - 2, '|');
+ 78 - overall_indent_level*2 - 2, '|');
if (description_str.size() > 1)
{
out << std::endl;
for (unsigned int i=0; isecond.get("documentation").length() != 0)
- out << std::setw(indent_level*2 + longest_name + 10) << ""
+ out << std::setw(overall_indent_level*2 + longest_name + 10) << ""
<< "(" << p->second.get("documentation") << ")" << std::endl;
}
@@ -2109,6 +2182,7 @@ ParameterHandler::print_parameters_section (std::ostream &out,
// sections to come, put two newlines
// between the last entry and the first
// subsection
+ if (style != XML)
{
unsigned int n_parameters = 0;
unsigned int n_sections = 0;
@@ -2128,7 +2202,6 @@ ParameterHandler::print_parameters_section (std::ostream &out,
&&
(n_sections != 0))
out << std::endl << std::endl;
- }
// now traverse subsections tree,
// in alphabetical order
@@ -2143,7 +2216,7 @@ ParameterHandler::print_parameters_section (std::ostream &out,
case Text:
case Description:
case ShortText:
- out << std::setw(indent_level*2) << ""
+ out << std::setw(overall_indent_level*2) << ""
<< "subsection " << demangle(p->first) << std::endl;
break;
case LaTeX:
@@ -2177,7 +2250,7 @@ ParameterHandler::print_parameters_section (std::ostream &out,
// then the contents of the
// subsection
enter_subsection (demangle(p->first));
- print_parameters_section (out, style, indent_level+1);
+ print_parameters_section (out, style, overall_indent_level+1);
leave_subsection ();
switch (style)
{
@@ -2186,14 +2259,14 @@ ParameterHandler::print_parameters_section (std::ostream &out,
// subsection. one
// blank line after
// each subsection
- out << std::setw(indent_level*2) << ""
+ out << std::setw(overall_indent_level*2) << ""
<< "end" << std::endl
<< std::endl;
// if this is a toplevel
// subsection, then have two
// newlines
- if (indent_level == 0)
+ if (overall_indent_level == 0)
out << std::endl;
break;
@@ -2202,7 +2275,7 @@ ParameterHandler::print_parameters_section (std::ostream &out,
case ShortText:
// write end of
// subsection.
- out << std::setw(indent_level*2) << ""
+ out << std::setw(overall_indent_level*2) << ""
<< "end" << std::endl;
break;
case LaTeX:
@@ -2213,6 +2286,33 @@ ParameterHandler::print_parameters_section (std::ostream &out,
}
}
+ // close top level elements, if there are any
+ switch (style)
+ {
+ case XML:
+ case LaTeX:
+ case Description:
+ break;
+ case Text:
+ case ShortText:
+ {
+ if (include_top_level_elements && (subsection_path.size() > 0))
+ for (unsigned int i=0; i::QGauss (const unsigned int n)
const long double tolerance
= (runtime_one + long_double_eps != runtime_one
?
- std::max (double_eps / 100, long_double_eps * 5)
+ fmax (double_eps / 100, long_double_eps * 5)
:
double_eps * 5
);
@@ -215,7 +215,7 @@ compute_quadrature_points(const unsigned int q,
const long double tolerance
= (runtime_one + long_double_eps != runtime_one
?
- std::max (double_eps / 100, long_double_eps * 5)
+ fmax (double_eps / 100, long_double_eps * 5)
:
double_eps * 5
);
diff --git a/deal.II/source/distributed/grid_refinement.cc b/deal.II/source/distributed/grid_refinement.cc
index f7f185ff4e..e4a5e8f414 100644
--- a/deal.II/source/distributed/grid_refinement.cc
+++ b/deal.II/source/distributed/grid_refinement.cc
@@ -199,11 +199,16 @@ namespace
Assert (interesting_range[0] <= interesting_range[1],
ExcInternalError());
+ Assert (interesting_range[0] >= 0,
+ ExcInternalError());
+
+ // adjust the lower bound only
+ // if the end point is not equal
+ // to zero, otherwise it could
+ // happen, that the result
+ // becomes negative
if (interesting_range[0] > 0)
interesting_range[0] *= 0.99;
- else
- interesting_range[0]
- -= 0.01 * (interesting_range[1] - interesting_range[0]);
if (interesting_range[1] > 0)
interesting_range[1] *= 1.01;
diff --git a/deal.II/source/distributed/tria.cc b/deal.II/source/distributed/tria.cc
index 4149b6e9a1..45db88fa60 100644
--- a/deal.II/source/distributed/tria.cc
+++ b/deal.II/source/distributed/tria.cc
@@ -2046,13 +2046,19 @@ namespace parallel
if (attached_data_size>0)
real_data_size = attached_data_size+sizeof(CellStatus);
+ Assert(this->n_cells()>0, ExcMessage("Can not save() an empty Triangulation."));
+
if (my_subdomain==0)
{
std::string fname=std::string(filename)+".info";
std::ofstream f(fname.c_str());
- f << Utilities::MPI::n_mpi_processes (mpi_communicator) << " "
+ f << "version nproc attached_bytes n_attached_objs n_coarse_cells" << std::endl
+ << 2 << " "
+ << Utilities::MPI::n_mpi_processes (mpi_communicator) << " "
<< real_data_size << " "
- << attached_data_pack_callbacks.size() << std::endl;
+ << attached_data_pack_callbacks.size() << " "
+ << this->n_cells(0)
+ << std::endl;
}
if (attached_data_size>0)
@@ -2082,6 +2088,10 @@ namespace parallel
Triangulation::
load(const char *filename)
{
+ Assert(this->n_cells()>0, ExcMessage("load() only works if Triangulation already contains the same coarse mesh!"));
+ Assert(this->n_levels()==1, ExcMessage("Triangulation may only contain coarse cells when calling load()."));
+
+
if (parallel_ghost != 0)
{
dealii::internal::p4est::functions::ghost_destroy (parallel_ghost);
@@ -2090,15 +2100,20 @@ namespace parallel
dealii::internal::p4est::functions::destroy (parallel_forest);
parallel_forest = 0;
dealii::internal::p4est::functions::connectivity_destroy (connectivity);
- connectivity=0;
+ connectivity = 0;
- unsigned int numcpus, attached_size, attached_count;
+ unsigned int version, numcpus, attached_size, attached_count, n_coarse_cells;
{
std::string fname=std::string(filename)+".info";
std::ifstream f(fname.c_str());
- f >> numcpus >> attached_size >> attached_count;
+ std::string firstline;
+ getline(f, firstline); //skip first line
+ f >> version >> numcpus >> attached_size >> attached_count >> n_coarse_cells;
}
+ Assert(version == 2, ExcMessage("Incompatible version found in .info file."));
+ Assert(this->n_cells(0) == n_coarse_cells, ExcMessage("Number of coarse cells differ!"));
+
attached_data_size = 0;
n_attached_datas = 0;
n_attached_deserialize = attached_count;
diff --git a/deal.II/source/dofs/dof_accessor_get.cc b/deal.II/source/dofs/dof_accessor_get.cc
index 427e7e9f2c..632522f993 100644
--- a/deal.II/source/dofs/dof_accessor_get.cc
+++ b/deal.II/source/dofs/dof_accessor_get.cc
@@ -55,6 +55,9 @@ get_interpolated_dof_values (const InputVector &values,
(this->dof_handler)
!= 0)
||
+ // for hp-DoFHandlers, we need to require that on
+ // active cells, you either don't specify an fe_index,
+ // or that you specify the correct one
(fe_index == this->active_fe_index())
||
(fe_index == DH::default_fe_index))
@@ -70,7 +73,7 @@ get_interpolated_dof_values (const InputVector &values,
FullMatrix interpolation (this->dof_handler->get_fe()[fe_index].dofs_per_cell,
this->get_fe().dofs_per_cell);
this->dof_handler->get_fe()[fe_index].get_interpolation_matrix (this->get_fe(),
- interpolation);
+ interpolation);
interpolation.vmult (interpolated_values, tmp);
}
}
@@ -85,28 +88,28 @@ get_interpolated_dof_values (const InputVector &values,
// space to this cell's (unknown) FE space unless an explicit
// fe_index is given
Assert ((dynamic_cast*>
- (this->dof_handler)
- != 0)
+ (this->dof_handler)
+ != 0)
||
- (fe_index != DH::default_fe_index),
- ExcMessage ("You cannot call this function on non-active cells "
- "of hp::DoFHandler objects unless you provide an explicit "
- "finite element index because they do not have naturally "
- "associated finite element spaces associated: degrees "
- "of freedom are only distributed on active cells for which "
- "the active_fe_index has been set."));
+ (fe_index != DH::default_fe_index),
+ ExcMessage ("You cannot call this function on non-active cells "
+ "of hp::DoFHandler objects unless you provide an explicit "
+ "finite element index because they do not have naturally "
+ "associated finite element spaces associated: degrees "
+ "of freedom are only distributed on active cells for which "
+ "the active_fe_index has been set."));
const FiniteElement &fe = this->get_dof_handler().get_fe()[fe_index];
const unsigned int dofs_per_cell = fe.dofs_per_cell;
Assert (this->dof_handler != 0,
- typename BaseClass::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (&fe != 0,
- typename BaseClass::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
Assert (interpolated_values.size() == dofs_per_cell,
- typename BaseClass::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- typename BaseClass::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Vector tmp1(dofs_per_cell);
diff --git a/deal.II/source/dofs/dof_accessor_set.cc b/deal.II/source/dofs/dof_accessor_set.cc
index bfbedda11c..bc3a6434c7 100644
--- a/deal.II/source/dofs/dof_accessor_set.cc
+++ b/deal.II/source/dofs/dof_accessor_set.cc
@@ -38,7 +38,6 @@
DEAL_II_NAMESPACE_OPEN
-
template
template
void
@@ -48,18 +47,43 @@ set_dof_values_by_interpolation (const Vector &local_values,
const unsigned int fe_index) const
{
if (!this->has_children())
- // if this cell has no children: simply set the values on this cell
- this->set_dof_values (local_values, values);
+ {
+ if ((dynamic_cast*>
+ (this->dof_handler)
+ != 0)
+ ||
+ // for hp-DoFHandlers, we need to require that on
+ // active cells, you either don't specify an fe_index,
+ // or that you specify the correct one
+ (fe_index == this->active_fe_index())
+ ||
+ (fe_index == DH::default_fe_index))
+ // simply set the values on this cell
+ this->set_dof_values (local_values, values);
+ else
+ {
+ Assert (local_values.size() == this->dof_handler->get_fe()[fe_index].dofs_per_cell,
+ ExcMessage ("Incorrect size of local_values vector.") );
+
+ FullMatrix interpolation (this->get_fe().dofs_per_cell, this->dof_handler->get_fe()[fe_index].dofs_per_cell);
+
+ this->get_fe().get_interpolation_matrix (this->dof_handler->get_fe()[fe_index],
+ interpolation);
+
+ // do the interpolation to the target space. for historical
+ // reasons, matrices are set to size 0x0 internally even
+ // we reinit as 4x0, so we have to treat this case specially
+ Vector tmp (this->get_fe().dofs_per_cell);
+ if ((tmp.size() > 0) && (local_values.size() > 0))
+ interpolation.vmult (tmp, local_values);
+
+ // now set the dof values in the global vector
+ this->set_dof_values (tmp, values);
+ }
+ }
else
// otherwise distribute them to the children
{
- // we are on a non-active cell. these do not have any finite
- // element associated with them in the hp context (in the non-hp
- // context, we can simply assume that the FE space to from which we
- // want to interpolate is the same as for all elements in the
- // mesh). consequently, we cannot interpolate to children's FE
- // space from this cell's (unknown) FE space unless an explicit
- // fe_index is given
Assert ((dynamic_cast*>
(this->dof_handler)
!= 0)
@@ -72,40 +96,31 @@ set_dof_values_by_interpolation (const Vector &local_values,
"of freedom are only distributed on active cells for which "
"the active_fe_index has been set."));
- const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell;
+ const FiniteElement &fe = this->get_dof_handler().get_fe()[fe_index];
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
Assert (this->dof_handler != 0,
- typename BaseClass::ExcInvalidObject());
- Assert (&this->get_fe() != 0,
- typename BaseClass::ExcInvalidObject());
+ typename BaseClass::ExcInvalidObject());
+ Assert (&this->get_dof_handler().get_fe() != 0,
+ typename BaseClass::ExcInvalidObject());
Assert (local_values.size() == dofs_per_cell,
- typename BaseClass::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Assert (values.size() == this->dof_handler->n_dofs(),
- typename BaseClass::ExcVectorDoesNotMatch());
+ typename BaseClass::ExcVectorDoesNotMatch());
Vector tmp(dofs_per_cell);
for (unsigned int child=0; childn_children(); ++child)
{
- Assert (this->child(child)->get_fe().dofs_per_cell == dofs_per_cell,
- ExcNotImplemented());
-
- // prolong the given data to the present cell. FullMatrix only wants
- // us to call vmult if the matrix size is actually non-zero, so
- // check that case
- if (tmp.size() > 0)
- {
- this->get_fe().get_prolongation_matrix(child, this->refinement_case())
- .vmult (tmp, local_values);
-
- this->child(child)->set_dof_values_by_interpolation (tmp, values);
- }
+ if (tmp.size() > 0)
+ fe.get_prolongation_matrix(child, this->refinement_case())
+ .vmult (tmp, local_values);
+ this->child(child)->set_dof_values_by_interpolation (tmp, values, fe_index);
}
}
}
-
// --------------------------------------------------------------------------
// explicit instantiations
#include "dof_accessor_set.inst"
diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc
index c8bb6d84f0..2dd018b6d2 100644
--- a/deal.II/source/dofs/dof_handler_policy.cc
+++ b/deal.II/source/dofs/dof_handler_policy.cc
@@ -1648,8 +1648,8 @@ namespace internal
unsigned int sent=needs_to_get_cells.size();
unsigned int recv=senders.size();
- MPI_Reduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, 0, tr->get_communicator());
- MPI_Reduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, 0, tr->get_communicator());
+ MPI_Allreduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, tr->get_communicator());
+ MPI_Allreduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, tr->get_communicator());
Assert(sum_send==sum_recv, ExcInternalError());
}
#endif
diff --git a/deal.II/source/fe/mapping_c1.cc b/deal.II/source/fe/mapping_c1.cc
index b7e0ec446c..9790fba5b2 100644
--- a/deal.II/source/fe/mapping_c1.cc
+++ b/deal.II/source/fe/mapping_c1.cc
@@ -80,7 +80,7 @@ MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &ce
// the interpolation points at @p{t=0.276} and @p{t=0.724}
// (Gauss-Lobatto points). Since at @p{t=0,1} we want a vertex which
// is actually at the boundary, we know that @p{d=0} and @p{a=-b-c},
- // which gives @p{s(0.276)} and @{s(0.726)} in terms of @p{b,c}. As
+ // which gives @p{s(0.276)} and @p{s(0.726)} in terms of @p{b,c}. As
// side-conditions, we want that the derivatives at @p{t=0} and
// @p{t=1}, i.e. at the vertices match those returned by the
// boundary.
diff --git a/deal.II/source/fe/mapping_q1.cc b/deal.II/source/fe/mapping_q1.cc
index 4696547bd2..beba2a11c5 100644
--- a/deal.II/source/fe/mapping_q1.cc
+++ b/deal.II/source/fe/mapping_q1.cc
@@ -1880,7 +1880,7 @@ transform_real_to_unit_cell_internal_codim1
(const typename Triangulation::cell_iterator &cell,
const Point &p,
const Point &initial_p_unit,
- MappingQ1::InternalData &mdata) const
+ typename MappingQ1::InternalData &mdata) const
{
const unsigned int spacedim1 = dim_+1;
const unsigned int dim1 = dim_;
diff --git a/deal.II/source/grid/grid_in.cc b/deal.II/source/grid/grid_in.cc
index c41f034ca3..c3072c1218 100644
--- a/deal.II/source/grid/grid_in.cc
+++ b/deal.II/source/grid/grid_in.cc
@@ -84,13 +84,13 @@ void GridIn::read_vtk(std::istream &in)
unsigned int no_vertices, no_quads=0,no_lines=0;
- char keyword_1[7],keyword_2[6],keyword_3[10] ;//keywords for the three types of data
+ std::string keyword;
- in.get(keyword_1, 7);
+ in >> keyword;
//////////////////Processing the POINTS section///////////////
- if (std::strcmp(keyword_1,"POINTS") == 0)//comparing the keyword points
+ if (keyword == "POINTS")
{
in>>no_vertices;// taking the no. of vertices
in.ignore(256, '\n');//ignoring the number beside the total no. of points.
@@ -120,24 +120,19 @@ void GridIn::read_vtk(std::istream &in)
in.ignore(256, '\n');//this move pointer to the next line ignoring unwanted no.
no = in.tellg();
getline(in,checkline);
- if (checkline.compare("") == 0)
- {
- in.get(keyword_2, 6);
- }
- else
+ if (checkline.compare("") != 0)
{
in.seekg(no);
- in.get(keyword_2, 6);
}
+ in >> keyword;
unsigned int total_cells, no_cells = 0, type, j = 0;// declaring counters, refer to the order of declaring variables for an idea of what is what!
///////////////////Processing the CELLS section that contains cells(cells) and bound_quads(subcelldata)///////////////////////
- if (std::strcmp(keyword_2,"CELLS") == 0)//comparing the keyword cells.
+ if (keyword == "CELLS")
{
-
in>>total_cells;
in.ignore(256,'\n');
@@ -244,16 +239,16 @@ void GridIn::read_vtk(std::istream &in)
/////////////////////Processing the CELL_TYPES section////////////////////////
- in>>keyword_3;
+ in >> keyword;
- if (std::strcmp(keyword_3,"CELL_TYPES") == 0)//Entering the cell_types section and ignoring data.
+ if (keyword == "CELL_TYPES")//Entering the cell_types section and ignoring data.
{
in.ignore(256, '\n');
while (!in.eof())
{
- in>>keyword_3;
- if (std::strcmp(keyword_3,"12") && std::strcmp(keyword_3,"9"))
+ in>>keyword;
+ if (keyword != "12" && keyword != "9")
{
break;
}
@@ -262,7 +257,7 @@ void GridIn::read_vtk(std::istream &in)
////////////////////////Processing the CELL_DATA section/////////////////////////////
- if (std::strcmp(keyword_3,"CELL_DATA") == 0)
+ if (keyword == "CELL_DATA")
{
int no_ids;
in>>no_ids;
diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc
index 85da38d151..5264d0a370 100644
--- a/deal.II/source/grid/tria.cc
+++ b/deal.II/source/grid/tria.cc
@@ -9550,7 +9550,9 @@ Triangulation (const Triangulation &other)
vertex_to_boundary_id_map_1d (0),
vertex_to_manifold_id_map_1d (0)
{
- Assert (false, ExcInternalError());
+ Assert (false, ExcMessage ("You are not allowed to call this constructor "
+ "because copying Triangulation objects is not "
+ "allowed. Use Triangulation::copy_from() instead."));
}
diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc
index 85a37b7aac..b083369760 100644
--- a/deal.II/source/hp/dof_handler.cc
+++ b/deal.II/source/hp/dof_handler.cc
@@ -1,7 +1,7 @@
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2003 - 2013 by the deal.II authors
+// Copyright (C) 2003 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
@@ -3275,8 +3275,11 @@ namespace hp
endc = end ();
for (; cell != endc; ++cell)
{
- // Look if the cell got children during
- // refinement
+ // Look if the cell got children during refinement by
+ // checking whether it has children now but didn't have
+ // children before refinement (the has_children array is
+ // set in pre-refinement action)
+ //
// Note: Although one level is added to
// the DoFHandler levels, when the
// triangulation got one, for the buffer
@@ -3291,10 +3294,15 @@ namespace hp
if (cell->has_children () &&
!(*has_children [cell->level ()])[cell->index ()])
{
- // Set active_fe_index in children to the
- // same value as in the parent cell.
+ // Set active_fe_index in children to the same value
+ // as in the parent cell. we can't access the
+ // active_fe_index in the parent cell any more through
+ // cell->active_fe_index() since that function is not
+ // allowed for inactive cells, but we can access this
+ // information from the DoFLevels directly
for (unsigned int i = 0; i < cell->n_children(); ++i)
- cell->child (i)->set_active_fe_index (cell->active_fe_index ());
+ cell->child (i)->set_active_fe_index
+ (levels[cell->level()]->active_fe_index (cell->index()));
}
}
}
diff --git a/deal.II/source/hp/mapping_collection.cc b/deal.II/source/hp/mapping_collection.cc
index 0d9fdcfa83..eb59d77463 100644
--- a/deal.II/source/hp/mapping_collection.cc
+++ b/deal.II/source/hp/mapping_collection.cc
@@ -82,16 +82,17 @@ namespace hp
//---------------------------------------------------------------------------
-
template
- MappingQ1
- StaticMappingQ1::mapping_q1;
-
+ MappingQ1& StaticMappingQ1::return_static_mapping_q1()
+ {
+ static MappingQ1 mapping;
+ return mapping;
+ }
template
MappingCollection
StaticMappingQ1::mapping_collection
- = MappingCollection(mapping_q1);
+ = MappingCollection(StaticMappingQ1::return_static_mapping_q1());
}
diff --git a/deal.II/source/lac/petsc_full_matrix.cc b/deal.II/source/lac/petsc_full_matrix.cc
index 20903076e8..8a35af920a 100644
--- a/deal.II/source/lac/petsc_full_matrix.cc
+++ b/deal.II/source/lac/petsc_full_matrix.cc
@@ -24,17 +24,54 @@ DEAL_II_NAMESPACE_OPEN
namespace PETScWrappers
{
+
+ FullMatrix::FullMatrix ()
+ {
+ const int m=0, n=0;
+ const int ierr
+ = MatCreateSeqDense (PETSC_COMM_SELF, m, n, PETSC_NULL,
+ &matrix);
+
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+ }
+
FullMatrix::FullMatrix (const size_type m,
const size_type n)
{
+ do_reinit (m, n);
+ }
+
+ void
+ FullMatrix::reinit (const size_type m,
+ const size_type n)
+ {
+ // get rid of old matrix and generate a
+ // new one
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+ const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
+#endif
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ do_reinit (m, n);
+ }
+
+ void
+ FullMatrix::do_reinit (const size_type m,
+ const size_type n)
+ {
+ // use the call sequence indicating only a maximal number of
+ // elements per row for all rows globally
const int ierr
- = MatCreateSeqDense(PETSC_COMM_SELF, m, n, PETSC_NULL,
- &matrix);
+ = MatCreateSeqDense (PETSC_COMM_SELF, m, n, PETSC_NULL,
+ &matrix);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
+
const MPI_Comm &
FullMatrix::get_mpi_communicator () const
{
diff --git a/deal.II/source/lac/petsc_vector_base.cc b/deal.II/source/lac/petsc_vector_base.cc
index 5f4bd0118c..3233797c69 100644
--- a/deal.II/source/lac/petsc_vector_base.cc
+++ b/deal.II/source/lac/petsc_vector_base.cc
@@ -1036,10 +1036,10 @@ namespace PETScWrappers
out.setf (std::ios::fixed, std::ios::floatfield);
if (across)
- for (size_type i=0; i extra_off_diagonals ?
@@ -242,9 +229,8 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
row+extra_off_diagonals) :
original_row_end);
- // find first free slot. the
- // first slot in each row is
- // the diagonal element
+ // find first free slot. the first slot in each row is the diagonal
+ // element
size_type *next_free_slot = &colnums[rowstart[row]] + 1;
// copy elements before side-diagonals
@@ -265,12 +251,9 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original,
original_row_end,
next_free_slot);
- // this error may happen if the
- // sum of previous elements per row
- // and those of the new diagonals
- // exceeds the maximum number of
- // elements per row given to this
- // constructor
+ // this error may happen if the sum of previous elements per row and
+ // those of the new diagonals exceeds the maximum number of elements per
+ // row given to this constructor
Assert (next_free_slot <= &colnums[rowstart[row+1]],
ExcNotEnoughSpace (0,rowstart[row+1]-rowstart[row]));
};
@@ -310,8 +293,7 @@ SparsityPattern::reinit (const size_type m,
const unsigned int max_per_row,
const bool)
{
- // simply map this function to the
- // other @p{reinit} function
+ // simply map this function to the other @p{reinit} function
const std::vector