From afd1f8d0ef2aa418aaacdad88d7fc5ed6d0be0b1 Mon Sep 17 00:00:00 2001 From: heltai Date: Sat, 1 Feb 2014 12:33:32 +0000 Subject: [PATCH] Merged from trunk: r32262 through r32365. git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@32366 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 1 + .../cmake/checks/check_01_cxx_features.cmake | 16 +- .../cmake/checks/check_03_compiler_bugs.cmake | 7 +- deal.II/cmake/configure/configure_1_mpi.cmake | 13 +- .../cmake/configure/configure_1_threads.cmake | 6 + ....cmake => macro_push_cmake_required.cmake} | 4 +- .../cmake/macros/macro_register_feature.cmake | 26 +- ...ag.cmake => macro_remove_duplicates.cmake} | 28 +- .../macros/macro_reset_cmake_required.cmake | 2 +- deal.II/cmake/modules/FindTRILINOS.cmake | 4 +- deal.II/cmake/setup_cached_variables.cmake | 12 +- deal.II/cmake/setup_compiler_flags.cmake | 15 +- deal.II/cmake/setup_compiler_flags_gnu.cmake | 2 +- deal.II/cmake/setup_finalize.cmake | 273 +--------- deal.II/cmake/setup_write_config.cmake | 268 ++++++++++ deal.II/doc/developers/cmake-internals.html | 8 +- deal.II/doc/developers/testsuite.html | 71 ++- deal.II/doc/external-libs/p4est.html | 11 +- deal.II/doc/license/adjust.pl | 44 -- deal.II/doc/license/replace.sh | 66 --- deal.II/doc/news/changes.h | 86 ++- deal.II/doc/publications/index.html | 44 +- deal.II/examples/step-1/doc/intro.dox | 20 +- deal.II/examples/step-1/doc/results.dox | 3 +- deal.II/examples/step-1/step-1.cc | 2 + deal.II/examples/step-17/doc/results.dox | 38 +- deal.II/examples/step-2/step-2.cc | 2 +- deal.II/examples/step-32/doc/results.dox | 15 +- deal.II/examples/step-4/step-4.cc | 4 +- deal.II/examples/step-42/step-42.cc | 15 +- deal.II/include/deal.II/base/event.h | 2 +- deal.II/include/deal.II/base/exceptions.h | 4 +- deal.II/include/deal.II/base/index_set.h | 13 +- .../include/deal.II/base/parameter_handler.h | 14 +- .../include/deal.II/base/symmetric_tensor.h | 44 +- deal.II/include/deal.II/distributed/tria.h | 9 +- deal.II/include/deal.II/dofs/dof_accessor.h | 70 ++- .../deal.II/dofs/dof_accessor.templates.h | 22 + .../include/deal.II/fe/fe_q_hierarchical.h | 2 + .../include/deal.II/grid/filtered_iterator.h | 2 +- deal.II/include/deal.II/grid/tria.h | 2 +- .../include/deal.II/hp/mapping_collection.h | 17 +- .../include/deal.II/lac/chunk_sparse_matrix.h | 26 +- .../lac/chunk_sparse_matrix.templates.h | 54 ++ deal.II/include/deal.II/lac/matrix_block.h | 5 +- .../deal.II/lac/parallel_block_vector.h | 66 ++- deal.II/include/deal.II/lac/parallel_vector.h | 46 ++ .../deal.II/lac/parallel_vector.templates.h | 80 +++ .../include/deal.II/lac/petsc_full_matrix.h | 40 +- deal.II/include/deal.II/lac/slepc_solver.h | 2 +- deal.II/include/deal.II/lac/sparse_matrix.h | 4 +- .../include/deal.II/lac/sparsity_pattern.h | 494 +++++++++--------- .../include/deal.II/lac/tridiagonal_matrix.h | 2 + deal.II/include/deal.II/lac/trilinos_vector.h | 5 +- .../include/deal.II/matrix_free/matrix_free.h | 14 +- .../matrix_free/matrix_free.templates.h | 4 +- .../include/deal.II/numerics/matrix_tools.h | 69 ++- .../deal.II/numerics/solution_transfer.h | 32 +- deal.II/source/base/parameter_handler.cc | 128 ++++- deal.II/source/base/quadrature_lib.cc | 4 +- deal.II/source/distributed/grid_refinement.cc | 11 +- deal.II/source/distributed/tria.cc | 25 +- deal.II/source/dofs/dof_accessor_get.cc | 31 +- deal.II/source/dofs/dof_accessor_set.cc | 75 +-- deal.II/source/dofs/dof_handler_policy.cc | 4 +- deal.II/source/fe/mapping_c1.cc | 2 +- deal.II/source/fe/mapping_q1.cc | 2 +- deal.II/source/grid/grid_in.cc | 27 +- deal.II/source/grid/tria.cc | 4 +- deal.II/source/hp/dof_handler.cc | 20 +- deal.II/source/hp/mapping_collection.cc | 11 +- deal.II/source/lac/petsc_full_matrix.cc | 41 +- deal.II/source/lac/petsc_vector_base.cc | 4 +- deal.II/source/lac/sparsity_pattern.cc | 342 ++++-------- deal.II/source/lac/sparsity_tools.cc | 3 +- deal.II/source/lac/trilinos_sparse_matrix.cc | 63 +-- .../source/multigrid/mg_transfer_prebuilt.cc | 11 +- deal.II/source/numerics/solution_transfer.cc | 344 +++--------- deal.II/tests/build_tests/CMakeLists.txt | 2 +- deal.II/tests/quick_tests/p4est.cc | 1 - deal.II/tests/quick_tests/step-petsc.cc | 2 +- tests/bits/chunk_sparse_matrix_16.cc | 115 ++++ tests/bits/chunk_sparse_matrix_16.output | 36 ++ tests/bits/dof_tools_01c.output | 16 +- tests/bits/dof_tools_02c.output | 20 +- tests/bits/dof_tools_15c.output | 244 ++++----- tests/bits/dof_tools_16a.output | 6 +- tests/bits/dof_tools_16c.output | 344 ++++++------ tests/bits/dof_tools_17c.output | 2 +- tests/bits/dof_tools_18c.output | 10 +- .../bits/parameter_handler_write_section_1.cc | 79 +++ .../parameter_handler_write_section_1.output | 11 + .../bits/parameter_handler_write_section_2.cc | 79 +++ .../parameter_handler_write_section_2.output | 15 + .../parameter_handler_write_section_xml.cc | 79 +++ ...parameter_handler_write_section_xml.output | 3 + tests/deal.II/fe_values_view_26.cc | 117 +++++ tests/deal.II/fe_values_view_26.output | 27 + tests/deal.II/fe_values_view_27.cc | 117 +++++ tests/deal.II/fe_values_view_27.output | 27 + tests/deal.II/fe_values_view_28.cc | 142 +++++ tests/deal.II/fe_values_view_28.output | 27 + tests/fe/block_mask_06.debug.output | 2 +- tests/fe/block_mask_07.debug.output | 2 +- tests/fe/component_mask_06.debug.output | 2 +- tests/fe/component_mask_07.debug.output | 2 +- tests/gla/mat_02.cc | 4 +- tests/hp/get_interpolated_dof_values_01.cc | 23 +- ...et_interpolated_dof_values_01.debug.output | 12 +- tests/hp/get_interpolated_dof_values_02.cc | 5 +- tests/hp/get_interpolated_dof_values_03.cc | 7 +- .../hp/set_dof_values_by_interpolation_01.cc | 23 +- ...of_values_by_interpolation_01.debug.output | 12 +- .../hp/set_dof_values_by_interpolation_02.cc | 118 +++++ .../set_dof_values_by_interpolation_02.output | 4 + .../hp/set_dof_values_by_interpolation_03.cc | 110 ++++ .../set_dof_values_by_interpolation_03.output | 88 ++++ tests/hp/solution_transfer_06.cc | 107 ++++ tests/hp/solution_transfer_06.output | 4 + tests/hp/solution_transfer_07.cc | 107 ++++ tests/hp/solution_transfer_07.output | 4 + tests/hp/solution_transfer_08.cc | 107 ++++ tests/hp/solution_transfer_08.output | 4 + tests/hp/solution_transfer_09.cc | 105 ++++ tests/hp/solution_transfer_09.output | 4 + tests/hp/solution_transfer_10.cc | 119 +++++ tests/hp/solution_transfer_10.output | 2 + tests/petsc/copy_to_dealvec.cc | 120 +++++ ...y_to_dealvec.with_mpi=true.mpirun=4.output | 8 + tests/petsc/copy_to_dealvec_block.cc | 138 +++++ ...ealvec_block.with_mpi=true.mpirun=4.output | 8 + tests/scripts/checkdoxygen.py | 30 ++ tests/trilinos/copy_to_dealvec.cc | 120 +++++ ...y_to_dealvec.with_mpi=true.mpirun=4.output | 8 + tests/trilinos/copy_to_dealvec_block.cc | 136 +++++ ...ealvec_block.with_mpi=true.mpirun=4.output | 8 + 136 files changed, 4630 insertions(+), 1846 deletions(-) rename deal.II/cmake/macros/{macro_push_test_flag.cmake => macro_push_cmake_required.cmake} (93%) rename deal.II/cmake/macros/{macro_pop_test_flag.cmake => macro_remove_duplicates.cmake} (56%) create mode 100644 deal.II/cmake/setup_write_config.cmake delete mode 100644 deal.II/doc/license/adjust.pl delete mode 100755 deal.II/doc/license/replace.sh create mode 100644 tests/bits/chunk_sparse_matrix_16.cc create mode 100644 tests/bits/chunk_sparse_matrix_16.output create mode 100644 tests/bits/parameter_handler_write_section_1.cc create mode 100644 tests/bits/parameter_handler_write_section_1.output create mode 100644 tests/bits/parameter_handler_write_section_2.cc create mode 100644 tests/bits/parameter_handler_write_section_2.output create mode 100644 tests/bits/parameter_handler_write_section_xml.cc create mode 100644 tests/bits/parameter_handler_write_section_xml.output create mode 100644 tests/deal.II/fe_values_view_26.cc create mode 100644 tests/deal.II/fe_values_view_26.output create mode 100644 tests/deal.II/fe_values_view_27.cc create mode 100644 tests/deal.II/fe_values_view_27.output create mode 100644 tests/deal.II/fe_values_view_28.cc create mode 100644 tests/deal.II/fe_values_view_28.output create mode 100644 tests/hp/set_dof_values_by_interpolation_02.cc create mode 100644 tests/hp/set_dof_values_by_interpolation_02.output create mode 100644 tests/hp/set_dof_values_by_interpolation_03.cc create mode 100644 tests/hp/set_dof_values_by_interpolation_03.output create mode 100644 tests/hp/solution_transfer_06.cc create mode 100644 tests/hp/solution_transfer_06.output create mode 100644 tests/hp/solution_transfer_07.cc create mode 100644 tests/hp/solution_transfer_07.output create mode 100644 tests/hp/solution_transfer_08.cc create mode 100644 tests/hp/solution_transfer_08.output create mode 100644 tests/hp/solution_transfer_09.cc create mode 100644 tests/hp/solution_transfer_09.output create mode 100644 tests/hp/solution_transfer_10.cc create mode 100644 tests/hp/solution_transfer_10.output create mode 100644 tests/petsc/copy_to_dealvec.cc create mode 100644 tests/petsc/copy_to_dealvec.with_mpi=true.mpirun=4.output create mode 100644 tests/petsc/copy_to_dealvec_block.cc create mode 100644 tests/petsc/copy_to_dealvec_block.with_mpi=true.mpirun=4.output create mode 100755 tests/scripts/checkdoxygen.py create mode 100644 tests/trilinos/copy_to_dealvec.cc create mode 100644 tests/trilinos/copy_to_dealvec.with_mpi=true.mpirun=4.output create mode 100644 tests/trilinos/copy_to_dealvec_block.cc create mode 100644 tests/trilinos/copy_to_dealvec_block.with_mpi=true.mpirun=4.output diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index c48544e743..ad2a8cacd4 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -123,6 +123,7 @@ ENDFOREACH() # INCLUDE(setup_custom_targets) INCLUDE(setup_finalize) +INCLUDE(setup_write_config) ######################################################################## diff --git a/deal.II/cmake/checks/check_01_cxx_features.cmake b/deal.II/cmake/checks/check_01_cxx_features.cmake index fa1540fae4..f464702949 100644 --- a/deal.II/cmake/checks/check_01_cxx_features.cmake +++ b/deal.II/cmake/checks/check_01_cxx_features.cmake @@ -51,7 +51,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) # Set CMAKE_REQUIRED_FLAGS for the unit tests MESSAGE(STATUS "Using C++11 flag \"${DEAL_II_CXX11_FLAG}\"") - PUSH_TEST_FLAG("${DEAL_II_CXX11_FLAG}") + PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}") CHECK_CXX_SOURCE_COMPILES( " @@ -103,7 +103,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) # that as well. # IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) - PUSH_TEST_FLAG("-pthread") + PUSH_CMAKE_REQUIRED("-pthread") CHECK_CXX_SOURCE_RUNS( " #include @@ -111,7 +111,8 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) int main(){ std::thread t(f,1); t.join(); return 0; } " DEAL_II_HAVE_CXX11_THREAD) - POP_TEST_FLAG() + RESET_CMAKE_REQUIRED() + PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}") ELSE() # Just export it ;-) SET(DEAL_II_HAVE_CXX11_THREAD TRUE CACHE BOOL "") @@ -146,7 +147,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) # # On Mac OS-X 10.9 with recent gcc compilers in C++11 mode linking to # some standard C library functions, notably toupper and tolower, fail - # due to unresolved references to this functions. + # due to unresolved references to these functions. # # Thanks to Denis Davydov for the testcase. # @@ -252,7 +253,8 @@ IF(DEAL_II_WITH_CXX11 AND NOT DEAL_II_HAVE_CXX11) " -DDEAL_II_WITH_CXX11=FALSE,\n" "or use a different compiler, instead. (If the compiler flag for C++11 " "support differs from \"-std=c++0x\" or \"-std=c++11\", a suitable " - "compiler flag has to be specified manually.\n\n" + "compiler flag has to be specified manually via\n" + " -DDEAL_II_CXX11_FLAG=\"...\"\n\n" ) ENDIF() @@ -264,14 +266,14 @@ IF(DEAL_II_WITH_CXX11) ADD_FLAGS(DEAL_II_CXX_FLAGS "${DEAL_II_CXX11_FLAG}") MESSAGE(STATUS "DEAL_II_WITH_CXX11 successfully set up") - PUSH_TEST_FLAG("${DEAL_II_CXX11_FLAG}") + PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}") CHECK_CXX_SOURCE_COMPILES( " #include int main(){ std::is_trivially_copyable bob; } " DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE) - POP_TEST_FLAG() + RESET_CMAKE_REQUIRED() ELSE() MESSAGE(STATUS "DEAL_II_WITH_CXX11 disabled") ENDIF() diff --git a/deal.II/cmake/checks/check_03_compiler_bugs.cmake b/deal.II/cmake/checks/check_03_compiler_bugs.cmake index 364bad027e..c913deb19c 100644 --- a/deal.II/cmake/checks/check_03_compiler_bugs.cmake +++ b/deal.II/cmake/checks/check_03_compiler_bugs.cmake @@ -29,8 +29,8 @@ # # - Wolfgang Bangerth, Matthias Maier, rewritten 2012 # -PUSH_TEST_FLAG("-Wreturn-type") -PUSH_TEST_FLAG("-Werror") +PUSH_CMAKE_REQUIRED("-Wreturn-type") +PUSH_CMAKE_REQUIRED("-Werror") CHECK_CXX_COMPILER_BUG( " const double foo() { return 1.; } @@ -38,8 +38,7 @@ CHECK_CXX_COMPILER_BUG( " DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG ) -POP_TEST_FLAG() -POP_TEST_FLAG() +RESET_CMAKE_REQUIRED() IF(DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG) ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-return-type) diff --git a/deal.II/cmake/configure/configure_1_mpi.cmake b/deal.II/cmake/configure/configure_1_mpi.cmake index 647ea4a81c..1927e8ecbd 100644 --- a/deal.II/cmake/configure/configure_1_mpi.cmake +++ b/deal.II/cmake/configure/configure_1_mpi.cmake @@ -52,6 +52,7 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) "not be autodetected" ) ENDIF() + FIND_PACKAGE(MPI) IF(NOT MPI_CXX_FOUND AND DEAL_II_WITH_MPI) @@ -136,6 +137,14 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) SET(${var} TRUE) ENDIF() + # + # Populate correct variables: + # + SET(MPI_LIBRARIES ${MPI_CXX_LIBRARIES}) + SET(MPI_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH}) + SET(MPI_CXX_FLAGS ${MPI_CXX_COMPILE_FLAGS}) + SET(MPI_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}") + # Hide some variables: MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY MPI_MPI_H) @@ -146,9 +155,9 @@ MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL) # # The user has to know the location of the mpi headers as well: # - SET(MPI_CXX_ADD_TO_USER_INCLUDE_DIRS TRUE) + SET(MPI_ADD_TO_USER_INCLUDE_DIRS TRUE) - REGISTER_FEATURE(MPI_CXX) + REGISTER_FEATURE(MPI) ENDMACRO() diff --git a/deal.II/cmake/configure/configure_1_threads.cmake b/deal.II/cmake/configure/configure_1_threads.cmake index edd2b4cd20..c7265653bb 100644 --- a/deal.II/cmake/configure/configure_1_threads.cmake +++ b/deal.II/cmake/configure/configure_1_threads.cmake @@ -154,6 +154,7 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL) REGISTER_FEATURE(TBB) + # TODO: Refactor IF(CMAKE_BUILD_TYPE MATCHES "Debug") IF(TBB_WITH_DEBUG_LIB) LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "TBB_USE_DEBUG" "TBB_DO_ASSERT=1") @@ -173,6 +174,11 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL) ENDIF() SETUP_THREADING() + + # TODO: Refactor this mess of a configure file... + SET(THREADS_LIBRARIES ${TBB_LIBRARIES}) + SET(THREADS_INCLUDE_DIRS ${TBB_INCLUDE_DIRS}) + ENDMACRO() diff --git a/deal.II/cmake/macros/macro_push_test_flag.cmake b/deal.II/cmake/macros/macro_push_cmake_required.cmake similarity index 93% rename from deal.II/cmake/macros/macro_push_test_flag.cmake rename to deal.II/cmake/macros/macro_push_cmake_required.cmake index 905ce92e16..180df5981d 100644 --- a/deal.II/cmake/macros/macro_push_test_flag.cmake +++ b/deal.II/cmake/macros/macro_push_cmake_required.cmake @@ -19,10 +19,10 @@ # CMAKE_REQUIRED_FLAGS # # Usage: -# PUSH_TEST_FLAG("flag") +# PUSH_CMAKE_REQUIRED("flag") # -MACRO(PUSH_TEST_FLAG _flag) +MACRO(PUSH_CMAKE_REQUIRED _flag) SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${_flag}") STRING(STRIP "${CMAKE_REQUIRED_FLAGS}" CMAKE_REQUIRED_FLAGS) diff --git a/deal.II/cmake/macros/macro_register_feature.cmake b/deal.II/cmake/macros/macro_register_feature.cmake index 22dffc44de..5c590280ee 100644 --- a/deal.II/cmake/macros/macro_register_feature.cmake +++ b/deal.II/cmake/macros/macro_register_feature.cmake @@ -15,26 +15,24 @@ ## --------------------------------------------------------------------- # -# This macro is used for the feature configuration in deal.II +# This macro is used for the feature configuration in deal.II. It adds +# individual FEATURE_* configuration variables to the corresponding +# DEAL_II_* variables # # Usage: # REGISTER_FEATURE(feature) # -# This macro will +# This macro will add # -# - add ${feature}_INCLUDE_DIRS and ${feature}_INCLUDE_PATH -# to the list of (internal) include directories -# - and if ${feature}_ADD_TO_USER_INCLUDE_DIRS is defined also to -# DEAL_II_USER_INCLUDE_DIRS +# _LIBRARIES +# _INCLUDE_DIRS(|_DEBUG|_RELEASE) +# _USER_INCLUDE_DIRS(|_DEBUG|_RELEASE) +# _DEFINITIONS(|_DEBUG|_RELEASE) +# _USER_DEFINITIONS(|_DEBUG|_RELEASE) +# _CXX_FLAGS(|_DEBUG|_RELEASE) +# _LINKER_FLAGS(|_DEBUG|_RELEASE) # -# - add ${feature}_LINKER_FLAGS and ${feature}_LINK_FLAGS to -# DEAL_II_LINKER_FLAGS -# -# - add ${feature}_CXX_FLAGS and ${feature}_COMPILE_FLAGS to -# DEAL_II_CXX_FLAGS -# -# - add ${feature}_LIBRARIES to the list of deal.II libraries depending -# on general, optimized or debug keyword +# to the corresponding DEAL_II_* variables # diff --git a/deal.II/cmake/macros/macro_pop_test_flag.cmake b/deal.II/cmake/macros/macro_remove_duplicates.cmake similarity index 56% rename from deal.II/cmake/macros/macro_pop_test_flag.cmake rename to deal.II/cmake/macros/macro_remove_duplicates.cmake index 045fe43e2f..d0ec688fdd 100644 --- a/deal.II/cmake/macros/macro_pop_test_flag.cmake +++ b/deal.II/cmake/macros/macro_remove_duplicates.cmake @@ -1,7 +1,7 @@ ## --------------------------------------------------------------------- ## $Id$ ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2014 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -15,21 +15,21 @@ ## --------------------------------------------------------------------- # -# A small macro used in the platform checks to remove the right most flag in -# CMAKE_REQUIRED_FLAGS -# -# We assume that the flags in CMAKE_REQUIRED_FLAGS are space separated +# Remove duplicate entries from a list. Optionally do this in reverse +# order, keeping the rightmost element # # Usage: -# POP_TEST_FLAG() +# REMOVE_DUPLICATES(list [REVERSE]) # -MACRO(POP_TEST_FLAG) - SET(CMAKE_REQUIRED_FLAGS " ${CMAKE_REQUIRED_FLAGS}") - STRING(REGEX REPLACE " [^ ]+$" "" - CMAKE_REQUIRED_FLAGS - "${CMAKE_REQUIRED_FLAGS}" - ) - STRING(STRIP "${CMAKE_REQUIRED_FLAGS}" CMAKE_REQUIRED_FLAGS) +MACRO(REMOVE_DUPLICATES _list) + IF(NOT "${${_list}}" STREQUAL "") + IF("${ARGN}" STREQUAL "REVERSE") + LIST(REVERSE ${_list}) + ENDIF() + LIST(REMOVE_DUPLICATES ${_list}) + IF("${ARGN}" STREQUAL "REVERSE") + LIST(REVERSE ${_list}) + ENDIF() + ENDIF() ENDMACRO() - diff --git a/deal.II/cmake/macros/macro_reset_cmake_required.cmake b/deal.II/cmake/macros/macro_reset_cmake_required.cmake index 53a4818786..02254b27a2 100644 --- a/deal.II/cmake/macros/macro_reset_cmake_required.cmake +++ b/deal.II/cmake/macros/macro_reset_cmake_required.cmake @@ -25,6 +25,6 @@ MACRO(RESET_CMAKE_REQUIRED) SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED}) SET(CMAKE_REQUIRED_INCLUDES) - SET(CMAKE_REQUIRED_LIBRARIES) + SET(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED}) ENDMACRO() diff --git a/deal.II/cmake/modules/FindTRILINOS.cmake b/deal.II/cmake/modules/FindTRILINOS.cmake index 8857da9f82..877e550f65 100644 --- a/deal.II/cmake/modules/FindTRILINOS.cmake +++ b/deal.II/cmake/modules/FindTRILINOS.cmake @@ -183,7 +183,7 @@ IF(TRILINOS_FOUND) ENDIF() LIST(APPEND CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIRS}) - PUSH_TEST_FLAG("${DEAL_II_CXX11_FLAG}") + PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}") CHECK_CXX_SOURCE_COMPILES( " @@ -196,7 +196,7 @@ IF(TRILINOS_FOUND) # # Try whether exporting HAS_C99_TR1_CMATH helps: # - PUSH_TEST_FLAG("-DHAS_C99_TR1_CMATH") + PUSH_CMAKE_REQUIRED("-DHAS_C99_TR1_CMATH") CHECK_CXX_SOURCE_COMPILES( " #include diff --git a/deal.II/cmake/setup_cached_variables.cmake b/deal.II/cmake/setup_cached_variables.cmake index c4fc91f1dd..51a3f0bc45 100644 --- a/deal.II/cmake/setup_cached_variables.cmake +++ b/deal.II/cmake/setup_cached_variables.cmake @@ -282,7 +282,7 @@ FOREACH(_flag ${DEAL_II_USED_FLAGS}) # file). # SET(${_flag}_SAVED ${${_flag}}) - SET(${_flag}) + SET(${_flag} "") ENDFOREACH() FOREACH(_variable @@ -304,9 +304,13 @@ ENDFOREACH() # Finally, read in CXXFLAGS and LDFLAGS from environment and prepend them # to the saved variables: # - -SET(CMAKE_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_SAVED}") +# Also strip leading and trailing whitespace from linker flags to make +# old cmake versions happy +# +SET(DEAL_II_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${DEAL_II_CXX_FLAGS_SAVED}") +STRING(STRIP "${DEAL_II_CXX_FLAGS_SAVED}" DEAL_II_CXX_FLAGS_SAVED) SET(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}") +STRING(STRIP "${DEAL_II_LINKER_FLAGS_SAVED}" DEAL_II_LINKER_FLAGS_SAVED) UNSET(ENV{CXXFLAGS}) UNSET(ENV{LDFLAGS}) @@ -353,7 +357,7 @@ It is not possible to install into the build directory. Please set CMAKE_INSTALL_PREFIX to a designated install directory different than CMAKE_BINARY_DIR. (Please note that you can use deal.II directly out of a build directory -if this is what you tried to do.) +without the need to install it, if this is what you tried to do.) " ) ENDIF() diff --git a/deal.II/cmake/setup_compiler_flags.cmake b/deal.II/cmake/setup_compiler_flags.cmake index 848f601042..d8eb42447c 100644 --- a/deal.II/cmake/setup_compiler_flags.cmake +++ b/deal.II/cmake/setup_compiler_flags.cmake @@ -66,12 +66,14 @@ # Check the user provided CXX flags: # -IF(NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}") +IF( NOT "${DEAL_II_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_CXX_FLAGS_SAVED}" + OR NOT "${DEAL_II_LINKER_FLAGS_SAVED}" STREQUAL "${CACHED_DEAL_II_LINKER_FLAGS_SAVED}") MESSAGE(STATUS "") # Rerun this test if cxx flags changed: UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE) ENDIF() SET(CACHED_DEAL_II_CXX_FLAGS_SAVED "${DEAL_II_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE) +SET(CACHED_DEAL_II_LINKER_FLAGS_SAVED "${DEAL_II_LINKER_FLAGS_SAVED}" CACHE INTERNAL "" FORCE) # Initialize all CMAKE_REQUIRED_* variables a this point: RESET_CMAKE_REQUIRED() @@ -82,11 +84,12 @@ CHECK_CXX_SOURCE_COMPILES( IF(NOT DEAL_II_HAVE_USABLE_CXX_FLAGS) UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE) - MESSAGE(FATAL_ERROR "\n" - "Configuration error: Cannot compile with the user supplied CXX flags:\n" - "${DEAL_II_CXX_FLAGS_SAVED}\n" - "Please check the CMake variable DEAL_II_CXX_FLAGS and the\n" - "environment variable CXXFLAGS\n\n" + MESSAGE(FATAL_ERROR " +Configuration error: Cannot compile with the user supplied flags: +CXX flags: ${DEAL_II_CXX_FLAGS_SAVED} +LD flags: ${DEAL_II_LINKER_FLAGS_SAVED} +Please check the CMake variables DEAL_II_CXX_FLAGS, DEAL_II_LINKER_FLAGS +and the environment variables CXXFLAGS, LDFLAGS.\n\n" ) ENDIF() diff --git a/deal.II/cmake/setup_compiler_flags_gnu.cmake b/deal.II/cmake/setup_compiler_flags_gnu.cmake index e0607ae195..59c4a24508 100644 --- a/deal.II/cmake/setup_compiler_flags_gnu.cmake +++ b/deal.II/cmake/setup_compiler_flags_gnu.cmake @@ -171,7 +171,7 @@ IF (CMAKE_BUILD_TYPE MATCHES "Debug") # # Enable test coverage # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fno-elide-constructors") + ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-fno-elide-constructors") ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs") ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs") ENDIF() diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake index fea5613d55..4baa99b615 100644 --- a/deal.II/cmake/setup_finalize.cmake +++ b/deal.II/cmake/setup_finalize.cmake @@ -54,25 +54,16 @@ ENDFOREACH() # # Deduplicate entries in DEAL_II_USER_INCLUDE_DIRS # -IF(NOT "${DEAL_II_USER_INCLUDE_DIRS}" STREQUAL "") - LIST(REMOVE_DUPLICATES DEAL_II_USER_INCLUDE_DIRS) -ENDIF() +REMOVE_DUPLICATES(DEAL_II_USER_INCLUDE_DIRS) # # Deduplicate entries in DEAL_II_EXTERNAL_LIBRARIES(_...) # in reverse order: # -IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES}" STREQUAL "") - LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES) - LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES) - LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES) -ENDIF() +REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES REVERSE) + FOREACH(_build ${DEAL_II_BUILD_TYPES}) - IF(NOT "${DEAL_II_EXTERNAL_LIBRARIES_${_build}}" STREQUAL "") - LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${_build}) - LIST(REMOVE_DUPLICATES DEAL_II_EXTERNAL_LIBRARIES_${_build}) - LIST(REVERSE DEAL_II_EXTERNAL_LIBRARIES_${_build}) - ENDIF() + REMOVE_DUPLICATES(DEAL_II_EXTERNAL_LIBRARIES_${_build} REVERSE) ENDFOREACH() # @@ -99,259 +90,3 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake "" ) - - -######################################################################## -# # -# And write a nice configuration summary to file: # -# # -######################################################################## - -SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log") -SET(_log_summary "${CMAKE_BINARY_DIR}/summary.log") -FILE(REMOVE ${_log_detailed} ${_log_summary}) - -MACRO(_both) - # Write to both log files: - FILE(APPEND ${_log_detailed} "${ARGN}") - FILE(APPEND ${_log_summary} "${ARGN}") -ENDMACRO() -MACRO(_detailed) - # Only write to detailed.log: - FILE(APPEND ${_log_detailed} "${ARGN}") -ENDMACRO() -MACRO(_summary) - # Only write to summary.log: - FILE(APPEND ${_log_summary} "${ARGN}") -ENDMACRO() - -_both( -"### -# -# ${DEAL_II_PACKAGE_NAME} configuration: -# CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE} -# BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS} -# CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} -# CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR} (Version ${DEAL_II_PACKAGE_VERSION}) -# CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR} -# CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} -# ${CMAKE_CXX_COMPILER} -" - ) - -IF(CMAKE_C_COMPILER_WORKS) - _detailed("# CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n") -ENDIF() -IF(CMAKE_Fortran_COMPILER_WORKS) - _detailed("# CMAKE_Fortran_COMPILER: ${CMAKE_Fortran_COMPILER}\n") -ENDIF() -_detailed("# CMAKE_GENERATOR: ${CMAKE_GENERATOR}\n") - -IF(CMAKE_CROSSCOMPILING) - _both( - "#\n# CROSSCOMPILING!\n" - ) -ENDIF() - -IF(DEAL_II_STATIC_EXECUTABLE) - _both( - "#\n# STATIC LINKAGE!\n" - ) -ENDIF() - -_both("#\n") - -_detailed( -"# Compiler flags used for this build: -# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS} -" - ) -IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n") -ENDIF() - -_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n") -IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n") -ENDIF() - -_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n") -IF(CMAKE_BUILD_TYPE MATCHES "Release") - _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") - _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n") -ENDIF() - -_detailed("#\n") - -IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) - _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n") -ENDIF() -_both("# Configured Features (") -IF(DEFINED DEAL_II_ALLOW_BUNDLED) - _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ") -ENDIF() -IF(DEAL_II_FORCE_AUTODETECTION) - _both("!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, ") -ENDIF() -_both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n") - - -# -# Cache for quicker access to avoid the O(n^2) complexity of a loop over -# _all_ defined variables. -# -GET_CMAKE_PROPERTY(_variables VARIABLES) -FOREACH(_var ${_variables}) - IF(_var MATCHES "DEAL_II_WITH") - LIST(APPEND _features "${_var}") - ELSEIF(_var MATCHES "DEAL_II_COMPONENT") - LIST(APPEND _components "${_var}") - ELSEIF(_var MATCHES "(MPI_CXX_COMPILER|MPI_CXX_COMPILE_FLAGS|MPI_CXX_LINK_FLAGS)") - LIST(APPEND _features_config ${_var}) - ELSEIF(_var MATCHES "(LIBRARIES|INCLUDE_PATH|INCLUDE_DIRS|LINKER_FLAGS)") - LIST(APPEND _features_config ${_var}) - ENDIF() -ENDFOREACH() - -FOREACH(_var ${_features}) - IF(${${_var}}) - # FEATURE is enabled - STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var}) - IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED) - _both("# ${_var} set up with external dependencies\n") - - # - # Print out version number: - # - IF(DEFINED ${_feature}_VERSION) - _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") - ELSEIF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) - _detailed("# TBB_VERSION = ${TBB_VERSION}\n") - ENDIF() - - IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION) - _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n") - ENDIF() - - # - # Print out ${_feature}_DIR: - # - IF(DEFINED ${_feature}_DIR) - _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") - ENDIF() - - # - # Print the feature configuration: - # - FOREACH(_var2 ${_features_config}) - IF( # MPI: - _var2 MATCHES "^${_feature}_CXX_(COMPILER|COMPILE_FLAGS|LINK_FLAGS|LIBRARIES|INCLUDE_PATH)$" OR - # Boost: - ( _feature MATCHES "BOOST" AND _var2 MATCHES "^BOOST_(LIBRARIES|INCLUDE_DIRS)$" ) OR - # TBB: - ( _feature MATCHES "THREADS" AND _var2 MATCHES "^TBB_(LIBRARIES|INCLUDE_DIRS)$" ) OR - # Generic: - ( (NOT _var2 MATCHES "^(MPI|Boost)") AND - _var2 MATCHES "^${_feature}_(INCLUDE_DIRS|LIBRARIES|LINKER_FLAGS)$" ) - ) - _detailed("# ${_var2} = ${${_var2}}\n") - ENDIF() - ENDFOREACH() - - ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED) - IF(DEAL_II_FORCE_BUNDLED_${_feature}) - _both("# ${_var} set up with bundled packages (forced)\n") - ELSE() - _both("# ${_var} set up with bundled packages\n") - ENDIF() - ELSE() - _both("# ${_var} = ${${_var}}\n") - ENDIF() - ELSE() - # FEATURE is disabled - _both("# ( ${_var} = ${${_var}} )\n") - ENDIF() -ENDFOREACH() - -_both( - "#\n# Component configuration:\n" - ) -FOREACH(_var ${_components}) - IF(_var MATCHES "DEAL_II_COMPONENT") - IF(${${_var}}) - _both("# ${_var}\n") - STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var}) - LIST(APPEND _components ${_component}) - ELSE() - _both("# ( ${_var} = ${${_var}} )\n") - ENDIF() - ENDIF() -ENDFOREACH() - -_summary( -"#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log -#\n# Run $ " - ) -IF(CMAKE_GENERATOR MATCHES "Ninja") - _summary("ninja info") -ELSE() -_summary("make help") -ENDIF() -_summary(" to print a help message with a list of top level targets\n") - -_both("#\n###") - - -######################################################################## -# # -# Dump the cache into config.cmake: # -# # -######################################################################## - -SET(_config_cmake "${CMAKE_BINARY_DIR}/config.cmake") -FILE(WRITE ${_config_cmake} -"# -# This is a raw CMake cache dump of this build directory suitable as an -# initial cache file: Use this file to preseed a CMake cache in an empty -# build directory by (note that it is still necessary to declare a source -# directory): -# $ cmake -C [...]/config.cmake ../deal.II -# -# If you want to have a clean configuration file have a look at -# doc/users/config.sample -#\n" - ) - -FUNCTION(_config _var) - # It is absolutely beyond my comprehension why on earth there is - # hardcoded logic built into CMake to throw an error if one uses - # uppercase variants of FindPACKAGE call variables... - IF(NOT _var MATCHES "BOOST_DIR") - UNSET(${_var}) - ENDIF() - # - # We have to get down to the raw entry in the cache, therefore clear the - # current value (and do it in a function to get private scope): - # - FILE(APPEND ${_config_cmake} - "SET(${_var} \"${${_var}}\" CACHE STRING \"\")\n" - ) -ENDFUNCTION() - -GET_CMAKE_PROPERTY(_variables CACHE_VARIABLES) -FOREACH(_var - CMAKE_C_COMPILER - CMAKE_CXX_COMPILER - CMAKE_Fortran_COMPILER - ${_variables} - ) - _config(${_var}) -ENDFOREACH() diff --git a/deal.II/cmake/setup_write_config.cmake b/deal.II/cmake/setup_write_config.cmake new file mode 100644 index 0000000000..f3062a3907 --- /dev/null +++ b/deal.II/cmake/setup_write_config.cmake @@ -0,0 +1,268 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2012 - 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + + +######################################################################## +# # +# Write a nice configuration summary to file: # +# # +######################################################################## + +SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log") +SET(_log_summary "${CMAKE_BINARY_DIR}/summary.log") +FILE(REMOVE ${_log_detailed} ${_log_summary}) + +MACRO(_both) + # Write to both log files: + FILE(APPEND ${_log_detailed} "${ARGN}") + FILE(APPEND ${_log_summary} "${ARGN}") +ENDMACRO() +MACRO(_detailed) + # Only write to detailed.log: + FILE(APPEND ${_log_detailed} "${ARGN}") +ENDMACRO() +MACRO(_summary) + # Only write to summary.log: + FILE(APPEND ${_log_summary} "${ARGN}") +ENDMACRO() + +_both( +"### +# +# ${DEAL_II_PACKAGE_NAME} configuration: +# CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE} +# BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS} +# CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} +# CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR} (Version ${DEAL_II_PACKAGE_VERSION}) +# CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR} +# CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} +# ${CMAKE_CXX_COMPILER} +" + ) + +IF(CMAKE_C_COMPILER_WORKS) + _detailed("# CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n") +ENDIF() +IF(CMAKE_Fortran_COMPILER_WORKS) + _detailed("# CMAKE_Fortran_COMPILER: ${CMAKE_Fortran_COMPILER}\n") +ENDIF() +_detailed("# CMAKE_GENERATOR: ${CMAKE_GENERATOR}\n") + +IF(CMAKE_CROSSCOMPILING) + _both( + "#\n# CROSSCOMPILING!\n" + ) +ENDIF() + +IF(DEAL_II_STATIC_EXECUTABLE) + _both( + "#\n# STATIC LINKAGE!\n" + ) +ENDIF() + +_both("#\n") + +_detailed( +"# Compiler flags used for this build: +# DEAL_II_CXX_FLAGS: ${DEAL_II_CXX_FLAGS} +" + ) +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${DEAL_II_CXX_FLAGS_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${DEAL_II_CXX_FLAGS_DEBUG}\n") +ENDIF() + +_detailed("# DEAL_II_LINKER_FLAGS: ${DEAL_II_LINKER_FLAGS}\n") +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${DEAL_II_LINKER_FLAGS_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${DEAL_II_LINKER_FLAGS_DEBUG}\n") +ENDIF() + +_detailed("# DEAL_II_DEFINITIONS: ${DEAL_II_DEFINITIONS}\n") +IF(CMAKE_BUILD_TYPE MATCHES "Release") + _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${DEAL_II_DEFINITIONS_RELEASE}\n") +ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${DEAL_II_DEFINITIONS_DEBUG}\n") +ENDIF() + +_detailed("#\n") + +IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) + _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n") +ENDIF() +_both("# Configured Features (") +IF(DEFINED DEAL_II_ALLOW_BUNDLED) + _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ") +ENDIF() +IF(DEAL_II_FORCE_AUTODETECTION) + _both("!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, ") +ENDIF() +_both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n") + + +# +# Cache for quicker access to avoid the O(n^2) complexity of a loop over +# _all_ defined variables. +# + +GET_CMAKE_PROPERTY(_variables VARIABLES) +FOREACH(_var ${_variables}) + IF(_var MATCHES "DEAL_II_WITH") + LIST(APPEND _features "${_var}") + ELSEIF(_var MATCHES "DEAL_II_COMPONENT") + LIST(APPEND _components "${_var}") + ENDIF() +ENDFOREACH() + +FOREACH(_var ${_features}) + IF(${${_var}}) + # FEATURE is enabled + STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var}) + IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED) + _both("# ${_var} set up with external dependencies\n") + + # + # Print out version number: + # + IF(DEFINED ${_feature}_VERSION) + _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") + ENDIF() + + # + # Special version numbers: + # + IF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) + _detailed("# TBB_VERSION = ${TBB_VERSION}\n") + ENDIF() + IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION) + _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n") + ENDIF() + + # + # Print out ${_feature}_DIR: + # + IF(NOT "${${_feature}_DIR}" STREQUAL "") + _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") + ENDIF() + + # + # Print the feature configuration: + # + FOREACH(_var2 + CXX_COMPILER C_COMPILER Fortran_COMPILER LIBRARIES INCLUDE_DIRS + USER_INCLUDE_DIRS DEFINITIONS USER_DEFINITIONS CXX_FLAGS + LINKER_FLAGS + ) + IF(DEFINED ${_feature}_${_var2}) + _detailed("# ${_feature}_${_var2} = ${${_feature}_${_var2}}\n") + ENDIF() + ENDFOREACH() + + ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED) + + IF(DEAL_II_FORCE_BUNDLED_${_feature}) + _both("# ${_var} set up with bundled packages (forced)\n") + ELSE() + _both("# ${_var} set up with bundled packages\n") + ENDIF() + ELSE() + _both("# ${_var} = ${${_var}}\n") + ENDIF() + ELSE() + # FEATURE is disabled + _both("# ( ${_var} = ${${_var}} )\n") + ENDIF() +ENDFOREACH() + +_both( + "#\n# Component configuration:\n" + ) +FOREACH(_var ${_components}) + IF(_var MATCHES "DEAL_II_COMPONENT") + IF(${${_var}}) + _both("# ${_var}\n") + STRING(REPLACE "DEAL_II_COMPONENT_" "" _component ${_var}) + LIST(APPEND _components ${_component}) + ELSE() + _both("# ( ${_var} = ${${_var}} )\n") + ENDIF() + ENDIF() +ENDFOREACH() + +_summary( +"#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log +#\n# Run $ " + ) +IF(CMAKE_GENERATOR MATCHES "Ninja") + _summary("ninja info") +ELSE() +_summary("make help") +ENDIF() +_summary(" to print a help message with a list of top level targets\n") + +_both("#\n###") + + +######################################################################## +# # +# Dump the cache into config.cmake: # +# # +######################################################################## + +SET(_config_cmake "${CMAKE_BINARY_DIR}/config.cmake") +FILE(WRITE ${_config_cmake} +"# +# This is a raw CMake cache dump of this build directory suitable as an +# initial cache file: Use this file to preseed a CMake cache in an empty +# build directory by (note that it is still necessary to declare a source +# directory): +# $ cmake -C [...]/config.cmake ../deal.II +# +# If you want to have a clean configuration file have a look at +# doc/users/config.sample +#\n" + ) + +FUNCTION(_config _var) + # It is absolutely beyond my comprehension why on earth there is + # hardcoded logic built into CMake to throw an error if one uses + # uppercase variants of FindPACKAGE call variables... + IF(NOT _var MATCHES "BOOST_DIR") + UNSET(${_var}) + ENDIF() + # + # We have to get down to the raw entry in the cache, therefore clear the + # current value (and do it in a function to get private scope): + # + FILE(APPEND ${_config_cmake} + "SET(${_var} \"${${_var}}\" CACHE STRING \"\")\n" + ) +ENDFUNCTION() + +GET_CMAKE_PROPERTY(_variables CACHE_VARIABLES) +FOREACH(_var + CMAKE_C_COMPILER + CMAKE_CXX_COMPILER + CMAKE_Fortran_COMPILER + ${_variables} + ) + _config(${_var}) +ENDFOREACH() diff --git a/deal.II/doc/developers/cmake-internals.html b/deal.II/doc/developers/cmake-internals.html index aea4a22765..3517b168bb 100644 --- a/deal.II/doc/developers/cmake-internals.html +++ b/deal.II/doc/developers/cmake-internals.html @@ -292,13 +292,13 @@ CHECK_CXX_COMPILER_FLAG(flag variable)
  • Necessary compiler flags can easily set in the string variable - CMAKE_REQUIRED_FLAGS. There are two small macros - that do this job nicely: + CMAKE_REQUIRED_FLAGS. There is a small macro that does this + job nicely:
    -PUSH_TEST_FLAG("-Werror")
    +PUSH_CMAKE_REQUIRED("-Werror")
     CHECK_CXX_SOURCE_COMPILES(...)
    -POP_TEST_FLAG()
    +RESET_CMAKE_REQUIRED()
     
  • Necessary include directories and libraries necessary for diff --git a/deal.II/doc/developers/testsuite.html b/deal.II/doc/developers/testsuite.html index 793b94dbbc..a5ad48f8fb 100644 --- a/deal.II/doc/developers/testsuite.html +++ b/deal.II/doc/developers/testsuite.html @@ -5,7 +5,7 @@ The deal.II Testsuite - + @@ -55,7 +55,8 @@
  • Running the testsuite
    1. How to interpret the output
    2. -
    3. Parallelize testsuite configuration
    4. +
    5. Parallelizing testsuite configuration
    6. +
    7. Generating coverage information
  • Testsuite development
    1. @@ -334,10 +335,12 @@ xx: =============================== OUTPUT END ============================ -

      Parallelize testsuite configuration

      +

      Parallelizing testsuite configuration

      - If you have set up a good portion of the testsuite you'll notice that a + If you have set up the testsuite (or at least a few hundred tests by + providing a sufficiently general regular expression + as TEST_PICKUP_REGEX) you'll notice that a reconfiguration of the build directory takes a noticeable time (in the order of minutes instead of seconds) with Reconfiguring testsuite subprojects. @@ -348,11 +351,69 @@ xx: =============================== OUTPUT END ============================ variable.

      - Alternatively, you can use Ninja. + Alternatively, you can use Ninja as your build tool instead + of make.

      + +

      Generating coverage information

      + +

      + The testsuite can also be used to provide coverage information, + i.e., data that shows which lines of the library are executed how many + times by running through all of the tests in the testsuite. This is of + interest in finding places in the library that are not covered by + the testsuite and, consequently, are prone to the inadvertent + introduction of bugs since existing functionality is not subject to + existing tests. +

      + +

      + To run the testsuite in this mode, essentially, you have to do three + things: +

        +
      1. + build the library with appropriate profiling flags +
      2. +
      3. + run all or some tests (built with the same profiling flags) +
      4. +
      5. + gather all information and convert them to a viewable format. +
      6. +
      + In order to achieve the first two, configure the library with +
      +  cmake -DCMAKE_BUILD_TYPE=Debug -DDEAL_II_SETUP_COVERAGE=YES <...>
      +      
      + You can then build the library and run the tests as usual. +

      + +

      + For the last point, one can in principal use whatever tool one + wants. That said, the deal.II ctest driver already has builtin + functionality to gather all profiling files and submit them to cdash + where we already gather testsuite results + (see below). You can do so by invoking +

      +  ctest -DCOVERAGE=YES <...> -S ../tests/run_testsuite.cmake
      +      
      + when running the testsuite, or directly by +
      +	ctest <...> -S ../tests/run_coverage.cmake
      +      
      +

      + +

      + At the end of all of this, results will be shown in a separate section + "Coverage" at the + deal.II cdash site. +

      + +

      Testsuite development

      diff --git a/deal.II/doc/external-libs/p4est.html b/deal.II/doc/external-libs/p4est.html index a1255c0cf0..767b54df50 100644 --- a/deal.II/doc/external-libs/p4est.html +++ b/deal.II/doc/external-libs/p4est.html @@ -38,7 +38,7 @@ webpage). Then call the script as follows:
       
      -    ./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
             
      where p4est-x-y-z.tar.gz is the name of the p4est distribution file, and /path/to/installation is a @@ -50,14 +50,9 @@ line like
       
      -    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 <...>
             
      - if the p4est library isn't picked up automatically. Note the presence - of /FAST at the end of the path necessary when using - the ./p4est-setup.sh script to select the release - version of p4est. Obviously, you - can also add additional flags to cmake as described in - the general ReadMe file. + if the p4est library isn't picked up automatically.


      diff --git a/deal.II/doc/license/adjust.pl b/deal.II/doc/license/adjust.pl deleted file mode 100644 index d36541a325..0000000000 --- a/deal.II/doc/license/adjust.pl +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/perl -## --------------------------------------------------------------------- -## $Id$ -## -## Copyright (C) 2012 - 2013 by the deal.II Authors -## -## This file is part of the deal.II library. -## -## The deal.II library is free software; you can use it, redistribute -## it, and/or modify it under the terms of the GNU Lesser General -## Public License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## The full text of the license can be found in the file LICENSE at -## the top level of the deal.II distribution. -## -## --------------------------------------------------------------------- - -my $header=1; - -print << 'EOT' -//---------------------------------------------------------------------- -// $Id$ -// -// Copyright (C) 1998 - 2013 by the deal.II authors -// -// This file is part of the deal.II library. -// -// The deal.II library is free software; you can use it, redistribute -// it, and/or modify it under the terms of the GNU Lesser General -// Public License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// The full text of the license can be found in the file LICENSE at -// the top level of the deal.II distribution. -// -//---------------------------------------------------------------------- -EOT - ; - -while(<>) -{ - $header=0 unless m/\/\//; - next if $header; - print; -} diff --git a/deal.II/doc/license/replace.sh b/deal.II/doc/license/replace.sh deleted file mode 100755 index 5b87905cd3..0000000000 --- a/deal.II/doc/license/replace.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -## --------------------------------------------------------------------- -## $Id$ -## -## Copyright (C) 2012 - 2013 by the deal.II Authors -## -## This file is part of the deal.II library. -## -## The deal.II library is free software; you can use it, redistribute -## it, and/or modify it under the terms of the GNU Lesser General -## Public License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## The full text of the license can be found in the file LICENSE at -## the top level of the deal.II distribution. -## -## --------------------------------------------------------------------- - -FILE=$1 - -FIRST_YEAR=$(grep Copyright $FILE | perl -pi -e 's/.*?(\d{4}).*/\1/') -if [ "$FIRST_YEAR" = "2013" ] || (! [[ "$FIRST_YEAR" =~ "^[0-9]+$" ]]) -then - YEAR="2013" -else if - YEAR="$FIRST_YEAR - 2013" -fi - -sed -e "s/@YEAR@/$YEAR/" doc/license/header-template > /tmp/foobar22.temp - -header_lines=1 -on_whitespace=true -whitespace_detected=false -while read line -do - if $on_whitespace && [[ $line =~ "^$" ]] - then - whitespace_detected=true - header_lines=$[$header_lines+1] - continue - else - on_whitespace=false - fi - - if ! [[ $line =~ "^//.*$" ]] - then - break - else - header_lines=$[$header_lines+1] - fi -done < $FILE - -if $whitespace_detected -then - echo "$FILE --> whitespace" - echo "$FILE --> $header_lines" -else - if [ $header_lines -lt 10 ] - then - echo "$FILE --> $header_lines" - fi -fi - -tail -n+$header_lines $FILE >> /tmp/foobar22.temp - -cp /tmp/foobar22.temp $FILE - diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index c58ef940bd..73d5cb20e9 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -50,6 +50,24 @@ inconvenience this causes.
        +
      1. Changed: It was possible to call DoFAccessor::set_active_fe_index() + on non-active cells. However, this made no sense: Since degrees of + freedoms only exist on active cells + for hp::DoFHandler (i.e., there is currently no implementation + of multilevel hp::DoFHandler objects), it does not make sense + to assign active FE indices to non-active cells since they + do not have finite element spaces associated with them without + having any degrees of freedom. +
        + The same of course is true for asking for the finite element active + on a non-active cell, i.e. using the functions + DoFAccessor::active_fe_index() and + DoFAccessor::get_fe(). All of these functions now produce exceptions on + non-active cells. +
        + (Wolfgang Bangerth, 2014/01/24) +
      2. +
      3. New: deal.II now links with the BOOST Iostreams library (at least if the libz and libbz2 libraries @@ -84,6 +102,67 @@ inconvenience this causes.

        Specific improvements

          +
        1. New/fixed: The ParameterHandler::print_parameters_section + method not worked for XML output. There is now a flag + include_top_level_elements which prints all higher + subsection elements, default is false. + For XML output setting this flag to true is required + to ensure that the output is a valid XML document, + starting with one root element ParameterHandler and + compatible with read_input_from_xml and the parameterGUI. +
          + (Martin Steigemann, 2014/02/01) + +
        2. New: There is now a method to copy the content from a + PETScWrappers::MPI::Vector and TrilinosWrappers::MPI::Vector to + deal.II's parallel distributed vector. +
          + (Ben Thompson, Martin Kronbichler, 2014/01/31) + +
        3. Fixed: The SolutionTransfer class had all sorts of problems when + used with hp::DoFHandler that made its results at least questionable. + Several parts of this class have been rewritten to make the results + more predictable and, likely, more correct. +
          + (Wolfgang Bangerth, 2014/01/26) + +
        4. Fixed: A regression where a single whitespace accidentally added to + DEAL_II_LINKER_FLAGS internally prevented cmake-2.8.8 from configuring + sucessfully. +
          + (Matthias Maier, Krysztof Bzowski, 2014/01/26) + +
        5. Fixed: SparsityPattern::max_entries_per_row() forgot to consider + the last row of the matrix and consequently sometimes returned + wrong values. This is now fixed. +
          + (Martin Kronbichler, 2014/01/22) +
        6. + +
        7. Improved: In rare cases when the vector of error indicators + has entries equal to zero the adjust_interesting_range method + produces a negative lower bound. As a result the + parallel::distributed::GridRefinement::refine_and_coarsen_fixed_* + methods flagged the wrong number of cells for coarsening and refinement. + This is now changed by adjusting the lower bound in adjust_interesting_range + only, if not equal to zero. +
          + (Martin Steigemann, 2014/01/22) +
        8. + +
        9. Changed: It was previously possible to set the + active_fe_index on non-active cells of an hp::DoFHandler. + However, this was prone to mistakes because it may lead to the assumption + that a finite element space out of the ones described by the hp::FECollection + associated with this hp::DoFHandler was actually associated with such + a cell. Since we do not actually distribute degrees of freedom for such + hp::DoFHandler objects on non-active cells, this is not the case. Consequently, + it no longer has any effect to assign active FE indices to non-active cells: + these values are simply reset later on. +
          + (Wolfgang Bangerth, 2014/01/20) +
        10. +
        11. Fixed: The method DoFTools::extract_constant_modes only worked for elements where the constant function 1 is represented by all ones. This is now fixed by querying the element for its constant modes on each cell. @@ -105,13 +184,14 @@ inconvenience this causes. space. Doing so now raises an exception.
          However, there are legitimate cases where one may want to interpolate - from children to a parent's finite element space. Since in the hp + from children to a parent's finite element space or the other way around. + Since in the hp case no finite element space is naturally associated with an inactive cell, it is now possible to pass an explicit finite element index - argument to the function specifying which element of an hp::FECollection + argument to these functions specifying which element of an hp::FECollection object describes the space onto which you want to interpolate.
          - (Wolfgang Bangerth, 2014/01/18) + (Mihai Alexe, Wolfgang Bangerth, 2014/01/18)
        12. Fixed: The methods IndexSet::do_compress() and diff --git a/deal.II/doc/publications/index.html b/deal.II/doc/publications/index.html index 8850757a45..f33462423a 100644 --- a/deal.II/doc/publications/index.html +++ b/deal.II/doc/publications/index.html @@ -132,7 +132,7 @@

          Older Releases

          - +
          1. Wolfgang Bangerth, Timo Heister, Luca Heltai, Guido Kanschat, Martin Kronbichler, Matthias Maier, and Toby D. Young
            @@ -288,12 +288,32 @@ International Journal of Heat and Mass Transfer, vol. 71, pp. 183-188, 2014.
          2. +
          3. + M. Hintermüller, A. Schiela, W. Wollner +
            + The length of the primal-dual path in + Moreau-Yosida-based path-following for state constrained + optimal control + +
            + SIAM J. Optim., vol. 24, pp. 108-126, 2014. +
          4. +
          5. T. Wick, G. Singh, M.F. Wheeler
            Pressurized-Fracture propagation using a phase-field approach coupled to a reservoir simulator
            - SPE 168597-MS, SPE HFTC Proc. 2014. + SPE 168597-MS, SPE HFTC Proc., 2014. +
          6. + +
          7. M.F. Wheeler, T. Wick, W. Wollner +
            + An Augmented-Lagrangian Method for the Phase-Field Approach for +Pressurized Fractures + +
            + Comput. Methods Appl. Mech. Engrg., vol. 271, pp. 69-85, 2014.
          @@ -763,6 +783,13 @@ arXiv:1303.7005, submitted, 2013.
        13. +
        14. M. R. Opmeer, T. Reis, W. Wollner +
          + Finite-Rank ADI Iteration for Operator Lyapunov Equations +
          + SIAM J. Control Optim., vol. 51, pp. 4084-4117, 2013. +
        15. +
        16. T. Povall
          Single Crystal Plasticity at Finite Strains: A Computational Investigation of Hardening Relations @@ -1266,7 +1293,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with DOI: 10.1103/PhysRevB.88.125308
        17. - +
        18. R. Hartmann @@ -1289,17 +1316,6 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with arXiv:1209.2811 [math.NA], 2012.
        19. -
        20. - M. Hintermüller, A. Schiela, W. Wollner -
          - The length of the primal-dual path in - Moreau-Yosida-based path-following for state constrained - optimal control - -
          - IGB-Report 57, Karl-Franzens-University Graz, Austria, 2012. -
        21. -
        22. M. Hinze, M. Kunkel, A. Steinbrecher, T. Stykel
          Model order reduction of coupled circuit-device systems diff --git a/deal.II/examples/step-1/doc/intro.dox b/deal.II/examples/step-1/doc/intro.dox index d4f763a4ba..d4b8e8a85c 100644 --- a/deal.II/examples/step-1/doc/intro.dox +++ b/deal.II/examples/step-1/doc/intro.dox @@ -111,6 +111,17 @@ end of the results section of this program, where we also provide a few links to other useful pieces of information. +

          Video lectures on tutorial programs

          + +This and several of the other tutorial programs are also discussed and +demonstrated in Wolfgang +Bangerth's video lectures on deal.II and computational science. In +particular, you can see the steps he executes to run this and other +programs, and you will get a much better idea of the tools that can be +used to work with deal.II. + +

          What this program does

          Let's come back to step-1, the current program. @@ -148,7 +159,7 @@ that we typically train mathematicians, engineers, or scientists in but that is important when you start writing software of more than a few hundred lines. Remember: Producing software is not the same as just writing code. -To make your life easier on this journey let us point to two resources that +To make your life easier on this journey let us point to three resources that are worthwhile browsing through before you start any large-scale programming: - The Best + Practices for Scientific Computing that gives an introduction to + many of the ways by which you can make sure you are an efficient + programmer writing programs that work. + As a general recommendation: If you expect to spend more than a few days writing software in the future, do yourself the favor of learning tools that can make your life more productive, in particular debuggers and integrated development environments. You will find that you will get the time spent learning these tools back severalfold soon by being more productive! +Several of the video lectures referenced above show how to use tools +such as integrated development environments or debuggers. diff --git a/deal.II/examples/step-1/doc/results.dox b/deal.II/examples/step-1/doc/results.dox index 751a3910b8..7cd2eebf64 100644 --- a/deal.II/examples/step-1/doc/results.dox +++ b/deal.II/examples/step-1/doc/results.dox @@ -1,7 +1,6 @@

          Results

          -The program has, after having been run, produced two grids, which look -like this: +Running the program produces graphics of two grids (grid-1.eps and grid-2.eps). They look like this: diff --git a/deal.II/examples/step-1/step-1.cc b/deal.II/examples/step-1/step-1.cc index 96da272b2b..eab42734ff 100644 --- a/deal.II/examples/step-1/step-1.cc +++ b/deal.II/examples/step-1/step-1.cc @@ -75,6 +75,7 @@ void first_grid () std::ofstream out ("grid-1.eps"); GridOut grid_out; grid_out.write_eps (triangulation, out); + std::cout << "Grid written to grid-1.eps" << std::endl; } @@ -190,6 +191,7 @@ void second_grid () GridOut grid_out; grid_out.write_eps (triangulation, out); + std::cout << "Grid written to grid-2.eps" << std::endl; // At this point, all objects created in this function will be destroyed in // reverse order. Unfortunately, we defined the boundary object after the diff --git a/deal.II/examples/step-17/doc/results.dox b/deal.II/examples/step-17/doc/results.dox index 9720ab3172..cb545b7eee 100644 --- a/deal.II/examples/step-17/doc/results.dox +++ b/deal.II/examples/step-17/doc/results.dox @@ -1,18 +1,26 @@

          Results

          -If the program above is compiled and run on a single processor machine, it -should generate results that are very similar to those that we already got -with step-8. However, it becomes more interesting if we run it on a cluster of -computers. Most clusters have some kind of scheduling system, all of which -have different calling syntaxes - on my system, I have to use the command -bsub with a whole host of options to run a job in parallel - so -that the exact command line syntax varies. If you have found out how to run a -job on your system, you should get output like this for a job on 8 processors, -and with a few more refinement cycles than in the code above (these -results were generated in 2004 with older versions of deal.II and a -version of METIS that generated different partitionings; consequently, -the numbers you get today are slightly different): +If the program above is compiled and run on a single processor +machine, it should generate results that are very similar to those +that we already got with step-8. However, it becomes more interesting +if we run it on a multicore machine or a cluster of computers. The +most basic way to run MPI programs is using a command line like +@code + mpirun -np 32 ./step-17 +@endcode +to run the step-17 executable with 32 processors. + +The command line above is the appropriate way of starting the program +on a multicore machine when using MPI for parallelization. On the +other hand, most clusters are shared resources and have some kind of +scheduling system that distributes jobs onto available processors. All +of these scheduling systems have their own calling syntax - on my system, I have to use the command +qsub with a whole host of options to run a job in parallel - so +that the exact command line syntax varies. + +Whether directly or through a scheduler, if you run this program on 8 +processors, you should get output like the following: @code Cycle 0: Number of active cells: 64 @@ -84,8 +92,10 @@ Cycle 16: 471186+470686+475694) Solver converged in 2251 iterations. @endcode - - +(This run uses a few more refinement cycles than the code available in +the examples/ directory. The run also used a version of METIS from +2004 that generated different partitionings; consequently, +the numbers you get today are slightly different.) As can be seen, we can easily get to almost four million unknowns. In fact, the code's runtime with 8 processes was less than 7 minutes up to (and including) diff --git a/deal.II/examples/step-2/step-2.cc b/deal.II/examples/step-2/step-2.cc index b3c9d2debb..5f43d944ab 100644 --- a/deal.II/examples/step-2/step-2.cc +++ b/deal.II/examples/step-2/step-2.cc @@ -47,7 +47,7 @@ // resulting from the distribution of degrees of freedom on the grid. That // class can be found here: #include -// We will also need to use an intermediate sparsity patter structure, which +// We will also need to use an intermediate sparsity pattern structure, which // is found in this file: #include diff --git a/deal.II/examples/step-32/doc/results.dox b/deal.II/examples/step-32/doc/results.dox index ca0d584e14..d26392b17d 100644 --- a/deal.II/examples/step-32/doc/results.dox +++ b/deal.II/examples/step-32/doc/results.dox @@ -38,10 +38,19 @@ cluster at Texas A&M University.

          Results for a 2d circular shell testcase

          +Next, we will run step-32 with the parameter file in the directory. Here we +are using 50 processors. The command to launch is (note that step-32.prm is +the default): -If we run the program as shown above (with the parameter file in the -directory), the output will look roughly -like this when run on 50 processors: + +
          +$ mpirun -n 50 ./step-32
          +
          +
          + +Note that running a job on a cluster typically requires going through a job +scheduler, which we won't discuss here. The output will look roughly like +this:
          diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc
          index d6ed24c0e9..f2bc57d2d2 100644
          --- a/deal.II/examples/step-4/step-4.cc
          +++ b/deal.II/examples/step-4/step-4.cc
          @@ -172,9 +172,9 @@ template 
           double RightHandSide::value (const Point &p,
                                             const unsigned int /*component*/) const
           {
          -  double return_value = 0;
          +  double return_value = 0.0;
             for (unsigned int i=0; iprevious_residual_norm to the most negative value
          +  // representable with double precision numbers so that the
          +  // comparison whether the current residual is less than that of the
          +  // previous step will always fail in the first step.
             template 
             void
             PlasticityContactProblem::solve_newton ()
          @@ -1701,7 +1705,8 @@ namespace Step42
               TrilinosWrappers::MPI::Vector locally_relevant_tmp_vector(locally_relevant_dofs, mpi_communicator);
               TrilinosWrappers::MPI::Vector distributed_solution(locally_owned_dofs, mpi_communicator);
           
          -    double residual_norm, previous_residual_norm;
          +    double residual_norm;
          +    double previous_residual_norm = -std::numeric_limits::max();
           
               const double correct_sigma = sigma_0;
           
          diff --git a/deal.II/include/deal.II/base/event.h b/deal.II/include/deal.II/base/event.h
          index a62e98643d..1cf7b27e73 100644
          --- a/deal.II/include/deal.II/base/event.h
          +++ b/deal.II/include/deal.II/base/event.h
          @@ -202,7 +202,7 @@ namespace Algorithms
           
               const unsigned int n = flags.size();
               const unsigned int m = event.flags.size();
          -    const unsigned int n_min = std::min(n, m);
          +    const unsigned int n_min = (n((index),0,(range)))
          diff --git a/deal.II/include/deal.II/base/index_set.h b/deal.II/include/deal.II/base/index_set.h
          index 166a642a23..2ed89bee18 100644
          --- a/deal.II/include/deal.II/base/index_set.h
          +++ b/deal.II/include/deal.II/base/index_set.h
          @@ -1,7 +1,7 @@
           // ---------------------------------------------------------------------
           // $Id$
           //
          -// Copyright (C) 2009 - 2013 by the deal.II authors
          +// Copyright (C) 2009 - 2014 by the deal.II authors
           //
           // This file is part of the deal.II library.
           //
          @@ -743,17 +743,12 @@ IndexSet::nth_index_in_set (const unsigned int n) const
                 range_end   = ranges.end();
               }
           
          -  std::vector::const_iterator
          +  const std::vector::const_iterator
             p = Utilities::lower_bound(range_begin, range_end, r,
                                        Range::nth_index_compare);
           
          -  if (p != ranges.end())
          -    return p->begin + (n-p->nth_index_in_set);
          -  else
          -    {
          -      Assert (false, ExcInternalError());
          -      return numbers::invalid_dof_index;
          -    }
          +  Assert (p != ranges.end(), ExcInternalError());
          +  return p->begin + (n-p->nth_index_in_set);
           }
           
           
          diff --git a/deal.II/include/deal.II/base/parameter_handler.h b/deal.II/include/deal.II/base/parameter_handler.h
          index 2e1ce3b072..a45d621ef1 100644
          --- a/deal.II/include/deal.II/base/parameter_handler.h
          +++ b/deal.II/include/deal.II/base/parameter_handler.h
          @@ -1769,7 +1769,7 @@ public:
           
             /**
              * Print all parameters with the given style to out. Presently
          -   * only Text and LaTeX are implemented.
          +   * only Text, LaTeX and XML are implemented.
              *
              * In Text format, the output is formatted in such a way that it
              * is possible to use it for later input again. This is most useful to
          @@ -1782,6 +1782,10 @@ public:
              * well as the documenting string given to the declare_entry() function
              * if available.
              *
          +   * In XML format, the output starts with one root element
          +   * ParameterHandler in order to get a valid XML document
          +   * and all subsections under it.
          +   * 
              * In Text format, the output contains the same information but
              * in a format so that the resulting file can be input into a latex
              * document such as a manual for the code for which this object handles
          @@ -1817,12 +1821,18 @@ public:
              * by entering and leaving subsections through the enter_subsection() and
              * leave_subsection() functions.
              *
          +   * If include_top_level_elements is true, also
          +   * the higher subsection elements are printed. In XML format
          +   * this is required to get a valid XML document and output starts
          +   * with one root element ParameterHandler.
          +   * 
              * In most cases, you will not want to use this function directly, but
              * have it called recursively by the previous function.
              */
             void print_parameters_section (std::ostream       &out,
                                            const OutputStyle   style,
          -                                 const unsigned int  indent_level);
          +                                 const unsigned int  indent_level,
          +                                 const bool          include_top_level_elements = false);
           
             /**
              * Print parameters to a logstream. This function allows to print all
          diff --git a/deal.II/include/deal.II/base/symmetric_tensor.h b/deal.II/include/deal.II/base/symmetric_tensor.h
          index 93ffc6296a..66814824fe 100644
          --- a/deal.II/include/deal.II/base/symmetric_tensor.h
          +++ b/deal.II/include/deal.II/base/symmetric_tensor.h
          @@ -1,7 +1,7 @@
           // ---------------------------------------------------------------------
           // $Id$
           //
          -// Copyright (C) 2005 - 2013 by the deal.II authors
          +// Copyright (C) 2005 - 2014 by the deal.II authors
           //
           // This file is part of the deal.II library.
           //
          @@ -1061,6 +1061,17 @@ namespace internal
           {
             namespace SymmetricTensorAccessors
             {
          +    template 
          +    Accessor::
          +    Accessor ()
          +      :
          +      tensor (*static_cast(0)),
          +      previous_indices ()
          +    {
          +      Assert (false, ExcMessage ("You can't call the default constructor of this class."));
          +    }
          +
          +
               template 
               Accessor::
               Accessor (tensor_type              &tensor,
          @@ -1071,6 +1082,15 @@ namespace internal
               {}
           
           
          +    template 
          +    Accessor::
          +    Accessor (const Accessor &a)
          +      :
          +      tensor (a.tensor),
          +      previous_indices (a.previous_indices)
          +    {}
          +
          +
           
               template 
               Accessor
          @@ -1082,6 +1102,18 @@ namespace internal
           
           
           
          +    template 
          +    Accessor::
          +    Accessor ()
          +      :
          +      tensor (*static_cast(0)),
          +      previous_indices ()
          +    {
          +      Assert (false, ExcMessage ("You can't call the default constructor of this class."));
          +    }
          +
          +
          +
               template 
               Accessor::
               Accessor (tensor_type              &tensor,
          @@ -1093,6 +1125,16 @@ namespace internal
           
           
           
          +    template 
          +    Accessor::
          +    Accessor (const Accessor &a)
          +      :
          +      tensor (a.tensor),
          +      previous_indices (a.previous_indices)
          +    {}
          +
          +
          +
               template 
               typename Accessor::reference
               Accessor::operator[] (const unsigned int i)
          diff --git a/deal.II/include/deal.II/distributed/tria.h b/deal.II/include/deal.II/distributed/tria.h
          index ce0a862fb2..b00a01b224 100644
          --- a/deal.II/include/deal.II/distributed/tria.h
          +++ b/deal.II/include/deal.II/distributed/tria.h
          @@ -514,17 +514,20 @@ namespace parallel
                  * Save the refinement information from the coarse mesh into the given
                  * file. This file needs to be reachable from all nodes in the computation
                  * on a shared network file system. See the SolutionTransfer class
          -       * on how to store solution vectors into this file.
          +       * on how to store solution vectors into this file. Additional cell-based data can be saved
          +       * using register_data_attach().
                  */
                 void save(const char *filename) const;
           
                 /**
                  * Load the refinement information saved with save() back in. The mesh
          -       * must contain the same coarse mesh that was used in save(). You do not
          +       * must contain the same coarse mesh that was used in save() before calling
          +       * this function. You do not
                  * need to load with the same number of MPI processes that you saved
                  * with. Rather, if a mesh is loaded with a different number of MPI
                  * processes than used at the time of saving, the mesh is repartitioned
          -       * appropriately.
          +       * appropriately. Cell-based data that was saved with register_data_attach()
          +       * can be read in with notify_ready_to_unpack() after calling load().
                  */
                 void load(const char *filename);
           
          diff --git a/deal.II/include/deal.II/dofs/dof_accessor.h b/deal.II/include/deal.II/dofs/dof_accessor.h
          index 885eeff0ee..038443436e 100644
          --- a/deal.II/include/deal.II/dofs/dof_accessor.h
          +++ b/deal.II/include/deal.II/dofs/dof_accessor.h
          @@ -1,7 +1,7 @@
           // ---------------------------------------------------------------------
           // $Id$
           //
          -// Copyright (C) 1998 - 2013 by the deal.II authors
          +// Copyright (C) 1998 - 2014 by the deal.II authors
           //
           // This file is part of the deal.II library.
           //
          @@ -1448,7 +1448,7 @@ public:
              * cells.
              *
              * In principle, it works as follows: if the cell pointed to by this
          -   * object is terminal, then the dof values are set in the global
          +   * object is terminal (i.e., has no children), then the dof values are set in the global
              * data vector by calling the set_dof_values() function; otherwise,
              * the values are prolonged to each of the children and this
              * function is called for each of them.
          @@ -1467,6 +1467,22 @@ public:
              * requirements are not taken care of and must be enforced by the
              * user afterward.
              *
          +   * If the cell is part of a hp::DoFHandler object, cells only have an
          +   * associated finite element space if they are active. However, this
          +   * function is supposed to also work on inactive cells
          +   * with children. Consequently, it carries a third argument that can be
          +   * used in the hp context that denotes the finite element space we are
          +   * supposed to interpret the input vector of this function in.
          +   * If the cell is active, this function
          +   * then interpolates the input vector interpreted as an element of the space described
          +   * by the fe_indexth element of the hp::FECollection associated
          +   * with the hp::DoFHandler of which this cell is a part of, and interpolates
          +   * it into the space that is associated with this cell. On the other hand, if the cell
          +   * is not active, then we first perform this interpolation from this cell
          +   * to its children using the given fe_index until we end
          +   * up on an active cell, at which point we follow the procedure outlined
          +   * at the beginning of the paragraph.
          +   *
              * It is assumed that both vectors already have the right size
              * beforehand. This function relies on the existence of a natural
              * interpolation property of finite element spaces of a cell to its
          @@ -1477,17 +1493,10 @@ public:
              * element class for a description of what the prolongation matrices
              * represent in this case.
              *
          -   * Unlike the set_dof_values() function, this function is associated
          -   * to cells rather than to lines, quads, and hexes, since
          -   * interpolation is presently only provided for cells by the finite
          -   * element objects.
          -   *
          -   * The output vector may be either a Vector, Vector,
          -   * or a BlockVector, or a PETSc vector if deal.II is
          -   * compiled to support these libraries. It is in the responsibility
          -   * of the caller to assure that the types of the numbers stored in
          -   * input and output vectors are compatible and with similar
          -   * accuracy.
          +   * @note Unlike the get_dof_values() function, this function is only available
          +   * on cells, rather than on lines, quads, and hexes, since interpolation
          +   * is presently only provided for cells by the finite element
          +   * classes.
              */
             template 
             void set_dof_values_by_interpolation (const Vector &local_values,
          @@ -1651,18 +1660,47 @@ public:
              * this iterator. For non-hp DoF handlers, this is of course always
              * the same element, independent of the cell we are presently on,
              * but for hp DoF handlers, this may change from cell to cell.
          +   *
          +   * @note Since degrees of freedoms only exist on active cells
          +   * for hp::DoFHandler (i.e., there is currently no implementation
          +   * of multilevel hp::DoFHandler objects), it does not make sense
          +   * to query the finite element on non-active cells since they
          +   * do not have finite element spaces associated with them without
          +   * having any degrees of freedom. Consequently, this function will
          +   * produce an exception when called on non-active cells.
              */
             const FiniteElement &
             get_fe () const;
           
             /**
          -   *  Returns the index inside the hp::FECollection of the
          -   *  FiniteElement used for this cell.
          +   * Returns the index inside the hp::FECollection of the
          +   * FiniteElement used for this cell. This function is
          +   * only useful if the DoF handler object associated with
          +   * the current cell is an hp::DoFHandler.
          +   *
          +   * @note Since degrees of freedoms only exist on active cells
          +   * for hp::DoFHandler (i.e., there is currently no implementation
          +   * of multilevel hp::DoFHandler objects), it does not make sense
          +   * to query active FE indices on non-active cells since they
          +   * do not have finite element spaces associated with them without
          +   * having any degrees of freedom. Consequently, this function will
          +   * produce an exception when called on non-active cells.
              */
             unsigned int active_fe_index () const;
           
             /**
          -   *  Sets the index of the FiniteElement used for this cell.
          +   * Sets the index of the FiniteElement used for this cell. This
          +   * determines which element in an hp::FECollection to use. This function is
          +   * only useful if the DoF handler object associated with
          +   * the current cell is an hp::DoFHandler.
          +   *
          +   * @note Since degrees of freedoms only exist on active cells
          +   * for hp::DoFHandler (i.e., there is currently no implementation
          +   * of multilevel hp::DoFHandler objects), it does not make sense
          +   * to assign active FE indices to non-active cells since they
          +   * do not have finite element spaces associated with them without
          +   * having any degrees of freedom. Consequently, this function will
          +   * produce an exception when called on non-active cells.
              */
             void set_active_fe_index (const unsigned int i);
             /**
          diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h
          index 2c9af2dcc0..9b689af2ab 100644
          --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h
          +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h
          @@ -3439,6 +3439,13 @@ inline
           const FiniteElement &
           DoFCellAccessor::get_fe () const
           {
          +  Assert ((dynamic_cast*>
          +	   (this->dof_handler) != 0)
          +	  ||
          +	  (this->has_children() == false),
          +          ExcMessage ("In hp::DoFHandler objects, finite elements are only associated "
          +		      "with active cells. Consequently, you can not ask for the "
          +		      "active finite element on cells with children."));
             return dealii::internal::DoFAccessor::get_fe (this->dof_handler->get_fe(), active_fe_index());
           }
           
          @@ -3449,6 +3456,14 @@ inline
           unsigned int
           DoFCellAccessor::active_fe_index () const
           {
          +  Assert ((dynamic_cast*>
          +	   (this->dof_handler) != 0)
          +	  ||
          +	  (this->has_children() == false),
          +          ExcMessage ("You can not ask for the active_fe_index on a cell that has "
          +                      "children because no degrees of freedom are assigned "
          +                      "to this cell and, consequently, no finite element "
          +		      "is associated with it."));
             return dealii::internal::DoFCellAccessor::Implementation::active_fe_index (*this);
           }
           
          @@ -3459,6 +3474,13 @@ inline
           void
           DoFCellAccessor::set_active_fe_index (const unsigned int i)
           {
          +  Assert ((dynamic_cast*>
          +	   (this->dof_handler) != 0)
          +	  ||
          +	  (this->has_children() == false),
          +          ExcMessage ("You can not set the active_fe_index on a cell that has "
          +                      "children because no degrees of freedom will be assigned "
          +                      "to this cell."));
             dealii::internal::DoFCellAccessor::Implementation::set_active_fe_index (*this, i);
           }
           
          diff --git a/deal.II/include/deal.II/fe/fe_q_hierarchical.h b/deal.II/include/deal.II/fe/fe_q_hierarchical.h
          index 54fe8b4e63..fd6602c5b1 100644
          --- a/deal.II/include/deal.II/fe/fe_q_hierarchical.h
          +++ b/deal.II/include/deal.II/fe/fe_q_hierarchical.h
          @@ -310,6 +310,8 @@ public:
             std::vector >
             hp_vertex_dof_identities (const FiniteElement &fe_other) const;
           
          +  /*@}*/
          +
             /**
              * Return the matrix interpolating from a face of one
              * element to the face of the neighboring element. The
          diff --git a/deal.II/include/deal.II/grid/filtered_iterator.h b/deal.II/include/deal.II/grid/filtered_iterator.h
          index c6a4c56f84..6356cd160a 100644
          --- a/deal.II/include/deal.II/grid/filtered_iterator.h
          +++ b/deal.II/include/deal.II/grid/filtered_iterator.h
          @@ -357,7 +357,7 @@ namespace IteratorFilters
            * @endcode
            * Note that by the @p set_to_next_positive call the first cell with
            * a set user flag was assigned to the @p begin iterator. For the
          - * @{end} iterator, no such call was necessary, since the past-the-end
          + * #end iterator, no such call was necessary, since the past-the-end
            * iterator always satisfies all predicates.
            *
            * The same can be achieved by the following snippet, though harder to read:
          diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h
          index 433ff1856b..87a8552b8f 100644
          --- a/deal.II/include/deal.II/grid/tria.h
          +++ b/deal.II/include/deal.II/grid/tria.h
          @@ -485,7 +485,7 @@ namespace internal
            *    typedef quad_iterator        cell_iterator;
            *    typedef active_quad_iterator active_cell_iterator;
            *
          -*    typedef line_iterator        face_iterator;
          + *    typedef line_iterator        face_iterator;
            *    typedef active_line_iterator active_face_iterator;
            *  @endcode
            *
          diff --git a/deal.II/include/deal.II/hp/mapping_collection.h b/deal.II/include/deal.II/hp/mapping_collection.h
          index 512a6872b4..117d76bee0 100644
          --- a/deal.II/include/deal.II/hp/mapping_collection.h
          +++ b/deal.II/include/deal.II/hp/mapping_collection.h
          @@ -148,16 +148,15 @@ namespace hp
             {
             private:
               /**
          -     * A static MappingQ1
          -     * object. We can't use the one
          -     * in ::StaticMappingQ1 since
          -     * we can't make sure that the
          -     * constructor for that object
          -     * is run before the
          -     * constructor for the present
          -     * static object.
          +     * A static MappingQ1 object. We can't use the one in ::StaticMappingQ1
          +     * since we can't make sure that the constructor for that object is run
          +     * before we want to use the object (when constructing mapping_collection
          +     * below).  Therefore we create a helper function which returns a
          +     * reference to a static object that will be constructed the first time
          +     * this function is called.
                */
          -    static MappingQ1 mapping_q1;
          +      static
          +      MappingQ1& return_static_mapping_q1();
           
             public:
               /**
          diff --git a/deal.II/include/deal.II/lac/chunk_sparse_matrix.h b/deal.II/include/deal.II/lac/chunk_sparse_matrix.h
          index e9ef398417..10d3831d8c 100644
          --- a/deal.II/include/deal.II/lac/chunk_sparse_matrix.h
          +++ b/deal.II/include/deal.II/lac/chunk_sparse_matrix.h
          @@ -118,7 +118,7 @@ namespace ChunkSparseMatrixIterators
                * Return a reference to the matrix into which this accessor points. Note
                * that in the present case, this is a constant reference.
                */
          -    MatrixType &get_matrix () const;
          +    const MatrixType &get_matrix () const;
           
             private:
               /**
          @@ -791,11 +791,8 @@ public:
                        const size_type j) const;
           
             /**
          -   * Return the main diagonal
          -   * element in the ith
          -   * row. This function throws an
          -   * error if the matrix is not
          -   * quadratic.
          +   * Return the main diagonal element in the ith row. This function
          +   * throws an error if the matrix is not quadratic.
              *
              * This function is considerably faster than the operator()(), since for
              * quadratic matrices, the diagonal entry may be the first to be stored in
          @@ -810,6 +807,21 @@ public:
              */
             number &diag_element (const size_type i);
           
          +  /**
          +   * Extracts a copy of the values and indices in the given matrix row.
          +   *
          +   * The user is expected to pass the length of the arrays column_indices and
          +   * values, which gives a means for checking that we do not write to
          +   * unallocated memory. This method is motivated by a similar method in
          +   * Trilinos row matrices and gives faster access to entries in the matrix as
          +   * compared to iterators which are quite slow for this matrix type.
          +   */
          +  void extract_row_copy (const size_type row,
          +                         const size_type array_length,
          +                         size_type      &row_length,
          +                         size_type      *column_indices,
          +                         number         *values) const;
          +
           //@}
             /**
              * @name Matrix vector multiplications
          @@ -1650,7 +1662,7 @@ namespace ChunkSparseMatrixIterators
           
             template 
             inline
          -  typename Accessor::MatrixType &
          +  const typename Accessor::MatrixType &
             Accessor::get_matrix () const
             {
               return *matrix;
          diff --git a/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h b/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
          index 62f8409c8f..188a020e40 100644
          --- a/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
          +++ b/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h
          @@ -596,6 +596,60 @@ ChunkSparseMatrix::add (const number factor,
           }
           
           
          +
          +template 
          +void
          +ChunkSparseMatrix::extract_row_copy (const size_type row,
          +                                             const size_type array_length,
          +                                             size_type &row_length,
          +                                             size_type *column_indices,
          +                                             number *values) const
          +{
          +  AssertIndexRange(cols->row_length(row), array_length+1);
          +  AssertIndexRange(row, m());
          +  const unsigned int chunk_size = cols->get_chunk_size();
          +  const size_type reduced_row = row/chunk_size;
          +
          +  SparsityPattern::iterator it = cols->sparsity_pattern.begin(reduced_row),
          +    itend = cols->sparsity_pattern.end(reduced_row);
          +  const number *val_ptr = &val[(it-cols->sparsity_pattern.begin(0))*chunk_size*chunk_size
          +                               +(row%chunk_size)*chunk_size];
          +
          +  // find out if we did padding and if this row is affected by it
          +  if (cols->n_cols() % chunk_size == 0)
          +    {
          +      for ( ; it < itend; ++it)
          +        {
          +          for (unsigned int c=0; ccolumn()*chunk_size+c;
          +            }
          +          val_ptr += chunk_size*chunk_size;
          +        }
          +      row_length = chunk_size * (cols->sparsity_pattern.row_length(reduced_row));
          +    }
          +  else
          +    {
          +      const unsigned int last_chunk_size = cols->n_cols() % chunk_size;
          +      row_length = 0;
          +      for ( ; it < itend; ++it)
          +        {
          +          const unsigned int next_chunk_size =
          +            (it->column()==cols->sparsity_pattern.n_cols()-1) ?
          +            last_chunk_size : chunk_size;
          +          for (unsigned int c=0; ccolumn()*chunk_size+c;
          +            }
          +          val_ptr += chunk_size*chunk_size;
          +        }
          +    }
          +}
          +
          +
          +
           template 
           template 
           void
          diff --git a/deal.II/include/deal.II/lac/matrix_block.h b/deal.II/include/deal.II/lac/matrix_block.h
          index f6542c8bcf..591f899180 100644
          --- a/deal.II/include/deal.II/lac/matrix_block.h
          +++ b/deal.II/include/deal.II/lac/matrix_block.h
          @@ -1,7 +1,7 @@
           // ---------------------------------------------------------------------
           // $Id$
           //
          -// Copyright (C) 2007 - 2013 by the deal.II authors
          +// Copyright (C) 2007 - 2014 by the deal.II authors
           //
           // This file is part of the deal.II library.
           //
          @@ -388,7 +388,8 @@ private:
              */
             BlockIndices column_indices;
           
          -  friend void internal::reinit<>(MatrixBlock &, const BlockSparsityPattern &);
          +  template 
          +  friend void internal::reinit(MatrixBlock &, const BlockSparsityPattern &);
           };
           
           
          diff --git a/deal.II/include/deal.II/lac/parallel_block_vector.h b/deal.II/include/deal.II/lac/parallel_block_vector.h
          index 7ffd04094b..3778ba590b 100644
          --- a/deal.II/include/deal.II/lac/parallel_block_vector.h
          +++ b/deal.II/include/deal.II/lac/parallel_block_vector.h
          @@ -24,13 +24,16 @@
           #include 
           #include 
           
          +#include 
          +#include 
          +
          +
           #include 
           #include 
           
           DEAL_II_NAMESPACE_OPEN
           
           
          -
           namespace parallel
           {
             namespace distributed
          @@ -171,6 +174,31 @@ namespace parallel
                 BlockVector &
                 operator= (const Vector &V);
           
          +#ifdef DEAL_II_WITH_PETSC
          +      /**
          +       * Copy the content of a PETSc vector into the calling vector. This
          +       * function assumes that the vectors layouts have already been
          +       * initialized to match.
          +       *
          +       * This operator is only available if deal.II was configured with PETSc.
          +       */
          +      BlockVector &
          +      operator = (const PETScWrappers::MPI::BlockVector &petsc_vec);
          +#endif
          +
          +#ifdef DEAL_II_WITH_TRILINOS
          +      /**
          +       * Copy the content of a Trilinos vector into the calling vector. This
          +       * function assumes that the vectors layouts have already been
          +       * initialized to match.
          +       *
          +       * This operator is only available if deal.II was configured with
          +       * Trilinos.
          +       */
          +      BlockVector &
          +      operator = (const TrilinosWrappers::MPI::BlockVector &trilinos_vec);
          +#endif
          +
                 /**
                  * Reinitialize the BlockVector to contain num_blocks blocks of
                  * size block_size each.
          @@ -594,6 +622,42 @@ namespace parallel
           
           
           
          +#ifdef DEAL_II_WITH_PETSC
          +
          +    template 
          +    inline
          +    BlockVector &
          +    BlockVector::operator = (const PETScWrappers::MPI::BlockVector &petsc_vec)
          +    {
          +      AssertDimension(this->n_blocks(), petsc_vec.n_blocks());
          +      for (unsigned int i=0; in_blocks(); ++i)
          +        this->block(i) = petsc_vec.block(i);
          +
          +      return *this;
          +    }
          +
          +#endif
          +
          +
          +
          +#ifdef DEAL_II_WITH_TRILINOS
          +
          +    template 
          +    inline
          +    BlockVector &
          +    BlockVector::operator = (const TrilinosWrappers::MPI::BlockVector &trilinos_vec)
          +    {
          +      AssertDimension(this->n_blocks(), trilinos_vec.n_blocks());
          +      for (unsigned int i=0; in_blocks(); ++i)
          +        this->block(i) = trilinos_vec.block(i);
          +
          +      return *this;
          +    }
          +
          +#endif
          +
          +
          +
               template 
               inline
               void
          diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h
          index 7ccb1f9743..126737eba7 100644
          --- a/deal.II/include/deal.II/lac/parallel_vector.h
          +++ b/deal.II/include/deal.II/lac/parallel_vector.h
          @@ -33,6 +33,27 @@
           
           DEAL_II_NAMESPACE_OPEN
           
          +#ifdef DEAL_II_WITH_PETSC
          +namespace PETScWrappers
          +{
          +  namespace MPI
          +  {
          +    class Vector;
          +  }
          +}
          +#endif
          +
          +#ifdef DEAL_II_WITH_TRILINOS
          +namespace TrilinosWrappers
          +{
          +  namespace MPI
          +  {
          +    class Vector;
          +  }
          +}
          +#endif
          +
          +
           namespace parallel
           {
             namespace distributed
          @@ -275,6 +296,31 @@ namespace parallel
                 Vector &
                 operator = (const Vector &in_vector);
           
          +#ifdef DEAL_II_WITH_PETSC
          +      /**
          +       * Copy the content of a PETSc vector into the calling vector. This
          +       * function assumes that the vectors layouts have already been
          +       * initialized to match.
          +       *
          +       * This operator is only available if deal.II was configured with PETSc.
          +       */
          +      Vector &
          +      operator = (const PETScWrappers::MPI::Vector &petsc_vec);
          +#endif
          +
          +#ifdef DEAL_II_WITH_TRILINOS
          +      /**
          +       * Copy the content of a Trilinos vector into the calling vector. This
          +       * function assumes that the vectors layouts have already been
          +       * initialized to match.
          +       *
          +       * This operator is only available if deal.II was configured with
          +       * Trilinos.
          +       */
          +      Vector &
          +      operator = (const TrilinosWrappers::MPI::Vector &trilinos_vec);
          +#endif
          +
                 /**
                  * This method copies the local range from another vector with the same
                  * local range, but possibly different layout of ghost indices.
          diff --git a/deal.II/include/deal.II/lac/parallel_vector.templates.h b/deal.II/include/deal.II/lac/parallel_vector.templates.h
          index 624168b2e7..252c5b926c 100644
          --- a/deal.II/include/deal.II/lac/parallel_vector.templates.h
          +++ b/deal.II/include/deal.II/lac/parallel_vector.templates.h
          @@ -20,6 +20,10 @@
           
           #include 
           #include 
          +#include 
          +
          +#include 
          +#include 
           
           DEAL_II_NAMESPACE_OPEN
           
          @@ -204,6 +208,82 @@ namespace parallel
           
           
           
          +#ifdef DEAL_II_WITH_PETSC
          +
          +    template 
          +    Vector &
          +    Vector::operator = (const PETScWrappers::MPI::Vector &petsc_vec)
          +    {
          +      Assert(petsc_vec.locally_owned_elements() == locally_owned_elements(),
          +             StandardExceptions::ExcInvalidState());
          +
          +      // get a representation of the vector and copy it
          +      PetscScalar *start_ptr;
          +      int ierr = VecGetArray (static_cast(petsc_vec), &start_ptr);
          +      AssertThrow (ierr == 0, ExcPETScError(ierr));
          +
          +      const size_type vec_size = local_size();
          +      std::copy (start_ptr, start_ptr + vec_size, begin());
          +
          +      // restore the representation of the vector
          +      ierr = VecRestoreArray (static_cast(petsc_vec), &start_ptr);
          +      AssertThrow (ierr == 0, ExcPETScError(ierr));
          +
          +      // spread ghost values between processes?
          +      if (vector_is_ghosted || petsc_vec.has_ghost_elements())
          +        update_ghost_values();
          +
          +      // return a pointer to this object per normal c++ operator overloading
          +      // semantics
          +      return *this;
          +    }
          +
          +#endif
          +
          +
          +
          +#ifdef DEAL_II_WITH_TRILINOS
          +
          +    template 
          +    Vector &
          +    Vector::operator = (const TrilinosWrappers::MPI::Vector &trilinos_vec)
          +    {
          +      if (trilinos_vec.has_ghost_elements() == false)
          +        {
          +          Assert(trilinos_vec.locally_owned_elements() == locally_owned_elements(),
          +                 StandardExceptions::ExcInvalidState());
          +        }
          +      else
          +        // ghosted trilinos vector must contain the local range of this vector
          +        // which is contiguous
          +        {
          +          Assert((trilinos_vec.locally_owned_elements() & locally_owned_elements())
          +                 == locally_owned_elements(),
          +                 StandardExceptions::ExcInvalidState());
          +        }
          +
          +      // create on trilinos data
          +      const std::size_t start_index =
          +        trilinos_vec.vector_partitioner().NumMyElements() > 0 ?
          +        trilinos_vec.vector_partitioner().
          +        LID(static_cast(this->local_range().first)) : 0;
          +      const VectorView in_view (local_size(), trilinos_vec.begin()+start_index);
          +      static_cast&>(vector_view) =
          +        static_cast&>(in_view);
          +
          +      // spread ghost values between processes?
          +      if (vector_is_ghosted || trilinos_vec.has_ghost_elements())
          +        update_ghost_values();
          +
          +      // return a pointer to this object per normal c++ operator overloading
          +      // semantics
          +      return *this;
          +    }
          +
          +#endif
          +
          +
          +
               template 
               void
               Vector::copy_from (const Vector &c,
          diff --git a/deal.II/include/deal.II/lac/petsc_full_matrix.h b/deal.II/include/deal.II/lac/petsc_full_matrix.h
          index 176e9d5fc3..c800efccd2 100644
          --- a/deal.II/include/deal.II/lac/petsc_full_matrix.h
          +++ b/deal.II/include/deal.II/lac/petsc_full_matrix.h
          @@ -50,26 +50,52 @@ namespace PETScWrappers
             class FullMatrix : public MatrixBase
             {
             public:
          +    
               /**
                * Declare type for container size.
                */
               typedef types::global_dof_index size_type;
           
          +
          +    /**
          +     * Default constructor. Create an empty matrix.
          +     */
          +    FullMatrix ();
          +
          +
               /**
          -     * Create a full matrix of dimensions
          -     * @p m times @p n.
          +     * Create a full matrix of dimensions @p m times @p n.
                */
               FullMatrix (const size_type m,
                           const size_type n);
           
          +
               /**
          -     * Return a reference to the MPI
          -     * communicator object in use with this
          -     * matrix. Since this is a sequential
          -     * matrix, it returns the MPI_COMM_SELF
          -     * communicator.
          +     * Throw away the present matrix and generate one that has the
          +     * same properties as if it were created by the constructor of
          +     * this class with the same argument list as the present function.
          +     */
          +    void reinit (const size_type m,
          +                 const size_type n);
          +
          +
          +    /**
          +     * Return a reference to the MPI communicator object in use with
          +     * this matrix. Since this is a sequential matrix, it returns the
          +     * MPI_COMM_SELF communicator.
                */
               virtual const MPI_Comm &get_mpi_communicator () const;
          +
          +  private:
          +
          +    /**
          +     * Do the actual work for the respective reinit() function and the
          +     * matching constructor, i.e. create a matrix. Getting rid of the
          +     * previous matrix is left to the caller.
          +     */
          +    void do_reinit (const size_type m,
          +                    const size_type n);
          +
             };
           
             /*@}*/
          diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h
          index ad8f01b418..ded75613d4 100644
          --- a/deal.II/include/deal.II/lac/slepc_solver.h
          +++ b/deal.II/include/deal.II/lac/slepc_solver.h
          @@ -174,7 +174,7 @@ namespace SLEPcWrappers
               /**
                * Same as above, but here a composite method for solving the
                * system $A x=\lambda B x$ with real matrices $A, B$ and
          -     * imaginary eigenpairs $x, \lamda$.
          +     * imaginary eigenpairs $x, \lambda$.
                */
               template 
               void
          diff --git a/deal.II/include/deal.II/lac/sparse_matrix.h b/deal.II/include/deal.II/lac/sparse_matrix.h
          index 4efc719c17..2fae863171 100644
          --- a/deal.II/include/deal.II/lac/sparse_matrix.h
          +++ b/deal.II/include/deal.II/lac/sparse_matrix.h
          @@ -145,7 +145,7 @@ namespace SparseMatrixIterators
                * Return a reference to the matrix into which this accessor points. Note
                * that in the present case, this is a constant reference.
                */
          -    MatrixType &get_matrix () const;
          +    const MatrixType &get_matrix () const;
           
             private:
               /**
          @@ -2086,7 +2086,7 @@ namespace SparseMatrixIterators
           
             template 
             inline
          -  typename Accessor::MatrixType &
          +  const typename Accessor::MatrixType &
             Accessor::get_matrix () const
             {
               return *matrix;
          diff --git a/deal.II/include/deal.II/lac/sparsity_pattern.h b/deal.II/include/deal.II/lac/sparsity_pattern.h
          index 414e6ea92b..e53b7184c6 100644
          --- a/deal.II/include/deal.II/lac/sparsity_pattern.h
          +++ b/deal.II/include/deal.II/lac/sparsity_pattern.h
          @@ -429,22 +429,6 @@ public:
              */
             SparsityPattern (const SparsityPattern &);
           
          -  /**
          -   * Initialize a rectangular matrix.
          -   *
          -   * @arg m number of rows
          -   * @arg n number of columns
          -   * @arg max_per_row maximum number of nonzero entries per row
          -   * @arg optimize_diagonal This parameter is ignored.
          -   *
          -   * @deprecated Use the constructor without the last argument since
          -   *   it is ignored.
          -   */
          -  SparsityPattern (const size_type m,
          -                   const size_type n,
          -                   const unsigned int max_per_row,
          -                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
          -
             /**
              * Initialize a rectangular matrix.
              *
          @@ -456,22 +440,6 @@ public:
                              const size_type n,
                              const unsigned int max_per_row);
           
          -  /**
          -   * Initialize a rectangular matrix.
          -   *
          -   * @arg m number of rows
          -   * @arg n number of columns
          -   * @arg row_lengths possible number of nonzero entries for each row.  This
          -   * vector must have one entry for each row.
          -   * @arg optimize_diagonal This argument is ignored.
          -   *
          -   * @deprecated Use the constructor without the last argument since
          -   *   it is ignored.
          -   */
          -  SparsityPattern (const size_type               m,
          -                   const size_type               n,
          -                   const std::vector &row_lengths,
          -                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
           
             /**
              * Initialize a rectangular matrix.
          @@ -496,21 +464,6 @@ public:
             SparsityPattern (const size_type n,
                              const unsigned int max_per_row);
           
          -  /**
          -   * Initialize a quadratic matrix.
          -   *
          -   * @arg m number of rows and columns
          -   * @arg row_lengths possible number of nonzero entries for each row.  This
          -   * vector must have one entry for each row.
          -   * @arg optimize_diagonal This argument is ignored.
          -   *
          -   * @deprecated Use the constructor without the last argument since
          -   *   it is ignored.
          -   */
          -  SparsityPattern (const size_type               m,
          -                   const std::vector &row_lengths,
          -                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
          -
             /**
              * Initialize a quadratic matrix.
              *
          @@ -559,22 +512,6 @@ public:
              */
             SparsityPattern &operator = (const SparsityPattern &);
           
          -  /**
          -   * Reallocate memory and set up data structures for a new matrix with m
          -   * rows and n columns, with at most max_per_row
          -   * nonzero entries per row.
          -   *
          -   * This function simply maps its operations to the other reinit
          -   * function.
          -   *
          -   * @deprecated The last argument of this function is ignored. Use the
          -   *     version of this function without the last argument.
          -   */
          -  void reinit (const size_type m,
          -               const size_type n,
          -               const unsigned int max_per_row,
          -               const bool optimize_diagonal) DEAL_II_DEPRECATED;
          -
             /**
              * Reallocate memory and set up data structures for a new matrix with m
              * rows and n columns, with at most max_per_row
          @@ -587,27 +524,6 @@ public:
                          const size_type n,
                          const unsigned int max_per_row);
           
          -  /**
          -   * Reallocate memory for a matrix of size m x n. The number of
          -   * entries for each row is taken from the array row_lengths which
          -   * has to give this number of each row i=1...m.
          -   *
          -   * If m*n==0 all memory is freed, resulting in a total
          -   * reinitialization of the object. If it is nonzero, new memory is only
          -   * allocated if the new size extends the old one. This is done to save time
          -   * and to avoid fragmentation of the heap.
          -   *
          -   * If the number of rows equals the number of columns and the last parameter
          -   * is true, diagonal elements are stored first in each row to allow
          -   * optimized access in relaxation methods of SparseMatrix.
          -   *
          -   * @deprecated The last argument of this function is ignored. Use the
          -   *     version of this function without the last argument.
          -   */
          -  void reinit (const size_type               m,
          -               const size_type               n,
          -               const std::vector &row_lengths,
          -               const bool optimize_diagonal) DEAL_II_DEPRECATED;
           
             /**
              * Reallocate memory for a matrix of size m x n. The number of
          @@ -627,16 +543,6 @@ public:
                          const size_type               n,
                          const std::vector &row_lengths);
           
          -  /**
          -   * Same as above, but with a VectorSlice argument instead.
          -   *
          -   * @deprecated The last argument of this function is ignored. Use the
          -   *     version of this function without the last argument.
          -   */
          -  void reinit (const size_type                                   m,
          -               const size_type                                   n,
          -               const VectorSlice > &row_lengths,
          -               const bool optimize_diagonal) DEAL_II_DEPRECATED;
           
             /**
              * Same as above, but with a VectorSlice argument instead.
          @@ -659,91 +565,6 @@ public:
              */
             void compress ();
           
          -  /**
          -   * This function can be used as a replacement for reinit(), subsequent calls
          -   * to add() and a final call to close() if you know exactly in advance the
          -   * entries that will form the matrix sparsity pattern.
          -   *
          -   * The first two parameters determine the size of the matrix. For the two
          -   * last ones, note that a sparse matrix can be described by a sequence of
          -   * rows, each of which is represented by a sequence of pairs of column
          -   * indices and values. In the present context, the begin() and end()
          -   * parameters designate iterators (of forward iterator type) into a
          -   * container, one representing one row. The distance between begin() and
          -   * end() should therefore be equal to n_rows(). These iterators may be
          -   * iterators of std::vector, std::list, pointers into a
          -   * C-style array, or any other iterator satisfying the requirements of a
          -   * forward iterator. The objects pointed to by these iterators (i.e. what we
          -   * get after applying operator* or operator-> to one of
          -   * these iterators) must be a container itself that provides functions
          -   * begin and end designating a range of iterators that
          -   * describe the contents of one line. Dereferencing these inner iterators
          -   * must either yield a pair of an unsigned integer as column index and a
          -   * value of arbitrary type (such a type would be used if we wanted to
          -   * describe a sparse matrix with one such object), or simply an unsigned
          -   * integer (of we only wanted to describe a sparsity pattern). The function
          -   * is able to determine itself whether an unsigned integer or a pair is what
          -   * we get after dereferencing the inner iterators, through some template
          -   * magic.
          -   *
          -   * While the order of the outer iterators denotes the different rows of the
          -   * matrix, the order of the inner iterator denoting the columns does not
          -   * matter, as they are sorted internal to this function anyway.
          -   *
          -   * Since that all sounds very complicated, consider the following example
          -   * code, which may be used to fill a sparsity pattern:
          -   * @code
          -   * std::vector > column_indices (n_rows);
          -   * for (unsigned int row=0; rowbegin and end (namely
          -   * std::vectors), and the inner iterators dereferenced yield
          -   * unsigned integers as column indices. Note that we could have replaced
          -   * each of the two std::vector occurrences by std::list,
          -   * and the inner one by std::set as well.
          -   *
          -   * Another example would be as follows, where we initialize a whole matrix,
          -   * not only a sparsity pattern:
          -   * @code
          -   * std::vector > entries (n_rows);
          -   * for (unsigned int row=0; rowstd::vector could
          -   * be replaced by std::list, and the inner std::map could be replaced by std::vector >, or a list or set of such pairs, as they all return
          -   * iterators that point to such pairs.
          -   *
          -   * @deprecated The last argument of this function is ignored. Use the
          -   *     version of this function without the last argument.
          -   */
          -  template 
          -  void copy_from (const size_type       n_rows,
          -                  const size_type       n_cols,
          -                  const ForwardIterator begin,
          -                  const ForwardIterator end,
          -                  const bool optimize_diagonal) DEAL_II_DEPRECATED;
           
             /**
              * This function can be used as a replacement for reinit(), subsequent calls
          @@ -827,19 +648,6 @@ public:
                             const ForwardIterator begin,
                             const ForwardIterator end);
           
          -  /**
          -   * Copy data from an object of type CompressedSparsityPattern,
          -   * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern.
          -   * Previous content of this object is lost, and the sparsity pattern is in
          -   * compressed mode afterwards.
          -   *
          -   * @deprecated The last argument of this function is ignored. Use the
          -   *     version of this function without the last argument.
          -   */
          -  template 
          -  void copy_from (const CompressedSparsityType &csp,
          -                  const bool optimize_diagonal) DEAL_II_DEPRECATED;
          -
             /**
              * Copy data from an object of type CompressedSparsityPattern,
              * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern. Although
          @@ -851,19 +659,6 @@ public:
             template 
             void copy_from (const CompressedSparsityType &csp);
           
          -  /**
          -   * Take a full matrix and use its nonzero entries to generate a sparse
          -   * matrix entry pattern for this object.
          -   *
          -   * Previous content of this object is lost, and the sparsity pattern is in
          -   * compressed mode afterwards.
          -   *
          -   * @deprecated The last argument of this function is ignored. Use the
          -   *     version of this function without the last argument.
          -   */
          -  template 
          -  void copy_from (const FullMatrix &matrix,
          -                  const bool optimize_diagonal) DEAL_II_DEPRECATED;
           
             /**
              * Take a full matrix and use its nonzero entries to generate a sparse
          @@ -906,6 +701,10 @@ public:
                               const bool      indices_are_sorted = false);
           
           // @}
          +
          +
          +
          +
             /**
              * @name Iterators
              */
          @@ -949,31 +748,6 @@ public:
              */
             iterator end (const size_type r) const;
           
          -  /**
          -   * STL-like iterator with the first entry of row r.
          -   *
          -   * Note that if the given row is empty, i.e. does not contain any nonzero
          -   * entries, then the iterator returned by this function equals
          -   * end(r). Note also that the iterator may not be dereferencable in
          -   * that case.
          -   *
          -   * @deprecated Use the iterators provided by the begin() and end()
          -   * functions instead.
          -   */
          -  row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
          -
          -  /**
          -   * Final iterator of row r. It points to the first element past the
          -   * end of line @p r, or past the end of the entire sparsity pattern.
          -   *
          -   * Note that the end iterator is not necessarily dereferencable. This is in
          -   * particular the case if it is the end iterator for the last row of a
          -   * matrix.
          -   *
          -   * @deprecated Use the iterators provided by the begin() and end()
          -   * functions instead.
          -   */
          -  row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
           
           // @}
             /**
          @@ -1038,15 +812,6 @@ public:
              */
             unsigned int row_length (const size_type row) const;
           
          -  /**
          -   * Determine whether the matrix uses the special convention for quadratic
          -   * matrices that the diagonal entries are stored first in each row.
          -   *
          -   * @deprecated The function always returns true if the matrix is
          -   * square and false if it is not.
          -   */
          -  bool optimize_diagonal () const DEAL_II_DEPRECATED;
          -
             /**
              * Return whether this object stores only those entries that have been added
              * explicitly, or if the sparsity pattern contains elements that have been
          @@ -1215,6 +980,255 @@ public:
              * @name Deprecated functions
              */
           // @{
          +
          +  /**
          +   * Initialize a rectangular matrix.
          +   *
          +   * @arg m number of rows
          +   * @arg n number of columns
          +   * @arg max_per_row maximum number of nonzero entries per row
          +   * @arg optimize_diagonal This parameter is ignored.
          +   *
          +   * @deprecated Use the constructor without the last argument since
          +   *   it is ignored.
          +   */
          +  SparsityPattern (const size_type m,
          +                   const size_type n,
          +                   const unsigned int max_per_row,
          +                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +  /**
          +   * Initialize a rectangular matrix.
          +   *
          +   * @arg m number of rows
          +   * @arg n number of columns
          +   * @arg row_lengths possible number of nonzero entries for each row.  This
          +   * vector must have one entry for each row.
          +   * @arg optimize_diagonal This argument is ignored.
          +   *
          +   * @deprecated Use the constructor without the last argument since
          +   *   it is ignored.
          +   */
          +  SparsityPattern (const size_type               m,
          +                   const size_type               n,
          +                   const std::vector &row_lengths,
          +                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +  /**
          +   * Initialize a quadratic matrix.
          +   *
          +   * @arg m number of rows and columns
          +   * @arg row_lengths possible number of nonzero entries for each row.  This
          +   * vector must have one entry for each row.
          +   * @arg optimize_diagonal This argument is ignored.
          +   *
          +   * @deprecated Use the constructor without the last argument since
          +   *   it is ignored.
          +   */
          +  SparsityPattern (const size_type               m,
          +                   const std::vector &row_lengths,
          +                   const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +
          +  /**
          +   * Reallocate memory for a matrix of size m x n. The number of
          +   * entries for each row is taken from the array row_lengths which
          +   * has to give this number of each row i=1...m.
          +   *
          +   * If m*n==0 all memory is freed, resulting in a total
          +   * reinitialization of the object. If it is nonzero, new memory is only
          +   * allocated if the new size extends the old one. This is done to save time
          +   * and to avoid fragmentation of the heap.
          +   *
          +   * If the number of rows equals the number of columns and the last parameter
          +   * is true, diagonal elements are stored first in each row to allow
          +   * optimized access in relaxation methods of SparseMatrix.
          +   *
          +   * @deprecated The last argument of this function is ignored. Use the
          +   *     version of this function without the last argument.
          +   */
          +  void reinit (const size_type               m,
          +               const size_type               n,
          +               const std::vector &row_lengths,
          +               const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +
          +  /**
          +   * Same as above, but with a VectorSlice argument instead.
          +   *
          +   * @deprecated The last argument of this function is ignored. Use the
          +   *     version of this function without the last argument.
          +   */
          +  void reinit (const size_type                                   m,
          +               const size_type                                   n,
          +               const VectorSlice > &row_lengths,
          +               const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +  /**
          +   * Reallocate memory and set up data structures for a new matrix with m
          +   * rows and n columns, with at most max_per_row
          +   * nonzero entries per row.
          +   *
          +   * This function simply maps its operations to the other reinit
          +   * function.
          +   *
          +   * @deprecated The last argument of this function is ignored. Use the
          +   *     version of this function without the last argument.
          +   */
          +  void reinit (const size_type m,
          +               const size_type n,
          +               const unsigned int max_per_row,
          +               const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +  /**
          +   * This function can be used as a replacement for reinit(), subsequent calls
          +   * to add() and a final call to close() if you know exactly in advance the
          +   * entries that will form the matrix sparsity pattern.
          +   *
          +   * The first two parameters determine the size of the matrix. For the two
          +   * last ones, note that a sparse matrix can be described by a sequence of
          +   * rows, each of which is represented by a sequence of pairs of column
          +   * indices and values. In the present context, the begin() and end()
          +   * parameters designate iterators (of forward iterator type) into a
          +   * container, one representing one row. The distance between begin() and
          +   * end() should therefore be equal to n_rows(). These iterators may be
          +   * iterators of std::vector, std::list, pointers into a
          +   * C-style array, or any other iterator satisfying the requirements of a
          +   * forward iterator. The objects pointed to by these iterators (i.e. what we
          +   * get after applying operator* or operator-> to one of
          +   * these iterators) must be a container itself that provides functions
          +   * begin and end designating a range of iterators that
          +   * describe the contents of one line. Dereferencing these inner iterators
          +   * must either yield a pair of an unsigned integer as column index and a
          +   * value of arbitrary type (such a type would be used if we wanted to
          +   * describe a sparse matrix with one such object), or simply an unsigned
          +   * integer (of we only wanted to describe a sparsity pattern). The function
          +   * is able to determine itself whether an unsigned integer or a pair is what
          +   * we get after dereferencing the inner iterators, through some template
          +   * magic.
          +   *
          +   * While the order of the outer iterators denotes the different rows of the
          +   * matrix, the order of the inner iterator denoting the columns does not
          +   * matter, as they are sorted internal to this function anyway.
          +   *
          +   * Since that all sounds very complicated, consider the following example
          +   * code, which may be used to fill a sparsity pattern:
          +   * @code
          +   * std::vector > column_indices (n_rows);
          +   * for (unsigned int row=0; rowbegin and end (namely
          +   * std::vectors), and the inner iterators dereferenced yield
          +   * unsigned integers as column indices. Note that we could have replaced
          +   * each of the two std::vector occurrences by std::list,
          +   * and the inner one by std::set as well.
          +   *
          +   * Another example would be as follows, where we initialize a whole matrix,
          +   * not only a sparsity pattern:
          +   * @code
          +   * std::vector > entries (n_rows);
          +   * for (unsigned int row=0; rowstd::vector could
          +   * be replaced by std::list, and the inner std::map could be replaced by std::vector >, or a list or set of such pairs, as they all return
          +   * iterators that point to such pairs.
          +   *
          +   * @deprecated The last argument of this function is ignored. Use the
          +   *     version of this function without the last argument.
          +   */
          +  template 
          +  void copy_from (const size_type       n_rows,
          +                  const size_type       n_cols,
          +                  const ForwardIterator begin,
          +                  const ForwardIterator end,
          +                  const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +  /**
          +   * Copy data from an object of type CompressedSparsityPattern,
          +   * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern.
          +   * Previous content of this object is lost, and the sparsity pattern is in
          +   * compressed mode afterwards.
          +   *
          +   * @deprecated The last argument of this function is ignored. Use the
          +   *     version of this function without the last argument.
          +   */
          +  template 
          +  void copy_from (const CompressedSparsityType &csp,
          +                  const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +
          +  /**
          +   * Take a full matrix and use its nonzero entries to generate a sparse
          +   * matrix entry pattern for this object.
          +   *
          +   * Previous content of this object is lost, and the sparsity pattern is in
          +   * compressed mode afterwards.
          +   *
          +   * @deprecated The last argument of this function is ignored. Use the
          +   *     version of this function without the last argument.
          +   */
          +  template 
          +  void copy_from (const FullMatrix &matrix,
          +                  const bool optimize_diagonal) DEAL_II_DEPRECATED;
          +
          +  /**
          +   * STL-like iterator with the first entry of row r.
          +   *
          +   * Note that if the given row is empty, i.e. does not contain any nonzero
          +   * entries, then the iterator returned by this function equals
          +   * end(r). Note also that the iterator may not be dereferencable in
          +   * that case.
          +   *
          +   * @deprecated Use the iterators provided by the begin() and end()
          +   * functions instead.
          +   */
          +  row_iterator row_begin (const size_type r) const DEAL_II_DEPRECATED;
          +
          +  /**
          +   * Final iterator of row r. It points to the first element past the
          +   * end of line @p r, or past the end of the entire sparsity pattern.
          +   *
          +   * Note that the end iterator is not necessarily dereferencable. This is in
          +   * particular the case if it is the end iterator for the last row of a
          +   * matrix.
          +   *
          +   * @deprecated Use the iterators provided by the begin() and end()
          +   * functions instead.
          +   */
          +  row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED;
          +
          +  /**
          +   * Determine whether the matrix uses the special convention for quadratic
          +   * matrices that the diagonal entries are stored first in each row.
          +   *
          +   * @deprecated The function always returns true if the matrix is
          +   * square and false if it is not.
          +   */
          +  bool optimize_diagonal () const DEAL_II_DEPRECATED;
          +
             /**
              * @deprecated This function is deprecated. Use SparsityTools::partition
              * instead.
          @@ -1293,6 +1307,8 @@ public:
              */
             const size_type *get_column_numbers () const DEAL_II_DEPRECATED;
           
          +// @}
          +
             BOOST_SERIALIZATION_SPLIT_MEMBER()
             /** @addtogroup Exceptions
              * @name Exceptions
          diff --git a/deal.II/include/deal.II/lac/tridiagonal_matrix.h b/deal.II/include/deal.II/lac/tridiagonal_matrix.h
          index 8b31214933..bf88c4113f 100644
          --- a/deal.II/include/deal.II/lac/tridiagonal_matrix.h
          +++ b/deal.II/include/deal.II/lac/tridiagonal_matrix.h
          @@ -50,6 +50,8 @@ template
           class TridiagonalMatrix
           {
           public:
          +  ///@name Constructors
          +  //@{
             /**
              * Declare type for container size.
              */
          diff --git a/deal.II/include/deal.II/lac/trilinos_vector.h b/deal.II/include/deal.II/lac/trilinos_vector.h
          index 9e7896532b..951d660755 100644
          --- a/deal.II/include/deal.II/lac/trilinos_vector.h
          +++ b/deal.II/include/deal.II/lac/trilinos_vector.h
          @@ -497,15 +497,14 @@ namespace TrilinosWrappers
               void Vector::reinit (const Epetra_Map             ¶llel_partitioner,
                                    const dealii::Vector &v)
               {
          -      if (vector.get() != 0 && vector->Map().SameAs(parallel_partitioner))
          +      if (vector.get() == 0 || vector->Map().SameAs(parallel_partitioner) == false)
                   vector.reset (new Epetra_FEVector(parallel_partitioner));
           
                 has_ghosts = vector->Map().UniqueGIDs()==false;
           
                 const int size = parallel_partitioner.NumMyElements();
           
          -      // Need to copy out values, since the
          -      // deal.II might not use doubles, so
          +      // Need to copy out values, since the deal.II might not use doubles, so
                 // that a direct access is not possible.
                 for (int i=0; i::
           reinit(const DH               &dof_handler,
                  const ConstraintMatrix &constraints_in,
                  const Quad             &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             MappingQ1                       mapping;
             std::vector               dof_handlers;
          @@ -1490,7 +1490,7 @@ reinit(const Mapping     &mapping,
                  const DH               &dof_handler,
                  const ConstraintMatrix &constraints_in,
                  const Quad             &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             std::vector               dof_handlers;
             std::vector constraints;
          @@ -1515,7 +1515,7 @@ void MatrixFree::
           reinit(const std::vector               &dof_handler,
                  const std::vector &constraint,
                  const std::vector                    &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             MappingQ1 mapping;
             std::vector locally_owned_set =
          @@ -1534,7 +1534,7 @@ void MatrixFree::
           reinit(const std::vector               &dof_handler,
                  const std::vector &constraint,
                  const Quad                                 &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             MappingQ1 mapping;
             std::vector quads;
          @@ -1555,7 +1555,7 @@ reinit(const Mapping                         &mapping,
                  const std::vector               &dof_handler,
                  const std::vector &constraint,
                  const Quad                                 &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             std::vector quads;
             quads.push_back(quad);
          @@ -1575,7 +1575,7 @@ reinit(const Mapping                         &mapping,
                  const std::vector  &dof_handler,
                  const std::vector &constraint,
                  const std::vector              &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             std::vector locally_owned_set =
               internal::MatrixFree::extract_locally_owned_index_sets
          @@ -1626,7 +1626,7 @@ reinit(const Mapping                         &mapping,
                  const std::vector &constraint,
                  const std::vector                &locally_owned_set,
                  const std::vector                    &quad,
          -       const MatrixFree::AdditionalData additional_data)
          +       const typename MatrixFree::AdditionalData additional_data)
           {
             // find out whether we use a hp Quadrature or a standard quadrature
             std::vector > quad_hp;
          diff --git a/deal.II/include/deal.II/matrix_free/matrix_free.templates.h b/deal.II/include/deal.II/matrix_free/matrix_free.templates.h
          index 359deb1d8f..25dab92538 100644
          --- a/deal.II/include/deal.II/matrix_free/matrix_free.templates.h
          +++ b/deal.II/include/deal.II/matrix_free/matrix_free.templates.h
          @@ -109,7 +109,7 @@ internal_reinit(const Mapping                          &mapping,
                           const std::vector &constraint,
                           const std::vector                 &locally_owned_set,
                           const std::vector >      &quad,
          -                const MatrixFree::AdditionalData additional_data)
          +                const typename MatrixFree::AdditionalData additional_data)
           {
             if (additional_data.initialize_indices == true)
               {
          @@ -231,7 +231,7 @@ internal_reinit(const Mapping                            &mapping,
                           const std::vector    &constraint,
                           const std::vector                   &locally_owned_set,
                           const std::vector >        &quad,
          -                const MatrixFree::AdditionalData additional_data)
          +                const typename MatrixFree::AdditionalData additional_data)
           {
             if (additional_data.initialize_indices == true)
               {
          diff --git a/deal.II/include/deal.II/numerics/matrix_tools.h b/deal.II/include/deal.II/numerics/matrix_tools.h
          index 27b47c9ba2..f9191796a3 100644
          --- a/deal.II/include/deal.II/numerics/matrix_tools.h
          +++ b/deal.II/include/deal.II/numerics/matrix_tools.h
          @@ -1,7 +1,7 @@
           // ---------------------------------------------------------------------
           // $Id$
           //
          -// Copyright (C) 1998 - 2013 by the deal.II authors
          +// Copyright (C) 1998 - 2014 by the deal.II authors
           //
           // This file is part of the deal.II library.
           //
          @@ -164,19 +164,20 @@ namespace TrilinosWrappers
            * basis functions, the roughness of the coefficient @p a, as well as
            * the degree of the given @p Mapping (if any).
            *
          - * Note, that for system elements the mass matrix and the laplace matrix is
          - * implemented such that each components couple only with itself, i.e. there
          - * is no coupling of shape functions belonging to different components. If the
          - * degrees of freedom have been sorted according to their vector component
          - * (e.g., using DoFRenumbering::component_wise()), then the resulting matrices
          - * will be block diagonal.
          + * Note, that for vector-valued elements the mass matrix and the
          + * laplace matrix is implemented in such a way that each component
          + * couples only with itself, i.e. there is no coupling of shape
          + * functions belonging to different components. If the degrees of
          + * freedom have been sorted according to their vector component (e.g.,
          + * using DoFRenumbering::component_wise()), then the resulting
          + * matrices will be block diagonal.
            *
          - * If the finite element for which the mass matrix or the laplace
          - * matrix is to be built has more than one component, this function
          - * accepts a single coefficient as well as a vector valued coefficient
          - * function. For the latter case make sure that the number of
          - * components coincides with the number of components of the system
          - * finite element.
          + * If the finite element for which the mass matrix or the Laplace
          + * matrix is to be built has more than one component, the functions
          + * accept a single coefficient as well as a vector valued coefficient
          + * function. For the latter case, the number of components must
          + * coincide with the number of components of the system finite
          + * element.
            *
            *
            * 

          Matrices on the boundary

          @@ -227,15 +228,18 @@ namespace TrilinosWrappers namespace MatrixCreator { /** - * Assemble the mass matrix. If no coefficient is given, it is assumed to be - * unity. + * Assemble the mass matrix. If no coefficient is given (i.e., if + * the pointer to a function object is zero as it is by default), + * the coefficient is taken as being constant and equal to one. * * If the library is configured to use multithreading, this function works * in parallel. * - * The optional argument @p constraints allows to apply constraints on the - * resulting matrix directly. Be careful when combining several matrices and - * using inhomogeneous constraints. + * The optional argument @p constraints allows to apply constraints + * on the resulting matrix directly. Note, however, that this + * becomes difficult when you have inhomogeneous constraints and + * later want to add several such matrices, for example in time + * dependent settings such as the main loop of step-26. * * See the general doc of this class for more information. */ @@ -259,15 +263,19 @@ namespace MatrixCreator const ConstraintMatrix &constraints = ConstraintMatrix()); /** - * Assemble the mass matrix and a right hand side vector. If no coefficient - * is given, it is assumed to be unity. + * Assemble the mass matrix and a right hand side vector. If no + * coefficient is given (i.e., if the pointer to a function object + * is zero as it is by default), the coefficient is taken as being + * constant and equal to one. * * If the library is configured to use multithreading, this function works * in parallel. * * The optional argument @p constraints allows to apply constraints on the - * resulting matrix directly. Be careful when combining several matrices and - * using inhomogeneous constraints. + * resulting matrix directly. Note, however, that this + * becomes difficult when you have inhomogeneous constraints and + * later want to add several such matrices, for example in time + * dependent settings such as the main loop of step-26. * * See the general doc of this class for more information. */ @@ -457,15 +465,18 @@ namespace MatrixCreator std::vector component_mapping = std::vector()); /** - * Assemble the Laplace matrix. If no coefficient is given, it is assumed to - * be constant one. + * Assemble the Laplace matrix. If no coefficient is given (i.e., if + * the pointer to a function object is zero as it is by default), + * the coefficient is taken as being constant and equal to one. * * If the library is configured to use multithreading, this function works * in parallel. * * The optional argument @p constraints allows to apply constraints on the - * resulting matrix directly. Be careful when combining several matrices and - * using inhomogeneous constraints. + * resulting matrix directly. Note, however, that this + * becomes difficult when you have inhomogeneous constraints and + * later want to add several such matrices, for example in time + * dependent settings such as the main loop of step-26. * * See the general doc of this class for more information. */ @@ -496,8 +507,10 @@ namespace MatrixCreator * in parallel. * * The optional argument @p constraints allows to apply constraints on the - * resulting matrix directly. Be careful when combining several matrices and - * using inhomogeneous constraints. + * resulting matrix directly. Note, however, that this + * becomes difficult when you have inhomogeneous constraints and + * later want to add several such matrices, for example in time + * dependent settings such as the main loop of step-26. * * See the general doc of this class for more information. */ diff --git a/deal.II/include/deal.II/numerics/solution_transfer.h b/deal.II/include/deal.II/numerics/solution_transfer.h index b37133426a..3c2dd0dbb0 100644 --- a/deal.II/include/deal.II/numerics/solution_transfer.h +++ b/deal.II/include/deal.II/numerics/solution_transfer.h @@ -136,7 +136,7 @@ DEAL_II_NAMESPACE_OPEN *
        23. Solution transfer with only refinement. Assume that we have got a * solution vector on the current (original) grid. * Each entry of this vector belongs to one of the - * DoFs of the discretisation. If we now refine the grid then the calling of + * DoFs of the discretization. If we now refine the grid then the calling of * DoFHandler::distribute_dofs() will change at least some of the * DoF indices. Hence we need to store the DoF indices of all active cells * before the refinement. A pointer for each active cell @@ -198,8 +198,36 @@ DEAL_II_NAMESPACE_OPEN * refine_interpolate(in, out)) only be called once. * * + * + *

          Implementation in the context of hp finite elements

          + * + * In the case of hp::DoFHandlers, it is not defined which of the finite elements + * that are part of the hp::FECollection associated with the DoF handler, should + * be considered on cells that are not active (i.e., that have children). This + * is because degrees of freedom are only allocated for active cells and, in fact, + * it is not allowed to set an active_fe_index on non-active cells using + * DoFAccessor::set_active_fe_index(). + * + * It is, thus, not entirely natural what should happen if, for example, a few cells + * are coarsened away. This class then implements the following algorithm: + * - If a cell is refined, then the values of the solution vector(s) are saved before + * refinement on the to-be-refined cell and in the space associated with this + * cell. These values are then interpolated to the finite element spaces of the + * children post-refinement. This may lose information if, for example, the old + * cell used a Q2 space and the children use Q1 spaces, or the information may + * be prolonged if the mother cell used a Q1 space and the children are Q2s. + * - If cells are to be coarsened, then the values from the child cells are + * interpolated to the mother cell using the largest of the child cell spaces. + * For example, if the children of a cell use Q1, Q2 and Q3 spaces, then the + * values from the children are interpolated into a Q3 space on the mother cell. + * After refinement, this Q3 function on the mother cell is then interpolated into + * the space the user has selected for this cell (which may be different from + * Q3, in this example, if the user has set the active_fe_index for a different + * space post-refinement and before calling hp::DoFHandler::distribute_dofs()). + * + * * @ingroup numerics - * @author Ralf Hartmann, 1999 + * @author Ralf Hartmann, 1999, Oliver Kayser-Herold and Wolfgang Bangerth, 2006, 2014 */ template, class DH=DoFHandler > class SolutionTransfer diff --git a/deal.II/source/base/parameter_handler.cc b/deal.II/source/base/parameter_handler.cc index 8742ec4c08..f448fa2b50 100644 --- a/deal.II/source/base/parameter_handler.cc +++ b/deal.II/source/base/parameter_handler.cc @@ -1858,18 +1858,82 @@ ParameterHandler::print_parameters (std::ostream &out, void ParameterHandler::print_parameters_section (std::ostream &out, const OutputStyle style, - const unsigned int indent_level) + const unsigned int indent_level, + const bool include_top_level_elements) { AssertThrow (out, ExcIO()); const boost::property_tree::ptree ¤t_section = entries->get_child (get_current_path()); + unsigned int overall_indent_level = indent_level; + switch (style) { + case XML: + { + if (include_top_level_elements) + { + // call the writer + // function and exit as + // there is nothing + // further to do down in + // this function + // + // XML has a requirement that + // there can only be one + // single top-level entry, + // but a section has multiple + // entries and sections. we + // work around this by + // creating a tree just for + // this purpose with the + // single top-level node + // "ParameterHandler" and + // assign the full path of + // down to the current section + // under it + boost::property_tree::ptree single_node_tree; + + // if there is no subsection selected, + // add the whole tree of entries, + // otherwise add a root element + // and the selected subsection under it + if (subsection_path.size() == 0) + { + single_node_tree.add_child("ParameterHandler", + *entries); + } + else + { + std::string path ("ParameterHandler"); + + single_node_tree.add_child(path, + boost::property_tree::ptree()); + + path += path_separator + get_current_path (); + single_node_tree.add_child (path, current_section); + }; + + write_xml (out, single_node_tree); + } + else + Assert (false, ExcNotImplemented()); + + break; + } case Text: case ShortText: { + // if there are top level elements to print, do it + if (include_top_level_elements && (subsection_path.size() > 0)) + for (unsigned int i=0; i doc_lines = Utilities:: break_text_into_lines (p->second.get("documentation"), - 78 - indent_level*2 - 2); + 78 - overall_indent_level*2 - 2); for (unsigned int i=0; ifirst) << std::setw(longest_name-demangle(p->first).length()+1) << " " @@ -2043,6 +2107,15 @@ ParameterHandler::print_parameters_section (std::ostream &out, case Description: { + // if there are top level elements to print, do it + if (include_top_level_elements && (subsection_path.size() > 0)) + for (unsigned int i=0; isecond.get("value"); // print name and value - out << std::setw(indent_level*2) << "" + out << std::setw(overall_indent_level*2) << "" << "set " << demangle(p->first) << std::setw(longest_name-demangle(p->first).length()+1) << " " @@ -2076,12 +2149,12 @@ ParameterHandler::print_parameters_section (std::ostream &out, const std::vector description_str = Utilities::break_text_into_lines (p->second.get ("pattern_description"), - 78 - indent_level*2 - 2, '|'); + 78 - overall_indent_level*2 - 2, '|'); if (description_str.size() > 1) { out << std::endl; for (unsigned int i=0; isecond.get("documentation").length() != 0) - out << std::setw(indent_level*2 + longest_name + 10) << "" + out << std::setw(overall_indent_level*2 + longest_name + 10) << "" << "(" << p->second.get("documentation") << ")" << std::endl; } @@ -2109,6 +2182,7 @@ ParameterHandler::print_parameters_section (std::ostream &out, // sections to come, put two newlines // between the last entry and the first // subsection + if (style != XML) { unsigned int n_parameters = 0; unsigned int n_sections = 0; @@ -2128,7 +2202,6 @@ ParameterHandler::print_parameters_section (std::ostream &out, && (n_sections != 0)) out << std::endl << std::endl; - } // now traverse subsections tree, // in alphabetical order @@ -2143,7 +2216,7 @@ ParameterHandler::print_parameters_section (std::ostream &out, case Text: case Description: case ShortText: - out << std::setw(indent_level*2) << "" + out << std::setw(overall_indent_level*2) << "" << "subsection " << demangle(p->first) << std::endl; break; case LaTeX: @@ -2177,7 +2250,7 @@ ParameterHandler::print_parameters_section (std::ostream &out, // then the contents of the // subsection enter_subsection (demangle(p->first)); - print_parameters_section (out, style, indent_level+1); + print_parameters_section (out, style, overall_indent_level+1); leave_subsection (); switch (style) { @@ -2186,14 +2259,14 @@ ParameterHandler::print_parameters_section (std::ostream &out, // subsection. one // blank line after // each subsection - out << std::setw(indent_level*2) << "" + out << std::setw(overall_indent_level*2) << "" << "end" << std::endl << std::endl; // if this is a toplevel // subsection, then have two // newlines - if (indent_level == 0) + if (overall_indent_level == 0) out << std::endl; break; @@ -2202,7 +2275,7 @@ ParameterHandler::print_parameters_section (std::ostream &out, case ShortText: // write end of // subsection. - out << std::setw(indent_level*2) << "" + out << std::setw(overall_indent_level*2) << "" << "end" << std::endl; break; case LaTeX: @@ -2213,6 +2286,33 @@ ParameterHandler::print_parameters_section (std::ostream &out, } } + // close top level elements, if there are any + switch (style) + { + case XML: + case LaTeX: + case Description: + break; + case Text: + case ShortText: + { + if (include_top_level_elements && (subsection_path.size() > 0)) + for (unsigned int i=0; i::QGauss (const unsigned int n) const long double tolerance = (runtime_one + long_double_eps != runtime_one ? - std::max (double_eps / 100, long_double_eps * 5) + fmax (double_eps / 100, long_double_eps * 5) : double_eps * 5 ); @@ -215,7 +215,7 @@ compute_quadrature_points(const unsigned int q, const long double tolerance = (runtime_one + long_double_eps != runtime_one ? - std::max (double_eps / 100, long_double_eps * 5) + fmax (double_eps / 100, long_double_eps * 5) : double_eps * 5 ); diff --git a/deal.II/source/distributed/grid_refinement.cc b/deal.II/source/distributed/grid_refinement.cc index f7f185ff4e..e4a5e8f414 100644 --- a/deal.II/source/distributed/grid_refinement.cc +++ b/deal.II/source/distributed/grid_refinement.cc @@ -199,11 +199,16 @@ namespace Assert (interesting_range[0] <= interesting_range[1], ExcInternalError()); + Assert (interesting_range[0] >= 0, + ExcInternalError()); + + // adjust the lower bound only + // if the end point is not equal + // to zero, otherwise it could + // happen, that the result + // becomes negative if (interesting_range[0] > 0) interesting_range[0] *= 0.99; - else - interesting_range[0] - -= 0.01 * (interesting_range[1] - interesting_range[0]); if (interesting_range[1] > 0) interesting_range[1] *= 1.01; diff --git a/deal.II/source/distributed/tria.cc b/deal.II/source/distributed/tria.cc index 4149b6e9a1..45db88fa60 100644 --- a/deal.II/source/distributed/tria.cc +++ b/deal.II/source/distributed/tria.cc @@ -2046,13 +2046,19 @@ namespace parallel if (attached_data_size>0) real_data_size = attached_data_size+sizeof(CellStatus); + Assert(this->n_cells()>0, ExcMessage("Can not save() an empty Triangulation.")); + if (my_subdomain==0) { std::string fname=std::string(filename)+".info"; std::ofstream f(fname.c_str()); - f << Utilities::MPI::n_mpi_processes (mpi_communicator) << " " + f << "version nproc attached_bytes n_attached_objs n_coarse_cells" << std::endl + << 2 << " " + << Utilities::MPI::n_mpi_processes (mpi_communicator) << " " << real_data_size << " " - << attached_data_pack_callbacks.size() << std::endl; + << attached_data_pack_callbacks.size() << " " + << this->n_cells(0) + << std::endl; } if (attached_data_size>0) @@ -2082,6 +2088,10 @@ namespace parallel Triangulation:: load(const char *filename) { + Assert(this->n_cells()>0, ExcMessage("load() only works if Triangulation already contains the same coarse mesh!")); + Assert(this->n_levels()==1, ExcMessage("Triangulation may only contain coarse cells when calling load().")); + + if (parallel_ghost != 0) { dealii::internal::p4est::functions::ghost_destroy (parallel_ghost); @@ -2090,15 +2100,20 @@ namespace parallel dealii::internal::p4est::functions::destroy (parallel_forest); parallel_forest = 0; dealii::internal::p4est::functions::connectivity_destroy (connectivity); - connectivity=0; + connectivity = 0; - unsigned int numcpus, attached_size, attached_count; + unsigned int version, numcpus, attached_size, attached_count, n_coarse_cells; { std::string fname=std::string(filename)+".info"; std::ifstream f(fname.c_str()); - f >> numcpus >> attached_size >> attached_count; + std::string firstline; + getline(f, firstline); //skip first line + f >> version >> numcpus >> attached_size >> attached_count >> n_coarse_cells; } + Assert(version == 2, ExcMessage("Incompatible version found in .info file.")); + Assert(this->n_cells(0) == n_coarse_cells, ExcMessage("Number of coarse cells differ!")); + attached_data_size = 0; n_attached_datas = 0; n_attached_deserialize = attached_count; diff --git a/deal.II/source/dofs/dof_accessor_get.cc b/deal.II/source/dofs/dof_accessor_get.cc index 427e7e9f2c..632522f993 100644 --- a/deal.II/source/dofs/dof_accessor_get.cc +++ b/deal.II/source/dofs/dof_accessor_get.cc @@ -55,6 +55,9 @@ get_interpolated_dof_values (const InputVector &values, (this->dof_handler) != 0) || + // for hp-DoFHandlers, we need to require that on + // active cells, you either don't specify an fe_index, + // or that you specify the correct one (fe_index == this->active_fe_index()) || (fe_index == DH::default_fe_index)) @@ -70,7 +73,7 @@ get_interpolated_dof_values (const InputVector &values, FullMatrix interpolation (this->dof_handler->get_fe()[fe_index].dofs_per_cell, this->get_fe().dofs_per_cell); this->dof_handler->get_fe()[fe_index].get_interpolation_matrix (this->get_fe(), - interpolation); + interpolation); interpolation.vmult (interpolated_values, tmp); } } @@ -85,28 +88,28 @@ get_interpolated_dof_values (const InputVector &values, // space to this cell's (unknown) FE space unless an explicit // fe_index is given Assert ((dynamic_cast*> - (this->dof_handler) - != 0) + (this->dof_handler) + != 0) || - (fe_index != DH::default_fe_index), - ExcMessage ("You cannot call this function on non-active cells " - "of hp::DoFHandler objects unless you provide an explicit " - "finite element index because they do not have naturally " - "associated finite element spaces associated: degrees " - "of freedom are only distributed on active cells for which " - "the active_fe_index has been set.")); + (fe_index != DH::default_fe_index), + ExcMessage ("You cannot call this function on non-active cells " + "of hp::DoFHandler objects unless you provide an explicit " + "finite element index because they do not have naturally " + "associated finite element spaces associated: degrees " + "of freedom are only distributed on active cells for which " + "the active_fe_index has been set.")); const FiniteElement &fe = this->get_dof_handler().get_fe()[fe_index]; const unsigned int dofs_per_cell = fe.dofs_per_cell; Assert (this->dof_handler != 0, - typename BaseClass::ExcInvalidObject()); + typename BaseClass::ExcInvalidObject()); Assert (&fe != 0, - typename BaseClass::ExcInvalidObject()); + typename BaseClass::ExcInvalidObject()); Assert (interpolated_values.size() == dofs_per_cell, - typename BaseClass::ExcVectorDoesNotMatch()); + typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), - typename BaseClass::ExcVectorDoesNotMatch()); + typename BaseClass::ExcVectorDoesNotMatch()); Vector tmp1(dofs_per_cell); diff --git a/deal.II/source/dofs/dof_accessor_set.cc b/deal.II/source/dofs/dof_accessor_set.cc index bfbedda11c..bc3a6434c7 100644 --- a/deal.II/source/dofs/dof_accessor_set.cc +++ b/deal.II/source/dofs/dof_accessor_set.cc @@ -38,7 +38,6 @@ DEAL_II_NAMESPACE_OPEN - template template void @@ -48,18 +47,43 @@ set_dof_values_by_interpolation (const Vector &local_values, const unsigned int fe_index) const { if (!this->has_children()) - // if this cell has no children: simply set the values on this cell - this->set_dof_values (local_values, values); + { + if ((dynamic_cast*> + (this->dof_handler) + != 0) + || + // for hp-DoFHandlers, we need to require that on + // active cells, you either don't specify an fe_index, + // or that you specify the correct one + (fe_index == this->active_fe_index()) + || + (fe_index == DH::default_fe_index)) + // simply set the values on this cell + this->set_dof_values (local_values, values); + else + { + Assert (local_values.size() == this->dof_handler->get_fe()[fe_index].dofs_per_cell, + ExcMessage ("Incorrect size of local_values vector.") ); + + FullMatrix interpolation (this->get_fe().dofs_per_cell, this->dof_handler->get_fe()[fe_index].dofs_per_cell); + + this->get_fe().get_interpolation_matrix (this->dof_handler->get_fe()[fe_index], + interpolation); + + // do the interpolation to the target space. for historical + // reasons, matrices are set to size 0x0 internally even + // we reinit as 4x0, so we have to treat this case specially + Vector tmp (this->get_fe().dofs_per_cell); + if ((tmp.size() > 0) && (local_values.size() > 0)) + interpolation.vmult (tmp, local_values); + + // now set the dof values in the global vector + this->set_dof_values (tmp, values); + } + } else // otherwise distribute them to the children { - // we are on a non-active cell. these do not have any finite - // element associated with them in the hp context (in the non-hp - // context, we can simply assume that the FE space to from which we - // want to interpolate is the same as for all elements in the - // mesh). consequently, we cannot interpolate to children's FE - // space from this cell's (unknown) FE space unless an explicit - // fe_index is given Assert ((dynamic_cast*> (this->dof_handler) != 0) @@ -72,40 +96,31 @@ set_dof_values_by_interpolation (const Vector &local_values, "of freedom are only distributed on active cells for which " "the active_fe_index has been set.")); - const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell; + const FiniteElement &fe = this->get_dof_handler().get_fe()[fe_index]; + const unsigned int dofs_per_cell = fe.dofs_per_cell; Assert (this->dof_handler != 0, - typename BaseClass::ExcInvalidObject()); - Assert (&this->get_fe() != 0, - typename BaseClass::ExcInvalidObject()); + typename BaseClass::ExcInvalidObject()); + Assert (&this->get_dof_handler().get_fe() != 0, + typename BaseClass::ExcInvalidObject()); Assert (local_values.size() == dofs_per_cell, - typename BaseClass::ExcVectorDoesNotMatch()); + typename BaseClass::ExcVectorDoesNotMatch()); Assert (values.size() == this->dof_handler->n_dofs(), - typename BaseClass::ExcVectorDoesNotMatch()); + typename BaseClass::ExcVectorDoesNotMatch()); Vector tmp(dofs_per_cell); for (unsigned int child=0; childn_children(); ++child) { - Assert (this->child(child)->get_fe().dofs_per_cell == dofs_per_cell, - ExcNotImplemented()); - - // prolong the given data to the present cell. FullMatrix only wants - // us to call vmult if the matrix size is actually non-zero, so - // check that case - if (tmp.size() > 0) - { - this->get_fe().get_prolongation_matrix(child, this->refinement_case()) - .vmult (tmp, local_values); - - this->child(child)->set_dof_values_by_interpolation (tmp, values); - } + if (tmp.size() > 0) + fe.get_prolongation_matrix(child, this->refinement_case()) + .vmult (tmp, local_values); + this->child(child)->set_dof_values_by_interpolation (tmp, values, fe_index); } } } - // -------------------------------------------------------------------------- // explicit instantiations #include "dof_accessor_set.inst" diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index c8bb6d84f0..2dd018b6d2 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -1648,8 +1648,8 @@ namespace internal unsigned int sent=needs_to_get_cells.size(); unsigned int recv=senders.size(); - MPI_Reduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, 0, tr->get_communicator()); - MPI_Reduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, 0, tr->get_communicator()); + MPI_Allreduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, tr->get_communicator()); + MPI_Allreduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, tr->get_communicator()); Assert(sum_send==sum_recv, ExcInternalError()); } #endif diff --git a/deal.II/source/fe/mapping_c1.cc b/deal.II/source/fe/mapping_c1.cc index b7e0ec446c..9790fba5b2 100644 --- a/deal.II/source/fe/mapping_c1.cc +++ b/deal.II/source/fe/mapping_c1.cc @@ -80,7 +80,7 @@ MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &ce // the interpolation points at @p{t=0.276} and @p{t=0.724} // (Gauss-Lobatto points). Since at @p{t=0,1} we want a vertex which // is actually at the boundary, we know that @p{d=0} and @p{a=-b-c}, - // which gives @p{s(0.276)} and @{s(0.726)} in terms of @p{b,c}. As + // which gives @p{s(0.276)} and @p{s(0.726)} in terms of @p{b,c}. As // side-conditions, we want that the derivatives at @p{t=0} and // @p{t=1}, i.e. at the vertices match those returned by the // boundary. diff --git a/deal.II/source/fe/mapping_q1.cc b/deal.II/source/fe/mapping_q1.cc index 4696547bd2..beba2a11c5 100644 --- a/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/source/fe/mapping_q1.cc @@ -1880,7 +1880,7 @@ transform_real_to_unit_cell_internal_codim1 (const typename Triangulation::cell_iterator &cell, const Point &p, const Point &initial_p_unit, - MappingQ1::InternalData &mdata) const + typename MappingQ1::InternalData &mdata) const { const unsigned int spacedim1 = dim_+1; const unsigned int dim1 = dim_; diff --git a/deal.II/source/grid/grid_in.cc b/deal.II/source/grid/grid_in.cc index c41f034ca3..c3072c1218 100644 --- a/deal.II/source/grid/grid_in.cc +++ b/deal.II/source/grid/grid_in.cc @@ -84,13 +84,13 @@ void GridIn::read_vtk(std::istream &in) unsigned int no_vertices, no_quads=0,no_lines=0; - char keyword_1[7],keyword_2[6],keyword_3[10] ;//keywords for the three types of data + std::string keyword; - in.get(keyword_1, 7); + in >> keyword; //////////////////Processing the POINTS section/////////////// - if (std::strcmp(keyword_1,"POINTS") == 0)//comparing the keyword points + if (keyword == "POINTS") { in>>no_vertices;// taking the no. of vertices in.ignore(256, '\n');//ignoring the number beside the total no. of points. @@ -120,24 +120,19 @@ void GridIn::read_vtk(std::istream &in) in.ignore(256, '\n');//this move pointer to the next line ignoring unwanted no. no = in.tellg(); getline(in,checkline); - if (checkline.compare("") == 0) - { - in.get(keyword_2, 6); - } - else + if (checkline.compare("") != 0) { in.seekg(no); - in.get(keyword_2, 6); } + in >> keyword; unsigned int total_cells, no_cells = 0, type, j = 0;// declaring counters, refer to the order of declaring variables for an idea of what is what! ///////////////////Processing the CELLS section that contains cells(cells) and bound_quads(subcelldata)/////////////////////// - if (std::strcmp(keyword_2,"CELLS") == 0)//comparing the keyword cells. + if (keyword == "CELLS") { - in>>total_cells; in.ignore(256,'\n'); @@ -244,16 +239,16 @@ void GridIn::read_vtk(std::istream &in) /////////////////////Processing the CELL_TYPES section//////////////////////// - in>>keyword_3; + in >> keyword; - if (std::strcmp(keyword_3,"CELL_TYPES") == 0)//Entering the cell_types section and ignoring data. + if (keyword == "CELL_TYPES")//Entering the cell_types section and ignoring data. { in.ignore(256, '\n'); while (!in.eof()) { - in>>keyword_3; - if (std::strcmp(keyword_3,"12") && std::strcmp(keyword_3,"9")) + in>>keyword; + if (keyword != "12" && keyword != "9") { break; } @@ -262,7 +257,7 @@ void GridIn::read_vtk(std::istream &in) ////////////////////////Processing the CELL_DATA section///////////////////////////// - if (std::strcmp(keyword_3,"CELL_DATA") == 0) + if (keyword == "CELL_DATA") { int no_ids; in>>no_ids; diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 85da38d151..5264d0a370 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -9550,7 +9550,9 @@ Triangulation (const Triangulation &other) vertex_to_boundary_id_map_1d (0), vertex_to_manifold_id_map_1d (0) { - Assert (false, ExcInternalError()); + Assert (false, ExcMessage ("You are not allowed to call this constructor " + "because copying Triangulation objects is not " + "allowed. Use Triangulation::copy_from() instead.")); } diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc index 85a37b7aac..b083369760 100644 --- a/deal.II/source/hp/dof_handler.cc +++ b/deal.II/source/hp/dof_handler.cc @@ -1,7 +1,7 @@ // --------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2003 - 2013 by the deal.II authors +// Copyright (C) 2003 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -3275,8 +3275,11 @@ namespace hp endc = end (); for (; cell != endc; ++cell) { - // Look if the cell got children during - // refinement + // Look if the cell got children during refinement by + // checking whether it has children now but didn't have + // children before refinement (the has_children array is + // set in pre-refinement action) + // // Note: Although one level is added to // the DoFHandler levels, when the // triangulation got one, for the buffer @@ -3291,10 +3294,15 @@ namespace hp if (cell->has_children () && !(*has_children [cell->level ()])[cell->index ()]) { - // Set active_fe_index in children to the - // same value as in the parent cell. + // Set active_fe_index in children to the same value + // as in the parent cell. we can't access the + // active_fe_index in the parent cell any more through + // cell->active_fe_index() since that function is not + // allowed for inactive cells, but we can access this + // information from the DoFLevels directly for (unsigned int i = 0; i < cell->n_children(); ++i) - cell->child (i)->set_active_fe_index (cell->active_fe_index ()); + cell->child (i)->set_active_fe_index + (levels[cell->level()]->active_fe_index (cell->index())); } } } diff --git a/deal.II/source/hp/mapping_collection.cc b/deal.II/source/hp/mapping_collection.cc index 0d9fdcfa83..eb59d77463 100644 --- a/deal.II/source/hp/mapping_collection.cc +++ b/deal.II/source/hp/mapping_collection.cc @@ -82,16 +82,17 @@ namespace hp //--------------------------------------------------------------------------- - template - MappingQ1 - StaticMappingQ1::mapping_q1; - + MappingQ1& StaticMappingQ1::return_static_mapping_q1() + { + static MappingQ1 mapping; + return mapping; + } template MappingCollection StaticMappingQ1::mapping_collection - = MappingCollection(mapping_q1); + = MappingCollection(StaticMappingQ1::return_static_mapping_q1()); } diff --git a/deal.II/source/lac/petsc_full_matrix.cc b/deal.II/source/lac/petsc_full_matrix.cc index 20903076e8..8a35af920a 100644 --- a/deal.II/source/lac/petsc_full_matrix.cc +++ b/deal.II/source/lac/petsc_full_matrix.cc @@ -24,17 +24,54 @@ DEAL_II_NAMESPACE_OPEN namespace PETScWrappers { + + FullMatrix::FullMatrix () + { + const int m=0, n=0; + const int ierr + = MatCreateSeqDense (PETSC_COMM_SELF, m, n, PETSC_NULL, + &matrix); + + AssertThrow (ierr == 0, ExcPETScError(ierr)); + } + FullMatrix::FullMatrix (const size_type m, const size_type n) { + do_reinit (m, n); + } + + void + FullMatrix::reinit (const size_type m, + const size_type n) + { + // get rid of old matrix and generate a + // new one +#if DEAL_II_PETSC_VERSION_LT(3,2,0) + const int ierr = MatDestroy (matrix); +#else + const int ierr = MatDestroy (&matrix); +#endif + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + do_reinit (m, n); + } + + void + FullMatrix::do_reinit (const size_type m, + const size_type n) + { + // use the call sequence indicating only a maximal number of + // elements per row for all rows globally const int ierr - = MatCreateSeqDense(PETSC_COMM_SELF, m, n, PETSC_NULL, - &matrix); + = MatCreateSeqDense (PETSC_COMM_SELF, m, n, PETSC_NULL, + &matrix); AssertThrow (ierr == 0, ExcPETScError(ierr)); } + const MPI_Comm & FullMatrix::get_mpi_communicator () const { diff --git a/deal.II/source/lac/petsc_vector_base.cc b/deal.II/source/lac/petsc_vector_base.cc index 5f4bd0118c..3233797c69 100644 --- a/deal.II/source/lac/petsc_vector_base.cc +++ b/deal.II/source/lac/petsc_vector_base.cc @@ -1036,10 +1036,10 @@ namespace PETScWrappers out.setf (std::ios::fixed, std::ios::floatfield); if (across) - for (size_type i=0; i extra_off_diagonals ? @@ -242,9 +229,8 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original, row+extra_off_diagonals) : original_row_end); - // find first free slot. the - // first slot in each row is - // the diagonal element + // find first free slot. the first slot in each row is the diagonal + // element size_type *next_free_slot = &colnums[rowstart[row]] + 1; // copy elements before side-diagonals @@ -265,12 +251,9 @@ SparsityPattern::SparsityPattern (const SparsityPattern &original, original_row_end, next_free_slot); - // this error may happen if the - // sum of previous elements per row - // and those of the new diagonals - // exceeds the maximum number of - // elements per row given to this - // constructor + // this error may happen if the sum of previous elements per row and + // those of the new diagonals exceeds the maximum number of elements per + // row given to this constructor Assert (next_free_slot <= &colnums[rowstart[row+1]], ExcNotEnoughSpace (0,rowstart[row+1]-rowstart[row])); }; @@ -310,8 +293,7 @@ SparsityPattern::reinit (const size_type m, const unsigned int max_per_row, const bool) { - // simply map this function to the - // other @p{reinit} function + // simply map this function to the other @p{reinit} function const std::vector row_lengths (m, max_per_row); reinit (m, n, row_lengths); } @@ -323,8 +305,7 @@ SparsityPattern::reinit (const size_type m, 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 row_lengths (m, max_per_row); reinit (m, n, row_lengths); } @@ -360,31 +341,23 @@ SparsityPattern::reinit (const size_type m, 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 max_dim) { if (rowstart) @@ -448,8 +409,7 @@ SparsityPattern::reinit (const size_type m, 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) @@ -475,14 +435,11 @@ SparsityPattern::reinit (const size_type m, ((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 tmp_entries (max_row_length); // Traverse all rows for (size_type line=0; line 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 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 row_lengths (csp.n_rows()); for (size_type i=0; i &matrix, template void SparsityPattern::copy_from (const FullMatrix &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 entries_per_row (matrix.m(), 0); for (size_type row=0; row(rowstart[i]-rowstart[i-1])); return m; @@ -806,30 +718,21 @@ SparsityPattern::operator () (const size_type i, Assert (j(i) << std::endl; AssertThrow (out, ExcIO()); @@ -1084,8 +968,7 @@ SparsityPattern::bandwidth () const b = std::abs(static_cast(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; } @@ -1096,8 +979,7 @@ SparsityPattern::block_write (std::ostream &out) const { AssertThrow (out, ExcIO()); - // first the simple objects, - // bracketed in [...] + // first the simple objects, bracketed in [...] out << '[' << max_dim << ' ' << rows << ' ' << cols << ' ' diff --git a/deal.II/source/lac/sparsity_tools.cc b/deal.II/source/lac/sparsity_tools.cc index afa8e0fa3d..10bac030c3 100644 --- a/deal.II/source/lac/sparsity_tools.cc +++ b/deal.II/source/lac/sparsity_tools.cc @@ -21,6 +21,7 @@ #include #include +#include #ifdef DEAL_II_WITH_MPI #include @@ -601,7 +602,7 @@ namespace SparsityTools 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)); diff --git a/deal.II/source/lac/trilinos_sparse_matrix.cc b/deal.II/source/lac/trilinos_sparse_matrix.cc index 88e828f356..0443687b93 100644 --- a/deal.II/source/lac/trilinos_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_sparse_matrix.cc @@ -593,38 +593,8 @@ namespace TrilinosWrappers AssertDimension (sparsity_pattern.n_rows(), static_cast(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(&input_row_map.Comm()); - if (exchange_data && communicator != 0) - { - std::vector - 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(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(n_global_elements(input_row_map))); - AssertDimension (sparsity_pattern.n_cols(), - static_cast(n_global_elements(input_col_map))); - } + AssertDimension (sparsity_pattern.n_cols(), + static_cast(n_global_elements(input_col_map))); column_space_map.reset (new Epetra_Map (input_col_map)); @@ -690,7 +660,8 @@ namespace TrilinosWrappers 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], @@ -724,15 +695,7 @@ namespace TrilinosWrappers } } - graph->FillComplete(input_col_map, input_row_map); - graph->OptimizeStorage(); - - AssertDimension (sparsity_pattern.n_cols(),static_cast( - 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 && @@ -748,8 +711,24 @@ namespace TrilinosWrappers 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( + 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 diff --git a/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/source/multigrid/mg_transfer_prebuilt.cc index b1fb5910fc..00d449ad91 100644 --- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -160,9 +160,7 @@ void MGTransferPrebuilt::build_matrices ( ExcNotImplemented()); for (unsigned int child=0; childn_children(); ++child) { - // set an alias to the - // prolongation matrix for - // this child + // set an alias to the prolongation matrix for this child const FullMatrix &prolongation = mg_dof.get_fe().get_prolongation_matrix (child, cell->refinement_case()); @@ -209,9 +207,7 @@ void MGTransferPrebuilt::build_matrices ( ExcNotImplemented()); for (unsigned int child=0; childn_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()); @@ -224,8 +220,7 @@ void MGTransferPrebuilt::build_matrices ( 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; iset (dof_indices_child[i], dofs_per_cell, diff --git a/deal.II/source/numerics/solution_transfer.cc b/deal.II/source/numerics/solution_transfer.cc index 8a3d59e895..0f5ffc5873 100644 --- a/deal.II/source/numerics/solution_transfer.cc +++ b/deal.II/source/numerics/solution_transfer.cc @@ -1,7 +1,7 @@ // --------------------------------------------------------------------- // $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. // @@ -135,10 +135,11 @@ SolutionTransfer::refine_interpolate(const VECTOR &in, // 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 @@ -149,7 +150,8 @@ SolutionTransfer::refine_interpolate(const VECTOR &in, ExcNumberOfDoFsPerCellHasChanged()); for (unsigned int i=0; isecond.indices_ptr)[i]); - cell->set_dof_values_by_interpolation(local_values, out); + cell->set_dof_values_by_interpolation(local_values, out, + this_fe_index); } } } @@ -233,9 +235,9 @@ void SolutionTransfer:: prepare_for_coarsening_and_refinement(const std::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()); @@ -243,7 +245,7 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) 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 &all_in) } // 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; @@ -270,20 +270,16 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) 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 > - (n_cells_to_stay_or_refine) + std::vector >(n_cells_to_stay_or_refine) .swap(indices_on_cell); std::vector > > @@ -292,19 +288,21 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) .swap(dof_values_on_cell); typename VECTOR::value_type zero_val = typename VECTOR::value_type(); + Table<2,FullMatrix > interpolation_hp; std::vector > restriction_is_additive; + internal::extract_interpolation_matrices (*dof_handler, interpolation_hp); internal::restriction_additive (dof_handler->get_fe(), restriction_is_additive); - Vector 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; @@ -315,9 +313,11 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) // 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 @@ -326,127 +326,51 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) // worked correctly for (unsigned int i=1; in_children(); ++i) Assert(cell->child(i)->coarsen_flag_set(), - ExcTriaPrepCoarseningNotCalledBefore()); - const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell; - - std::vector >(in_size, - Vector(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; childn_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; childn_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; childn_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 >(in_size, + Vector(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; jget_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; childn_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; iget_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; } } @@ -513,152 +437,40 @@ interpolate (const std::vector &all_in, const std::vector > *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; jactive_fe_index(); - bool different_elements = false; - if (cell->has_children()) - { - new_fe_index = cell->child(0)->active_fe_index(); - for (unsigned int child=1; childn_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; ihas_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; childn_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; iset_dof_values_by_interpolation(local_values, - all_out[j]); - } + tmp.reinit (in_size, true); + for (unsigned int i=0; iset_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 diff --git a/deal.II/tests/build_tests/CMakeLists.txt b/deal.II/tests/build_tests/CMakeLists.txt index 02318b6259..1c7a815469 100644 --- a/deal.II/tests/build_tests/CMakeLists.txt +++ b/deal.II/tests/build_tests/CMakeLists.txt @@ -67,7 +67,7 @@ FOREACH(_step_full ${_steps}) 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} ) diff --git a/deal.II/tests/quick_tests/p4est.cc b/deal.II/tests/quick_tests/p4est.cc index bdf355f89c..38ec82d35c 100644 --- a/deal.II/tests/quick_tests/p4est.cc +++ b/deal.II/tests/quick_tests/p4est.cc @@ -77,7 +77,6 @@ int main(int argc, char *argv[]) { Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); test<2>(); test<3>(); diff --git a/deal.II/tests/quick_tests/step-petsc.cc b/deal.II/tests/quick_tests/step-petsc.cc index 21586bf98a..bed3725cfc 100644 --- a/deal.II/tests/quick_tests/step-petsc.cc +++ b/deal.II/tests/quick_tests/step-petsc.cc @@ -109,7 +109,7 @@ void LaplaceProblem::assemble_system () std::vector local_dof_indices (dofs_per_cell); - typename DoFHandler<2>::active_cell_iterator + DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active (), endc = dof_handler.end (); diff --git a/tests/bits/chunk_sparse_matrix_16.cc b/tests/bits/chunk_sparse_matrix_16.cc new file mode 100644 index 0000000000..0f42e2bffb --- /dev/null +++ b/tests/bits/chunk_sparse_matrix_16.cc @@ -0,0 +1,115 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include + + +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 m(sp); + + // first set a few entries + for (unsigned int i=0; i src(m.n()), dst(m.m()), dst_ref(m.m()); + for (unsigned int i=0; i indices(sp.max_entries_per_row()); + std::vector values(sp.max_entries_per_row()); + for (unsigned int i=0; i(3)1FE_DGP<1>(3)1FE_Q<1>(2)3 in 1d: DEAL::0 @@ -2436,21 +2436,20 @@ 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 @@ -2458,19 +2457,19 @@ 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 @@ -2478,19 +2477,19 @@ 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 @@ -2498,21 +2497,22 @@ 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 @@ -3339,7 +3339,7 @@ DEAL::12 DEAL::110 DEAL::661 DEAL::13 -DEAL::1 +DEAL::14 DEAL::27 DEAL::260 DEAL::0 @@ -3568,7 +3568,7 @@ DEAL::10 DEAL::95 DEAL::922 DEAL::19 -DEAL::6 +DEAL::7 DEAL::51 DEAL::451 DEAL::17 @@ -3664,7 +3664,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::19 -DEAL::6 +DEAL::7 DEAL::51 DEAL::508 DEAL::18 @@ -4465,7 +4465,7 @@ DEAL::11 DEAL::105 DEAL::549 DEAL::10 -DEAL::10 +DEAL::11 DEAL::39 DEAL::308 DEAL::0 @@ -4577,7 +4577,7 @@ DEAL::11 DEAL::121 DEAL::605 DEAL::10 -DEAL::0 +DEAL::12 DEAL::12 DEAL::120 DEAL::0 @@ -5648,7 +5648,7 @@ DEAL::4 DEAL::25 DEAL::69 DEAL::6 -DEAL::6 +DEAL::7 DEAL::23 DEAL::102 DEAL::4 @@ -5708,11 +5708,11 @@ DEAL::6 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 @@ -5744,11 +5744,11 @@ DEAL::1 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 @@ -6248,11 +6248,11 @@ DEAL::6 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 diff --git a/tests/bits/dof_tools_16a.output b/tests/bits/dof_tools_16a.output index 2255194d5d..12a6893e06 100644 --- a/tests/bits/dof_tools_16a.output +++ b/tests/bits/dof_tools_16a.output @@ -21,7 +21,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::Checking Q1 in 2d: @@ -96,7 +96,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::Checking Q2 in 2d: @@ -171,7 +171,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::Checking Q3 in 2d: diff --git a/tests/bits/dof_tools_16c.output b/tests/bits/dof_tools_16c.output index 0588cae599..f5f37ae74e 100644 --- a/tests/bits/dof_tools_16c.output +++ b/tests/bits/dof_tools_16c.output @@ -21,7 +21,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::Checking Q1 in 2d: @@ -96,7 +96,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::Checking Q2 in 2d: @@ -171,7 +171,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::Checking Q3 in 2d: @@ -284,7 +284,7 @@ DEAL:: DEAL::0 DEAL:: DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::0 @@ -438,7 +438,7 @@ DEAL:: DEAL::0 DEAL:: DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::0 @@ -499,7 +499,7 @@ DEAL::2 DEAL::5 DEAL::4 DEAL::2 -DEAL::1 +DEAL::2 DEAL::4 DEAL::5 DEAL::2 @@ -556,7 +556,7 @@ DEAL::3 DEAL::10 DEAL::12 DEAL::3 -DEAL::0 +DEAL::2 DEAL::2 DEAL::6 DEAL::3 @@ -609,7 +609,7 @@ DEAL:: DEAL::0 DEAL:: DEAL::0 -DEAL::0 +DEAL::1 DEAL::1 DEAL::0 DEAL::0 @@ -670,7 +670,7 @@ DEAL::2 DEAL::5 DEAL::4 DEAL::2 -DEAL::1 +DEAL::2 DEAL::4 DEAL::5 DEAL::2 @@ -727,7 +727,7 @@ DEAL::3 DEAL::10 DEAL::12 DEAL::3 -DEAL::0 +DEAL::2 DEAL::2 DEAL::6 DEAL::3 @@ -901,7 +901,7 @@ DEAL::4 DEAL::33 DEAL::120 DEAL::8 -DEAL::1 +DEAL::4 DEAL::12 DEAL::60 DEAL::0 @@ -1091,39 +1091,39 @@ 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: @@ -1214,7 +1214,7 @@ DEAL::4 DEAL::10 DEAL::21 DEAL::3 -DEAL::3 +DEAL::4 DEAL::11 DEAL::21 DEAL::3 @@ -1309,7 +1309,7 @@ DEAL::10 DEAL::92 DEAL::520 DEAL::13 -DEAL::10 +DEAL::12 DEAL::58 DEAL::498 DEAL::11 @@ -1388,39 +1388,39 @@ 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)2FE_DGP<1>(3)1 in 1d: @@ -1750,147 +1750,147 @@ 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::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: @@ -1955,40 +1955,40 @@ 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::1 DEAL::0 DEAL::Checking FE_DGP<1>(3)1FE_DGP<1>(3)1FE_Q<1>(2)3 in 1d: DEAL::0 @@ -2052,39 +2052,39 @@ 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: @@ -2650,7 +2650,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::3 -DEAL::1 +DEAL::4 DEAL::7 DEAL::15 DEAL::0 @@ -2674,7 +2674,7 @@ DEAL::4 DEAL::16 DEAL::24 DEAL::3 -DEAL::0 +DEAL::6 DEAL::6 DEAL::18 DEAL::2 @@ -4398,97 +4398,96 @@ DEAL::0 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 @@ -4496,31 +4495,31 @@ 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 @@ -4528,31 +4527,31 @@ 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 @@ -4560,31 +4559,31 @@ 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 @@ -4592,33 +4591,34 @@ 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 @@ -4755,21 +4755,20 @@ 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 @@ -4777,19 +4776,19 @@ 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 @@ -4797,19 +4796,19 @@ 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 @@ -4817,17 +4816,18 @@ 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 @@ -5156,7 +5156,7 @@ DEAL::2 DEAL::4 DEAL::2 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::1 @@ -5164,7 +5164,7 @@ DEAL::2 DEAL::3 DEAL::1 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5212,7 +5212,7 @@ DEAL::2 DEAL::4 DEAL::2 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5268,7 +5268,7 @@ DEAL::2 DEAL::4 DEAL::2 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5324,7 +5324,7 @@ DEAL::2 DEAL::4 DEAL::2 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5380,7 +5380,7 @@ DEAL::2 DEAL::4 DEAL::2 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5440,23 +5440,23 @@ DEAL::1 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 @@ -5472,7 +5472,7 @@ DEAL::0 DEAL::0 DEAL::0 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5516,15 +5516,15 @@ DEAL::2 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 @@ -5780,7 +5780,7 @@ DEAL::2 DEAL::3 DEAL::1 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 @@ -5836,7 +5836,7 @@ DEAL::2 DEAL::3 DEAL::1 DEAL::1 -DEAL::1 +DEAL::2 DEAL::3 DEAL::2 DEAL::0 diff --git a/tests/bits/dof_tools_17c.output b/tests/bits/dof_tools_17c.output index c9b6c94213..cbdb815c96 100644 --- a/tests/bits/dof_tools_17c.output +++ b/tests/bits/dof_tools_17c.output @@ -4721,7 +4721,7 @@ DEAL::18 DEAL::69 DEAL::969 DEAL::17 -DEAL::17 +DEAL::18 DEAL::213 DEAL::2023 DEAL::17 diff --git a/tests/bits/dof_tools_18c.output b/tests/bits/dof_tools_18c.output index 8844277820..47dbd6a264 100644 --- a/tests/bits/dof_tools_18c.output +++ b/tests/bits/dof_tools_18c.output @@ -1433,7 +1433,7 @@ DEAL::7 DEAL::49 DEAL::361 DEAL::17 -DEAL::12 +DEAL::13 DEAL::141 DEAL::1514 DEAL::13 @@ -2348,7 +2348,7 @@ DEAL::145 DEAL::25112 DEAL::5654353 DEAL::439 -DEAL::42 +DEAL::50 DEAL::1758 DEAL::401968 DEAL::438 @@ -3606,7 +3606,7 @@ DEAL::1 DEAL::10 DEAL::45 DEAL::159 -DEAL::18 +DEAL::23 DEAL::145 DEAL::625 DEAL::7 @@ -3614,7 +3614,7 @@ DEAL::8 DEAL::48 DEAL::142 DEAL::9 -DEAL::3 +DEAL::8 DEAL::28 DEAL::166 DEAL::9 @@ -3622,7 +3622,7 @@ DEAL::10 DEAL::61 DEAL::372 DEAL::15 -DEAL::8 +DEAL::12 DEAL::46 DEAL::298 DEAL::0 diff --git a/tests/bits/parameter_handler_write_section_1.cc b/tests/bits/parameter_handler_write_section_1.cc new file mode 100644 index 0000000000..69351b09b9 --- /dev/null +++ b/tests/bits/parameter_handler_write_section_1.cc @@ -0,0 +1,79 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + + +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; +} diff --git a/tests/bits/parameter_handler_write_section_1.output b/tests/bits/parameter_handler_write_section_1.output new file mode 100644 index 0000000000..ddcb05bbb2 --- /dev/null +++ b/tests/bits/parameter_handler_write_section_1.output @@ -0,0 +1,11 @@ + +# doc 4 +set double 2 = 4.321 + +# docs 3 +set double+double = 6.1415926 +set int*int = 2 + +# docs 1 +set string&list = < & > ; / + diff --git a/tests/bits/parameter_handler_write_section_2.cc b/tests/bits/parameter_handler_write_section_2.cc new file mode 100644 index 0000000000..80763c747c --- /dev/null +++ b/tests/bits/parameter_handler_write_section_2.cc @@ -0,0 +1,79 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + + +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; +} diff --git a/tests/bits/parameter_handler_write_section_2.output b/tests/bits/parameter_handler_write_section_2.output new file mode 100644 index 0000000000..2312214379 --- /dev/null +++ b/tests/bits/parameter_handler_write_section_2.output @@ -0,0 +1,15 @@ + +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 + diff --git a/tests/bits/parameter_handler_write_section_xml.cc b/tests/bits/parameter_handler_write_section_xml.cc new file mode 100644 index 0000000000..da219d14fd --- /dev/null +++ b/tests/bits/parameter_handler_write_section_xml.cc @@ -0,0 +1,79 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + + +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; +} diff --git a/tests/bits/parameter_handler_write_section_xml.output b/tests/bits/parameter_handler_write_section_xml.output new file mode 100644 index 0000000000..d9345a9d22 --- /dev/null +++ b/tests/bits/parameter_handler_write_section_xml.output @@ -0,0 +1,3 @@ + + +4.3214.321doc 42[Double -1.79769e+308...1.79769e+308 (inclusive)]< & > ; /< & > ; /docs 13[Anything]224[Integer range -2147483648...2147483647 (inclusive)]6.14159266.1415926docs 35[Double -1.79769e+308...1.79769e+308 (inclusive)] diff --git a/tests/deal.II/fe_values_view_26.cc b/tests/deal.II/fe_values_view_26.cc new file mode 100644 index 0000000000..ec1aedf8f8 --- /dev/null +++ b/tests/deal.II/fe_values_view_26.cc @@ -0,0 +1,117 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + +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 +void test (const Triangulation &tr, + const FiniteElement &fe) +{ + deallog << "FE=" << fe.get_name() + << std::endl; + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + Vector fe_function(dof.n_dofs()); + for (unsigned int i=0; i quadrature(2); + FEValues 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::type> curls (quadrature.size()); + std::vector > 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(); + test_hyper_cube<3>(); +} diff --git a/tests/deal.II/fe_values_view_26.output b/tests/deal.II/fe_values_view_26.output new file mode 100644 index 0000000000..9341da7943 --- /dev/null +++ b/tests/deal.II/fe_values_view_26.output @@ -0,0 +1,27 @@ + +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 diff --git a/tests/deal.II/fe_values_view_27.cc b/tests/deal.II/fe_values_view_27.cc new file mode 100644 index 0000000000..54dbb8534c --- /dev/null +++ b/tests/deal.II/fe_values_view_27.cc @@ -0,0 +1,117 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + +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 +void test (const Triangulation &tr, + const FiniteElement &fe) +{ + deallog << "FE=" << fe.get_name() + << std::endl; + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + Vector fe_function(dof.n_dofs()); + for (unsigned int i=0; i quadrature(2); + FEValues 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::type> curls (quadrature.size()); + std::vector > 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(); + test_hyper_cube<3>(); +} diff --git a/tests/deal.II/fe_values_view_27.output b/tests/deal.II/fe_values_view_27.output new file mode 100644 index 0000000000..0fffb35a02 --- /dev/null +++ b/tests/deal.II/fe_values_view_27.output @@ -0,0 +1,27 @@ + +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 diff --git a/tests/deal.II/fe_values_view_28.cc b/tests/deal.II/fe_values_view_28.cc new file mode 100644 index 0000000000..74b1736bcd --- /dev/null +++ b/tests/deal.II/fe_values_view_28.cc @@ -0,0 +1,142 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +class F : public Function<2> +{ +public: + F() : Function<2>(2) {} + + virtual void vector_value (const Point<2> &p, + Vector &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 +void test (const Triangulation &tr, + const FiniteElement &fe) +{ + deallog << "FE=" << fe.get_name() + << std::endl; + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + Vector 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 quadrature(2); + FEValues 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::type> curls (quadrature.size()); + std::vector > 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(); +} diff --git a/tests/deal.II/fe_values_view_28.output b/tests/deal.II/fe_values_view_28.output new file mode 100644 index 0000000000..9341da7943 --- /dev/null +++ b/tests/deal.II/fe_values_view_28.output @@ -0,0 +1,27 @@ + +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 diff --git a/tests/fe/block_mask_06.debug.output b/tests/fe/block_mask_06.debug.output index 1d6e01e408..86258ec278 100644 --- a/tests/fe/block_mask_06.debug.output +++ b/tests/fe/block_mask_06.debug.output @@ -1,3 +1,3 @@ DEAL::OK -DEAL::ExcDimensionMismatch((n),(size())) +DEAL::dealii::ExcDimensionMismatch((n),(size())) diff --git a/tests/fe/block_mask_07.debug.output b/tests/fe/block_mask_07.debug.output index 13c0ee31da..495bb33e34 100644 --- a/tests/fe/block_mask_07.debug.output +++ b/tests/fe/block_mask_07.debug.output @@ -1,4 +1,4 @@ DEAL::OK -DEAL::ExcDimensionMismatch((n),(size())) +DEAL::dealii::ExcDimensionMismatch((n),(size())) DEAL::ExcMessage ("No block is selected at all!") diff --git a/tests/fe/component_mask_06.debug.output b/tests/fe/component_mask_06.debug.output index 1d6e01e408..86258ec278 100644 --- a/tests/fe/component_mask_06.debug.output +++ b/tests/fe/component_mask_06.debug.output @@ -1,3 +1,3 @@ DEAL::OK -DEAL::ExcDimensionMismatch((n),(size())) +DEAL::dealii::ExcDimensionMismatch((n),(size())) diff --git a/tests/fe/component_mask_07.debug.output b/tests/fe/component_mask_07.debug.output index 7e58605874..305c93780f 100644 --- a/tests/fe/component_mask_07.debug.output +++ b/tests/fe/component_mask_07.debug.output @@ -1,4 +1,4 @@ DEAL::OK -DEAL::ExcDimensionMismatch((n),(size())) +DEAL::dealii::ExcDimensionMismatch((n),(size())) DEAL::ExcMessage ("No component is selected at all!") diff --git a/tests/gla/mat_02.cc b/tests/gla/mat_02.cc index 9e2d1ef56c..7ae4ead9d3 100644 --- a/tests/gla/mat_02.cc +++ b/tests/gla/mat_02.cc @@ -45,6 +45,7 @@ void test () IndexSet local_relevant= local_active; if (myid==1) local_relevant.add_range(5,10); + local_relevant.add_range(0,1); CompressedSimpleSparsityPattern csp (local_relevant); @@ -52,8 +53,7 @@ void test () 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); diff --git a/tests/hp/get_interpolated_dof_values_01.cc b/tests/hp/get_interpolated_dof_values_01.cc index 743e8a75ea..3e1d9cdd70 100644 --- a/tests/hp/get_interpolated_dof_values_01.cc +++ b/tests/hp/get_interpolated_dof_values_01.cc @@ -44,7 +44,7 @@ template 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 tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -57,7 +57,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::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); @@ -68,9 +69,21 @@ void test () // 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::cell_iterator cell=dof_handler.begin(0); - Vector 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 local (dofs_per_cell); try { @@ -78,7 +91,7 @@ void test () } catch (const ExceptionBase &e) { - deallog << "Yes, exception!" << std::endl; + deallog << "Yes, exception 2!" << std::endl; deallog << e.get_exc_name() << std::endl; } } diff --git a/tests/hp/get_interpolated_dof_values_01.debug.output b/tests/hp/get_interpolated_dof_values_01.debug.output index ba7953b18d..41ebc1842e 100644 --- a/tests/hp/get_interpolated_dof_values_01.debug.output +++ b/tests/hp/get_interpolated_dof_values_01.debug.output @@ -1,7 +1,13 @@ -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.") diff --git a/tests/hp/get_interpolated_dof_values_02.cc b/tests/hp/get_interpolated_dof_values_02.cc index c97e8aafce..e6f64c218e 100644 --- a/tests/hp/get_interpolated_dof_values_02.cc +++ b/tests/hp/get_interpolated_dof_values_02.cc @@ -49,7 +49,7 @@ template 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 tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -62,7 +62,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::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); diff --git a/tests/hp/get_interpolated_dof_values_03.cc b/tests/hp/get_interpolated_dof_values_03.cc index 0a4e142cbd..e47f005e0c 100644 --- a/tests/hp/get_interpolated_dof_values_03.cc +++ b/tests/hp/get_interpolated_dof_values_03.cc @@ -44,9 +44,9 @@ template 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 tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -59,7 +59,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::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); diff --git a/tests/hp/set_dof_values_by_interpolation_01.cc b/tests/hp/set_dof_values_by_interpolation_01.cc index 323033ad07..0fa4497cca 100644 --- a/tests/hp/set_dof_values_by_interpolation_01.cc +++ b/tests/hp/set_dof_values_by_interpolation_01.cc @@ -44,7 +44,7 @@ template 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 tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -57,7 +57,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::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); @@ -68,13 +69,25 @@ void test () // 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::cell_iterator cell=dof_handler.begin(0); - Vector 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 local (dofs_per_cell); + + try + { + cell->set_dof_values_by_interpolation (local, solution); } catch (const ExceptionBase &e) { diff --git a/tests/hp/set_dof_values_by_interpolation_01.debug.output b/tests/hp/set_dof_values_by_interpolation_01.debug.output index 2aca68e01e..57dc42ca78 100644 --- a/tests/hp/set_dof_values_by_interpolation_01.debug.output +++ b/tests/hp/set_dof_values_by_interpolation_01.debug.output @@ -1,7 +1,13 @@ +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.") diff --git a/tests/hp/set_dof_values_by_interpolation_02.cc b/tests/hp/set_dof_values_by_interpolation_02.cc new file mode 100644 index 0000000000..172fb5956a --- /dev/null +++ b/tests/hp/set_dof_values_by_interpolation_02.cc @@ -0,0 +1,118 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PRECISION 2 + + + + +template +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 tr; + GridGenerator::hyper_cube(tr, 0., 1.); + tr.refine_global (2); + + hp::FECollection fe; + for (unsigned int i=1; i<5; ++i) + fe.push_back (FE_Q(i)); + + hp::DoFHandler dof_handler(tr); + for (typename hp::DoFHandler::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 solution1(dof_handler.n_dofs()); + Vector solution2(dof_handler.n_dofs()); + + // do the test + for (typename hp::DoFHandler::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 local (cell->get_fe().dofs_per_cell); + for (unsigned int i=0; iset_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; +} + + + diff --git a/tests/hp/set_dof_values_by_interpolation_02.output b/tests/hp/set_dof_values_by_interpolation_02.output new file mode 100644 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/hp/set_dof_values_by_interpolation_02.output @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK diff --git a/tests/hp/set_dof_values_by_interpolation_03.cc b/tests/hp/set_dof_values_by_interpolation_03.cc new file mode 100644 index 0000000000..cb3d0dce2c --- /dev/null +++ b/tests/hp/set_dof_values_by_interpolation_03.cc @@ -0,0 +1,110 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +template +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 tr; + GridGenerator::hyper_cube(tr, 0., 1.); + tr.refine_global (2); + + hp::FECollection fe; + for (unsigned int i=1; i<5; ++i) + fe.push_back (FE_Q(i)); + + hp::DoFHandler dof_handler(tr); + for (typename hp::DoFHandler::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 solution(dof_handler.n_dofs()); + + // do the test where we set data on the coarsest cell with an + // explicit Q1 space + typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(0); + Vector local (fe[0].dofs_per_cell); + for (unsigned int i=0; iset_dof_values_by_interpolation (local, solution, + 0); + + // for comparison purposes, also output the values of DoFs on all cells + for (typename hp::DoFHandler::active_cell_iterator cell=dof_handler.begin_active(); + cell!=dof_handler.end(); ++cell) + { + Vector x (cell->get_fe().dofs_per_cell); + cell->get_dof_values (solution, x); + deallog << "cell =" << cell << ": "; + for (unsigned int i=0; i(); + test<2>(); + test<3>(); + + return 0; +} + + + diff --git a/tests/hp/set_dof_values_by_interpolation_03.output b/tests/hp/set_dof_values_by_interpolation_03.output new file mode 100644 index 0000000000..e3cf799331 --- /dev/null +++ b/tests/hp/set_dof_values_by_interpolation_03.output @@ -0,0 +1,88 @@ + +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 diff --git a/tests/hp/solution_transfer_06.cc b/tests/hp/solution_transfer_06.cc new file mode 100644 index 0000000000..0163725017 --- /dev/null +++ b/tests/hp/solution_transfer_06.cc @@ -0,0 +1,107 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +using namespace dealii; + + +template +void test () +{ + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation); + + hp::FECollection fe_collection; + fe_collection.push_back(FE_Q(1)); + fe_collection.push_back(FE_Q(2)); + + hp::DoFHandler dof_handler(triangulation); + dof_handler.begin_active()->set_active_fe_index(0); + dof_handler.distribute_dofs (fe_collection); + + // Init solution + Vector solution(dof_handler.n_dofs()); + solution = 1.0; + + + // set refine flag for the only cell we have, then do the refinement + SolutionTransfer, hp::DoFHandler > + 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; cn_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 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 (); + test<2> (); + test<3> (); +} diff --git a/tests/hp/solution_transfer_06.output b/tests/hp/solution_transfer_06.output new file mode 100644 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/hp/solution_transfer_06.output @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK diff --git a/tests/hp/solution_transfer_07.cc b/tests/hp/solution_transfer_07.cc new file mode 100644 index 0000000000..8f69df6be8 --- /dev/null +++ b/tests/hp/solution_transfer_07.cc @@ -0,0 +1,107 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +using namespace dealii; + + +template +void test () +{ + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation); + + hp::FECollection fe_collection; + fe_collection.push_back(FE_Q(1)); + fe_collection.push_back(FE_Q(2)); + + hp::DoFHandler dof_handler(triangulation); + dof_handler.begin_active()->set_active_fe_index(0); + dof_handler.distribute_dofs (fe_collection); + + // Init solution + Vector solution(dof_handler.n_dofs()); + solution = 1.0; + + + // set refine flag for the only cell we have, then do the refinement + SolutionTransfer, hp::DoFHandler > + 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; cn_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 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 (); + test<2> (); + test<3> (); +} diff --git a/tests/hp/solution_transfer_07.output b/tests/hp/solution_transfer_07.output new file mode 100644 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/hp/solution_transfer_07.output @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK diff --git a/tests/hp/solution_transfer_08.cc b/tests/hp/solution_transfer_08.cc new file mode 100644 index 0000000000..ba3285f6ce --- /dev/null +++ b/tests/hp/solution_transfer_08.cc @@ -0,0 +1,107 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +using namespace dealii; + + +template +void test () +{ + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation); + triangulation.refine_global (1); + + hp::FECollection fe_collection; + fe_collection.push_back(FE_Q(1)); + fe_collection.push_back(FE_Q(2)); + + hp::DoFHandler dof_handler(triangulation); + for (unsigned int c=0; cn_children(); ++c) + dof_handler.begin(0)->child(c)->set_active_fe_index(1); + dof_handler.distribute_dofs (fe_collection); + + // Init solution + Vector solution(dof_handler.n_dofs()); + solution = 1.0; + + // coarsen everything away + SolutionTransfer, hp::DoFHandler > + solution_trans(dof_handler); + for (unsigned int c=0; cn_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 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 (); + test<2> (); + test<3> (); +} diff --git a/tests/hp/solution_transfer_08.output b/tests/hp/solution_transfer_08.output new file mode 100644 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/hp/solution_transfer_08.output @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK diff --git a/tests/hp/solution_transfer_09.cc b/tests/hp/solution_transfer_09.cc new file mode 100644 index 0000000000..1527b87d5a --- /dev/null +++ b/tests/hp/solution_transfer_09.cc @@ -0,0 +1,105 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +using namespace dealii; + + +template +void test () +{ + Triangulation triangulation; + GridGenerator::hyper_cube (triangulation); + + hp::FECollection fe_collection; + fe_collection.push_back(FE_Q(1)); + fe_collection.push_back(FE_Q(2)); + + hp::DoFHandler dof_handler(triangulation); + dof_handler.begin_active()->set_active_fe_index(0); + dof_handler.distribute_dofs (fe_collection); + + // Init solution + Vector solution(dof_handler.n_dofs()); + solution = 1.0; + + + // set refine flag for the only cell we have, then do the refinement + SolutionTransfer, hp::DoFHandler > + 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; cn_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 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 (); + test<2> (); + test<3> (); +} diff --git a/tests/hp/solution_transfer_09.output b/tests/hp/solution_transfer_09.output new file mode 100644 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/hp/solution_transfer_09.output @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK diff --git a/tests/hp/solution_transfer_10.cc b/tests/hp/solution_transfer_10.cc new file mode 100644 index 0000000000..75ac94f5fb --- /dev/null +++ b/tests/hp/solution_transfer_10.cc @@ -0,0 +1,119 @@ +// --------------------------------------------------------------------- +// $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 + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +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 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, 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 new_solution(dof_handler.n_dofs()); + solultion_trans.interpolate(solution, new_solution); + + deallog << "OK" << std::endl; +} + diff --git a/tests/hp/solution_transfer_10.output b/tests/hp/solution_transfer_10.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/hp/solution_transfer_10.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/petsc/copy_to_dealvec.cc b/tests/petsc/copy_to_dealvec.cc new file mode 100644 index 0000000000..08c27f28aa --- /dev/null +++ b/tests/petsc/copy_to_dealvec.cc @@ -0,0 +1,120 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include + + +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 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(); +} diff --git a/tests/petsc/copy_to_dealvec.with_mpi=true.mpirun=4.output b/tests/petsc/copy_to_dealvec.with_mpi=true.mpirun=4.output new file mode 100644 index 0000000000..6ed3f0103a --- /dev/null +++ b/tests/petsc/copy_to_dealvec.with_mpi=true.mpirun=4.output @@ -0,0 +1,8 @@ + +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 diff --git a/tests/petsc/copy_to_dealvec_block.cc b/tests/petsc/copy_to_dealvec_block.cc new file mode 100644 index 0000000000..b761d37994 --- /dev/null +++ b/tests/petsc/copy_to_dealvec_block.cc @@ -0,0 +1,138 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include + + +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 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 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(); +} diff --git a/tests/petsc/copy_to_dealvec_block.with_mpi=true.mpirun=4.output b/tests/petsc/copy_to_dealvec_block.with_mpi=true.mpirun=4.output new file mode 100644 index 0000000000..6ed3f0103a --- /dev/null +++ b/tests/petsc/copy_to_dealvec_block.with_mpi=true.mpirun=4.output @@ -0,0 +1,8 @@ + +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 diff --git a/tests/scripts/checkdoxygen.py b/tests/scripts/checkdoxygen.py new file mode 100755 index 0000000000..3bcd7f5da3 --- /dev/null +++ b/tests/scripts/checkdoxygen.py @@ -0,0 +1,30 @@ +#!/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])); diff --git a/tests/trilinos/copy_to_dealvec.cc b/tests/trilinos/copy_to_dealvec.cc new file mode 100644 index 0000000000..a7234635f0 --- /dev/null +++ b/tests/trilinos/copy_to_dealvec.cc @@ -0,0 +1,120 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include + + +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 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(); +} diff --git a/tests/trilinos/copy_to_dealvec.with_mpi=true.mpirun=4.output b/tests/trilinos/copy_to_dealvec.with_mpi=true.mpirun=4.output new file mode 100644 index 0000000000..6ed3f0103a --- /dev/null +++ b/tests/trilinos/copy_to_dealvec.with_mpi=true.mpirun=4.output @@ -0,0 +1,8 @@ + +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 diff --git a/tests/trilinos/copy_to_dealvec_block.cc b/tests/trilinos/copy_to_dealvec_block.cc new file mode 100644 index 0000000000..15b41fe26b --- /dev/null +++ b/tests/trilinos/copy_to_dealvec_block.cc @@ -0,0 +1,136 @@ +// --------------------------------------------------------------------- +// $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 +#include +#include +#include +#include +#include +#include +#include +#include + + +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 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 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(); +} diff --git a/tests/trilinos/copy_to_dealvec_block.with_mpi=true.mpirun=4.output b/tests/trilinos/copy_to_dealvec_block.with_mpi=true.mpirun=4.output new file mode 100644 index 0000000000..6ed3f0103a --- /dev/null +++ b/tests/trilinos/copy_to_dealvec_block.with_mpi=true.mpirun=4.output @@ -0,0 +1,8 @@ + +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 -- 2.39.5