#
INCLUDE(setup_custom_targets)
INCLUDE(setup_finalize)
+INCLUDE(setup_write_config)
########################################################################
# 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(
"
# that as well.
#
IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
- PUSH_TEST_FLAG("-pthread")
+ PUSH_CMAKE_REQUIRED("-pthread")
CHECK_CXX_SOURCE_RUNS(
"
#include <thread>
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 "")
#
# 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.
#
" -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()
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 <type_traits>
int main(){ std::is_trivially_copyable<int> bob; }
"
DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
- POP_TEST_FLAG()
+ RESET_CMAKE_REQUIRED()
ELSE()
MESSAGE(STATUS "DEAL_II_WITH_CXX11 disabled")
ENDIF()
#
# - 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.; }
"
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)
"not be autodetected"
)
ENDIF()
+
FIND_PACKAGE(MPI)
IF(NOT MPI_CXX_FOUND AND DEAL_II_WITH_MPI)
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)
#
# 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()
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")
ENDIF()
SETUP_THREADING()
+
+ # TODO: Refactor this mess of a configure file...
+ SET(THREADS_LIBRARIES ${TBB_LIBRARIES})
+ SET(THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS})
+
ENDMACRO()
# 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)
## ---------------------------------------------------------------------
#
-# 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
+# <FEATURE>_LIBRARIES
+# <FEATURE>_INCLUDE_DIRS(|_DEBUG|_RELEASE)
+# <FEATURE>_USER_INCLUDE_DIRS(|_DEBUG|_RELEASE)
+# <FEATURE>_DEFINITIONS(|_DEBUG|_RELEASE)
+# <FEATURE>_USER_DEFINITIONS(|_DEBUG|_RELEASE)
+# <FEATURE>_CXX_FLAGS(|_DEBUG|_RELEASE)
+# <FEATURE>_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
#
## ---------------------------------------------------------------------
## $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.
##
## ---------------------------------------------------------------------
#
-# 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()
-
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()
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(
"
#
# 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 <Sacado_cmath.hpp>
# file).
#
SET(${_flag}_SAVED ${${_flag}})
- SET(${_flag})
+ SET(${_flag} "")
ENDFOREACH()
FOREACH(_variable
# 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})
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()
# 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()
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()
#
# 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()
#
# 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()
#
${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()
--- /dev/null
+## ---------------------------------------------------------------------
+## $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()
</pre>
<li> Necessary compiler flags can easily set in the string variable
- <code>CMAKE_REQUIRED_FLAGS</code>. There are two small macros
- that do this job nicely:
+ <code>CMAKE_REQUIRED_FLAGS</code>. There is a small macro that does this
+ job nicely:
<pre class="cmake">
-PUSH_TEST_FLAG("-Werror")
+PUSH_CMAKE_REQUIRED("-Werror")
CHECK_CXX_SOURCE_COMPILES(...)
-POP_TEST_FLAG()
+RESET_CMAKE_REQUIRED()
</pre>
<li> Necessary include directories and libraries necessary for
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>The deal.II Testsuite</title>
<link href="../screen.css" rel="StyleSheet">
- <meta name="copyright" content="Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II Authors">
+ <meta name="copyright" content="Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 by the deal.II Authors">
<meta name="date" content="$Date$">
<meta name="svn_id" content="$Id$">
<meta name="keywords" content="deal dealii finite elements fem triangulation">
<li><a href="#run">Running the testsuite</a></li>
<ol>
<li><a href="#runoutput">How to interpret the output</a></li>
- <li><a href="#runmakeopts">Parallelize testsuite configuration</a></li>
+ <li><a href="#runmakeopts">Parallelizing testsuite configuration</a></li>
+ <li><a href="#coverage">Generating coverage information</a></li>
</ol>
<li><a href="#layout">Testsuite development</a></li>
<ol>
<a name="runmakeopts"></a>
- <h3>Parallelize testsuite configuration</h3>
+ <h3>Parallelizing testsuite configuration</h3>
<p>
- 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 <code>TEST_PICKUP_REGEX</code>) you'll notice that a
reconfiguration of the build directory takes a noticeable time (in the
order of minutes instead of seconds) with
<code>Reconfiguring testsuite subprojects</code>.
variable.
</p>
<p>
- Alternatively, you can use <code>Ninja</code>.
+ Alternatively, you can use <code>Ninja</code> as your build tool instead
+ of <code>make</code>.
</p>
+ <a name="coverage"></a>
+ <h3>Generating coverage information</h3>
+
+ <p>
+ The testsuite can also be used to provide <i>coverage</i> 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.
+ </p>
+
+ <p>
+ To run the testsuite in this mode, essentially, you have to do three
+ things:
+ <ol>
+ <li>
+ build the library with appropriate profiling flags
+ </li>
+ <li>
+ run all or some tests (built with the same profiling flags)
+ </li>
+ <li>
+ gather all information and convert them to a viewable format.
+ </li>
+ </ol>
+ In order to achieve the first two, configure the library with
+ <pre>
+ cmake -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_SETUP_COVERAGE=YES <...>
+ </pre>
+ You can then build the library and run the tests as usual.
+ </p>
+
+ <p>
+ 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 <a href="#submit">below</a>). You can do so by invoking
+ <pre>
+ ctest -DCOVERAGE=YES <...> -S ../tests/run_testsuite.cmake
+ </pre>
+ when running the testsuite, or directly by
+ <pre>
+ ctest <...> -S ../tests/run_coverage.cmake
+ </pre>
+ </p>
+
+ <p>
+ At the end of all of this, results will be shown in a separate section
+ "Coverage" at the
+ <a href="http://cdash.kyomu.43-1.org/index.php?project=deal.II&display=project"
+ target="_top">deal.II cdash site</a>.
+ </p>
+
+
<a name="layout"></a>
<h2>Testsuite development</h2>
webpage). Then call the script as follows:
<pre>
- ./p4est-setup.sh p4est-x-y-z.tar.gz /path/to/installation
+sh ./p4est-setup.sh p4est-x-y-z.tar.gz /path/to/installation
</pre>
where <code>p4est-x-y-z.tar.gz</code> is the name of the p4est
distribution file, and <code>/path/to/installation</code> is a
line like
<pre>
- cmake -DP4EST_DIR=/path/to/installation -DDEAL_II_WITH_P4EST=ON -DDEAL_II_WITH_MPI=ON <...>
+cmake -DP4EST_DIR=/path/to/installation -DDEAL_II_WITH_P4EST=ON -DDEAL_II_WITH_MPI=ON <...>
</pre>
- if the p4est library isn't picked up automatically. Note the presence
- of <code>/FAST</code> at the end of the path necessary when using
- the <code>./p4est-setup.sh</code> script to select the release
- version of p4est. Obviously, you
- can also add additional flags to <code>cmake</code> as described in
- the general <a href="../readme.html">ReadMe file</a>.
+ if the p4est library isn't picked up automatically.
</p>
<hr />
+++ /dev/null
-#!/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;
-}
+++ /dev/null
-#!/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
-
<ol>
+ <li> 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.
+ <br>
+ 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.
+ <br>
+ (Wolfgang Bangerth, 2014/01/24)
+ </li>
+
<li> New: deal.II now links with the
<a href="http://www.boost.org/doc/libs/1_55_0/libs/iostreams/doc/index.html">BOOST
Iostreams</a> library (at least if the libz and libbz2 libraries
<h3>Specific improvements</h3>
<ol>
+ <li>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.
+ <br>
+ (Martin Steigemann, 2014/02/01)
+
+ <li>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.
+ <br>
+ (Ben Thompson, Martin Kronbichler, 2014/01/31)
+
+ <li>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.
+ <br>
+ (Wolfgang Bangerth, 2014/01/26)
+
+ <li>Fixed: A regression where a single whitespace accidentally added to
+ DEAL_II_LINKER_FLAGS internally prevented cmake-2.8.8 from configuring
+ sucessfully.
+ <br>
+ (Matthias Maier, Krysztof Bzowski, 2014/01/26)
+
+ <li> 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.
+ <br>
+ (Martin Kronbichler, 2014/01/22)
+ </li>
+
+ <li> 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.
+ <br>
+ (Martin Steigemann, 2014/01/22)
+ </li>
+
+ <li> Changed: It was previously possible to set the
+ <code>active_fe_index</code> 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.
+ <br>
+ (Wolfgang Bangerth, 2014/01/20)
+ </li>
+
<li> 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.
space. Doing so now raises an exception.
<br>
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.
<br>
- (Wolfgang Bangerth, 2014/01/18)
+ (Mihai Alexe, Wolfgang Bangerth, 2014/01/18)
</li>
<li> Fixed: The methods IndexSet::do_compress() and
<h4>Older Releases</h4>
-
+
<ol>
<li>
Wolfgang Bangerth, Timo Heister, Luca Heltai, Guido Kanschat, Martin Kronbichler, Matthias Maier, and Toby D. Young <br/>
International Journal of Heat and Mass Transfer, vol. 71, pp. 183-188, 2014.
</li>
+ <li>
+ M. Hintermüller, A. Schiela, W. Wollner
+ <br>
+ <strong>The length of the primal-dual path in
+ Moreau-Yosida-based path-following for state constrained
+ optimal control
+ </strong>
+ <br>
+ SIAM J. Optim., vol. 24, pp. 108-126, 2014.
+ </li>
+
<li> T. Wick, G. Singh, M.F. Wheeler
<br>
<strong>Pressurized-Fracture propagation using a phase-field approach coupled to a reservoir simulator
</strong>
<br>
- SPE 168597-MS, SPE HFTC Proc. 2014.
+ SPE 168597-MS, SPE HFTC Proc., 2014.
+ </li>
+
+ <li> M.F. Wheeler, T. Wick, W. Wollner
+ <br>
+ <strong>An Augmented-Lagrangian Method for the Phase-Field Approach for
+Pressurized Fractures
+ </strong>
+ <br>
+ Comput. Methods Appl. Mech. Engrg., vol. 271, pp. 69-85, 2014.
</li>
</ol>
arXiv:1303.7005, submitted, 2013.
</li>
+ <li> M. R. Opmeer, T. Reis, W. Wollner
+ <br>
+ <strong>Finite-Rank ADI Iteration for Operator Lyapunov Equations</strong>
+ <br>
+ SIAM J. Control Optim., vol. 51, pp. 4084-4117, 2013.
+ </li>
+
<li> T. Povall
<br>
<strong>Single Crystal Plasticity at Finite Strains: A Computational Investigation of Hardening Relations</strong>
<a href="http://link.aps.org/doi/10.1103/PhysRevB.88.125308">DOI:
10.1103/PhysRevB.88.125308</a>
</li>
-
+
<li>
<a href="http://ganymed.iwr.uni-heidelberg.de/~hartmann/"
target="_top">R. Hartmann</a>
arXiv:1209.2811 [math.NA], 2012.
</li>
- <li>
- M. Hintermüller, A. Schiela, W. Wollner
- <br>
- <strong>The length of the primal-dual path in
- Moreau-Yosida-based path-following for state constrained
- optimal control
- </strong>
- <br>
- IGB-Report 57, Karl-Franzens-University Graz, Austria, 2012.
- </li>
-
<li> M. Hinze, M. Kunkel, A. Steinbrecher, T. Stykel
<br>
<strong>Model order reduction of coupled circuit-device systems
to other useful pieces of information.
+<h3> Video lectures on tutorial programs </h3>
+
+This and several of the other tutorial programs are also discussed and
+demonstrated in <a
+href="http://www.math.tamu.edu/~bangerth/videos.html">Wolfgang
+Bangerth's video lectures</a> 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.
+
+
<h3> What this program does </h3>
Let's come back to step-1, the current program.
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 <a
specifically written for scientists and engineers, not for computer
scientists, and has a focus on short, practical lessons.
+- An article on <a href="http://arxiv.org/abs/1210.0530">Best
+ Practices for Scientific Computing</a> 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.
<h1>Results</h1>
-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:
<TABLE WIDTH="60%" ALIGN="center">
<tr>
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;
}
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
<h1>Results</h1>
-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
-<code>bsub</code> 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
+<code>qsub</code> 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
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)
// resulting from the distribution of degrees of freedom on the grid. That
// class can be found here:
#include <deal.II/lac/sparse_matrix.h>
-// 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 <deal.II/lac/compressed_sparsity_pattern.h>
<h3>Results for a 2d circular shell testcase</h3>
+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:
+<code>
+<pre>
+$ mpirun -n 50 ./step-32
+</pre>
+</code>
+
+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:
<code>
<pre>
double RightHandSide<dim>::value (const Point<dim> &p,
const unsigned int /*component*/) const
{
- double return_value = 0;
+ double return_value = 0.0;
for (unsigned int i=0; i<dim; ++i)
- return_value += 4*std::pow(p(i), 4);
+ return_value += 4.0 * std::pow(p(i), 4.0);
return return_value;
}
/* ---------------------------------------------------------------------
* $Id$
*
- * Copyright (C) 2012 - 2013 by the deal.II authors
+ * Copyright (C) 2012 - 2014 by the deal.II authors
*
* This file is part of the deal.II library.
*
// on the current mesh. There are two nested loops: the outer loop for the Newton
// iteration and the inner loop for the line search which
// will be used only if necessary. To obtain a good and reasonable
- // starting value we solve an elastic problem in very first Newton step on each
+ // starting value we solve an elastic problem in the very first Newton step on each
// mesh (or only on the first mesh if we transfer solutions between meshes). We
// do so by setting the yield stress to an unreasonably large value in these
// iterations and then setting it back to the correct value in subsequent
// iterations.
//
- // Other than this, the top part of this function should be reasonably
- // obvious:
+ // Other than this, the top part of this function should be
+ // reasonably obvious. We initialize the variable
+ // <code>previous_residual_norm</code> 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 <int dim>
void
PlasticityContactProblem<dim>::solve_newton ()
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<double>::max();
const double correct_sigma = sigma_0;
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<m)?n:m;
// Now, if all_true set in the
// other, then all must be true
* @author Guido Kanschat 2007
*/
#define AssertDimension(dim1,dim2) Assert((dim1) == (dim2), \
- ExcDimensionMismatch((dim1),(dim2)))
+ dealii::ExcDimensionMismatch((dim1),(dim2)))
/**
* @author Guido Kanschat 2007
*/
#define AssertIndexRange(index,range) Assert((index) < (range), \
- ExcIndexRange((index),0,(range)))
+ dealii::ExcIndexRange((index),0,(range)))
#define AssertGlobalIndexRange(index,range) Assert((index) < (range), \
ExcIndexRange<types::global_dof_index>((index),0,(range)))
// ---------------------------------------------------------------------
// $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.
//
range_end = ranges.end();
}
- std::vector<Range>::const_iterator
+ const std::vector<Range>::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);
}
/**
* Print all parameters with the given style to <tt>out</tt>. Presently
- * only <tt>Text</tt> and <tt>LaTeX</tt> are implemented.
+ * only <tt>Text</tt>, <tt>LaTeX</tt> and <tt>XML</tt> are implemented.
*
* In <tt>Text</tt> 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
* well as the documenting string given to the declare_entry() function
* if available.
*
+ * In <tt>XML</tt> format, the output starts with one root element
+ * <tt>ParameterHandler</tt> in order to get a valid XML document
+ * and all subsections under it.
+ *
* In <tt>Text</tt> 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
* by entering and leaving subsections through the enter_subsection() and
* leave_subsection() functions.
*
+ * If <tt>include_top_level_elements</tt> is <tt>true</tt>, also
+ * the higher subsection elements are printed. In <tt>XML</tt> format
+ * this is required to get a valid XML document and output starts
+ * with one root element <tt>ParameterHandler</tt>.
+ *
* 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
// ---------------------------------------------------------------------
// $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.
//
{
namespace SymmetricTensorAccessors
{
+ template <int rank, int dim, bool constness, int P, typename Number>
+ Accessor<rank,dim,constness,P,Number>::
+ Accessor ()
+ :
+ tensor (*static_cast<tensor_type*>(0)),
+ previous_indices ()
+ {
+ Assert (false, ExcMessage ("You can't call the default constructor of this class."));
+ }
+
+
template <int rank, int dim, bool constness, int P, typename Number>
Accessor<rank,dim,constness,P,Number>::
Accessor (tensor_type &tensor,
{}
+ template <int rank, int dim, bool constness, int P, typename Number>
+ Accessor<rank,dim,constness,P,Number>::
+ Accessor (const Accessor &a)
+ :
+ tensor (a.tensor),
+ previous_indices (a.previous_indices)
+ {}
+
+
template <int rank, int dim, bool constness, int P, typename Number>
Accessor<rank,dim,constness,P-1,Number>
+ template <int rank, int dim, bool constness, typename Number>
+ Accessor<rank,dim,constness,1,Number>::
+ Accessor ()
+ :
+ tensor (*static_cast<tensor_type*>(0)),
+ previous_indices ()
+ {
+ Assert (false, ExcMessage ("You can't call the default constructor of this class."));
+ }
+
+
+
template <int rank, int dim, bool constness, typename Number>
Accessor<rank,dim,constness,1,Number>::
Accessor (tensor_type &tensor,
+ template <int rank, int dim, bool constness, typename Number>
+ Accessor<rank,dim,constness,1,Number>::
+ Accessor (const Accessor &a)
+ :
+ tensor (a.tensor),
+ previous_indices (a.previous_indices)
+ {}
+
+
+
template <int rank, int dim, bool constness, typename Number>
typename Accessor<rank,dim,constness,1,Number>::reference
Accessor<rank,dim,constness,1,Number>::operator[] (const unsigned int i)
* 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);
// ---------------------------------------------------------------------
// $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.
//
* 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.
* 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 <code>fe_index</code>th 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 <code>fe_index</code> 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
* 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<float>, Vector<double>,
- * or a BlockVector<double>, 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 <class OutputVector, typename number>
void set_dof_values_by_interpolation (const Vector<number> &local_values,
* 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<DH::dimension,DH::space_dimension> &
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);
/**
const FiniteElement<DH::dimension,DH::space_dimension> &
DoFCellAccessor<DH,lda>::get_fe () const
{
+ Assert ((dynamic_cast<const dealii::DoFHandler<DH::dimension,DH::space_dimension>*>
+ (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());
}
unsigned int
DoFCellAccessor<DH,lda>::active_fe_index () const
{
+ Assert ((dynamic_cast<const dealii::DoFHandler<DH::dimension,DH::space_dimension>*>
+ (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);
}
void
DoFCellAccessor<DH,lda>::set_active_fe_index (const unsigned int i)
{
+ Assert ((dynamic_cast<const dealii::DoFHandler<DH::dimension,DH::space_dimension>*>
+ (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);
}
std::vector<std::pair<unsigned int, unsigned int> >
hp_vertex_dof_identities (const FiniteElement<dim> &fe_other) const;
+ /*@}*/
+
/**
* Return the matrix interpolating from a face of one
* element to the face of the neighboring element. The
* @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:
* 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
*
{
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<dim,spacedim> mapping_q1;
+ static
+ MappingQ1<dim,spacedim>& return_static_mapping_q1();
public:
/**
* 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:
/**
const size_type j) const;
/**
- * Return the main diagonal
- * element in the <i>i</i>th
- * row. This function throws an
- * error if the matrix is not
- * quadratic.
+ * Return the main diagonal element in the <i>i</i>th 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
*/
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
template <typename number>
inline
- typename Accessor<number, true>::MatrixType &
+ const typename Accessor<number, true>::MatrixType &
Accessor<number, true>::get_matrix () const
{
return *matrix;
}
+
+template <typename number>
+void
+ChunkSparseMatrix<number>::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; c<chunk_size; ++c)
+ {
+ *values++ = val_ptr[c];
+ *column_indices++ = it->column()*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; c<next_chunk_size; ++c, ++row_length)
+ {
+ *values++ = val_ptr[c];
+ *column_indices++ = it->column()*chunk_size+c;
+ }
+ val_ptr += chunk_size*chunk_size;
+ }
+ }
+}
+
+
+
template <typename number>
template <class OutVector, class InVector>
void
// ---------------------------------------------------------------------
// $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.
//
*/
BlockIndices column_indices;
- friend void internal::reinit<>(MatrixBlock<MATRIX> &, const BlockSparsityPattern &);
+ template <class OTHER_MATRIX>
+ friend void internal::reinit(MatrixBlock<OTHER_MATRIX> &, const BlockSparsityPattern &);
};
#include <deal.II/lac/block_vector_base.h>
#include <deal.II/lac/parallel_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
+#include <deal.II/lac/trilinos_parallel_block_vector.h>
+
+
#include <cstdio>
#include <vector>
DEAL_II_NAMESPACE_OPEN
-
namespace parallel
{
namespace distributed
BlockVector &
operator= (const Vector<Number> &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<Number> &
+ 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<Number> &
+ operator = (const TrilinosWrappers::MPI::BlockVector &trilinos_vec);
+#endif
+
/**
* Reinitialize the BlockVector to contain <tt>num_blocks</tt> blocks of
* size <tt>block_size</tt> each.
+#ifdef DEAL_II_WITH_PETSC
+
+ template <typename Number>
+ inline
+ BlockVector<Number> &
+ BlockVector<Number>::operator = (const PETScWrappers::MPI::BlockVector &petsc_vec)
+ {
+ AssertDimension(this->n_blocks(), petsc_vec.n_blocks());
+ for (unsigned int i=0; i<this->n_blocks(); ++i)
+ this->block(i) = petsc_vec.block(i);
+
+ return *this;
+ }
+
+#endif
+
+
+
+#ifdef DEAL_II_WITH_TRILINOS
+
+ template <typename Number>
+ inline
+ BlockVector<Number> &
+ BlockVector<Number>::operator = (const TrilinosWrappers::MPI::BlockVector &trilinos_vec)
+ {
+ AssertDimension(this->n_blocks(), trilinos_vec.n_blocks());
+ for (unsigned int i=0; i<this->n_blocks(); ++i)
+ this->block(i) = trilinos_vec.block(i);
+
+ return *this;
+ }
+
+#endif
+
+
+
template <typename Number>
inline
void
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
Vector<Number> &
operator = (const Vector<Number2> &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<Number> &
+ 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<Number> &
+ 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.
#include <deal.II/base/config.h>
#include <deal.II/lac/parallel_vector.h>
+#include <deal.II/lac/vector_view.h>
+
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/trilinos_vector.h>
DEAL_II_NAMESPACE_OPEN
+#ifdef DEAL_II_WITH_PETSC
+
+ template <typename Number>
+ Vector<Number> &
+ Vector<Number>::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<const Vec &>(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<const Vec &>(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 <typename Number>
+ Vector<Number> &
+ Vector<Number>::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<TrilinosWrappers::types::int_type>(this->local_range().first)) : 0;
+ const VectorView<double> in_view (local_size(), trilinos_vec.begin()+start_index);
+ static_cast<dealii::Vector<Number>&>(vector_view) =
+ static_cast<const dealii::Vector<double>&>(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 <typename Number>
void
Vector<Number>::copy_from (const Vector<Number> &c,
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);
+
};
/*@}*/
/**
* 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 <typename OutputVector>
void
* 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:
/**
template <typename number>
inline
- typename Accessor<number, true>::MatrixType &
+ const typename Accessor<number, true>::MatrixType &
Accessor<number, true>::get_matrix () const
{
return *matrix;
*/
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.
*
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<unsigned int> &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Initialize a rectangular matrix.
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<unsigned int> &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
-
/**
* Initialize a quadratic matrix.
*
*/
SparsityPattern &operator = (const SparsityPattern &);
- /**
- * Reallocate memory and set up data structures for a new matrix with <tt>m
- * </tt>rows and <tt>n</tt> columns, with at most <tt>max_per_row</tt>
- * nonzero entries per row.
- *
- * This function simply maps its operations to the other <tt>reinit</tt>
- * 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 <tt>m
* </tt>rows and <tt>n</tt> columns, with at most <tt>max_per_row</tt>
const size_type n,
const unsigned int max_per_row);
- /**
- * Reallocate memory for a matrix of size <tt>m x n</tt>. The number of
- * entries for each row is taken from the array <tt>row_lengths</tt> which
- * has to give this number of each row <tt>i=1...m</tt>.
- *
- * If <tt>m*n==0</tt> 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<unsigned int> &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Reallocate memory for a matrix of size <tt>m x n</tt>. The number of
const size_type n,
const std::vector<unsigned int> &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<const std::vector<unsigned int> > &row_lengths,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Same as above, but with a VectorSlice argument instead.
*/
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 <tt>std::vector</tt>, <tt>std::list</tt>, 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 <tt>operator*</tt> or <tt>operator-></tt> to one of
- * these iterators) must be a container itself that provides functions
- * <tt>begin</tt> and <tt>end</tt> 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<std::vector<unsigned int> > column_indices (n_rows);
- * for (unsigned int row=0; row<n_rows; ++row)
- * // generate necessary columns in this row
- * fill_row (column_indices[row]);
- *
- * sparsity.copy_from (n_rows, n_cols,
- * column_indices.begin(),
- * column_indices.end());
- * @endcode
- *
- * Note that this example works since the iterators dereferenced yield
- * containers with functions <tt>begin</tt> and <tt>end</tt> (namely
- * <tt>std::vector</tt>s), and the inner iterators dereferenced yield
- * unsigned integers as column indices. Note that we could have replaced
- * each of the two <tt>std::vector</tt> occurrences by <tt>std::list</tt>,
- * and the inner one by <tt>std::set</tt> as well.
- *
- * Another example would be as follows, where we initialize a whole matrix,
- * not only a sparsity pattern:
- * @code
- * std::vector<std::map<unsigned int,double> > entries (n_rows);
- * for (unsigned int row=0; row<n_rows; ++row)
- * // generate necessary pairs of columns
- * // and corresponding values in this row
- * fill_row (entries[row]);
- *
- * sparsity.copy_from (n_rows, n_cols,
- * column_indices.begin(),
- * column_indices.end());
- * matrix.reinit (sparsity);
- * matrix.copy_from (column_indices.begin(),
- * column_indices.end());
- * @endcode
- *
- * This example works because dereferencing iterators of the inner type
- * yields a pair of unsigned integers and a value, the first of which we
- * take as column index. As previously, the outer <tt>std::vector</tt> could
- * be replaced by <tt>std::list</tt>, and the inner <tt>std::map<unsigned
- * int,double></tt> could be replaced by <tt>std::vector<std::pair<unsigned
- * int,double> ></tt>, 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 <typename ForwardIterator>
- 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
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 <typename CompressedSparsityType>
- 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
template <typename CompressedSparsityType>
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 <typename number>
- void copy_from (const FullMatrix<number> &matrix,
- const bool optimize_diagonal) DEAL_II_DEPRECATED;
/**
* Take a full matrix and use its nonzero entries to generate a sparse
const bool indices_are_sorted = false);
// @}
+
+
+
+
/**
* @name Iterators
*/
*/
iterator end (const size_type r) const;
- /**
- * STL-like iterator with the first entry of row <tt>r</tt>.
- *
- * Note that if the given row is empty, i.e. does not contain any nonzero
- * entries, then the iterator returned by this function equals
- * <tt>end(r)</tt>. 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 <tt>r</tt>. 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;
// @}
/**
*/
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
* @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<unsigned int> &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<unsigned int> &row_lengths,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+
+ /**
+ * Reallocate memory for a matrix of size <tt>m x n</tt>. The number of
+ * entries for each row is taken from the array <tt>row_lengths</tt> which
+ * has to give this number of each row <tt>i=1...m</tt>.
+ *
+ * If <tt>m*n==0</tt> 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<unsigned int> &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<const std::vector<unsigned int> > &row_lengths,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * Reallocate memory and set up data structures for a new matrix with <tt>m
+ * </tt>rows and <tt>n</tt> columns, with at most <tt>max_per_row</tt>
+ * nonzero entries per row.
+ *
+ * This function simply maps its operations to the other <tt>reinit</tt>
+ * 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 <tt>std::vector</tt>, <tt>std::list</tt>, 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 <tt>operator*</tt> or <tt>operator-></tt> to one of
+ * these iterators) must be a container itself that provides functions
+ * <tt>begin</tt> and <tt>end</tt> 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<std::vector<unsigned int> > column_indices (n_rows);
+ * for (unsigned int row=0; row<n_rows; ++row)
+ * // generate necessary columns in this row
+ * fill_row (column_indices[row]);
+ *
+ * sparsity.copy_from (n_rows, n_cols,
+ * column_indices.begin(),
+ * column_indices.end());
+ * @endcode
+ *
+ * Note that this example works since the iterators dereferenced yield
+ * containers with functions <tt>begin</tt> and <tt>end</tt> (namely
+ * <tt>std::vector</tt>s), and the inner iterators dereferenced yield
+ * unsigned integers as column indices. Note that we could have replaced
+ * each of the two <tt>std::vector</tt> occurrences by <tt>std::list</tt>,
+ * and the inner one by <tt>std::set</tt> as well.
+ *
+ * Another example would be as follows, where we initialize a whole matrix,
+ * not only a sparsity pattern:
+ * @code
+ * std::vector<std::map<unsigned int,double> > entries (n_rows);
+ * for (unsigned int row=0; row<n_rows; ++row)
+ * // generate necessary pairs of columns
+ * // and corresponding values in this row
+ * fill_row (entries[row]);
+ *
+ * sparsity.copy_from (n_rows, n_cols,
+ * column_indices.begin(),
+ * column_indices.end());
+ * matrix.reinit (sparsity);
+ * matrix.copy_from (column_indices.begin(),
+ * column_indices.end());
+ * @endcode
+ *
+ * This example works because dereferencing iterators of the inner type
+ * yields a pair of unsigned integers and a value, the first of which we
+ * take as column index. As previously, the outer <tt>std::vector</tt> could
+ * be replaced by <tt>std::list</tt>, and the inner <tt>std::map<unsigned
+ * int,double></tt> could be replaced by <tt>std::vector<std::pair<unsigned
+ * int,double> ></tt>, 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 <typename ForwardIterator>
+ 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 <typename CompressedSparsityType>
+ 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 <typename number>
+ void copy_from (const FullMatrix<number> &matrix,
+ const bool optimize_diagonal) DEAL_II_DEPRECATED;
+
+ /**
+ * STL-like iterator with the first entry of row <tt>r</tt>.
+ *
+ * Note that if the given row is empty, i.e. does not contain any nonzero
+ * entries, then the iterator returned by this function equals
+ * <tt>end(r)</tt>. 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 <tt>r</tt>. 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.
*/
const size_type *get_column_numbers () const DEAL_II_DEPRECATED;
+// @}
+
BOOST_SERIALIZATION_SPLIT_MEMBER()
/** @addtogroup Exceptions
* @name Exceptions
class TridiagonalMatrix
{
public:
+ ///@name Constructors
+ //@{
/**
* Declare type for container size.
*/
void Vector::reinit (const Epetra_Map ¶llel_partitioner,
const dealii::Vector<number> &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<size; ++i)
(*vector)[0][i] = v(gid(parallel_partitioner,i));
reinit(const DH &dof_handler,
const ConstraintMatrix &constraints_in,
const Quad &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
MappingQ1<dim> mapping;
std::vector<const DH *> dof_handlers;
const DH &dof_handler,
const ConstraintMatrix &constraints_in,
const Quad &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
std::vector<const DH *> dof_handlers;
std::vector<const ConstraintMatrix *> constraints;
reinit(const std::vector<const DH *> &dof_handler,
const std::vector<const ConstraintMatrix *> &constraint,
const std::vector<Quad> &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
MappingQ1<dim> mapping;
std::vector<IndexSet> locally_owned_set =
reinit(const std::vector<const DH *> &dof_handler,
const std::vector<const ConstraintMatrix *> &constraint,
const Quad &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
MappingQ1<dim> mapping;
std::vector<Quad> quads;
const std::vector<const DH *> &dof_handler,
const std::vector<const ConstraintMatrix *> &constraint,
const Quad &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
std::vector<Quad> quads;
quads.push_back(quad);
const std::vector<const DH *> &dof_handler,
const std::vector<const ConstraintMatrix *> &constraint,
const std::vector<Quad> &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
std::vector<IndexSet> locally_owned_set =
internal::MatrixFree::extract_locally_owned_index_sets
const std::vector<const ConstraintMatrix *> &constraint,
const std::vector<IndexSet> &locally_owned_set,
const std::vector<Quad> &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
// find out whether we use a hp Quadrature or a standard quadrature
std::vector<hp::QCollection<1> > quad_hp;
const std::vector<const ConstraintMatrix *> &constraint,
const std::vector<IndexSet> &locally_owned_set,
const std::vector<hp::QCollection<1> > &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
if (additional_data.initialize_indices == true)
{
const std::vector<const ConstraintMatrix *> &constraint,
const std::vector<IndexSet> &locally_owned_set,
const std::vector<hp::QCollection<1> > &quad,
- const MatrixFree<dim,Number>::AdditionalData additional_data)
+ const typename MatrixFree<dim,Number>::AdditionalData additional_data)
{
if (additional_data.initialize_indices == true)
{
// ---------------------------------------------------------------------
// $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.
//
* 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.
*
*
* <h3>Matrices on the boundary</h3>
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.
*/
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.
*/
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
/**
- * 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.
*/
* 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.
*/
* <li> 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
* <tt>refine_interpolate(in, out)</tt>) only be called once.
* </ul>
*
+ *
+ * <h3>Implementation in the context of hp finite elements</h3>
+ *
+ * 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<int dim, typename VECTOR=Vector<double>, class DH=DoFHandler<dim> >
class SolutionTransfer
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<subsection_path.size(); ++i)
+ {
+ out << std::setw(overall_indent_level*2) << ""
+ << "subsection " << demangle (subsection_path[i]) << std::endl;
+ overall_indent_level += 1;
+ };
+
// first find out the longest
// entry name to be able to
// align the equal signs
const std::vector<std::string> doc_lines
= Utilities::
break_text_into_lines (p->second.get<std::string>("documentation"),
- 78 - indent_level*2 - 2);
+ 78 - overall_indent_level*2 - 2);
for (unsigned int i=0; i<doc_lines.size(); ++i)
- out << std::setw(indent_level*2) << ""
+ out << std::setw(overall_indent_level*2) << ""
<< "# "
<< doc_lines[i]
<< std::endl;
// print name and value
// of this entry
- 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) << " "
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; i<subsection_path.size(); ++i)
+ {
+ out << std::setw(overall_indent_level*2) << ""
+ << "subsection " << demangle (subsection_path[i]) << std::endl;
+ overall_indent_level += 1;
+ };
+
// first find out the longest
// entry name to be able to
// align the equal signs
const std::string value = p->second.get<std::string>("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) << " "
const std::vector<std::string> description_str
= Utilities::break_text_into_lines (p->second.get<std::string>
("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; i<description_str.size(); ++i)
- out << std::setw(indent_level*2+6) << ""
+ out << std::setw(overall_indent_level*2+6) << ""
<< description_str[i] << std::endl;
}
else if (description_str.empty() == false)
// documenting string,
// print it as well
if (p->second.get<std::string>("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<std::string>("documentation") << ")" << std::endl;
}
// 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;
&&
(n_sections != 0))
out << std::endl << std::endl;
- }
// now traverse subsections tree,
// in alphabetical order
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:
// 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)
{
// 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;
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:
}
}
+ // 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<subsection_path.size(); ++i)
+ {
+ overall_indent_level -= 1;
+ out << std::setw(overall_indent_level*2) << ""
+ << "end" << std::endl;
+ };
+
+ break;
+ }
+
+ default:
+ Assert (false, ExcNotImplemented());
+ }
+
+}
+
void
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
);
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
);
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;
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)
Triangulation<dim,spacedim>::
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<dim>::ghost_destroy (parallel_ghost);
dealii::internal::p4est::functions<dim>::destroy (parallel_forest);
parallel_forest = 0;
dealii::internal::p4est::functions<dim>::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;
(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))
FullMatrix<double> 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);
}
}
// space to this cell's (unknown) FE space unless an explicit
// fe_index is given
Assert ((dynamic_cast<DoFHandler<DH::dimension,DH::space_dimension>*>
- (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<dim,spacedim> &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<number> tmp1(dofs_per_cell);
DEAL_II_NAMESPACE_OPEN
-
template <class DH, bool lda>
template <class OutputVector, typename number>
void
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<DoFHandler<DH::dimension,DH::space_dimension>*>
+ (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<double> 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<number> 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<DoFHandler<DH::dimension,DH::space_dimension>*>
(this->dof_handler)
!= 0)
"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<dim,spacedim> &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<number> tmp(dofs_per_cell);
for (unsigned int child=0; child<this->n_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"
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
// 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.
(const typename Triangulation<dim_,dim_ + 1>::cell_iterator &cell,
const Point<dim_ + 1> &p,
const Point<dim_ > &initial_p_unit,
- MappingQ1<dim,spacedim>::InternalData &mdata) const
+ typename MappingQ1<dim,spacedim>::InternalData &mdata) const
{
const unsigned int spacedim1 = dim_+1;
const unsigned int dim1 = dim_;
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.
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');
/////////////////////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;
}
////////////////////////Processing the CELL_DATA section/////////////////////////////
- if (std::strcmp(keyword_3,"CELL_DATA") == 0)
+ if (keyword == "CELL_DATA")
{
int no_ids;
in>>no_ids;
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."));
}
// ---------------------------------------------------------------------
// $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.
//
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
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()));
}
}
}
//---------------------------------------------------------------------------
-
template<int dim, int spacedim>
- MappingQ1<dim,spacedim>
- StaticMappingQ1<dim,spacedim>::mapping_q1;
-
+ MappingQ1<dim,spacedim>& StaticMappingQ1<dim,spacedim>::return_static_mapping_q1()
+ {
+ static MappingQ1<dim,spacedim> mapping;
+ return mapping;
+ }
template<int dim, int spacedim>
MappingCollection<dim,spacedim>
StaticMappingQ1<dim,spacedim>::mapping_collection
- = MappingCollection<dim,spacedim>(mapping_q1);
+ = MappingCollection<dim,spacedim>(StaticMappingQ1<dim,spacedim>::return_static_mapping_q1());
}
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
{
out.setf (std::ios::fixed, std::ios::floatfield);
if (across)
- for (size_type i=0; i<size(); ++i)
+ for (size_type i=0; i<local_size(); ++i)
out << val[i] << ' ';
else
- for (size_type i=0; i<size(); ++i)
+ for (size_type i=0; i<local_size(); ++i)
out << val[i] << std::endl;
out << std::endl;
reinit (original.rows, original.cols, max_per_row);
- // now copy the entries from
- // the other object
+ // now copy the entries from the other object
for (size_type row=0; row<original.rows; ++row)
{
- // copy the elements of this row
- // of the other object
+ // copy the elements of this row of the other object
//
- // note that the first object actually
- // is the main-diagonal element,
+ // note that the first object actually is the main-diagonal element,
// which we need not copy
//
- // we do the copying in two steps:
- // first we note that the elements in
- // @p{original} are sorted, so we may
- // first copy all the elements up to
- // the first side-diagonal one which
- // is to be filled in. then we insert
- // the side-diagonals, finally copy
- // the rest from that element onwards
- // which is not a side-diagonal any
- // more.
+ // we do the copying in two steps: first we note that the elements in
+ // @p{original} are sorted, so we may first copy all the elements up to
+ // the first side-diagonal one which is to be filled in. then we insert
+ // the side-diagonals, finally copy the rest from that element onwards
+ // which is not a side-diagonal any more.
const size_type *const
original_row_start = &original.colnums[original.rowstart[row]] + 1;
- // the following requires that
- // @p{original} be compressed since
+ // the following requires that @p{original} be compressed since
// otherwise there might be invalid_entry's
const size_type *const
original_row_end = &original.colnums[original.rowstart[row+1]];
- // find pointers before and
- // after extra
- // off-diagonals. if at top or
- // bottom of matrix, then set
- // these pointers such that no
- // copying is necessary (see
- // the @p{copy} commands)
+ // find pointers before and after extra off-diagonals. if at top or
+ // bottom of matrix, then set these pointers such that no copying is
+ // necessary (see the @p{copy} commands)
const size_type *const
original_last_before_side_diagonals
= (row > extra_off_diagonals ?
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
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]));
};
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<unsigned int> row_lengths (m, max_per_row);
reinit (m, n, row_lengths);
}
const size_type n,
const unsigned int max_per_row)
{
- // simply map this function to the
- // other @p{reinit} function
+ // simply map this function to the other @p{reinit} function
const std::vector<unsigned int> row_lengths (m, max_per_row);
reinit (m, n, row_lengths);
}
rowstart = 0;
colnums = 0;
max_vec_len = max_dim = rows = cols = 0;
- // if dimension is zero: ignore
- // max_per_row
+ // if dimension is zero: ignore max_per_row
max_row_length = 0;
compressed = false;
return;
}
- // first, if the matrix is
- // quadratic, we
- // will have to make sure that each
- // row has at least one entry for
- // the diagonal element. make this
- // more obvious by having a
- // variable which we can query
+ // first, if the matrix is quadratic, we will have to make sure that each
+ // row has at least one entry for the diagonal element. make this more
+ // obvious by having a variable which we can query
store_diagonal_first_in_row = (m == n);
- // find out how many entries we
- // need in the @p{colnums} array. if
- // this number is larger than
- // @p{max_vec_len}, then we will need
- // to reallocate memory
+ // find out how many entries we need in the @p{colnums} array. if this
+ // number is larger than @p{max_vec_len}, then we will need to reallocate
+ // memory
//
- // note that the number of elements
- // per row is bounded by the number
- // of columns
+ // note that the number of elements per row is bounded by the number of
+ // columns
//
std::size_t vec_len = 0;
for (size_type i=0; i<m; ++i)
row_lengths[i]),
n);
- // sometimes, no entries are
- // requested in the matrix (this
- // most often happens when blocks
- // in a block matrix are simply
- // zero). in that case, allocate
- // exactly one element, to have a
- // valid pointer to some memory
+ // sometimes, no entries are requested in the matrix (this most often
+ // happens when blocks in a block matrix are simply zero). in that case,
+ // allocate exactly one element, to have a valid pointer to some memory
if (vec_len == 0)
{
vec_len = 1;
if (store_diagonal_first_in_row && (max_row_length==0) && (m!=0))
max_row_length = 1;
- // allocate memory for the rowstart
- // values, if necessary. even
- // though we re-set the pointers
- // again immediately after deleting
- // their old content, set them to
- // zero in between because the
- // allocation might fail, in which
- // case we get an exception and the
- // destructor of this object will
- // be called -- where we look at
- // the non-nullness of the (now
- // invalid) pointer again and try
- // to delete the memory a second
- // time.
+ // allocate memory for the rowstart values, if necessary. even though we
+ // re-set the pointers again immediately after deleting their old content,
+ // set them to zero in between because the allocation might fail, in which
+ // case we get an exception and the destructor of this object will be called
+ // -- where we look at the non-nullness of the (now invalid) pointer again
+ // and try to delete the memory a second time.
if (rows > max_dim)
{
if (rowstart)
rowstart = new std::size_t[max_dim+1];
}
- // allocate memory for the column
- // numbers if necessary
+ // allocate memory for the column numbers if necessary
if (vec_len > max_vec_len)
{
if (colnums)
((vec_len == 1) && (rowstart[rows] == 0)),
ExcInternalError());
- // preset the column numbers by a
- // value indicating it is not in
- // use
+ // preset the column numbers by a value indicating it is not in use
std::fill_n (&colnums[0], vec_len, invalid_entry);
- // if diagonal elements are
- // special: let the first entry in
- // each row be the diagonal value
+ // if diagonal elements are special: let the first entry in each row be the
+ // diagonal value
if (store_diagonal_first_in_row)
for (size_type i=0; i<rows; i++)
colnums[rowstart[i]] = i;
next_row_start = 0,
row_length = 0;
- // first find out how many non-zero
- // elements there are, in order to
- // allocate the right amount of
- // memory
+ // first find out how many non-zero elements there are, in order to allocate
+ // the right amount of memory
const std::size_t nonzero_elements
= std::count_if (&colnums[rowstart[0]],
&colnums[rowstart[rows]],
size_type *new_colnums = new size_type[nonzero_elements];
- // reserve temporary storage to
- // store the entries of one row
+ // reserve temporary storage to store the entries of one row
std::vector<size_type> tmp_entries (max_row_length);
// Traverse all rows
for (size_type line=0; line<rows; ++line)
{
- // copy used entries, break if
- // first unused entry is reached
+ // copy used entries, break if first unused entry is reached
row_length = 0;
for (size_type j=rowstart[line]; j<rowstart[line+1]; ++j,++row_length)
if (colnums[j] != invalid_entry)
tmp_entries[row_length] = colnums[j];
else
break;
- // now @p{rowstart} is
- // the number of entries in
- // this line
+ // now @p{rowstart} is the number of entries in this line
- // Sort only beginning at the
- // second entry, if optimized
- // storage of diagonal entries
- // is on.
+ // Sort only beginning at the second entry, if optimized storage of
+ // diagonal entries is on.
- // if this line is empty or has
- // only one entry, don't sort
+ // if this line is empty or has only one entry, don't sort
if (row_length > 1)
std::sort ((store_diagonal_first_in_row)
? tmp_entries.begin()+1
: tmp_entries.begin(),
tmp_entries.begin()+row_length);
- // insert column numbers
- // into the new field
+ // insert column numbers into the new field
for (size_type j=0; j<row_length; ++j)
new_colnums[next_free_entry++] = tmp_entries[j];
- // note new start of this and
- // the next row
+ // note new start of this and the next row
rowstart[line] = next_row_start;
next_row_start = next_free_entry;
- // some internal checks: either
- // the matrix is not quadratic,
- // or if it is, then the first
- // element of this row must be
- // the diagonal element
- // (i.e. with column
- // index==line number)
+ // some internal checks: either the matrix is not quadratic, or if it
+ // is, then the first element of this row must be the diagonal element
+ // (i.e. with column index==line number)
Assert ((!store_diagonal_first_in_row) ||
(new_colnums[rowstart[line]] == line),
ExcInternalError());
- // assert that the first entry
- // does not show up in
- // the remaining ones and that
- // the remaining ones are unique
- // among themselves (this handles
- // both cases, quadratic and
- // rectangular matrices)
+ // assert that the first entry does not show up in the remaining ones
+ // and that the remaining ones are unique among themselves (this handles
+ // both cases, quadratic and rectangular matrices)
//
- // the only exception here is
- // if the row contains no
- // entries at all
+ // the only exception here is if the row contains no entries at all
Assert ((rowstart[line] == next_row_start)
||
(std::find (&new_colnums[rowstart[line]+1],
ExcInternalError());
};
- // assert that we have used all
- // allocated space, no more and no
- // less
+ // assert that we have used all allocated space, no more and no less
Assert (next_free_entry == nonzero_elements,
ExcInternalError());
// set iterator-past-the-end
rowstart[rows] = next_row_start;
- // set colnums to the newly
- // allocated array and delete the
- // old one
+ // set colnums to the newly allocated array and delete the old one
delete[] colnums;
colnums = new_colnums;
void
SparsityPattern::copy_from (const CSP &csp)
{
- // first determine row lengths for
- // each row. if the matrix is
- // quadratic, then we might have to
- // add an additional entry for the
- // diagonal, if that is not yet
- // present. as we have to call
- // compress anyway later on, don't
- // bother to check whether that
- // diagonal entry is in a certain
- // row or not
+ // first determine row lengths for each row. if the matrix is quadratic,
+ // then we might have to add an additional entry for the diagonal, if that
+ // is not yet present. as we have to call compress anyway later on, don't
+ // bother to check whether that diagonal entry is in a certain row or not
const bool do_diag_optimize = (csp.n_rows() == csp.n_cols());
std::vector<unsigned int> row_lengths (csp.n_rows());
for (size_type i=0; i<csp.n_rows(); ++i)
}
reinit (csp.n_rows(), csp.n_cols(), row_lengths);
- // now enter all the elements into
- // the matrix, if there are
- // any. note that if the matrix is
- // quadratic, then we already have
- // the diagonal element
+ // now enter all the elements into the matrix, if there are any. note that
+ // if the matrix is quadratic, then we already have the diagonal element
// preallocated
if (n_rows() != 0 && n_cols() != 0)
for (size_type row = 0; row<csp.n_rows(); ++row)
}
}
- // do not need to compress the sparsity
- // pattern since we already have
- // allocated the right amount of data,
- // and the CSP data is sorted, too.
+ // do not need to compress the sparsity pattern since we already have
+ // allocated the right amount of data, and the CSP data is sorted, too.
compressed = true;
}
template <typename number>
void SparsityPattern::copy_from (const FullMatrix<number> &matrix)
{
- // first init with the number of entries
- // per row. if this matrix is square then we
- // also have to allocate memory for the
- // diagonal entry, unless we have already
- // counted it
+ // first init with the number of entries per row. if this matrix is square
+ // then we also have to allocate memory for the diagonal entry, unless we
+ // have already counted it
std::vector<unsigned int> entries_per_row (matrix.m(), 0);
for (size_type row=0; row<matrix.m(); ++row)
{
bool
SparsityPattern::empty () const
{
- // let's try to be on the safe side of
- // life by using multiple possibilities in
- // the check for emptiness... (sorry for
- // this kludge -- emptying matrices and
- // freeing memory was not present in the
- // original implementation and I don't
- // know at how many places I missed
- // something in adding it, so I try to
- // be cautious. wb)
+ // let's try to be on the safe side of life by using multiple possibilities
+ // in the check for emptiness... (sorry for this kludge -- emptying matrices
+ // and freeing memory was not present in the original implementation and I
+ // don't know at how many places I missed something in adding it, so I try
+ // to be cautious. wb)
if ((rowstart==0) || (rows==0) || (cols==0))
{
Assert (rowstart==0, ExcInternalError());
SparsityPattern::size_type
SparsityPattern::max_entries_per_row () const
{
- // if compress() has not yet been
- // called, we can get the maximum
- // number of elements per row using
- // the stored value
+ // if compress() has not yet been called, we can get the maximum number of
+ // elements per row using the stored value
if (!compressed)
return max_row_length;
- // if compress() was called, we
- // use a better algorithm which
- // gives us a sharp bound
+ // if compress() was called, we use a better algorithm which gives us a
+ // sharp bound
size_type m = 0;
- for (size_type i=1; i<rows; ++i)
+ for (size_type i=1; i<=rows; ++i)
m = std::max (m, static_cast<size_type>(rowstart[i]-rowstart[i-1]));
return m;
Assert (j<cols, ExcIndexRange(j,0,cols));
Assert (compressed, ExcNotCompressed());
- // let's see whether there is
- // something in this line
+ // let's see whether there is something in this line
if (rowstart[i] == rowstart[i+1])
return invalid_entry;
- // If special storage of diagonals
- // was requested, we can get the
- // diagonal element faster by this
- // query.
+ // If special storage of diagonals was requested, we can get the diagonal
+ // element faster by this query.
if (store_diagonal_first_in_row && (i==j))
return rowstart[i];
- // all other entries are sorted, so
- // we can use a binary search
- // algorithm
+ // all other entries are sorted, so we can use a binary search algorithm
//
- // note that the entries are only
- // sorted upon compression, so this
- // would fail for non-compressed
- // sparsity patterns; however, that
- // is why the Assertion is at the
- // top of this function, so it may
- // not be called for noncompressed
- // structures.
+ // note that the entries are only sorted upon compression, so this would
+ // fail for non-compressed sparsity patterns; however, that is why the
+ // Assertion is at the top of this function, so it may not be called for
+ // noncompressed structures.
const size_type *sorted_region_start = (store_diagonal_first_in_row ?
&colnums[rowstart[i]+1] :
&colnums[rowstart[i]]);
Assert (global_index < n_nonzero_elements(),
ExcIndexRange (global_index, 0, n_nonzero_elements()));
- // first find the row in which the
- // entry is located. for this note
- // that the rowstart array indexes
- // the global indices at which each
- // row starts. since it is sorted,
- // and since there is an element
- // for the one-past-last row, we
- // can simply use a bisection
- // search on it
+ // first find the row in which the entry is located. for this note that the
+ // rowstart array indexes the global indices at which each row starts. since
+ // it is sorted, and since there is an element for the one-past-last row, we
+ // can simply use a bisection search on it
const size_type row
= (std::upper_bound (&rowstart[0], &rowstart[rows], global_index)
- &rowstart[0] - 1);
- // now, the column index is simple
- // since that is what the colnums
- // array stores:
+ // now, the column index is simple since that is what the colnums array
+ // stores:
const size_type col = colnums[global_index];
// so return the respective pair
{
Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
Assert (compressed==false, ExcMatrixIsCompressed());
- // Note that we only require a
- // quadratic matrix here, no
- // special treatment of diagonals
+ // Note that we only require a quadratic matrix here, no special treatment
+ // of diagonals
Assert (rows==cols, ExcNotQuadratic());
- // loop over all elements presently
- // in the sparsity pattern and add
- // the transpose element. note:
+ // loop over all elements presently in the sparsity pattern and add the
+ // transpose element. note:
//
- // 1. that the sparsity pattern
- // changes which we work on, but
- // not the present row
+ // 1. that the sparsity pattern changes which we work on, but not the
+ // present row
//
- // 2. that the @p{add} function can
- // be called on elements that
- // already exist without any harm
+ // 2. that the @p{add} function can be called on elements that already exist
+ // without any harm
for (size_type row=0; row<rows; ++row)
for (size_type k=rowstart[row]; k<rowstart[row+1]; k++)
{
- // check whether we are at
- // the end of the entries of
- // this row. if so, go to
- // next row
+ // check whether we are at the end of the entries of this row. if so,
+ // go to next row
if (colnums[k] == invalid_entry)
break;
- // otherwise add the
- // transpose entry if this is
- // not the diagonal (that
- // would not harm, only take
- // time to check up)
+ // otherwise add the transpose entry if this is not the diagonal (that
+ // would not harm, only take time to check up)
if (colnums[k] != row)
add (colnums[k], row);
};
for (size_type i=0; i<rows; ++i)
for (size_type j=rowstart[i]; j<rowstart[i+1]; ++j)
if (colnums[j] != invalid_entry)
- // while matrix entries are
- // usually written (i,j),
- // with i vertical and j
- // horizontal, gnuplot output
- // is x-y, that is we have to
- // exchange the order of
- // output
+ // while matrix entries are usually written (i,j), with i vertical and
+ // j horizontal, gnuplot output is x-y, that is we have to exchange
+ // the order of output
out << colnums[j] << " " << -static_cast<signed int>(i) << std::endl;
AssertThrow (out, ExcIO());
b = std::abs(static_cast<signed int>(i-colnums[j]));
}
else
- // leave if at the end of
- // the entries of this line
+ // leave if at the end of the entries of this line
break;
return b;
}
{
AssertThrow (out, ExcIO());
- // first the simple objects,
- // bracketed in [...]
+ // first the simple objects, bracketed in [...]
out << '[' << max_dim << ' '
<< rows << ' '
<< cols << ' '
#include <deal.II/lac/sparsity_tools.h>
#include <algorithm>
+#include <functional>
#ifdef DEAL_II_WITH_MPI
#include <deal.II/base/utilities.h>
Assert (status.MPI_TAG==124, ExcInternalError());
MPI_Get_count(&status, MPI_BYTE, &len);
- Assert( len%sizeof(unsigned int)==0, ExcInternalError());
+ Assert( len%sizeof(size_type)==0, ExcInternalError());
recv_buf.resize(len/sizeof(size_type));
AssertDimension (sparsity_pattern.n_rows(),
static_cast<size_type>(n_global_elements(input_row_map)));
-
- // exchange data if requested with deal.II's own function
-#ifdef DEAL_II_WITH_MPI
- const Epetra_MpiComm* communicator =
- dynamic_cast<const Epetra_MpiComm*>(&input_row_map.Comm());
- if (exchange_data && communicator != 0)
- {
- std::vector<size_type>
- owned_per_proc(communicator->NumProc(), -1);
- size_type my_elements = input_row_map.NumMyElements();
- MPI_Allgather(&my_elements, 1,
- Utilities::MPI::internal::mpi_type_id(&my_elements),
- &owned_per_proc[0], 1,
- Utilities::MPI::internal::mpi_type_id(&my_elements),
- communicator->Comm());
-
- AssertDimension(std::accumulate(owned_per_proc.begin(),
- owned_per_proc.end(), size_type()), sparsity_pattern.n_rows());
-
- SparsityTools::distribute_sparsity_pattern
- (const_cast<CompressedSimpleSparsityPattern&>(sparsity_pattern),
- owned_per_proc, communicator->Comm(), sparsity_pattern.row_index_set());
- }
-#endif
-
- if (input_row_map.Comm().MyPID() == 0)
- {
- AssertDimension (sparsity_pattern.n_rows(),
- static_cast<size_type>(n_global_elements(input_row_map)));
- AssertDimension (sparsity_pattern.n_cols(),
- static_cast<size_type>(n_global_elements(input_col_map)));
- }
+ AssertDimension (sparsity_pattern.n_cols(),
+ static_cast<size_type>(n_global_elements(input_col_map)));
column_space_map.reset (new Epetra_Map (input_col_map));
if (input_row_map.Comm().NumProc() > 1)
{
graph.reset (new Epetra_CrsGraph (Copy, input_row_map,
- &n_entries_per_row[0], true));
+ &n_entries_per_row[0],
+ exchange_data ? false : true));
if (have_ghost_rows == true)
nonlocal_graph.reset (new Epetra_CrsGraph (Copy, off_processor_map,
&n_entries_per_ghost_row[0],
}
}
- graph->FillComplete(input_col_map, input_row_map);
- graph->OptimizeStorage();
-
- AssertDimension (sparsity_pattern.n_cols(),static_cast<size_type>(
- n_global_cols(*graph)));
-
- matrix.reset (new Epetra_FECrsMatrix(Copy, *graph, false));
-
- // and now the same operations for the nonlocal graph and matrix
+ // finalize nonlocal graph and create nonlocal matrix
if (nonlocal_graph.get() != 0)
{
if (nonlocal_graph->IndicesAreGlobal() == false &&
nonlocal_graph->FillComplete(input_col_map, input_row_map);
nonlocal_graph->OptimizeStorage();
+ // insert data from nonlocal graph into the final sparsity pattern
+ if (exchange_data)
+ {
+ Epetra_Export exporter(nonlocal_graph->RowMap(), input_row_map);
+ int ierr = graph->Export(*nonlocal_graph, exporter, Add);
+ Assert (ierr==0, ExcTrilinosError(ierr));
+ }
+
nonlocal_matrix.reset (new Epetra_CrsMatrix(Copy, *nonlocal_graph));
}
+
+ graph->FillComplete(input_col_map, input_row_map);
+ graph->OptimizeStorage();
+
+ AssertDimension (sparsity_pattern.n_cols(),static_cast<size_type>(
+ n_global_cols(*graph)));
+
+ matrix.reset (new Epetra_FECrsMatrix(Copy, *graph, false));
last_action = Zero;
// In the end, the matrix needs to be compressed in order to be really
ExcNotImplemented());
for (unsigned int child=0; child<cell->n_children(); ++child)
{
- // set an alias to the
- // prolongation matrix for
- // this child
+ // set an alias to the prolongation matrix for this child
const FullMatrix<double> &prolongation
= mg_dof.get_fe().get_prolongation_matrix (child,
cell->refinement_case());
ExcNotImplemented());
for (unsigned int child=0; child<cell->n_children(); ++child)
{
- // set an alias to the
- // prolongation matrix for
- // this child
+ // set an alias to the prolongation matrix for this child
prolongation
= mg_dof.get_fe().get_prolongation_matrix (child,
cell->refinement_case());
cell->child(child)->get_mg_dof_indices (dof_indices_child);
- // now set the entries in the
- // matrix
+ // now set the entries in the matrix
for (unsigned int i=0; i<dofs_per_cell; ++i)
prolongation_matrices[level]->set (dof_indices_child[i],
dofs_per_cell,
// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1999 - 2013 by the deal.II authors
+// Copyright (C) 1999 - 2014 by the deal.II authors
//
// This file is part of the deal.II library.
//
// which is both done by one
// function
{
- const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell;
- local_values.reinit(dofs_per_cell, true); // fast reinit, i.e. the
- // entries are not set to 0.
- // make sure that the size of the
+ const unsigned int this_fe_index = pointerstruct->second.active_fe_index;
+ const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[this_fe_index].dofs_per_cell;
+ local_values.reinit(dofs_per_cell, true);
+
+ // make sure that the size of the
// stored indices is the same as
// dofs_per_cell. this is kind of a
// test if we use the same fe in the
ExcNumberOfDoFsPerCellHasChanged());
for (unsigned int i=0; i<dofs_per_cell; ++i)
local_values(i)=in((*pointerstruct->second.indices_ptr)[i]);
- cell->set_dof_values_by_interpolation(local_values, out);
+ cell->set_dof_values_by_interpolation(local_values, out,
+ this_fe_index);
}
}
}
SolutionTransfer<dim, VECTOR, DH>::
prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in)
{
- Assert(prepared_for!=pure_refinement, ExcAlreadyPrepForRef());
- Assert(prepared_for!=coarsening_and_refinement,
- ExcAlreadyPrepForCoarseAndRef());
+ Assert (prepared_for!=pure_refinement, ExcAlreadyPrepForRef());
+ Assert (prepared_for!=coarsening_and_refinement,
+ ExcAlreadyPrepForCoarseAndRef());
const unsigned int in_size=all_in.size();
Assert(in_size!=0, ExcNoInVectorsGiven());
clear();
const unsigned int n_active_cells = dof_handler->get_tria().n_active_cells();
- n_dofs_old=dof_handler->n_dofs();
+ n_dofs_old = dof_handler->n_dofs();
for (unsigned int i=0; i<in_size; ++i)
{
}
// first count the number
- // of cells that'll be coarsened
+ // of cells that will be coarsened
// and that'll stay or be refined
unsigned int n_cells_to_coarsen=0;
unsigned int n_cells_to_stay_or_refine=0;
- typename DH::active_cell_iterator
- act_cell = dof_handler->begin_active(),
- endc = dof_handler->end();
- for (; act_cell!=endc; ++act_cell)
+ for (typename DH::active_cell_iterator act_cell = dof_handler->begin_active();
+ act_cell!=dof_handler->end(); ++act_cell)
{
if (act_cell->coarsen_flag_set())
++n_cells_to_coarsen;
ExcInternalError());
unsigned int n_coarsen_fathers=0;
- typename DH::cell_iterator
- cell=dof_handler->begin();
- for (; cell!=endc; ++cell)
+ for (typename DH::cell_iterator cell=dof_handler->begin();
+ cell!=dof_handler->end(); ++cell)
if (!cell->active() && cell->child(0)->coarsen_flag_set())
++n_coarsen_fathers;
-
- if (n_cells_to_coarsen)
- Assert(n_cells_to_coarsen>=2*n_coarsen_fathers, ExcInternalError());
+ Assert(n_cells_to_coarsen>=2*n_coarsen_fathers, ExcInternalError());
// allocate the needed memory. initialize
// the following arrays in an efficient
// way, without copying much
- std::vector<std::vector<types::global_dof_index> >
- (n_cells_to_stay_or_refine)
+ std::vector<std::vector<types::global_dof_index> >(n_cells_to_stay_or_refine)
.swap(indices_on_cell);
std::vector<std::vector<Vector<typename VECTOR::value_type> > >
.swap(dof_values_on_cell);
typename VECTOR::value_type zero_val = typename VECTOR::value_type();
+
Table<2,FullMatrix<double> > interpolation_hp;
std::vector<std::vector<bool> > restriction_is_additive;
+
internal::extract_interpolation_matrices (*dof_handler, interpolation_hp);
internal::restriction_additive (dof_handler->get_fe(), restriction_is_additive);
- Vector<typename VECTOR::value_type> tmp, tmp2;
// we need counters for
// the 'to_stay_or_refine' cells 'n_sr' and
// the 'coarsen_fathers' cells 'n_cf',
unsigned int n_sr=0, n_cf=0;
- cell = dof_handler->begin();
- for (; cell!=endc; ++cell)
+ for (typename DH::cell_iterator cell=dof_handler->begin();
+ cell!=dof_handler->end(); ++cell)
{
+ // CASE 1: active cell that remains as it is
if (cell->active() && !cell->coarsen_flag_set())
{
const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell;
// interpolating to the children
cell->get_dof_indices(indices_on_cell[n_sr]);
cell_map[std::make_pair(cell->level(), cell->index())]
- = Pointerstruct(&indices_on_cell[n_sr],cell->active_fe_index());
+ = Pointerstruct(&indices_on_cell[n_sr], cell->active_fe_index());
++n_sr;
}
+
+ // CASE 2: cell is inactive but will become active
else if (cell->has_children() && cell->child(0)->coarsen_flag_set())
{
// note that if one child has the
// worked correctly
for (unsigned int i=1; i<cell->n_children(); ++i)
Assert(cell->child(i)->coarsen_flag_set(),
- ExcTriaPrepCoarseningNotCalledBefore());
- const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell;
-
- std::vector<Vector<typename VECTOR::value_type> >(in_size,
- Vector<typename VECTOR::value_type>(dofs_per_cell))
- .swap(dof_values_on_cell[n_cf]);
+ ExcMessage("It looks like you didn't call "
+ "Triangulation::prepare_coarsening_and_refinement before "
+ "calling the current function. This can't work."));
+
+ // we will need to interpolate from the children of this cell
+ // to the current one. in the hp context, this also means
+ // we need to figure out which finite element space to interpolate
+ // to since that is not implied by the global FE as in the non-hp
+ // case.
+ bool different_fe_on_children = false;
+ for (unsigned int child=1; child<cell->n_children(); ++child)
+ if (cell->child(child)->active_fe_index()
+ != cell->child(0)->active_fe_index())
+ {
+ different_fe_on_children = true;
+ break;
+ }
- unsigned int fe_index = cell->active_fe_index();
+ // take FE index from the child with most
+ // degrees of freedom locally
unsigned int most_general_child = 0;
- bool different_elements = false;
- for (unsigned int child=0; child<cell->n_children(); ++child)
- {
- if (cell->child(child)->active_fe_index() != fe_index)
- different_elements = true;
- // take FE index from the child with most
- // degrees of freedom locally
+ if (different_fe_on_children == true)
+ for (unsigned int child=1; child<cell->n_children(); ++child)
if (cell->child(child)->get_fe().dofs_per_cell >
cell->child(most_general_child)->get_fe().dofs_per_cell)
most_general_child = child;
- }
- if (different_elements == true)
- fe_index = cell->child(most_general_child)->active_fe_index();
+ const unsigned int target_fe_index = cell->child(most_general_child)->active_fe_index();
+
+ const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[target_fe_index].dofs_per_cell;
+ std::vector<Vector<typename VECTOR::value_type> >(in_size,
+ Vector<typename VECTOR::value_type>(dofs_per_cell))
+ .swap(dof_values_on_cell[n_cf]);
+
+
+ // store the data of each of the input vectors. get this data
+ // as interpolated onto a finite element space that encompasses
+ // that of all the children. note that cell->get_interpolated_dof_values
+ // already does all of the interpolations between spaces
for (unsigned int j=0; j<in_size; ++j)
- {
- // store the data of each of
- // the input vectors
- if (different_elements == false)
- cell->get_interpolated_dof_values(all_in[j],
- dof_values_on_cell[n_cf][j]);
- else
- {
- // if we have different elements, first
- // interpolate the children's contribution to
- // the most general FE on the child
- // level. Then we manually write the
- // interpolation operation to the coarser
- // level
- dof_values_on_cell[n_cf][j].reinit (cell->child(most_general_child)->get_fe().dofs_per_cell);
- const unsigned int fe_ind_general =
- cell->child(most_general_child)->active_fe_index();
- for (unsigned int child=0; child<cell->n_children(); ++child)
- {
- tmp.reinit (cell->child(child)->get_fe().dofs_per_cell,
- true);
- cell->child(child)->get_dof_values (all_in[j],
- tmp);
- const unsigned int child_ind =
- cell->child(child)->active_fe_index();
- if (child_ind != fe_ind_general)
- {
- tmp2.reinit (cell->child(most_general_child)->get_fe().dofs_per_cell,
- true);
-
- // if the
- // matrix
- // has size
- // 0 and
- // the
- // corresponding
- // elements
- // have
- // more
- // than
- // zero
- // DoFs,
- // then
- // this
- // means
- // that the
- // internal::extract_interpolation_matrices
- // function
- // above
- // couldn't
- // get the
- // interpolation
- // matrix
- // between
- // this
- // pair of
- // elements. since
- // we need
- // it here,
- // this is
- // an error
- if ((interpolation_hp(fe_ind_general, child_ind).m() == 0)
- &&
- (interpolation_hp(fe_ind_general, child_ind).n() == 0)
- &&
- ((tmp2.size() > 0) || (tmp.size() > 0)))
- Assert (false,
- ExcMessage (std::string("No interpolation from element ")
- + cell->child(child)->get_fe().get_name()
- + " to element "
- + cell->child(most_general_child)->get_fe().get_name()
- + " is available, but it is needed here."));
- interpolation_hp(fe_ind_general, child_ind).vmult (tmp2, tmp);
- }
- else
- tmp2.swap (tmp);
-
- // now do the interpolation
- // operation. FullMatrix only wants us
- // to call vmult if the matrix size is
- // actually non-zero, so check that
- // case
- const unsigned int dofs_per_cell = tmp2.size();
- tmp.reinit (dofs_per_cell, true);
- if (dofs_per_cell > 0)
- cell->child(most_general_child)->get_fe().
- get_restriction_matrix(child, cell->refinement_case()).vmult (tmp, tmp2);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- if (restriction_is_additive[fe_ind_general][i])
- dof_values_on_cell[n_cf][j](i) += tmp(i);
- else if (tmp(i) != zero_val)
- dof_values_on_cell[n_cf][j](i) = tmp(i);
- }
- }
- }
+ cell->get_interpolated_dof_values(all_in[j],
+ dof_values_on_cell[n_cf][j],
+ target_fe_index);
cell_map[std::make_pair(cell->level(), cell->index())]
- = Pointerstruct(&dof_values_on_cell[n_cf], fe_index);
+ = Pointerstruct(&dof_values_on_cell[n_cf], target_fe_index);
++n_cf;
}
}
const std::vector<Vector<typename VECTOR::value_type> > *const valuesptr
=pointerstruct->second.dof_values_ptr;
- const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell;
-
- // cell stayed or is
- // refined
+ // cell stayed as it was or was refined
if (indexptr)
{
Assert (valuesptr == 0,
ExcInternalError());
+ const unsigned int old_fe_index =
+ pointerstruct->second.active_fe_index;
+
// get the values of
// each of the input
// data vectors on this
// cell and prolong it
// to its children
unsigned int in_size = indexptr->size();
- local_values.reinit(dofs_per_cell, true);
for (unsigned int j=0; j<size; ++j)
{
- // check the FE index of the new element. if
- // we have children and not all of the
- // children have the same FE index, need to
- // manually implement
- // set_dof_values_by_interpolation
- unsigned int new_fe_index = cell->active_fe_index();
- bool different_elements = false;
- if (cell->has_children())
- {
- new_fe_index = cell->child(0)->active_fe_index();
- for (unsigned int child=1; child<cell->n_children(); ++child)
- if (cell->child(child)->active_fe_index() != new_fe_index)
- {
- different_elements = true;
- break;
- }
- }
- if (different_elements == true ||
- new_fe_index != pointerstruct->second.active_fe_index)
- {
- const unsigned int old_index =
- pointerstruct->second.active_fe_index;
- tmp.reinit (in_size, true);
- for (unsigned int i=0; i<in_size; ++i)
- tmp(i)=all_in[j]((*indexptr)[i]);
- if (different_elements == false)
- {
- AssertDimension (tmp.size(),
- interpolation_hp(new_fe_index,old_index).n());
- local_values.reinit (cell->has_children() ?
- cell->child(0)->get_fe().dofs_per_cell
- : cell->get_fe().dofs_per_cell, true);
- // do the interpolation. we get into trouble if the
- // interpolation_hp(new,old) matrix hasn't been computed.
- // this can happen if the respective elements don't support
- // the corresponding interpolation; if that's the case, then
- // the computation of the matrix simply sets the matrix
- // back to size zero. so if we get here and that is
- // the wrong size, then this may be because the elements
- // haven't implemented the correct function yet
- //
- // there is one wrinkle. we would like to only error out if
- // the size of the matrix is 0 times 0 but at least one
- // of the elements has more than one dof per cell. the
- // problem is that if you reinit a matrix to 4x0, it automatically
- // sets its size to 0x0. so we can only execute the following
- // test if *both* elements have dofs_per_cell>0, not if *at
- // least one* have.
- Assert (! ((interpolation_hp(new_fe_index,old_index).m() == 0)
- &&
- (interpolation_hp(new_fe_index,old_index).n() == 0)
- &&
- ((dof_handler->get_fe()[new_fe_index].dofs_per_cell > 0)
- &&
- (dof_handler->get_fe()[old_index].dofs_per_cell > 0))),
- ExcMessage ("The interpolation between two different "
- "elements you are trying to use here has "
- "not been implemented for this pair of "
- "elements!"));
-
- // simple case where all children have the
- // same FE index: just interpolate to their FE
- // first and then use the standard routines
- if (tmp.size() > 0)
- interpolation_hp(new_fe_index,old_index).vmult (local_values, tmp);
- else
- local_values = 0;
- }
-
- if (cell->has_children() == false)
- cell->set_dof_values (local_values, all_out[j]);
- else
- for (unsigned int child=0; child<cell->n_children(); ++child)
- {
- if (different_elements == true)
- {
- const unsigned int c_index =
- cell->child(child)->active_fe_index();
- if (c_index != old_index)
- {
- AssertDimension (tmp.size(),
- interpolation_hp(c_index,old_index).n());
- local_values.reinit(cell->child(child)->get_fe().dofs_per_cell, true);
-
- // do the interpolation. same problem as above
- Assert (! ((interpolation_hp(c_index,old_index).m() == 0)
- &&
- (interpolation_hp(c_index,old_index).n() == 0)
- &&
- ((dof_handler->get_fe()[c_index].dofs_per_cell > 0)
- &&
- (dof_handler->get_fe()[old_index].dofs_per_cell > 0))),
- ExcMessage ("The interpolation between two different "
- "elements you are trying to use here has "
- "not been implemented for this pair of "
- "elements!"));
-
- if (tmp.size() > 0)
- interpolation_hp(c_index,old_index).vmult (local_values, tmp);
- else
- local_values = 0;
- }
- else
- local_values = tmp;
- }
- tmp2.reinit (cell->child(child)->get_fe().dofs_per_cell, true);
- cell->child(child)->get_fe().get_prolongation_matrix(child, cell->refinement_case())
- .vmult (tmp2, local_values);
- cell->child(child)->set_dof_values(tmp2,all_out[j]);
- }
- }
- else
- {
- AssertDimension (dofs_per_cell, indexptr->size());
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- local_values(i)=all_in[j]((*indexptr)[i]);
- cell->set_dof_values_by_interpolation(local_values,
- all_out[j]);
- }
+ tmp.reinit (in_size, true);
+ for (unsigned int i=0; i<in_size; ++i)
+ tmp(i) = all_in[j]((*indexptr)[i]);
+
+ cell->set_dof_values_by_interpolation (tmp, all_out[j],
+ old_fe_index);
}
}
- // children of cell were
- // deleted
else if (valuesptr)
+ // the children of this cell were
+ // deleted
{
Assert (!cell->has_children(), ExcInternalError());
Assert (indexptr == 0,
ExcInternalError());
+
+ const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
dofs.resize(dofs_per_cell);
// get the local
// indices
FILE(GLOB _files ${_step_full}/*)
SET(_command)
FOREACH(_file ${_files})
- IF(NOT _file MATCHES "/(doc|.svn)")
+ IF(NOT _file MATCHES "/(CMakeCache.txt|CMakeFiles|doc|.svn)")
LIST(APPEND _command
COMMAND ${CMAKE_COMMAND} -E copy ${_file} ${_step_dir}
)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
- unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
test<2>();
test<3>();
\r
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);\r
\r
- typename DoFHandler<2>::active_cell_iterator\r
+ DoFHandler<2>::active_cell_iterator\r
cell = dof_handler.begin_active (),\r
endc = dof_handler.end ();\r
\r
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2004 - 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// compare matrix-vector product in chunk sparse matrix with usual vmult and
+// extract_row_copy.
+
+#include "../tests.h"
+#include <deal.II/lac/chunk_sparse_matrix.h>
+#include <deal.II/lac/vector.h>
+#include <fstream>
+#include <iomanip>
+
+
+void test (const unsigned int chunk_size)
+{
+ deallog << "Chunk size = " << chunk_size << std::endl;
+
+ for (unsigned int n_cols = 4; n_cols<7; ++n_cols)
+ {
+ deallog << "n_cols = " << n_cols << std::endl;
+ ChunkSparsityPattern sp (5,n_cols,3,chunk_size);
+ for (unsigned int i=0; i<5; ++i)
+ for (unsigned int j=0; j<n_cols; ++j)
+ if ((i+2*j+1) % 3 == 0)
+ sp.add (i,j);
+ sp.compress ();
+
+ ChunkSparseMatrix<double> m(sp);
+
+ // first set a few entries
+ for (unsigned int i=0; i<m.m(); ++i)
+ for (unsigned int j=0; j<m.n(); ++j)
+ if ((i+2*j+1) % 3 == 0)
+ m.set (i,j, i*j*.5+.5);
+
+ // next perform a matrix-vector product using the entries as given by
+ // the entries in extract_row_copy and compare it with the exact value
+ Vector<double> src(m.n()), dst(m.m()), dst_ref(m.m());
+ for (unsigned int i=0; i<src.size(); ++i)
+ src(i) = (double)Testing::rand()/RAND_MAX;
+ std::vector<types::global_dof_index> indices(sp.max_entries_per_row());
+ std::vector<double> values(sp.max_entries_per_row());
+ for (unsigned int i=0; i<m.m(); ++i)
+ {
+ types::global_dof_index n_entries = numbers::invalid_unsigned_int;
+ m.extract_row_copy(i, values.size(), n_entries, &indices[0], &values[0]);
+ double sum = 0;
+ for (unsigned int j=0; j<n_entries; ++j)
+ sum += values[j] * src(indices[j]);
+ dst(i) = sum;
+ }
+ m.vmult(dst_ref, src);
+ dst -= dst_ref;
+ deallog << "Error in matrix-vector product done via extract_row_copy: "
+ << dst.linfty_norm() << std::endl;
+ }
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
+ for (unsigned int i=0;
+ i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+ ++i)
+ test (chunk_sizes[i]);
+ }
+ catch (std::exception &exc)
+ {
+ deallog << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ deallog << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ deallog << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ deallog << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+
+DEAL::Chunk size = 1
+DEAL::n_cols = 4
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 5
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 6
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::Chunk size = 2
+DEAL::n_cols = 4
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 5
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 6
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::Chunk size = 4
+DEAL::n_cols = 4
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 5
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 6
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::Chunk size = 5
+DEAL::n_cols = 4
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 5
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 6
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::Chunk size = 7
+DEAL::n_cols = 4
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 5
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
+DEAL::n_cols = 6
+DEAL::Error in matrix-vector product done via extract_row_copy: 0
DEAL::25
DEAL::50
DEAL::4
-DEAL::4
+DEAL::5
DEAL::14
DEAL::38
DEAL::0
DEAL::23
DEAL::46
DEAL::4
-DEAL::3
+DEAL::5
DEAL::14
DEAL::37
DEAL::0
DEAL::36
DEAL::189
DEAL::15
-DEAL::4
+DEAL::9
DEAL::21
DEAL::159
DEAL::15
-DEAL::0
+DEAL::9
DEAL::9
DEAL::135
DEAL::0
DEAL::1760
DEAL::281395
DEAL::427
-DEAL::53
+DEAL::100
DEAL::409
DEAL::61921
DEAL::49
DEAL::18
DEAL::153
DEAL::13
-DEAL::13
+DEAL::14
DEAL::91
DEAL::1214
DEAL::17
DEAL::154
DEAL::629
DEAL::13
-DEAL::13
+DEAL::14
DEAL::167
DEAL::1776
DEAL::0
DEAL::18
DEAL::153
DEAL::13
-DEAL::13
+DEAL::14
DEAL::127
DEAL::1574
DEAL::17
DEAL::15
DEAL::30
DEAL::3
-DEAL::2
+DEAL::3
DEAL::9
DEAL::23
DEAL::0
DEAL::9
DEAL::18
DEAL::4
-DEAL::3
+DEAL::4
DEAL::13
DEAL::29
DEAL::3
DEAL::11
DEAL::22
DEAL::4
-DEAL::2
+DEAL::3
DEAL::8
DEAL::18
DEAL::0
DEAL::10
DEAL::99
DEAL::9
-DEAL::5
+DEAL::6
DEAL::13
DEAL::134
DEAL::10
DEAL::6
DEAL::38
DEAL::9
-DEAL::0
+DEAL::1
DEAL::1
DEAL::15
DEAL::0
DEAL::510
DEAL::71507
DEAL::425
-DEAL::11
+DEAL::20
DEAL::83
DEAL::11439
DEAL::48
DEAL::46
DEAL::457
DEAL::17
-DEAL::4
+DEAL::5
DEAL::34
DEAL::389
DEAL::14
DEAL::54
DEAL::419
DEAL::15
-DEAL::1
+DEAL::2
DEAL::4
DEAL::65
DEAL::16
DEAL::16
DEAL::72
DEAL::9
-DEAL::1
+DEAL::10
DEAL::19
DEAL::126
DEAL::15
-DEAL::4
+DEAL::6
DEAL::18
DEAL::128
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::2
DEAL::1
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::0
DEAL::
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
DEAL::1
DEAL::0
+DEAL::1
+DEAL::2
DEAL::2
DEAL::0
DEAL::0
DEAL::43
DEAL::126
DEAL::6
-DEAL::3
+DEAL::4
DEAL::16
DEAL::63
DEAL::6
DEAL::43
DEAL::126
DEAL::6
-DEAL::2
+DEAL::5
DEAL::11
DEAL::54
DEAL::0
DEAL::0
DEAL::
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::Checking FE_DGP<1>(3)1FE_DGP<1>(3)1FE_Q<1>(2)3 in 1d:
DEAL::0
DEAL::0
DEAL::
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
DEAL::1
DEAL::0
+DEAL::1
+DEAL::2
DEAL::2
DEAL::0
DEAL::0
DEAL::110
DEAL::661
DEAL::13
-DEAL::1
+DEAL::14
DEAL::27
DEAL::260
DEAL::0
DEAL::95
DEAL::922
DEAL::19
-DEAL::6
+DEAL::7
DEAL::51
DEAL::451
DEAL::17
DEAL::0
DEAL::0
DEAL::19
-DEAL::6
+DEAL::7
DEAL::51
DEAL::508
DEAL::18
DEAL::105
DEAL::549
DEAL::10
-DEAL::10
+DEAL::11
DEAL::39
DEAL::308
DEAL::0
DEAL::121
DEAL::605
DEAL::10
-DEAL::0
+DEAL::12
DEAL::12
DEAL::120
DEAL::0
DEAL::25
DEAL::69
DEAL::6
-DEAL::6
+DEAL::7
DEAL::23
DEAL::102
DEAL::4
DEAL::37
DEAL::96
DEAL::6
-DEAL::1
+DEAL::7
DEAL::13
DEAL::57
DEAL::6
-DEAL::1
+DEAL::4
DEAL::10
DEAL::39
DEAL::0
DEAL::7
DEAL::21
DEAL::5
-DEAL::1
+DEAL::3
DEAL::9
DEAL::33
DEAL::10
-DEAL::0
+DEAL::7
DEAL::7
DEAL::42
DEAL::0
DEAL::37
DEAL::96
DEAL::6
-DEAL::1
+DEAL::7
DEAL::13
DEAL::57
DEAL::6
-DEAL::0
+DEAL::10
DEAL::10
DEAL::60
DEAL::0
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking Q1 in 2d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking Q2 in 2d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking Q3 in 2d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking Q1 in 2d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking Q2 in 2d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking Q3 in 2d:
DEAL::0
DEAL::
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::0
DEAL::5
DEAL::4
DEAL::2
-DEAL::1
+DEAL::2
DEAL::4
DEAL::5
DEAL::2
DEAL::10
DEAL::12
DEAL::3
-DEAL::0
+DEAL::2
DEAL::2
DEAL::6
DEAL::3
DEAL::0
DEAL::
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::0
DEAL::5
DEAL::4
DEAL::2
-DEAL::1
+DEAL::2
DEAL::4
DEAL::5
DEAL::2
DEAL::10
DEAL::12
DEAL::3
-DEAL::0
+DEAL::2
DEAL::2
DEAL::6
DEAL::3
DEAL::33
DEAL::120
DEAL::8
-DEAL::1
+DEAL::4
DEAL::12
DEAL::60
DEAL::0
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking FE_DGQ<1>(2)2 in 1d:
DEAL::10
DEAL::21
DEAL::3
-DEAL::3
+DEAL::4
DEAL::11
DEAL::21
DEAL::3
DEAL::92
DEAL::520
DEAL::13
-DEAL::10
+DEAL::12
DEAL::58
DEAL::498
DEAL::11
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking FE_DGQ<1>(2)2FE_DGP<1>(3)1 in 1d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking FE_DGQ<1>(2)2FE_DGQ<1>(2)2FE_Q<1>(3)3 in 1d:
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::Checking FE_DGP<1>(3)1FE_DGP<1>(3)1FE_Q<1>(2)3 in 1d:
DEAL::0
DEAL::0
DEAL::0
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::Checking FE_Q<2>(1)3FE_DGP<2>(3)1FE_Q<2>(1)3 in 2d:
DEAL::0
DEAL::0
DEAL::3
-DEAL::1
+DEAL::4
DEAL::7
DEAL::15
DEAL::0
DEAL::16
DEAL::24
DEAL::3
-DEAL::0
+DEAL::6
DEAL::6
DEAL::18
DEAL::2
DEAL::0
DEAL::1 2 5 6
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::6
-DEAL::0
DEAL::4
-DEAL::0
+DEAL::4
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::6
-DEAL::0
DEAL::4
-DEAL::0
+DEAL::4
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::4
-DEAL::0
+DEAL::5
DEAL::5
DEAL::0
DEAL::6
DEAL::0
DEAL::
DEAL::0
-DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
-DEAL::0
+DEAL::1
DEAL::0
DEAL::0
DEAL::1
+DEAL::1
DEAL::0
DEAL::0
-DEAL::0
+DEAL::1
DEAL::1
DEAL::0
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
DEAL::3
DEAL::1
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::2
DEAL::1
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::0
DEAL::0
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::4
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::1
-DEAL::0
+DEAL::3
DEAL::3
DEAL::3
DEAL::1
DEAL::3
DEAL::1
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::3
DEAL::1
DEAL::1
-DEAL::1
+DEAL::2
DEAL::3
DEAL::2
DEAL::0
DEAL::69
DEAL::969
DEAL::17
-DEAL::17
+DEAL::18
DEAL::213
DEAL::2023
DEAL::17
DEAL::49
DEAL::361
DEAL::17
-DEAL::12
+DEAL::13
DEAL::141
DEAL::1514
DEAL::13
DEAL::25112
DEAL::5654353
DEAL::439
-DEAL::42
+DEAL::50
DEAL::1758
DEAL::401968
DEAL::438
DEAL::10
DEAL::45
DEAL::159
-DEAL::18
+DEAL::23
DEAL::145
DEAL::625
DEAL::7
DEAL::48
DEAL::142
DEAL::9
-DEAL::3
+DEAL::8
DEAL::28
DEAL::166
DEAL::9
DEAL::61
DEAL::372
DEAL::15
-DEAL::8
+DEAL::12
DEAL::46
DEAL::298
DEAL::0
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2002 - 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// check ParameterHandler::print_parameters_section (..., XML, 0, true). have a few
+// names that contain all sorts of weird (for XML) characters
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/parameter_handler.h>
+#include <fstream>
+
+
+int main ()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ ParameterHandler prm;
+ prm.declare_entry ("int1",
+ "1",
+ Patterns::Integer(),
+ "doc 1");
+ prm.enter_subsection ("ss1");
+ {
+ prm.declare_entry ("double 1",
+ "1.234",
+ Patterns::Double(),
+ "doc 3");
+
+ // things with strange characters
+ prm.enter_subsection ("Testing%testing");
+ {
+ prm.declare_entry ("double 2",
+ "4.321",
+ Patterns::Double(),
+ "doc 4");
+ prm.declare_entry ("string&list",
+ "< & > ; /",
+ Patterns::Anything(),
+ "docs 1");
+ prm.declare_entry ("int*int",
+ "2",
+ Patterns::Integer());
+ prm.declare_entry ("double+double",
+ "6.1415926",
+ Patterns::Double(),
+ "docs 3");
+ }
+ prm.leave_subsection ();
+ }
+ prm.leave_subsection ();
+
+ prm.enter_subsection ("ss1");
+ prm.enter_subsection ("Testing%testing");
+ prm.print_parameters_section (logfile, ParameterHandler::Text, 0);
+ prm.leave_subsection ();
+ prm.leave_subsection ();
+
+ logfile << std::endl;
+
+ return 0;
+}
--- /dev/null
+
+# doc 4
+set double 2 = 4.321
+
+# docs 3
+set double+double = 6.1415926
+set int*int = 2
+
+# docs 1
+set string&list = < & > ; /
+
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2002 - 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// check ParameterHandler::print_parameters_section (..., XML, 0, true). have a few
+// names that contain all sorts of weird (for XML) characters
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/parameter_handler.h>
+#include <fstream>
+
+
+int main ()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ ParameterHandler prm;
+ prm.declare_entry ("int1",
+ "1",
+ Patterns::Integer(),
+ "doc 1");
+ prm.enter_subsection ("ss1");
+ {
+ prm.declare_entry ("double 1",
+ "1.234",
+ Patterns::Double(),
+ "doc 3");
+
+ // things with strange characters
+ prm.enter_subsection ("Testing%testing");
+ {
+ prm.declare_entry ("double 2",
+ "4.321",
+ Patterns::Double(),
+ "doc 4");
+ prm.declare_entry ("string&list",
+ "< & > ; /",
+ Patterns::Anything(),
+ "docs 1");
+ prm.declare_entry ("int*int",
+ "2",
+ Patterns::Integer());
+ prm.declare_entry ("double+double",
+ "6.1415926",
+ Patterns::Double(),
+ "docs 3");
+ }
+ prm.leave_subsection ();
+ }
+ prm.leave_subsection ();
+
+ prm.enter_subsection ("ss1");
+ prm.enter_subsection ("Testing%testing");
+ prm.print_parameters_section (logfile, ParameterHandler::Text, 0, true);
+ prm.leave_subsection ();
+ prm.leave_subsection ();
+
+ logfile << std::endl;
+
+ return 0;
+}
--- /dev/null
+
+subsection ss1
+ subsection Testing%testing
+ # doc 4
+ set double 2 = 4.321
+
+ # docs 3
+ set double+double = 6.1415926
+ set int*int = 2
+
+ # docs 1
+ set string&list = < & > ; /
+ end
+end
+
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2002 - 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// check ParameterHandler::print_parameters_section (..., XML, 0, true). have a few
+// names that contain all sorts of weird (for XML) characters
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/parameter_handler.h>
+#include <fstream>
+
+
+int main ()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ ParameterHandler prm;
+ prm.declare_entry ("int1",
+ "1",
+ Patterns::Integer(),
+ "doc 1");
+ prm.enter_subsection ("ss1");
+ {
+ prm.declare_entry ("double 1",
+ "1.234",
+ Patterns::Double(),
+ "doc 3");
+
+ // things with strange characters
+ prm.enter_subsection ("Testing%testing");
+ {
+ prm.declare_entry ("double 2",
+ "4.321",
+ Patterns::Double(),
+ "doc 4");
+ prm.declare_entry ("string&list",
+ "< & > ; /",
+ Patterns::Anything(),
+ "docs 1");
+ prm.declare_entry ("int*int",
+ "2",
+ Patterns::Integer());
+ prm.declare_entry ("double+double",
+ "6.1415926",
+ Patterns::Double(),
+ "docs 3");
+ }
+ prm.leave_subsection ();
+ }
+ prm.leave_subsection ();
+
+ prm.enter_subsection ("ss1");
+ prm.enter_subsection ("Testing%testing");
+ prm.print_parameters_section (logfile, ParameterHandler::XML, 0, true);
+ prm.leave_subsection ();
+ prm.leave_subsection ();
+
+ logfile << std::endl;
+
+ return 0;
+}
--- /dev/null
+
+<?xml version="1.0" encoding="utf-8"?>
+<ParameterHandler><ss1><Testing_25testing><double_202><value>4.321</value><default_value>4.321</default_value><documentation>doc 4</documentation><pattern>2</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_202><string_26list><value>< & > ; /</value><default_value>< & > ; /</default_value><documentation>docs 1</documentation><pattern>3</pattern><pattern_description>[Anything]</pattern_description></string_26list><int_2aint><value>2</value><default_value>2</default_value><documentation/><pattern>4</pattern><pattern_description>[Integer range -2147483648...2147483647 (inclusive)]</pattern_description></int_2aint><double_2bdouble><value>6.1415926</value><default_value>6.1415926</default_value><documentation>docs 3</documentation><pattern>5</pattern><pattern_description>[Double -1.79769e+308...1.79769e+308 (inclusive)]</pattern_description></double_2bdouble></Testing_25testing></ss1></ParameterHandler>
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// a bit like _25, but test for the curl of a function. there was a
+// bug in get_function_curls
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/function.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_q1.h>
+
+#include <fstream>
+
+
+
+Tensor<1,1> curl (const Tensor<2,2> &grads)
+{
+ return Point<1>(grads[1][0] - grads[0][1]);
+}
+
+
+Tensor<1,3> curl (const Tensor<2,3> &grads)
+{
+ return Point<3>(grads[2][1] - grads[1][2],
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
+}
+
+
+
+template<int dim>
+void test (const Triangulation<dim> &tr,
+ const FiniteElement<dim> &fe)
+{
+ deallog << "FE=" << fe.get_name()
+ << std::endl;
+
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ Vector<double> fe_function(dof.n_dofs());
+ for (unsigned int i=0; i<dof.n_dofs(); ++i)
+ fe_function(i) = i+1;
+
+ const QGauss<dim> quadrature(2);
+ FEValues<dim> fe_values (fe, quadrature,
+ update_values | update_gradients | update_q_points);
+ fe_values.reinit (dof.begin_active());
+
+ // let the FEValues object compute the
+ // divergences at quadrature points
+ std::vector<typename dealii::internal::CurlType<dim>::type> curls (quadrature.size());
+ std::vector<Tensor<2,dim> > grads (quadrature.size());
+ FEValuesExtractors::Vector extractor(0);
+ fe_values[extractor].get_function_curls (fe_function, curls);
+ fe_values[extractor].get_function_gradients (fe_function, grads);
+
+ // now compare
+ for (unsigned int q=0; q<quadrature.size(); ++q)
+ {
+ deallog << " curls[q]= " << curls[q] << std::endl
+ << " grads[q]= " << grads[q] << std::endl;
+ Assert ((curl(grads[q]) - curls[q]).norm()
+ <= 1e-10,
+ ExcInternalError());
+ }
+}
+
+
+
+template<int dim>
+void test_hyper_cube()
+{
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube(tr);
+
+ FESystem<dim> fe (FE_Q<dim>(1),
+ dim);
+ test(tr, fe);
+}
+
+
+int main()
+{
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
+
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
+
+ test_hyper_cube<2>();
+ test_hyper_cube<3>();
+}
--- /dev/null
+
+DEAL::FE=FESystem<2>[FE_Q<2>(1)^2]
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL::FE=FESystem<3>[FE_Q<3>(1)^3]
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// like _26, but for non-primitive elements. the bug was in code only
+// relevant to non-primitive elements
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/function.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/fe_nedelec.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_q1.h>
+
+#include <fstream>
+
+
+
+Tensor<1,1> curl (const Tensor<2,2> &grads)
+{
+ return Point<1>(grads[1][0] - grads[0][1]);
+}
+
+
+Tensor<1,3> curl (const Tensor<2,3> &grads)
+{
+ return Point<3>(grads[2][1] - grads[1][2],
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
+}
+
+
+
+template<int dim>
+void test (const Triangulation<dim> &tr,
+ const FiniteElement<dim> &fe)
+{
+ deallog << "FE=" << fe.get_name()
+ << std::endl;
+
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ Vector<double> fe_function(dof.n_dofs());
+ for (unsigned int i=0; i<dof.n_dofs(); ++i)
+ fe_function(i) = i+1;
+
+ const QGauss<dim> quadrature(2);
+ FEValues<dim> fe_values (fe, quadrature,
+ update_values | update_gradients | update_q_points);
+ fe_values.reinit (dof.begin_active());
+
+ // let the FEValues object compute the
+ // divergences at quadrature points
+ std::vector<typename dealii::internal::CurlType<dim>::type> curls (quadrature.size());
+ std::vector<Tensor<2,dim> > grads (quadrature.size());
+ FEValuesExtractors::Vector extractor(0);
+ fe_values[extractor].get_function_curls (fe_function, curls);
+ fe_values[extractor].get_function_gradients (fe_function, grads);
+
+ // now compare
+ for (unsigned int q=0; q<quadrature.size(); ++q)
+ {
+ deallog << " curls[q]= " << curls[q] << std::endl
+ << " grads[q]= " << grads[q] << std::endl;
+ Assert ((curl(grads[q]) - curls[q]).norm()
+ <= 1e-10,
+ ExcInternalError());
+ }
+}
+
+
+
+template<int dim>
+void test_hyper_cube()
+{
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube(tr);
+
+ FESystem<dim> fe (FE_Nedelec<dim>(1),
+ 2);
+ test(tr, fe);
+}
+
+
+int main()
+{
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
+
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
+
+ test_hyper_cube<2>();
+ test_hyper_cube<3>();
+}
--- /dev/null
+
+DEAL::FE=FESystem<2>[FE_Nedelec<2>(1)^2]
+DEAL:: curls[q]= 0.00
+DEAL:: grads[q]= 19.6 1.00 1.00 -10.1
+DEAL:: curls[q]= 26.0
+DEAL:: grads[q]= 19.6 -27.0 -1.00 -2.14
+DEAL:: curls[q]= -30.0
+DEAL:: grads[q]= 27.6 -1.00 -31.0 -10.1
+DEAL:: curls[q]= 4.00
+DEAL:: grads[q]= 27.6 43.0 47.0 -2.14
+DEAL::FE=FESystem<3>[FE_Nedelec<3>(1)^2]
+DEAL:: curls[q]= 0.00 0.00 1.42e-14
+DEAL:: grads[q]= -75.8 0.711 0.711 0.711 -86.9 0.711 0.711 0.711 34.6
+DEAL:: curls[q]= 0.00 -54.0 106.
+DEAL:: grads[q]= -75.8 -107. -54.7 -0.711 -83.6 0.711 -0.711 0.711 38.0
+DEAL:: curls[q]= 16.8 -1.07e-14 -109.
+DEAL:: grads[q]= -72.4 -0.711 0.711 -110. -86.9 -17.6 0.711 -0.711 46.0
+DEAL:: curls[q]= 26.1 -63.2 2.85
+DEAL:: grads[q]= -72.4 113. -63.9 116. -83.6 -26.8 -0.711 -0.711 49.4
+DEAL:: curls[q]= -35.7 71.7 1.10e-14
+DEAL:: grads[q]= -48.4 0.711 -0.711 0.711 -59.6 -0.711 -72.4 -36.4 34.6
+DEAL:: curls[q]= -44.9 30.3 115.
+DEAL:: grads[q]= -48.4 -116. 109. -0.711 -56.2 -0.711 79.2 -45.6 38.0
+DEAL:: curls[q]= -13.2 80.9 -118.
+DEAL:: grads[q]= -45.0 -0.711 -0.711 -119. -59.6 72.3 -81.6 59.2 46.0
+DEAL:: curls[q]= -13.2 30.3 2.85
+DEAL:: grads[q]= -45.0 123. 119. 126. -56.2 81.6 88.4 68.4 49.4
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2007 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// like _27, but even simpler. this is based on a testcase proposed by
+// Christoph Heiniger
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/function.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/fe_nedelec.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/numerics/vector_tools.h>
+
+#include <fstream>
+
+
+class F : public Function<2>
+{
+public:
+ F() : Function<2>(2) {}
+
+ virtual void vector_value (const Point<2> &p,
+ Vector<double> &v) const
+ {
+ // make the function equal to (0,x^2)
+ v[0] = 0;
+ v[1] = p[0]*p[0];
+ }
+};
+
+
+
+Tensor<1,1> curl (const Tensor<2,2> &grads)
+{
+ return Point<1>(grads[1][0] - grads[0][1]);
+}
+
+
+Tensor<1,3> curl (const Tensor<2,3> &grads)
+{
+ return Point<3>(grads[2][1] - grads[1][2],
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
+}
+
+
+
+template<int dim>
+void test (const Triangulation<dim> &tr,
+ const FiniteElement<dim> &fe)
+{
+ deallog << "FE=" << fe.get_name()
+ << std::endl;
+
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ Vector<double> fe_function(dof.n_dofs());
+ // set the elements of the vector in such a way that the function
+ // equals the vector function (0,x^2)
+ ConstraintMatrix cm;
+ cm.close ();
+ VectorTools::project (dof, cm, QGauss<2>(4), F(), fe_function);
+
+ const QGauss<dim> quadrature(2);
+ FEValues<dim> fe_values (fe, quadrature,
+ update_values | update_gradients | update_q_points);
+ fe_values.reinit (dof.begin_active());
+
+ // let the FEValues object compute the
+ // divergences at quadrature points
+ std::vector<typename dealii::internal::CurlType<dim>::type> curls (quadrature.size());
+ std::vector<Tensor<2,dim> > grads (quadrature.size());
+ FEValuesExtractors::Vector extractor(0);
+ fe_values[extractor].get_function_curls (fe_function, curls);
+ fe_values[extractor].get_function_gradients (fe_function, grads);
+
+ // now compare
+ for (unsigned int q=0; q<quadrature.size(); ++q)
+ {
+ deallog << " curls[q]= " << curls[q] << std::endl
+ << " grads[q]= " << grads[q] << std::endl;
+ Assert ((curl(grads[q]) - curls[q]).norm()
+ <= 1e-10,
+ ExcInternalError());
+
+ // we know the function F=(0,x^2) and we chose an element with
+ // high enough degree to exactly represent this function, so the
+ // curl of this function should be
+ // curl F = d_x F_y - d_y F_x = 2x
+ // verify that this is true
+ Assert (std::fabs(curls[q][0] - 2*fe_values.quadrature_point(q)[0])
+ <= 1e-10,
+ ExcInternalError());
+ }
+}
+
+
+
+template<int dim>
+void test_hyper_cube()
+{
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube(tr);
+
+ FE_Nedelec<dim> fe(3);
+ test(tr, fe);
+}
+
+
+int main()
+{
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
+
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
+
+ test_hyper_cube<2>();
+}
--- /dev/null
+
+DEAL::FE=FESystem<2>[FE_Q<2>(1)^2]
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL:: curls[q]= -2.00
+DEAL:: grads[q]= 2.00 4.00 2.00 4.00
+DEAL::FE=FESystem<3>[FE_Q<3>(1)^3]
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
+DEAL:: curls[q]= -6.00 9.00 -3.00
+DEAL:: grads[q]= 3.00 6.00 12.0 3.00 6.00 12.0 3.00 6.00 12.0
DEAL::OK
-DEAL::ExcDimensionMismatch((n),(size()))
+DEAL::dealii::ExcDimensionMismatch((n),(size()))
DEAL::OK
-DEAL::ExcDimensionMismatch((n),(size()))
+DEAL::dealii::ExcDimensionMismatch((n),(size()))
DEAL::ExcMessage ("No block is selected at all!")
DEAL::OK
-DEAL::ExcDimensionMismatch((n),(size()))
+DEAL::dealii::ExcDimensionMismatch((n),(size()))
DEAL::OK
-DEAL::ExcDimensionMismatch((n),(size()))
+DEAL::dealii::ExcDimensionMismatch((n),(size()))
DEAL::ExcMessage ("No component is selected at all!")
IndexSet local_relevant= local_active;
if (myid==1)
local_relevant.add_range(5,10);
+ local_relevant.add_range(0,1);
CompressedSimpleSparsityPattern csp (local_relevant);
if (local_relevant.is_element(i))
csp.add(i,i);
- if (myid==0)
- csp.add(0,1);
+ csp.add(0,1);
typename LA::MPI::SparseMatrix mat;
mat.reinit (local_active, local_active, csp, MPI_COMM_WORLD);
void test ()
{
// create a hp::DoFHandler with different finite elements on the
- // cells. note that we assign active_fe_indices also to inactive
+ // cells. note that we skip setting active_fe_indices on inactive
// elements
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr, 0., 1.);
hp::DoFHandler<dim> dof_handler(tr);
for (typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
cell!=dof_handler.end(); ++cell)
- cell->set_active_fe_index (cell->index() % fe.size());
+ if (cell->has_children() == false)
+ cell->set_active_fe_index (cell->index() % fe.size());
dof_handler.distribute_dofs (fe);
// try to interpolate from the active cell onto the coarsest cell,
// which is definitely not active. this can't work, so expect an
- // exception
+ // exception for both the call to cell->get_fe() and the call to
+ // cell->get_interpolated_dof_values
typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin(0);
- Vector<double> local (cell->get_fe().dofs_per_cell);
+
+ unsigned int dofs_per_cell = 4;
+ try
+ {
+ dofs_per_cell = cell->get_fe().dofs_per_cell;
+ }
+ catch (const ExceptionBase &e)
+ {
+ deallog << "Yes, exception 1!" << std::endl;
+ deallog << e.get_exc_name() << std::endl;
+ }
+ Vector<double> local (dofs_per_cell);
try
{
}
catch (const ExceptionBase &e)
{
- deallog << "Yes, exception!" << std::endl;
+ deallog << "Yes, exception 2!" << std::endl;
deallog << e.get_exc_name() << std::endl;
}
}
-DEAL::Yes, exception!
+DEAL::Yes, exception 1!
+DEAL::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.")
+DEAL::Yes, exception 2!
DEAL::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.")
-DEAL::Yes, exception!
+DEAL::Yes, exception 1!
+DEAL::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.")
+DEAL::Yes, exception 2!
DEAL::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.")
-DEAL::Yes, exception!
+DEAL::Yes, exception 1!
+DEAL::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.")
+DEAL::Yes, exception 2!
DEAL::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.")
void test ()
{
// create a hp::DoFHandler with different finite elements on the
- // cells. note that we assign active_fe_indices also to inactive
+ // cells. note that we skip setting active_fe_indices on inactive
// elements
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr, 0., 1.);
hp::DoFHandler<dim> dof_handler(tr);
for (typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
cell!=dof_handler.end(); ++cell)
- cell->set_active_fe_index (cell->index() % fe.size());
+ if (cell->has_children() == false)
+ cell->set_active_fe_index (cell->index() % fe.size());
dof_handler.distribute_dofs (fe);
void test ()
{
deallog << dim << "D" << std::endl;
-
+
// create a hp::DoFHandler with different finite elements on the
- // cells. note that we assign active_fe_indices also to inactive
+ // cells. note that we skip setting active_fe_indices on inactive
// elements
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr, 0., 1.);
hp::DoFHandler<dim> dof_handler(tr);
for (typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
cell!=dof_handler.end(); ++cell)
- cell->set_active_fe_index (cell->index() % fe.size());
+ if (cell->has_children() == false)
+ cell->set_active_fe_index (cell->index() % fe.size());
dof_handler.distribute_dofs (fe);
void test ()
{
// create a hp::DoFHandler with different finite elements on the
- // cells. note that we assign active_fe_indices also to inactive
+ // cells. note that we skip setting active_fe_indices on inactive
// elements
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr, 0., 1.);
hp::DoFHandler<dim> dof_handler(tr);
for (typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
cell!=dof_handler.end(); ++cell)
- cell->set_active_fe_index (cell->index() % fe.size());
+ if (cell->has_children() == false)
+ cell->set_active_fe_index (cell->index() % fe.size());
dof_handler.distribute_dofs (fe);
// try to interpolate from the active cell onto the coarsest cell,
// which is definitely not active. this can't work, so expect an
- // exception
+ // exception for both the call to cell->get_fe() and the call to
+ // cell->get_interpolated_dof_values
typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin(0);
- Vector<double> local (cell->get_fe().dofs_per_cell);
+ unsigned int dofs_per_cell = 4;
try
{
- cell->get_interpolated_dof_values (solution, local);
+ dofs_per_cell = cell->get_fe().dofs_per_cell;
+ }
+ catch (const ExceptionBase &e)
+ {
+ deallog << "Yes, exception 1!" << std::endl;
+ deallog << e.get_exc_name() << std::endl;
+ }
+ Vector<double> local (dofs_per_cell);
+
+ try
+ {
+ cell->set_dof_values_by_interpolation (local, solution);
}
catch (const ExceptionBase &e)
{
+DEAL::Yes, exception 1!
+DEAL::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.")
DEAL::Yes, exception!
-DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects because they do not have " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
+DEAL::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.")
+DEAL::Yes, exception 1!
+DEAL::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.")
DEAL::Yes, exception!
-DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects because they do not have " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
+DEAL::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.")
+DEAL::Yes, exception 1!
+DEAL::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.")
DEAL::Yes, exception!
-DEAL::ExcMessage ("You cannot call this function on non-active cells " "of hp::DoFHandler objects because they do not have " "associated finite element spaces associated: degrees " "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")
+DEAL::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.")
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1998 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// cell->set_dof_values_by_interpolation can not work properly in the hp
+// context when called on non-active cells because these do not have a
+// finite element associated with them
+//
+// this test verifies that if we call the function on active cells with no
+// explicitly given fe_index that we get the same result as from
+// cell->set_dof_values, and that if we call it with an fe_index for a Q1
+// element that we simply get the vertex dof values set on the space of that
+// cell
+
+#include "../tests.h"
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/fe/fe_q.h>
+
+#include <vector>
+#include <fstream>
+#include <string>
+
+#define PRECISION 2
+
+
+
+
+template <int dim>
+void test ()
+{
+ // create a hp::DoFHandler with different finite elements on the
+ // cells. note that we skip setting active_fe_indices on inactive
+ // elements
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube(tr, 0., 1.);
+ tr.refine_global (2);
+
+ hp::FECollection<dim> fe;
+ for (unsigned int i=1; i<5; ++i)
+ fe.push_back (FE_Q<dim>(i));
+
+ hp::DoFHandler<dim> dof_handler(tr);
+ for (typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
+ cell!=dof_handler.end(); ++cell)
+ if (cell->has_children() == false)
+ cell->set_active_fe_index (cell->index() % fe.size());
+
+ dof_handler.distribute_dofs (fe);
+
+ // create a mostly arbitrary FE field
+ Vector<double> solution1(dof_handler.n_dofs());
+ Vector<double> solution2(dof_handler.n_dofs());
+
+ // do the test
+ for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active();
+ cell!=dof_handler.end(); ++cell)
+ {
+ solution1 = 0;
+ solution2 = 0;
+
+ // set values without specifying an explicit fe_index
+ Vector<double> local (cell->get_fe().dofs_per_cell);
+ for (unsigned int i=0; i<local.size(); ++i)
+ local(i) = i;
+
+ cell->set_dof_values_by_interpolation (local, solution1);
+
+ // then do the same with the "correct", local fe_index
+ cell->set_dof_values_by_interpolation (local, solution2,
+ cell->active_fe_index());
+
+ // now verify correctness
+ Assert (solution1 == solution2, ExcInternalError());
+ }
+ deallog << "OK" << std::endl;
+}
+
+
+int
+main()
+{
+ std::ofstream logfile ("output");
+ logfile.precision (PRECISION);
+ logfile.setf(std::ios::fixed);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test<1>();
+ test<2>();
+ test<3>();
+
+ return 0;
+}
+
+
+
--- /dev/null
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 1998 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// cell->set_dof_values_by_interpolation can not work properly in the hp
+// context when called on non-active cells because these do not have a
+// finite element associated with them
+//
+// this test verifies that if we call the function on active cells with an
+// explicitly given fe_index that we can interpolate from parents to the
+// children
+
+#include "../tests.h"
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_tools.h>
+#include <deal.II/fe/fe_q.h>
+
+#include <vector>
+#include <fstream>
+#include <string>
+
+
+template <int dim>
+void test ()
+{
+ deallog << dim << "D" << std::endl;
+
+ // create a hp::DoFHandler with different finite elements on the
+ // cells. note that we skip setting active_fe_indices on inactive
+ // elements
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube(tr, 0., 1.);
+ tr.refine_global (2);
+
+ hp::FECollection<dim> fe;
+ for (unsigned int i=1; i<5; ++i)
+ fe.push_back (FE_Q<dim>(i));
+
+ hp::DoFHandler<dim> dof_handler(tr);
+ for (typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
+ cell!=dof_handler.end(); ++cell)
+ if (cell->has_children() == false)
+ cell->set_active_fe_index (cell->index() % fe.size());
+
+ dof_handler.distribute_dofs (fe);
+
+ Vector<double> solution(dof_handler.n_dofs());
+
+ // do the test where we set data on the coarsest cell with an
+ // explicit Q1 space
+ typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin(0);
+ Vector<double> local (fe[0].dofs_per_cell);
+ for (unsigned int i=0; i<local.size(); ++i)
+ local(i) = i;
+ cell->set_dof_values_by_interpolation (local, solution,
+ 0);
+
+ // for comparison purposes, also output the values of DoFs on all cells
+ for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active();
+ cell!=dof_handler.end(); ++cell)
+ {
+ Vector<double> x (cell->get_fe().dofs_per_cell);
+ cell->get_dof_values (solution, x);
+ deallog << "cell =" << cell << ": ";
+ for (unsigned int i=0; i<x.size(); ++i)
+ deallog << x[i] << ' ';
+ deallog << std::endl;
+ }
+}
+
+
+int
+main()
+{
+ std::ofstream logfile ("output");
+ logfile.precision (1);
+ logfile.setf(std::ios::fixed);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test<1>();
+ test<2>();
+ test<3>();
+
+ return 0;
+}
+
+
+
--- /dev/null
+
+DEAL::1D
+DEAL::cell =2.0: 0 0.250000
+DEAL::cell =2.1: 0.250000 0.500000 0.375000
+DEAL::cell =2.2: 0.500000 0.750000 0.583333 0.666667
+DEAL::cell =2.3: 0.750000 1.00000 0.812500 0.875000 0.937500
+DEAL::2D
+DEAL::cell =2.0: 0 0.250000 0.500000 0.750000
+DEAL::cell =2.1: 0.250000 0.500000 0.750000 1.00000 0.500000 0.750000 0.375000 0.875000 0.625000
+DEAL::cell =2.2: 0.500000 0.750000 1.00000 1.25000 0.666667 0.833333 0.916667 1.08333 0.583333 0.666667 1.08333 1.16667 0.750000 0.833333 0.916667 1.00000
+DEAL::cell =2.3: 0.750000 1.00000 1.25000 1.50000 0.875000 1.00000 1.12500 1.12500 1.25000 1.37500 0.812500 0.875000 0.937500 1.31250 1.37500 1.43750 0.937500 1.00000 1.06250 1.06250 1.12500 1.18750 1.18750 1.25000 1.31250
+DEAL::cell =2.4: 0.500000 0.750000 1.00000 1.25000
+DEAL::cell =2.5: 0.750000 1.00000 1.25000 1.50000 1.00000 1.25000 0.875000 1.37500 1.12500
+DEAL::cell =2.6: 1.00000 1.25000 1.50000 1.75000 1.16667 1.33333 1.41667 1.58333 1.08333 1.16667 1.58333 1.66667 1.25000 1.33333 1.41667 1.50000
+DEAL::cell =2.7: 1.25000 1.50000 1.75000 2.00000 1.37500 1.50000 1.62500 1.62500 1.75000 1.87500 1.31250 1.37500 1.43750 1.81250 1.87500 1.93750 1.43750 1.50000 1.56250 1.56250 1.62500 1.68750 1.68750 1.75000 1.81250
+DEAL::cell =2.8: 1.00000 1.25000 1.50000 1.75000
+DEAL::cell =2.9: 1.25000 1.50000 1.75000 2.00000 1.50000 1.75000 1.37500 1.87500 1.62500
+DEAL::cell =2.10: 1.50000 1.75000 2.00000 2.25000 1.66667 1.83333 1.91667 2.08333 1.58333 1.66667 2.08333 2.16667 1.75000 1.83333 1.91667 2.00000
+DEAL::cell =2.11: 1.75000 2.00000 2.25000 2.50000 1.87500 2.00000 2.12500 2.12500 2.25000 2.37500 1.81250 1.87500 1.93750 2.31250 2.37500 2.43750 1.93750 2.00000 2.06250 2.06250 2.12500 2.18750 2.18750 2.25000 2.31250
+DEAL::cell =2.12: 1.50000 1.75000 2.00000 2.25000
+DEAL::cell =2.13: 1.75000 2.00000 2.25000 2.50000 2.00000 2.25000 1.87500 2.37500 2.12500
+DEAL::cell =2.14: 2.00000 2.25000 2.50000 2.75000 2.16667 2.33333 2.41667 2.58333 2.08333 2.16667 2.58333 2.66667 2.25000 2.33333 2.41667 2.50000
+DEAL::cell =2.15: 2.25000 2.50000 2.75000 3.00000 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.31250 2.37500 2.43750 2.81250 2.87500 2.93750 2.43750 2.50000 2.56250 2.56250 2.62500 2.68750 2.68750 2.75000 2.81250
+DEAL::3D
+DEAL::cell =2.0: 0 0.250000 0.500000 0.750000 1.00000 1.25000 1.50000 1.75000
+DEAL::cell =2.1: 0.250000 0.500000 0.750000 1.00000 1.25000 1.50000 1.75000 2.00000 0.500000 0.750000 0.375000 0.875000 1.50000 1.75000 1.37500 1.87500 0.750000 1.00000 1.25000 1.50000 1.00000 1.25000 0.875000 1.37500 0.625000 1.62500 1.12500
+DEAL::cell =2.2: 0.500000 0.750000 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000 0.666667 0.833333 0.916667 1.08333 0.583333 0.666667 1.08333 1.16667 1.66667 1.83333 1.91667 2.08333 1.58333 1.66667 2.08333 2.16667 0.833333 1.16667 1.08333 1.41667 1.33333 1.66667 1.58333 1.91667 1.00000 1.16667 1.33333 1.50000 1.25000 1.41667 1.58333 1.75000 0.916667 1.25000 1.00000 1.33333 1.41667 1.75000 1.50000 1.83333 0.750000 0.833333 0.916667 1.00000 1.75000 1.83333 1.91667 2.00000 1.08333 1.16667 1.25000 1.33333 1.41667 1.50000 1.58333 1.66667
+DEAL::cell =2.3: 0.750000 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 0.875000 1.00000 1.12500 1.12500 1.25000 1.37500 0.812500 0.875000 0.937500 1.31250 1.37500 1.43750 1.87500 2.00000 2.12500 2.12500 2.25000 2.37500 1.81250 1.87500 1.93750 2.31250 2.37500 2.43750 1.00000 1.25000 1.50000 1.25000 1.50000 1.75000 1.50000 1.75000 2.00000 1.75000 2.00000 2.25000 1.12500 1.25000 1.37500 1.37500 1.50000 1.62500 1.62500 1.75000 1.87500 1.37500 1.50000 1.62500 1.62500 1.75000 1.87500 1.87500 2.00000 2.12500 1.06250 1.31250 1.56250 1.12500 1.37500 1.62500 1.18750 1.43750 1.68750 1.56250 1.81250 2.06250 1.62500 1.87500 2.12500 1.68750 1.93750 2.18750 0.937500 1.00000 1.06250 1.06250 1.12500 1.18750 1.18750 1.25000 1.31250 1.93750 2.00000 2.06250 2.06250 2.12500 2.18750 2.18750 2.25000 2.31250 1.18750 1.25000 1.31250 1.31250 1.37500 1.43750 1.43750 1.50000 1.56250 1.43750 1.50000 1.56250 1.56250 1.62500 1.68750 1.68750 1.75000 1.81250 1.68750 1.75000 1.81250 1.81250 1.87500 1.93750 1.93750 2.00000 2.06250
+DEAL::cell =2.4: 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000
+DEAL::cell =2.5: 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 1.50000 1.75000 1.37500 1.87500 2.50000 2.75000 2.37500 2.87500 1.75000 2.00000 2.25000 2.50000 2.00000 2.25000 1.87500 2.37500 1.62500 2.62500 2.12500
+DEAL::cell =2.6: 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 1.66667 1.83333 1.91667 2.08333 1.58333 1.66667 2.08333 2.16667 2.66667 2.83333 2.91667 3.08333 2.58333 2.66667 3.08333 3.16667 1.83333 2.16667 2.08333 2.41667 2.33333 2.66667 2.58333 2.91667 2.00000 2.16667 2.33333 2.50000 2.25000 2.41667 2.58333 2.75000 1.91667 2.25000 2.00000 2.33333 2.41667 2.75000 2.50000 2.83333 1.75000 1.83333 1.91667 2.00000 2.75000 2.83333 2.91667 3.00000 2.08333 2.16667 2.25000 2.33333 2.41667 2.50000 2.58333 2.66667
+DEAL::cell =2.7: 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 1.87500 2.00000 2.12500 2.12500 2.25000 2.37500 1.81250 1.87500 1.93750 2.31250 2.37500 2.43750 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 2.81250 2.87500 2.93750 3.31250 3.37500 3.43750 2.00000 2.25000 2.50000 2.25000 2.50000 2.75000 2.50000 2.75000 3.00000 2.75000 3.00000 3.25000 2.12500 2.25000 2.37500 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.87500 3.00000 3.12500 2.06250 2.31250 2.56250 2.12500 2.37500 2.62500 2.18750 2.43750 2.68750 2.56250 2.81250 3.06250 2.62500 2.87500 3.12500 2.68750 2.93750 3.18750 1.93750 2.00000 2.06250 2.06250 2.12500 2.18750 2.18750 2.25000 2.31250 2.93750 3.00000 3.06250 3.06250 3.12500 3.18750 3.18750 3.25000 3.31250 2.18750 2.25000 2.31250 2.31250 2.37500 2.43750 2.43750 2.50000 2.56250 2.43750 2.50000 2.56250 2.56250 2.62500 2.68750 2.68750 2.75000 2.81250 2.68750 2.75000 2.81250 2.81250 2.87500 2.93750 2.93750 3.00000 3.06250
+DEAL::cell =2.8: 0.500000 0.750000 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000
+DEAL::cell =2.9: 0.750000 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 1.00000 1.25000 0.875000 1.37500 2.00000 2.25000 1.87500 2.37500 1.25000 1.50000 1.75000 2.00000 1.50000 1.75000 1.37500 1.87500 1.12500 2.12500 1.62500
+DEAL::cell =2.10: 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 1.16667 1.33333 1.41667 1.58333 1.08333 1.16667 1.58333 1.66667 2.16667 2.33333 2.41667 2.58333 2.08333 2.16667 2.58333 2.66667 1.33333 1.66667 1.58333 1.91667 1.83333 2.16667 2.08333 2.41667 1.50000 1.66667 1.83333 2.00000 1.75000 1.91667 2.08333 2.25000 1.41667 1.75000 1.50000 1.83333 1.91667 2.25000 2.00000 2.33333 1.25000 1.33333 1.41667 1.50000 2.25000 2.33333 2.41667 2.50000 1.58333 1.66667 1.75000 1.83333 1.91667 2.00000 2.08333 2.16667
+DEAL::cell =2.11: 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 1.37500 1.50000 1.62500 1.62500 1.75000 1.87500 1.31250 1.37500 1.43750 1.81250 1.87500 1.93750 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.31250 2.37500 2.43750 2.81250 2.87500 2.93750 1.50000 1.75000 2.00000 1.75000 2.00000 2.25000 2.00000 2.25000 2.50000 2.25000 2.50000 2.75000 1.62500 1.75000 1.87500 1.87500 2.00000 2.12500 2.12500 2.25000 2.37500 1.87500 2.00000 2.12500 2.12500 2.25000 2.37500 2.37500 2.50000 2.62500 1.56250 1.81250 2.06250 1.62500 1.87500 2.12500 1.68750 1.93750 2.18750 2.06250 2.31250 2.56250 2.12500 2.37500 2.62500 2.18750 2.43750 2.68750 1.43750 1.50000 1.56250 1.56250 1.62500 1.68750 1.68750 1.75000 1.81250 2.43750 2.50000 2.56250 2.56250 2.62500 2.68750 2.68750 2.75000 2.81250 1.68750 1.75000 1.81250 1.81250 1.87500 1.93750 1.93750 2.00000 2.06250 1.93750 2.00000 2.06250 2.06250 2.12500 2.18750 2.18750 2.25000 2.31250 2.18750 2.25000 2.31250 2.31250 2.37500 2.43750 2.43750 2.50000 2.56250
+DEAL::cell =2.12: 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000
+DEAL::cell =2.13: 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 2.00000 2.25000 1.87500 2.37500 3.00000 3.25000 2.87500 3.37500 2.25000 2.50000 2.75000 3.00000 2.50000 2.75000 2.37500 2.87500 2.12500 3.12500 2.62500
+DEAL::cell =2.14: 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 2.16667 2.33333 2.41667 2.58333 2.08333 2.16667 2.58333 2.66667 3.16667 3.33333 3.41667 3.58333 3.08333 3.16667 3.58333 3.66667 2.33333 2.66667 2.58333 2.91667 2.83333 3.16667 3.08333 3.41667 2.50000 2.66667 2.83333 3.00000 2.75000 2.91667 3.08333 3.25000 2.41667 2.75000 2.50000 2.83333 2.91667 3.25000 3.00000 3.33333 2.25000 2.33333 2.41667 2.50000 3.25000 3.33333 3.41667 3.50000 2.58333 2.66667 2.75000 2.83333 2.91667 3.00000 3.08333 3.16667
+DEAL::cell =2.15: 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.31250 2.37500 2.43750 2.81250 2.87500 2.93750 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.31250 3.37500 3.43750 3.81250 3.87500 3.93750 2.50000 2.75000 3.00000 2.75000 3.00000 3.25000 3.00000 3.25000 3.50000 3.25000 3.50000 3.75000 2.62500 2.75000 2.87500 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 3.37500 3.50000 3.62500 2.56250 2.81250 3.06250 2.62500 2.87500 3.12500 2.68750 2.93750 3.18750 3.06250 3.31250 3.56250 3.12500 3.37500 3.62500 3.18750 3.43750 3.68750 2.43750 2.50000 2.56250 2.56250 2.62500 2.68750 2.68750 2.75000 2.81250 3.43750 3.50000 3.56250 3.56250 3.62500 3.68750 3.68750 3.75000 3.81250 2.68750 2.75000 2.81250 2.81250 2.87500 2.93750 2.93750 3.00000 3.06250 2.93750 3.00000 3.06250 3.06250 3.12500 3.18750 3.18750 3.25000 3.31250 3.18750 3.25000 3.31250 3.31250 3.37500 3.43750 3.43750 3.50000 3.56250
+DEAL::cell =2.16: 1.00000 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000
+DEAL::cell =2.17: 1.25000 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 1.50000 1.75000 1.37500 1.87500 2.50000 2.75000 2.37500 2.87500 1.75000 2.00000 2.25000 2.50000 2.00000 2.25000 1.87500 2.37500 1.62500 2.62500 2.12500
+DEAL::cell =2.18: 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 1.66667 1.83333 1.91667 2.08333 1.58333 1.66667 2.08333 2.16667 2.66667 2.83333 2.91667 3.08333 2.58333 2.66667 3.08333 3.16667 1.83333 2.16667 2.08333 2.41667 2.33333 2.66667 2.58333 2.91667 2.00000 2.16667 2.33333 2.50000 2.25000 2.41667 2.58333 2.75000 1.91667 2.25000 2.00000 2.33333 2.41667 2.75000 2.50000 2.83333 1.75000 1.83333 1.91667 2.00000 2.75000 2.83333 2.91667 3.00000 2.08333 2.16667 2.25000 2.33333 2.41667 2.50000 2.58333 2.66667
+DEAL::cell =2.19: 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 1.87500 2.00000 2.12500 2.12500 2.25000 2.37500 1.81250 1.87500 1.93750 2.31250 2.37500 2.43750 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 2.81250 2.87500 2.93750 3.31250 3.37500 3.43750 2.00000 2.25000 2.50000 2.25000 2.50000 2.75000 2.50000 2.75000 3.00000 2.75000 3.00000 3.25000 2.12500 2.25000 2.37500 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.87500 3.00000 3.12500 2.06250 2.31250 2.56250 2.12500 2.37500 2.62500 2.18750 2.43750 2.68750 2.56250 2.81250 3.06250 2.62500 2.87500 3.12500 2.68750 2.93750 3.18750 1.93750 2.00000 2.06250 2.06250 2.12500 2.18750 2.18750 2.25000 2.31250 2.93750 3.00000 3.06250 3.06250 3.12500 3.18750 3.18750 3.25000 3.31250 2.18750 2.25000 2.31250 2.31250 2.37500 2.43750 2.43750 2.50000 2.56250 2.43750 2.50000 2.56250 2.56250 2.62500 2.68750 2.68750 2.75000 2.81250 2.68750 2.75000 2.81250 2.81250 2.87500 2.93750 2.93750 3.00000 3.06250
+DEAL::cell =2.20: 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000
+DEAL::cell =2.21: 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 2.50000 2.75000 2.37500 2.87500 3.50000 3.75000 3.37500 3.87500 2.75000 3.00000 3.25000 3.50000 3.00000 3.25000 2.87500 3.37500 2.62500 3.62500 3.12500
+DEAL::cell =2.22: 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 2.66667 2.83333 2.91667 3.08333 2.58333 2.66667 3.08333 3.16667 3.66667 3.83333 3.91667 4.08333 3.58333 3.66667 4.08333 4.16667 2.83333 3.16667 3.08333 3.41667 3.33333 3.66667 3.58333 3.91667 3.00000 3.16667 3.33333 3.50000 3.25000 3.41667 3.58333 3.75000 2.91667 3.25000 3.00000 3.33333 3.41667 3.75000 3.50000 3.83333 2.75000 2.83333 2.91667 3.00000 3.75000 3.83333 3.91667 4.00000 3.08333 3.16667 3.25000 3.33333 3.41667 3.50000 3.58333 3.66667
+DEAL::cell =2.23: 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 2.81250 2.87500 2.93750 3.31250 3.37500 3.43750 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 3.81250 3.87500 3.93750 4.31250 4.37500 4.43750 3.00000 3.25000 3.50000 3.25000 3.50000 3.75000 3.50000 3.75000 4.00000 3.75000 4.00000 4.25000 3.12500 3.25000 3.37500 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.87500 4.00000 4.12500 3.06250 3.31250 3.56250 3.12500 3.37500 3.62500 3.18750 3.43750 3.68750 3.56250 3.81250 4.06250 3.62500 3.87500 4.12500 3.68750 3.93750 4.18750 2.93750 3.00000 3.06250 3.06250 3.12500 3.18750 3.18750 3.25000 3.31250 3.93750 4.00000 4.06250 4.06250 4.12500 4.18750 4.18750 4.25000 4.31250 3.18750 3.25000 3.31250 3.31250 3.37500 3.43750 3.43750 3.50000 3.56250 3.43750 3.50000 3.56250 3.56250 3.62500 3.68750 3.68750 3.75000 3.81250 3.68750 3.75000 3.81250 3.81250 3.87500 3.93750 3.93750 4.00000 4.06250
+DEAL::cell =2.24: 1.50000 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000
+DEAL::cell =2.25: 1.75000 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 2.00000 2.25000 1.87500 2.37500 3.00000 3.25000 2.87500 3.37500 2.25000 2.50000 2.75000 3.00000 2.50000 2.75000 2.37500 2.87500 2.12500 3.12500 2.62500
+DEAL::cell =2.26: 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 2.16667 2.33333 2.41667 2.58333 2.08333 2.16667 2.58333 2.66667 3.16667 3.33333 3.41667 3.58333 3.08333 3.16667 3.58333 3.66667 2.33333 2.66667 2.58333 2.91667 2.83333 3.16667 3.08333 3.41667 2.50000 2.66667 2.83333 3.00000 2.75000 2.91667 3.08333 3.25000 2.41667 2.75000 2.50000 2.83333 2.91667 3.25000 3.00000 3.33333 2.25000 2.33333 2.41667 2.50000 3.25000 3.33333 3.41667 3.50000 2.58333 2.66667 2.75000 2.83333 2.91667 3.00000 3.08333 3.16667
+DEAL::cell =2.27: 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 2.37500 2.50000 2.62500 2.62500 2.75000 2.87500 2.31250 2.37500 2.43750 2.81250 2.87500 2.93750 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.31250 3.37500 3.43750 3.81250 3.87500 3.93750 2.50000 2.75000 3.00000 2.75000 3.00000 3.25000 3.00000 3.25000 3.50000 3.25000 3.50000 3.75000 2.62500 2.75000 2.87500 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 3.37500 3.50000 3.62500 2.56250 2.81250 3.06250 2.62500 2.87500 3.12500 2.68750 2.93750 3.18750 3.06250 3.31250 3.56250 3.12500 3.37500 3.62500 3.18750 3.43750 3.68750 2.43750 2.50000 2.56250 2.56250 2.62500 2.68750 2.68750 2.75000 2.81250 3.43750 3.50000 3.56250 3.56250 3.62500 3.68750 3.68750 3.75000 3.81250 2.68750 2.75000 2.81250 2.81250 2.87500 2.93750 2.93750 3.00000 3.06250 2.93750 3.00000 3.06250 3.06250 3.12500 3.18750 3.18750 3.25000 3.31250 3.18750 3.25000 3.31250 3.31250 3.37500 3.43750 3.43750 3.50000 3.56250
+DEAL::cell =2.28: 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000
+DEAL::cell =2.29: 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 3.00000 3.25000 2.87500 3.37500 4.00000 4.25000 3.87500 4.37500 3.25000 3.50000 3.75000 4.00000 3.50000 3.75000 3.37500 3.87500 3.12500 4.12500 3.62500
+DEAL::cell =2.30: 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 3.16667 3.33333 3.41667 3.58333 3.08333 3.16667 3.58333 3.66667 4.16667 4.33333 4.41667 4.58333 4.08333 4.16667 4.58333 4.66667 3.33333 3.66667 3.58333 3.91667 3.83333 4.16667 4.08333 4.41667 3.50000 3.66667 3.83333 4.00000 3.75000 3.91667 4.08333 4.25000 3.41667 3.75000 3.50000 3.83333 3.91667 4.25000 4.00000 4.33333 3.25000 3.33333 3.41667 3.50000 4.25000 4.33333 4.41667 4.50000 3.58333 3.66667 3.75000 3.83333 3.91667 4.00000 4.08333 4.16667
+DEAL::cell =2.31: 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.31250 3.37500 3.43750 3.81250 3.87500 3.93750 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.31250 4.37500 4.43750 4.81250 4.87500 4.93750 3.50000 3.75000 4.00000 3.75000 4.00000 4.25000 4.00000 4.25000 4.50000 4.25000 4.50000 4.75000 3.62500 3.75000 3.87500 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 4.37500 4.50000 4.62500 3.56250 3.81250 4.06250 3.62500 3.87500 4.12500 3.68750 3.93750 4.18750 4.06250 4.31250 4.56250 4.12500 4.37500 4.62500 4.18750 4.43750 4.68750 3.43750 3.50000 3.56250 3.56250 3.62500 3.68750 3.68750 3.75000 3.81250 4.43750 4.50000 4.56250 4.56250 4.62500 4.68750 4.68750 4.75000 4.81250 3.68750 3.75000 3.81250 3.81250 3.87500 3.93750 3.93750 4.00000 4.06250 3.93750 4.00000 4.06250 4.06250 4.12500 4.18750 4.18750 4.25000 4.31250 4.18750 4.25000 4.31250 4.31250 4.37500 4.43750 4.43750 4.50000 4.56250
+DEAL::cell =2.32: 2.00000 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000
+DEAL::cell =2.33: 2.25000 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 2.50000 2.75000 2.37500 2.87500 3.50000 3.75000 3.37500 3.87500 2.75000 3.00000 3.25000 3.50000 3.00000 3.25000 2.87500 3.37500 2.62500 3.62500 3.12500
+DEAL::cell =2.34: 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 2.66667 2.83333 2.91667 3.08333 2.58333 2.66667 3.08333 3.16667 3.66667 3.83333 3.91667 4.08333 3.58333 3.66667 4.08333 4.16667 2.83333 3.16667 3.08333 3.41667 3.33333 3.66667 3.58333 3.91667 3.00000 3.16667 3.33333 3.50000 3.25000 3.41667 3.58333 3.75000 2.91667 3.25000 3.00000 3.33333 3.41667 3.75000 3.50000 3.83333 2.75000 2.83333 2.91667 3.00000 3.75000 3.83333 3.91667 4.00000 3.08333 3.16667 3.25000 3.33333 3.41667 3.50000 3.58333 3.66667
+DEAL::cell =2.35: 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 2.87500 3.00000 3.12500 3.12500 3.25000 3.37500 2.81250 2.87500 2.93750 3.31250 3.37500 3.43750 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 3.81250 3.87500 3.93750 4.31250 4.37500 4.43750 3.00000 3.25000 3.50000 3.25000 3.50000 3.75000 3.50000 3.75000 4.00000 3.75000 4.00000 4.25000 3.12500 3.25000 3.37500 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.87500 4.00000 4.12500 3.06250 3.31250 3.56250 3.12500 3.37500 3.62500 3.18750 3.43750 3.68750 3.56250 3.81250 4.06250 3.62500 3.87500 4.12500 3.68750 3.93750 4.18750 2.93750 3.00000 3.06250 3.06250 3.12500 3.18750 3.18750 3.25000 3.31250 3.93750 4.00000 4.06250 4.06250 4.12500 4.18750 4.18750 4.25000 4.31250 3.18750 3.25000 3.31250 3.31250 3.37500 3.43750 3.43750 3.50000 3.56250 3.43750 3.50000 3.56250 3.56250 3.62500 3.68750 3.68750 3.75000 3.81250 3.68750 3.75000 3.81250 3.81250 3.87500 3.93750 3.93750 4.00000 4.06250
+DEAL::cell =2.36: 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000
+DEAL::cell =2.37: 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 3.50000 3.75000 3.37500 3.87500 4.50000 4.75000 4.37500 4.87500 3.75000 4.00000 4.25000 4.50000 4.00000 4.25000 3.87500 4.37500 3.62500 4.62500 4.12500
+DEAL::cell =2.38: 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 3.66667 3.83333 3.91667 4.08333 3.58333 3.66667 4.08333 4.16667 4.66667 4.83333 4.91667 5.08333 4.58333 4.66667 5.08333 5.16667 3.83333 4.16667 4.08333 4.41667 4.33333 4.66667 4.58333 4.91667 4.00000 4.16667 4.33333 4.50000 4.25000 4.41667 4.58333 4.75000 3.91667 4.25000 4.00000 4.33333 4.41667 4.75000 4.50000 4.83333 3.75000 3.83333 3.91667 4.00000 4.75000 4.83333 4.91667 5.00000 4.08333 4.16667 4.25000 4.33333 4.41667 4.50000 4.58333 4.66667
+DEAL::cell =2.39: 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 3.81250 3.87500 3.93750 4.31250 4.37500 4.43750 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 4.81250 4.87500 4.93750 5.31250 5.37500 5.43750 4.00000 4.25000 4.50000 4.25000 4.50000 4.75000 4.50000 4.75000 5.00000 4.75000 5.00000 5.25000 4.12500 4.25000 4.37500 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.87500 5.00000 5.12500 4.06250 4.31250 4.56250 4.12500 4.37500 4.62500 4.18750 4.43750 4.68750 4.56250 4.81250 5.06250 4.62500 4.87500 5.12500 4.68750 4.93750 5.18750 3.93750 4.00000 4.06250 4.06250 4.12500 4.18750 4.18750 4.25000 4.31250 4.93750 5.00000 5.06250 5.06250 5.12500 5.18750 5.18750 5.25000 5.31250 4.18750 4.25000 4.31250 4.31250 4.37500 4.43750 4.43750 4.50000 4.56250 4.43750 4.50000 4.56250 4.56250 4.62500 4.68750 4.68750 4.75000 4.81250 4.68750 4.75000 4.81250 4.81250 4.87500 4.93750 4.93750 5.00000 5.06250
+DEAL::cell =2.40: 2.50000 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000
+DEAL::cell =2.41: 2.75000 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 3.00000 3.25000 2.87500 3.37500 4.00000 4.25000 3.87500 4.37500 3.25000 3.50000 3.75000 4.00000 3.50000 3.75000 3.37500 3.87500 3.12500 4.12500 3.62500
+DEAL::cell =2.42: 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 3.16667 3.33333 3.41667 3.58333 3.08333 3.16667 3.58333 3.66667 4.16667 4.33333 4.41667 4.58333 4.08333 4.16667 4.58333 4.66667 3.33333 3.66667 3.58333 3.91667 3.83333 4.16667 4.08333 4.41667 3.50000 3.66667 3.83333 4.00000 3.75000 3.91667 4.08333 4.25000 3.41667 3.75000 3.50000 3.83333 3.91667 4.25000 4.00000 4.33333 3.25000 3.33333 3.41667 3.50000 4.25000 4.33333 4.41667 4.50000 3.58333 3.66667 3.75000 3.83333 3.91667 4.00000 4.08333 4.16667
+DEAL::cell =2.43: 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 3.37500 3.50000 3.62500 3.62500 3.75000 3.87500 3.31250 3.37500 3.43750 3.81250 3.87500 3.93750 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.31250 4.37500 4.43750 4.81250 4.87500 4.93750 3.50000 3.75000 4.00000 3.75000 4.00000 4.25000 4.00000 4.25000 4.50000 4.25000 4.50000 4.75000 3.62500 3.75000 3.87500 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 4.37500 4.50000 4.62500 3.56250 3.81250 4.06250 3.62500 3.87500 4.12500 3.68750 3.93750 4.18750 4.06250 4.31250 4.56250 4.12500 4.37500 4.62500 4.18750 4.43750 4.68750 3.43750 3.50000 3.56250 3.56250 3.62500 3.68750 3.68750 3.75000 3.81250 4.43750 4.50000 4.56250 4.56250 4.62500 4.68750 4.68750 4.75000 4.81250 3.68750 3.75000 3.81250 3.81250 3.87500 3.93750 3.93750 4.00000 4.06250 3.93750 4.00000 4.06250 4.06250 4.12500 4.18750 4.18750 4.25000 4.31250 4.18750 4.25000 4.31250 4.31250 4.37500 4.43750 4.43750 4.50000 4.56250
+DEAL::cell =2.44: 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000
+DEAL::cell =2.45: 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 4.00000 4.25000 3.87500 4.37500 5.00000 5.25000 4.87500 5.37500 4.25000 4.50000 4.75000 5.00000 4.50000 4.75000 4.37500 4.87500 4.12500 5.12500 4.62500
+DEAL::cell =2.46: 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 4.16667 4.33333 4.41667 4.58333 4.08333 4.16667 4.58333 4.66667 5.16667 5.33333 5.41667 5.58333 5.08333 5.16667 5.58333 5.66667 4.33333 4.66667 4.58333 4.91667 4.83333 5.16667 5.08333 5.41667 4.50000 4.66667 4.83333 5.00000 4.75000 4.91667 5.08333 5.25000 4.41667 4.75000 4.50000 4.83333 4.91667 5.25000 5.00000 5.33333 4.25000 4.33333 4.41667 4.50000 5.25000 5.33333 5.41667 5.50000 4.58333 4.66667 4.75000 4.83333 4.91667 5.00000 5.08333 5.16667
+DEAL::cell =2.47: 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.31250 4.37500 4.43750 4.81250 4.87500 4.93750 5.37500 5.50000 5.62500 5.62500 5.75000 5.87500 5.31250 5.37500 5.43750 5.81250 5.87500 5.93750 4.50000 4.75000 5.00000 4.75000 5.00000 5.25000 5.00000 5.25000 5.50000 5.25000 5.50000 5.75000 4.62500 4.75000 4.87500 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 5.37500 5.50000 5.62500 4.56250 4.81250 5.06250 4.62500 4.87500 5.12500 4.68750 4.93750 5.18750 5.06250 5.31250 5.56250 5.12500 5.37500 5.62500 5.18750 5.43750 5.68750 4.43750 4.50000 4.56250 4.56250 4.62500 4.68750 4.68750 4.75000 4.81250 5.43750 5.50000 5.56250 5.56250 5.62500 5.68750 5.68750 5.75000 5.81250 4.68750 4.75000 4.81250 4.81250 4.87500 4.93750 4.93750 5.00000 5.06250 4.93750 5.00000 5.06250 5.06250 5.12500 5.18750 5.18750 5.25000 5.31250 5.18750 5.25000 5.31250 5.31250 5.37500 5.43750 5.43750 5.50000 5.56250
+DEAL::cell =2.48: 3.00000 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000
+DEAL::cell =2.49: 3.25000 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 3.50000 3.75000 3.37500 3.87500 4.50000 4.75000 4.37500 4.87500 3.75000 4.00000 4.25000 4.50000 4.00000 4.25000 3.87500 4.37500 3.62500 4.62500 4.12500
+DEAL::cell =2.50: 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 3.66667 3.83333 3.91667 4.08333 3.58333 3.66667 4.08333 4.16667 4.66667 4.83333 4.91667 5.08333 4.58333 4.66667 5.08333 5.16667 3.83333 4.16667 4.08333 4.41667 4.33333 4.66667 4.58333 4.91667 4.00000 4.16667 4.33333 4.50000 4.25000 4.41667 4.58333 4.75000 3.91667 4.25000 4.00000 4.33333 4.41667 4.75000 4.50000 4.83333 3.75000 3.83333 3.91667 4.00000 4.75000 4.83333 4.91667 5.00000 4.08333 4.16667 4.25000 4.33333 4.41667 4.50000 4.58333 4.66667
+DEAL::cell =2.51: 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 3.87500 4.00000 4.12500 4.12500 4.25000 4.37500 3.81250 3.87500 3.93750 4.31250 4.37500 4.43750 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 4.81250 4.87500 4.93750 5.31250 5.37500 5.43750 4.00000 4.25000 4.50000 4.25000 4.50000 4.75000 4.50000 4.75000 5.00000 4.75000 5.00000 5.25000 4.12500 4.25000 4.37500 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.87500 5.00000 5.12500 4.06250 4.31250 4.56250 4.12500 4.37500 4.62500 4.18750 4.43750 4.68750 4.56250 4.81250 5.06250 4.62500 4.87500 5.12500 4.68750 4.93750 5.18750 3.93750 4.00000 4.06250 4.06250 4.12500 4.18750 4.18750 4.25000 4.31250 4.93750 5.00000 5.06250 5.06250 5.12500 5.18750 5.18750 5.25000 5.31250 4.18750 4.25000 4.31250 4.31250 4.37500 4.43750 4.43750 4.50000 4.56250 4.43750 4.50000 4.56250 4.56250 4.62500 4.68750 4.68750 4.75000 4.81250 4.68750 4.75000 4.81250 4.81250 4.87500 4.93750 4.93750 5.00000 5.06250
+DEAL::cell =2.52: 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000
+DEAL::cell =2.53: 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 4.50000 4.75000 4.37500 4.87500 5.50000 5.75000 5.37500 5.87500 4.75000 5.00000 5.25000 5.50000 5.00000 5.25000 4.87500 5.37500 4.62500 5.62500 5.12500
+DEAL::cell =2.54: 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 6.25000 4.66667 4.83333 4.91667 5.08333 4.58333 4.66667 5.08333 5.16667 5.66667 5.83333 5.91667 6.08333 5.58333 5.66667 6.08333 6.16667 4.83333 5.16667 5.08333 5.41667 5.33333 5.66667 5.58333 5.91667 5.00000 5.16667 5.33333 5.50000 5.25000 5.41667 5.58333 5.75000 4.91667 5.25000 5.00000 5.33333 5.41667 5.75000 5.50000 5.83333 4.75000 4.83333 4.91667 5.00000 5.75000 5.83333 5.91667 6.00000 5.08333 5.16667 5.25000 5.33333 5.41667 5.50000 5.58333 5.66667
+DEAL::cell =2.55: 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 6.25000 6.50000 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 4.81250 4.87500 4.93750 5.31250 5.37500 5.43750 5.87500 6.00000 6.12500 6.12500 6.25000 6.37500 5.81250 5.87500 5.93750 6.31250 6.37500 6.43750 5.00000 5.25000 5.50000 5.25000 5.50000 5.75000 5.50000 5.75000 6.00000 5.75000 6.00000 6.25000 5.12500 5.25000 5.37500 5.37500 5.50000 5.62500 5.62500 5.75000 5.87500 5.37500 5.50000 5.62500 5.62500 5.75000 5.87500 5.87500 6.00000 6.12500 5.06250 5.31250 5.56250 5.12500 5.37500 5.62500 5.18750 5.43750 5.68750 5.56250 5.81250 6.06250 5.62500 5.87500 6.12500 5.68750 5.93750 6.18750 4.93750 5.00000 5.06250 5.06250 5.12500 5.18750 5.18750 5.25000 5.31250 5.93750 6.00000 6.06250 6.06250 6.12500 6.18750 6.18750 6.25000 6.31250 5.18750 5.25000 5.31250 5.31250 5.37500 5.43750 5.43750 5.50000 5.56250 5.43750 5.50000 5.56250 5.56250 5.62500 5.68750 5.68750 5.75000 5.81250 5.68750 5.75000 5.81250 5.81250 5.87500 5.93750 5.93750 6.00000 6.06250
+DEAL::cell =2.56: 3.50000 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000
+DEAL::cell =2.57: 3.75000 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 4.00000 4.25000 3.87500 4.37500 5.00000 5.25000 4.87500 5.37500 4.25000 4.50000 4.75000 5.00000 4.50000 4.75000 4.37500 4.87500 4.12500 5.12500 4.62500
+DEAL::cell =2.58: 4.00000 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 4.16667 4.33333 4.41667 4.58333 4.08333 4.16667 4.58333 4.66667 5.16667 5.33333 5.41667 5.58333 5.08333 5.16667 5.58333 5.66667 4.33333 4.66667 4.58333 4.91667 4.83333 5.16667 5.08333 5.41667 4.50000 4.66667 4.83333 5.00000 4.75000 4.91667 5.08333 5.25000 4.41667 4.75000 4.50000 4.83333 4.91667 5.25000 5.00000 5.33333 4.25000 4.33333 4.41667 4.50000 5.25000 5.33333 5.41667 5.50000 4.58333 4.66667 4.75000 4.83333 4.91667 5.00000 5.08333 5.16667
+DEAL::cell =2.59: 4.25000 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 4.37500 4.50000 4.62500 4.62500 4.75000 4.87500 4.31250 4.37500 4.43750 4.81250 4.87500 4.93750 5.37500 5.50000 5.62500 5.62500 5.75000 5.87500 5.31250 5.37500 5.43750 5.81250 5.87500 5.93750 4.50000 4.75000 5.00000 4.75000 5.00000 5.25000 5.00000 5.25000 5.50000 5.25000 5.50000 5.75000 4.62500 4.75000 4.87500 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 4.87500 5.00000 5.12500 5.12500 5.25000 5.37500 5.37500 5.50000 5.62500 4.56250 4.81250 5.06250 4.62500 4.87500 5.12500 4.68750 4.93750 5.18750 5.06250 5.31250 5.56250 5.12500 5.37500 5.62500 5.18750 5.43750 5.68750 4.43750 4.50000 4.56250 4.56250 4.62500 4.68750 4.68750 4.75000 4.81250 5.43750 5.50000 5.56250 5.56250 5.62500 5.68750 5.68750 5.75000 5.81250 4.68750 4.75000 4.81250 4.81250 4.87500 4.93750 4.93750 5.00000 5.06250 4.93750 5.00000 5.06250 5.06250 5.12500 5.18750 5.18750 5.25000 5.31250 5.18750 5.25000 5.31250 5.31250 5.37500 5.43750 5.43750 5.50000 5.56250
+DEAL::cell =2.60: 4.50000 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 6.25000
+DEAL::cell =2.61: 4.75000 5.00000 5.25000 5.50000 5.75000 6.00000 6.25000 6.50000 5.00000 5.25000 4.87500 5.37500 6.00000 6.25000 5.87500 6.37500 5.25000 5.50000 5.75000 6.00000 5.50000 5.75000 5.37500 5.87500 5.12500 6.12500 5.62500
+DEAL::cell =2.62: 5.00000 5.25000 5.50000 5.75000 6.00000 6.25000 6.50000 6.75000 5.16667 5.33333 5.41667 5.58333 5.08333 5.16667 5.58333 5.66667 6.16667 6.33333 6.41667 6.58333 6.08333 6.16667 6.58333 6.66667 5.33333 5.66667 5.58333 5.91667 5.83333 6.16667 6.08333 6.41667 5.50000 5.66667 5.83333 6.00000 5.75000 5.91667 6.08333 6.25000 5.41667 5.75000 5.50000 5.83333 5.91667 6.25000 6.00000 6.33333 5.25000 5.33333 5.41667 5.50000 6.25000 6.33333 6.41667 6.50000 5.58333 5.66667 5.75000 5.83333 5.91667 6.00000 6.08333 6.16667
+DEAL::cell =2.63: 5.25000 5.50000 5.75000 6.00000 6.25000 6.50000 6.75000 7.00000 5.37500 5.50000 5.62500 5.62500 5.75000 5.87500 5.31250 5.37500 5.43750 5.81250 5.87500 5.93750 6.37500 6.50000 6.62500 6.62500 6.75000 6.87500 6.31250 6.37500 6.43750 6.81250 6.87500 6.93750 5.50000 5.75000 6.00000 5.75000 6.00000 6.25000 6.00000 6.25000 6.50000 6.25000 6.50000 6.75000 5.62500 5.75000 5.87500 5.87500 6.00000 6.12500 6.12500 6.25000 6.37500 5.87500 6.00000 6.12500 6.12500 6.25000 6.37500 6.37500 6.50000 6.62500 5.56250 5.81250 6.06250 5.62500 5.87500 6.12500 5.68750 5.93750 6.18750 6.06250 6.31250 6.56250 6.12500 6.37500 6.62500 6.18750 6.43750 6.68750 5.43750 5.50000 5.56250 5.56250 5.62500 5.68750 5.68750 5.75000 5.81250 6.43750 6.50000 6.56250 6.56250 6.62500 6.68750 6.68750 6.75000 6.81250 5.68750 5.75000 5.81250 5.81250 5.87500 5.93750 5.93750 6.00000 6.06250 5.93750 6.00000 6.06250 6.06250 6.12500 6.18750 6.18750 6.25000 6.31250 6.18750 6.25000 6.31250 6.31250 6.37500 6.43750 6.43750 6.50000 6.56250
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// SolutionTransfer accessed the active_fe_index of the cell from which to
+// interpolate to children, but this active_fe_index is now on an inactive
+// cell and may no longer be valid. we need to use the number previously
+// stored
+
+#include "../tests.h"
+#include <fstream>
+#include <sstream>
+#include <iostream>
+
+#include <deal.II/base/logstream.h>
+
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/dofs/dof_tools.h>
+
+#include <deal.II/hp/fe_collection.h>
+
+#include <deal.II/numerics/solution_transfer.h>
+
+#include <deal.II/numerics/data_out.h>
+
+using namespace dealii;
+
+
+template <int dim>
+void test ()
+{
+ Triangulation<dim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+
+ hp::FECollection<dim> fe_collection;
+ fe_collection.push_back(FE_Q<dim>(1));
+ fe_collection.push_back(FE_Q<dim>(2));
+
+ hp::DoFHandler<dim> dof_handler(triangulation);
+ dof_handler.begin_active()->set_active_fe_index(0);
+ dof_handler.distribute_dofs (fe_collection);
+
+ // Init solution
+ Vector<double> solution(dof_handler.n_dofs());
+ solution = 1.0;
+
+
+ // set refine flag for the only cell we have, then do the refinement
+ SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
+ solution_trans(dof_handler);
+ dof_handler.begin_active()->set_refine_flag ();
+ solution_trans.prepare_for_coarsening_and_refinement(solution);
+ triangulation.execute_coarsening_and_refinement ();
+
+ // now set the active_fe_index flags on the new set of fine level cells
+ for (unsigned int c=0; c<dof_handler.begin(0)->n_children(); ++c)
+ dof_handler.begin(0)->child(c)->set_active_fe_index(1);
+
+ // distribute dofs and transfer solution there
+ dof_handler.distribute_dofs (fe_collection);
+
+ Vector<double> new_solution(dof_handler.n_dofs());
+ solution_trans.interpolate(solution, new_solution);
+
+ // we should now have only 1s in the new_solution vector
+ for (unsigned int i=0; i<new_solution.size(); ++i)
+ Assert (new_solution[i] == 1, ExcInternalError());
+
+ // we are good if we made it to here
+ deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test<1> ();
+ test<2> ();
+ test<3> ();
+}
--- /dev/null
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// SolutionTransfer accessed the active_fe_index of the cell from which to
+// interpolate to children, but this active_fe_index is now on an inactive
+// cell and may no longer be valid. we need to use the number previously
+// stored
+
+#include "../tests.h"
+#include <fstream>
+#include <sstream>
+#include <iostream>
+
+#include <deal.II/base/logstream.h>
+
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/dofs/dof_tools.h>
+
+#include <deal.II/hp/fe_collection.h>
+
+#include <deal.II/numerics/solution_transfer.h>
+
+#include <deal.II/numerics/data_out.h>
+
+using namespace dealii;
+
+
+template <int dim>
+void test ()
+{
+ Triangulation<dim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+
+ hp::FECollection<dim> fe_collection;
+ fe_collection.push_back(FE_Q<dim>(1));
+ fe_collection.push_back(FE_Q<dim>(2));
+
+ hp::DoFHandler<dim> dof_handler(triangulation);
+ dof_handler.begin_active()->set_active_fe_index(0);
+ dof_handler.distribute_dofs (fe_collection);
+
+ // Init solution
+ Vector<double> solution(dof_handler.n_dofs());
+ solution = 1.0;
+
+
+ // set refine flag for the only cell we have, then do the refinement
+ SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
+ solution_trans(dof_handler);
+ dof_handler.begin_active()->set_refine_flag ();
+ solution_trans.prepare_for_pure_refinement();
+ triangulation.execute_coarsening_and_refinement ();
+
+ // now set the active_fe_index flags on the new set of fine level cells
+ for (unsigned int c=0; c<dof_handler.begin(0)->n_children(); ++c)
+ dof_handler.begin(0)->child(c)->set_active_fe_index(1);
+
+ // distribute dofs and transfer solution there
+ dof_handler.distribute_dofs (fe_collection);
+
+ Vector<double> new_solution(dof_handler.n_dofs());
+ solution_trans.refine_interpolate(solution, new_solution);
+
+ // we should now have only 1s in the new_solution vector
+ for (unsigned int i=0; i<new_solution.size(); ++i)
+ Assert (new_solution[i] == 1, ExcInternalError());
+
+ // we are good if we made it to here
+ deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test<1> ();
+ test<2> ();
+ test<3> ();
+}
--- /dev/null
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// like _07 but do it the other way around: start with a fine mesh, then
+// coarsen
+
+#include "../tests.h"
+#include <fstream>
+#include <sstream>
+#include <iostream>
+
+#include <deal.II/base/logstream.h>
+
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/dofs/dof_tools.h>
+
+#include <deal.II/hp/fe_collection.h>
+
+#include <deal.II/numerics/solution_transfer.h>
+
+#include <deal.II/numerics/data_out.h>
+
+using namespace dealii;
+
+
+template <int dim>
+void test ()
+{
+ Triangulation<dim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+ triangulation.refine_global (1);
+
+ hp::FECollection<dim> fe_collection;
+ fe_collection.push_back(FE_Q<dim>(1));
+ fe_collection.push_back(FE_Q<dim>(2));
+
+ hp::DoFHandler<dim> dof_handler(triangulation);
+ for (unsigned int c=0; c<dof_handler.begin(0)->n_children(); ++c)
+ dof_handler.begin(0)->child(c)->set_active_fe_index(1);
+ dof_handler.distribute_dofs (fe_collection);
+
+ // Init solution
+ Vector<double> solution(dof_handler.n_dofs());
+ solution = 1.0;
+
+ // coarsen everything away
+ SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
+ solution_trans(dof_handler);
+ for (unsigned int c=0; c<dof_handler.begin(0)->n_children(); ++c)
+ dof_handler.begin(0)->child(c)->set_coarsen_flag ();
+
+ solution_trans.prepare_for_coarsening_and_refinement(solution);
+ triangulation.execute_coarsening_and_refinement ();
+
+ // now set the active_fe_index flags on the only remaining cell
+ dof_handler.begin_active()->set_active_fe_index(0);
+
+ // distribute dofs and transfer solution there
+ dof_handler.distribute_dofs (fe_collection);
+
+ Vector<double> new_solution(dof_handler.n_dofs());
+ solution_trans.interpolate(solution, new_solution);
+
+ // we should now have only 1s in the new_solution vector
+ for (unsigned int i=0; i<new_solution.size(); ++i)
+ Assert (new_solution[i] == 1, ExcInternalError());
+
+ // we are good if we made it to here
+ deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test<1> ();
+ test<2> ();
+ test<3> ();
+}
--- /dev/null
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2011 - 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Like _07 but with all same fe indices. This triggered yet another place
+// where we had the same kind of error.
+
+#include "../tests.h"
+#include <fstream>
+#include <sstream>
+#include <iostream>
+
+#include <deal.II/base/logstream.h>
+
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/dofs/dof_tools.h>
+
+#include <deal.II/hp/fe_collection.h>
+
+#include <deal.II/numerics/solution_transfer.h>
+
+#include <deal.II/numerics/data_out.h>
+
+using namespace dealii;
+
+
+template <int dim>
+void test ()
+{
+ Triangulation<dim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+
+ hp::FECollection<dim> fe_collection;
+ fe_collection.push_back(FE_Q<dim>(1));
+ fe_collection.push_back(FE_Q<dim>(2));
+
+ hp::DoFHandler<dim> dof_handler(triangulation);
+ dof_handler.begin_active()->set_active_fe_index(0);
+ dof_handler.distribute_dofs (fe_collection);
+
+ // Init solution
+ Vector<double> solution(dof_handler.n_dofs());
+ solution = 1.0;
+
+
+ // set refine flag for the only cell we have, then do the refinement
+ SolutionTransfer<dim, Vector<double>, hp::DoFHandler<dim> >
+ solution_trans(dof_handler);
+ dof_handler.begin_active()->set_refine_flag ();
+ solution_trans.prepare_for_pure_refinement();
+ triangulation.execute_coarsening_and_refinement ();
+
+ // now set the active_fe_index flags on the new set of fine level cells
+ for (unsigned int c=0; c<dof_handler.begin(0)->n_children(); ++c)
+ dof_handler.begin(0)->child(c)->set_active_fe_index(0);
+
+ // distribute dofs and transfer solution there
+ dof_handler.distribute_dofs (fe_collection);
+
+ Vector<double> new_solution(dof_handler.n_dofs());
+ solution_trans.refine_interpolate(solution, new_solution);
+
+ // we should now have only 1s in the new_solution vector
+ for (unsigned int i=0; i<new_solution.size(); ++i)
+ Assert (new_solution[i] == 1, ExcInternalError());
+
+ // we are good if we made it to here
+ deallog << "OK" << std::endl;
+}
+
+
+int main()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test<1> ();
+ test<2> ();
+ test<3> ();
+}
--- /dev/null
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// A test by Krzysztof Bzowski that verifies something in SolutionTransfer
+// that didn't work for a few days
+
+#include <deal.II/base/logstream.h>
+
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_nothing.h>
+#include <deal.II/dofs/dof_tools.h>
+
+#include <deal.II/hp/fe_collection.h>
+
+#include <deal.II/numerics/solution_transfer.h>
+
+#include <iostream>
+#include <fstream>
+
+using namespace dealii;
+
+int main()
+{
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ Triangulation<2> triangulation(Triangulation<2>::none);
+ GridGenerator::hyper_cube (triangulation);
+ triangulation.refine_global(1);
+
+ hp::FECollection<2> fe_collection;
+ fe_collection.push_back(FE_Q<2>(1));
+ fe_collection.push_back(FE_Nothing<2>());
+
+ hp::DoFHandler<2> dof_handler(triangulation);
+
+ // Assign FEQ to all cells
+ hp::DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active();
+ hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
+
+
+
+ /*
+ * -----------
+ * | 0 | 0 |
+ * -----------
+ * | 1 | 1 | 0 - FEQ, 1 - FE_Nothing
+ * -----------
+ */
+
+ cell->set_active_fe_index(1);
+ cell++;
+ cell->set_active_fe_index(1);
+ cell++;
+ cell->set_active_fe_index(0);
+ cell++;
+ cell->set_active_fe_index(0);
+
+ dof_handler.distribute_dofs (fe_collection);
+
+ // Init solution
+ Vector<double> solution(dof_handler.n_dofs());
+ solution = 1.0;
+
+
+ /* Set refine flags:
+ * -----------
+ * | | R |
+ * -----------
+ * | R | |
+ * -----------
+ */
+
+
+ cell = dof_handler.begin_active();
+ cell->set_refine_flag();
+ cell++;
+ cell++;
+ cell++;
+ cell->set_refine_flag();
+
+ triangulation.prepare_coarsening_and_refinement();
+
+ // Interpolate solution
+ SolutionTransfer<2, Vector<double>, hp::DoFHandler<2> > solultion_trans(dof_handler);
+ solultion_trans.prepare_for_coarsening_and_refinement(solution);
+
+ triangulation.execute_coarsening_and_refinement ();
+
+ dof_handler.distribute_dofs(fe_collection);
+
+ Vector<double> new_solution(dof_handler.n_dofs());
+ solultion_trans.interpolate(solution, new_solution);
+
+ deallog << "OK" << std::endl;
+}
+
--- /dev/null
+
+DEAL::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Test parallel::distributed::Vector::operator=(PETScWrappers::MPI::Vector&)
+
+#include "../tests.h"
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/parallel_vector.h>
+#include <deal.II/base/index_set.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <vector>
+
+
+void test ()
+{
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+ unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
+ if (myid==0)
+ deallog << "numproc=" << numproc << std::endl;
+
+ // each processor owns 2 indices and all
+ // are ghosting Element 1 (the second)
+
+ IndexSet local_active(numproc*2);
+ local_active.add_range(myid*2,myid*2+2);
+ IndexSet local_relevant(numproc*2);
+ local_relevant.add_range(1,2);
+
+ PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
+
+ parallel::distributed::Vector<double> copied(local_active, local_relevant, MPI_COMM_WORLD);
+
+ // set local values
+ vb(myid*2)=myid*2.0;
+ vb(myid*2+1)=myid*2.0+1.0;
+
+ vb.compress(VectorOperation::insert);
+ vb*=2.0;
+ v=vb;
+ //v.update_ghost_values();
+
+ Assert(!vb.has_ghost_elements(), ExcInternalError());
+ Assert(v.has_ghost_elements(), ExcInternalError());
+
+ copied = vb;
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ Assert(copied(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+
+ copied = v;
+
+ // check ghost values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << "ghost: " << copied(1) << std::endl;
+ Assert(copied(1) == 2.0, ExcInternalError());
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ Assert(copied(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+
+
+ // done
+ if (myid==0)
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main (int argc, char **argv)
+{
+ Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+
+ deallog.push(Utilities::int_to_string(myid));
+
+ if (myid == 0)
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
+ else
+ test();
+}
--- /dev/null
+
+DEAL:0::numproc=4
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::ghost: 2.000
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Test parallel::distributed::Vector::operator=(PETScWrappers::MPI::BlockVector&)
+
+#include "../tests.h"
+#include <deal.II/lac/petsc_parallel_vector.h>
+#include <deal.II/lac/parallel_vector.h>
+#include <deal.II/lac/parallel_block_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
+#include <deal.II/base/index_set.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <vector>
+
+
+void test ()
+{
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+ unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
+ if (myid==0)
+ deallog << "numproc=" << numproc << std::endl;
+
+ // each processor owns 2 indices and all
+ // are ghosting Element 1 (the second)
+
+ IndexSet local_active(numproc*2);
+ local_active.add_range(myid*2,myid*2+2);
+ IndexSet local_relevant(numproc*2);
+ local_relevant.add_range(1,2);
+
+ PETScWrappers::MPI::Vector vb_one(local_active, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector v_one(local_active, local_relevant, MPI_COMM_WORLD);
+
+ parallel::distributed::Vector<double> copied_one(local_active, local_relevant, MPI_COMM_WORLD);
+
+ // set local values
+ vb_one(myid*2)=myid*2.0;
+ vb_one(myid*2+1)=myid*2.0+1.0;
+
+ vb_one.compress(VectorOperation::insert);
+ vb_one*=2.0;
+ v_one=vb_one;
+
+ PETScWrappers::MPI::BlockVector vb, v;
+ vb.reinit(2);
+ v.reinit(2);
+ parallel::distributed::BlockVector<double> copied(2);
+ for (unsigned int bl=0; bl<2; ++bl)
+ {
+ vb.block(bl) = vb_one;
+ v.block(bl) = v_one;
+ copied.block(bl) = copied_one;
+ }
+ vb.collect_sizes();
+ v.collect_sizes();
+ copied.collect_sizes();
+
+ copied = vb;
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ for (unsigned int bl=0; bl<2; ++bl)
+ {
+ Assert(copied.block(bl)(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied.block(bl)(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ }
+
+ copied = v;
+
+ // check ghost values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << "ghost: " << copied(1) << std::endl;
+ Assert(copied(1) == 2.0, ExcInternalError());
+ Assert(copied.block(1)(1) == 2.0, ExcInternalError());
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ for (unsigned int bl=0; bl<2; ++bl)
+ {
+ Assert(copied.block(bl)(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied.block(bl)(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ }
+
+ // done
+ if (myid==0)
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main (int argc, char **argv)
+{
+ Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+
+ deallog.push(Utilities::int_to_string(myid));
+
+ if (myid == 0)
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
+ else
+ test();
+}
--- /dev/null
+
+DEAL:0::numproc=4
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::ghost: 2.000
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::OK
--- /dev/null
+#!/usr/bin/python
+
+# run this script on all headers of deal.II to check that
+# all doxygen groups have matching @{ @} pairs.
+# for example:
+# find include -name "*h" -print | xargs -n 1 ../tests/scripts/checkdoxygen.py
+
+import sys
+
+args=sys.argv
+args.pop(0)
+
+f = open(args[0])
+lines = f.readlines()
+f.close()
+
+
+count = 0
+lineno = 1
+for l in lines:
+ if "@{" in l:
+ count = count + 1
+ elif "@}" in l:
+ count = count -1
+ if (count < 0):
+ sys.exit("Error in file '%s' in line %d"%(args[0],lineno));
+ lineno = lineno + 1
+
+if (count != 0):
+ sys.exit("Error: missing closing braces in file '%s'"%(args[0]));
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Test parallel::distributed::Vector::operator=(TrilinosWrappers::MPI::Vector&)
+
+#include "../tests.h"
+#include <deal.II/lac/trilinos_vector.h>
+#include <deal.II/lac/parallel_vector.h>
+#include <deal.II/base/index_set.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <vector>
+
+
+void test ()
+{
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+ unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
+ if (myid==0)
+ deallog << "numproc=" << numproc << std::endl;
+
+ // each processor owns 2 indices and all
+ // are ghosting Element 1 (the second)
+
+ IndexSet local_active(numproc*2);
+ local_active.add_range(myid*2,myid*2+2);
+ IndexSet local_relevant(numproc*2);
+ local_relevant.add_range(1,2);
+
+ TrilinosWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
+ TrilinosWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
+
+ parallel::distributed::Vector<double> copied(local_active, local_relevant, MPI_COMM_WORLD);
+
+ // set local values
+ vb(myid*2)=myid*2.0;
+ vb(myid*2+1)=myid*2.0+1.0;
+
+ vb.compress(VectorOperation::insert);
+ vb*=2.0;
+ v=vb;
+ //v.update_ghost_values();
+
+ Assert(!vb.has_ghost_elements(), ExcInternalError());
+ Assert(v.has_ghost_elements(), ExcInternalError());
+
+ copied = vb;
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ Assert(copied(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+
+ copied = v;
+
+ // check ghost values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << "ghost: " << copied(1) << std::endl;
+ Assert(copied(1) == 2.0, ExcInternalError());
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ Assert(copied(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+
+
+ // done
+ if (myid==0)
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main (int argc, char **argv)
+{
+ Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+
+ deallog.push(Utilities::int_to_string(myid));
+
+ if (myid == 0)
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
+ else
+ test();
+}
--- /dev/null
+
+DEAL:0::numproc=4
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::ghost: 2.000
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::OK
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2014 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Test parallel::distributed::Vector::operator=(TrilinosWrappers::MPI::BlockVector&)
+
+#include "../tests.h"
+#include <deal.II/lac/trilinos_vector.h>
+#include <deal.II/lac/parallel_vector.h>
+#include <deal.II/lac/parallel_block_vector.h>
+#include <deal.II/lac/trilinos_parallel_block_vector.h>
+#include <deal.II/base/index_set.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <vector>
+
+
+void test ()
+{
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+ unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
+ if (myid==0)
+ deallog << "numproc=" << numproc << std::endl;
+
+ // each processor owns 2 indices and all
+ // are ghosting Element 1 (the second)
+
+ IndexSet local_active(numproc*2);
+ local_active.add_range(myid*2,myid*2+2);
+ IndexSet local_relevant(numproc*2);
+ local_relevant.add_range(1,2);
+
+ TrilinosWrappers::MPI::Vector vb_one(local_active, MPI_COMM_WORLD);
+ TrilinosWrappers::MPI::Vector v_one(local_active, local_relevant, MPI_COMM_WORLD);
+
+ parallel::distributed::Vector<double> copied_one(local_active, local_relevant, MPI_COMM_WORLD);
+
+ // set local values
+ vb_one(myid*2)=myid*2.0;
+ vb_one(myid*2+1)=myid*2.0+1.0;
+
+ vb_one.compress(VectorOperation::insert);
+ vb_one*=2.0;
+ v_one=vb_one;
+
+ TrilinosWrappers::MPI::BlockVector vb(2), v(2);
+ parallel::distributed::BlockVector<double> copied(2);
+ for (unsigned int bl=0; bl<2; ++bl)
+ {
+ vb.block(bl) = vb_one;
+ v.block(bl) = v_one;
+ copied.block(bl) = copied_one;
+ }
+ vb.collect_sizes();
+ v.collect_sizes();
+ copied.collect_sizes();
+
+ copied = vb;
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ for (unsigned int bl=0; bl<2; ++bl)
+ {
+ Assert(copied.block(bl)(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied.block(bl)(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ }
+
+ copied = v;
+
+ // check ghost values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << "ghost: " << copied(1) << std::endl;
+ Assert(copied(1) == 2.0, ExcInternalError());
+ Assert(copied.block(1)(1) == 2.0, ExcInternalError());
+
+ // check local values
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ {
+ deallog << myid*2 << ":" << copied(myid*2) << std::endl;
+ deallog << myid*2+1 << ":" << copied(myid*2+1) << std::endl;
+ }
+
+ for (unsigned int bl=0; bl<2; ++bl)
+ {
+ Assert(copied.block(bl)(myid*2) == myid*4.0, ExcInternalError());
+ Assert(copied.block(bl)(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+ }
+
+ // done
+ if (myid==0)
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main (int argc, char **argv)
+{
+ Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+ unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+
+ deallog.push(Utilities::int_to_string(myid));
+
+ if (myid == 0)
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
+ else
+ test();
+}
--- /dev/null
+
+DEAL:0::numproc=4
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::ghost: 2.000
+DEAL:0::0:0
+DEAL:0::1:2.000
+DEAL:0::OK