From b2e5c6b021d070b1398519075d3ea2d6d58374b3 Mon Sep 17 00:00:00 2001 From: heltai Date: Mon, 2 Dec 2013 16:00:06 +0000 Subject: [PATCH] Merged from trunk git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@31844 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/bundled/functionparser/fpoptimizer.cc | 43 +- .../cmake/checks/check_03_compiler_bugs.cmake | 13 + .../checks/check_03_generator_bugs.cmake | 34 + deal.II/cmake/macros/macro_add_test.cmake | 12 +- .../macro_deal_ii_invoke_autopilot.cmake | 6 +- deal.II/cmake/macros/macro_pickup_tests.cmake | 36 +- deal.II/cmake/scripts/run_test.cmake | 6 - deal.II/cmake/scripts/run_testsuite.cmake | 9 +- deal.II/cmake/setup_testsuite.cmake | 29 +- deal.II/doc/developers/cmake-internals.html | 789 +++++++++--------- deal.II/doc/developers/porting.html | 63 +- deal.II/doc/developers/svn.html | 19 +- deal.II/doc/developers/testsuite.html | 557 ++++++------- deal.II/doc/developers/toc.html | 183 ++-- .../doc/developers/writing-documentation.html | 110 +-- deal.II/doc/documentation.html | 75 +- deal.II/doc/doxygen/CMakeLists.txt | 43 +- deal.II/doc/doxygen/footer.html | 11 - deal.II/doc/doxygen/header.html.in | 20 - deal.II/doc/doxygen/headers/main.h | 2 - deal.II/doc/doxygen/headers/multithreading.h | 30 +- deal.II/doc/doxygen/options.dox.in | 16 +- deal.II/doc/doxygen/scripts/mod_footer.pl | 15 + deal.II/doc/doxygen/scripts/mod_header.pl | 16 + deal.II/doc/doxygen/stylesheet.css | 326 +------- deal.II/doc/license.html | 2 +- deal.II/doc/navbar.html | 2 +- deal.II/doc/news/changes.h | 61 +- deal.II/doc/publications/dealii.bib | 13 +- deal.II/doc/publications/index.html | 106 +-- deal.II/doc/readme.html | 6 +- deal.II/doc/reports/index.html | 24 +- deal.II/doc/screen.css | 156 ++-- deal.II/doc/users/cmake.html | 579 ++++++------- deal.II/doc/users/cmakelists.html | 52 +- deal.II/doc/users/doxygen.html | 4 +- deal.II/doc/users/navbar.html | 2 +- deal.II/doc/users/toc.html | 234 +++--- deal.II/examples/step-14/doc/results.dox | 22 +- deal.II/examples/step-14/step-14.cc | 249 +++--- deal.II/examples/step-42/doc/intro.dox | 4 +- deal.II/examples/step-51/doc/intro.dox | 28 +- deal.II/examples/step-51/doc/results.dox | 30 +- deal.II/examples/step-9/doc/results.dox | 18 +- deal.II/examples/step-9/step-9.cc | 392 +++++---- .../include/deal.II/base/derivative_form.h | 20 +- deal.II/include/deal.II/base/exceptions.h | 2 +- .../deal.II/base/polynomials_nedelec.h | 18 +- deal.II/include/deal.II/base/quadrature.h | 20 +- deal.II/include/deal.II/base/quadrature_lib.h | 4 +- .../deal.II/base/tensor_product_polynomials.h | 2 +- deal.II/include/deal.II/base/work_stream.h | 144 ++-- .../include/deal.II/dofs/dof_renumbering.h | 36 +- deal.II/include/deal.II/fe/fe_face.h | 2 +- deal.II/include/deal.II/fe/fe_nedelec.h | 16 +- deal.II/include/deal.II/fe/fe_values.h | 82 +- deal.II/include/deal.II/integrators/laplace.h | 31 +- .../include/deal.II/lac/constraint_matrix.h | 8 + deal.II/include/deal.II/lac/sparse_direct.h | 10 +- .../deal.II/matrix_free/fe_evaluation.h | 24 +- .../matrix_free/matrix_free.templates.h | 6 +- .../include/deal.II/numerics/vector_tools.h | 10 +- .../deal.II/numerics/vector_tools.templates.h | 32 +- deal.II/source/base/data_out_base.cc | 2 +- deal.II/source/base/exceptions.cc | 39 +- deal.II/source/dofs/dof_renumbering.cc | 22 - deal.II/source/dofs/dof_renumbering.inst.in | 17 - deal.II/source/dofs/dof_tools_constraints.cc | 210 +++-- deal.II/source/fe/fe_values.cc | 162 ++-- deal.II/source/fe/mapping_cartesian.cc | 24 +- deal.II/source/fe/mapping_q1.cc | 31 +- deal.II/source/grid/grid_generator.cc | 5 +- deal.II/source/grid/grid_tools.inst.in | 14 + deal.II/source/lac/constraint_matrix.cc | 35 +- deal.II/source/lac/sparse_direct.cc | 48 +- deal.II/source/numerics/data_out.cc | 25 +- .../numerics/derivative_approximation.cc | 7 +- .../numerics/vector_tools_interpolate.inst.in | 2 +- deal.II/tests/CMakeLists.txt | 37 +- 79 files changed, 2777 insertions(+), 2817 deletions(-) create mode 100644 deal.II/cmake/checks/check_03_generator_bugs.cmake delete mode 100644 deal.II/doc/doxygen/footer.html delete mode 100644 deal.II/doc/doxygen/header.html.in create mode 100644 deal.II/doc/doxygen/scripts/mod_footer.pl create mode 100644 deal.II/doc/doxygen/scripts/mod_header.pl diff --git a/deal.II/bundled/functionparser/fpoptimizer.cc b/deal.II/bundled/functionparser/fpoptimizer.cc index 4eab746805..a9d7d3cb26 100644 --- a/deal.II/bundled/functionparser/fpoptimizer.cc +++ b/deal.II/bundled/functionparser/fpoptimizer.cc @@ -16,6 +16,20 @@ download the development version of the library. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "fpconfig.hh" #ifdef FP_SUPPORT_OPTIMIZER #include "fparser.hh" @@ -1181,7 +1195,6 @@ x83 int lI2; #else -#include typedef uint_least32_t lI2; @@ -1296,7 +1309,6 @@ Birth(){Have(p);} nG Set(Ref*p2){Have(p2);iC2;p=p2;} #endif -#include e72 Compare2ndRev{nN1 T>inline @@ -1344,7 +1356,6 @@ long xE1; #define FPHASH_CONST(x) x##ULL #else -#include typedef uint_fast64_t xE1; @@ -1369,8 +1380,6 @@ fphash_t&yZ1!=e82?hash1 -#include l33 lA1{e72 Grammar;} @@ -1644,7 +1653,6 @@ eM3&indent="\\" #endif #ifndef FPOptimizer_GrammarHH #define FPOptimizer_GrammarHH -#include t5{tK1 class c02;} @@ -1768,9 +1776,6 @@ fp_const_negativezero()yP-Epsilon xF::value;} } #ifdef FP_SUPPORT_OPTIMIZER -#include -#include -#include nG1{using l33 lA1;using @@ -1946,16 +1951,11 @@ FPoptimizer_Optimize::tC info,e32 tO3,std::ostream&o=cV2);} #endif -#include e42 lA1::nZ2 yT1=false);e42 iU1 yT1=false); -#include -#include -#include -#include using l33 lA1;using @@ -2163,8 +2163,6 @@ tmp.str(); #endif } #ifdef FP_SUPPORT_OPTIMIZER -#include -#include #ifndef FP_GENERATING_POWI_TABLE enum{MAX_POWI_BYTECODE_LENGTH=20} ; @@ -3226,9 +3224,6 @@ ConstantFolding_MulLogicItems(iM3(tree.GetOpcode()==cMul)i1 nI iH2,false);} } -#include -#include -#include l33{using l33 FUNCTIONPARSERTYPES;using @@ -4209,7 +4204,6 @@ c81 cM1)n4 eE3 t23} -#include l33{using l33 FUNCTIONPARSERTYPES;using @@ -4605,8 +4599,6 @@ break;yF3 xY3 return t23} -#include -#include #ifdef FP_SUPPORT_OPTIMIZER using l33 @@ -4959,11 +4951,6 @@ eB1 } #endif #ifdef FP_SUPPORT_OPTIMIZER -#include -#include -#include -#include -#include using l33 FUNCTIONPARSERTYPES; @@ -5057,7 +5044,6 @@ l33 lA1;using l33 FUNCTIONPARSERTYPES; -#include l33 lA1{x83 ParamSpec_GetDepCode @@ -5191,7 +5177,6 @@ depcode=ParamSpec_GetDepCode(param);if(depcode!=0)o<<"@D" < using l33 lA1;using diff --git a/deal.II/cmake/checks/check_03_compiler_bugs.cmake b/deal.II/cmake/checks/check_03_compiler_bugs.cmake index a31f9f4824..f278a9435d 100644 --- a/deal.II/cmake/checks/check_03_compiler_bugs.cmake +++ b/deal.II/cmake/checks/check_03_compiler_bugs.cmake @@ -350,6 +350,19 @@ IF( DEAL_II_ICC_NUMERICLIMITS_BUG OR ENDIF() +# +# in intel (at least 13.1 and 14), vectorization causes +# wrong code. See https://code.google.com/p/dealii/issues/detail?id=156 +# or tests/hp/solution_transfer.cc +# A work-around is to disable all vectorization. +# +# - Timo Heister, 2013 +# +IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-vec") +ENDIF() + + # # gcc-4.8.1 has some problems with the constexpr "vertices_per_cell" in the # definition of alternating_form_at_vertices. diff --git a/deal.II/cmake/checks/check_03_generator_bugs.cmake b/deal.II/cmake/checks/check_03_generator_bugs.cmake new file mode 100644 index 0000000000..76d31d9487 --- /dev/null +++ b/deal.II/cmake/checks/check_03_generator_bugs.cmake @@ -0,0 +1,34 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 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. +## +## --------------------------------------------------------------------- + + +# +# CMakes Ninja generator is currently incompatible with everything but gcc +# and clang. +# +# - Matthias Maier, 2013 +# + +IF( CMAKE_GENERATOR MATCHES "Ninja" AND NOT + ( CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR + CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) ) + MESSAGE(FATAL_ERROR "\n" + "Error!\n" + "The CMAKE_GENERATOR \"${CMAKE_GENERATOR}\" " + "currently only supports the GNU and Clang C++ compilers, but " + "\"${CMAKE_CXX_COMPILER_ID}\" was found.\n\n" + ) +ENDIF() diff --git a/deal.II/cmake/macros/macro_add_test.cmake b/deal.II/cmake/macros/macro_add_test.cmake index 8c3843a2fb..c4a2b90a1e 100644 --- a/deal.II/cmake/macros/macro_add_test.cmake +++ b/deal.II/cmake/macros/macro_add_test.cmake @@ -31,12 +31,9 @@ # DEAL_II_ADD_TEST(category test_name comparison_file [ARGN]) # # This macro assumes that a source file "./tests/category/.cc" -# as well as the comparison file "./tests/category/" is -# available in the testsuite. The output of compiled source file is -# compared against the file comparison file. -# -# [ARGN] is an optional list of additional output lines passed down to the -# run_test.cmake script and printed at the beginning of the test output. +# as well as the comparison file "" is available in the +# testsuite. The output of compiled source file is compared against the +# file comparison file. # # This macro gets the following options from the comparison file name (have # a look at the testsuite documentation for details): @@ -246,7 +243,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) -DTRGT=${_diff_target} -DTEST=${_test_full} -DEXPECT=${_expect} - -DADDITIONAL_OUTPUT=${ARGN} -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR} -DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_target}/interrupt_guard.cc -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake @@ -263,7 +259,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) # when compiling the not yet existent executable that is shared # between the different tests. # - # Luckily CMake has a mechanism to force a test to be run when + # Luckily CMake has a mechanism to force a test to be run after # another has finished (and both are scheduled): # IF(NOT "${_n_cpu}" STREQUAL "0") diff --git a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake index 46a05912e0..c0207506c9 100644 --- a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake @@ -97,15 +97,15 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") IF(DEFINED OSX_CERTIFICATE_NAME) - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/${TARGET}.signed + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed COMMAND codesign -f -s ${OSX_CERTIFICATE_NAME} ${TARGET} - COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/${TARGET}.signed + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed COMMENT "Digitally signing ${TARGET}" DEPENDS ${TARGET} VERBATIM ) ADD_CUSTOM_TARGET(sign ALL - DEPENDS ${CMAKE_BINARY_DIR}/${TARGET}.signed + DEPENDS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed ) ADD_DEPENDENCIES(run sign) ELSE() diff --git a/deal.II/cmake/macros/macro_pickup_tests.cmake b/deal.II/cmake/macros/macro_pickup_tests.cmake index 45b69eddce..69a3950b97 100644 --- a/deal.II/cmake/macros/macro_pickup_tests.cmake +++ b/deal.II/cmake/macros/macro_pickup_tests.cmake @@ -51,6 +51,30 @@ MACRO(DEAL_II_PICKUP_TESTS) SET(_define_test FALSE) ENDIF() + # + # Respect compiler constraint: + # + + STRING(REGEX MATCHALL + "compiler=[^=]*=(on|off|yes|no|true|false)" _matches ${_test} + ) + FOREACH(_match ${_matches}) + STRING(REGEX REPLACE + "^compiler=([^=]*)=(on|off|yes|no|true|false)$" "\\1" + _compiler ${_match} + ) + STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match}) + + IF( ( "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" + MATCHES "^${_compiler}" + AND NOT ${_boolean} ) + OR ( NOT "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" + MATCHES "^${_compiler}" + AND ${_boolean} ) ) + SET(_define_test FALSE) + ENDIF() + ENDFOREACH() + # # Query configuration and check whether we support it. Otherwise # set _define_test to FALSE: @@ -82,18 +106,6 @@ The feature \"DEAL_II_${_feature}\" does not exist.\n" ENDIF() ENDFOREACH() - # - # Respect TEST_OVERRIDE_LOCATION: - # - - SET(_add_output) - IF(EXISTS ${TEST_OVERRIDE_LOCATION}/${_category}/${_test}) - SET(_add_output - "!!NOTE!! Comparison file overriden by ${TEST_OVERRIDE_LOCATION}/${_category}/${_test}" - ) - SET(_comparison "${TEST_OVERRIDE_LOCATION}/${_category}/${_test}") - ENDIF() - IF(_define_test) STRING(REGEX REPLACE "\\..*" "" _test ${_test}) DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_add_output}) diff --git a/deal.II/cmake/scripts/run_test.cmake b/deal.II/cmake/scripts/run_test.cmake index cb815aae64..47b7db7f87 100644 --- a/deal.II/cmake/scripts/run_test.cmake +++ b/deal.II/cmake/scripts/run_test.cmake @@ -28,8 +28,6 @@ # (return value 0) # Possible values are CONFIGURE, BUILD, RUN, DIFF, PASSED # -# ADDITIONAL_OUTPUT - A list of additional output lines that should be printed -# # GUARD_FILE - used to detect a forced interruption of this script: On # startup the backed up file ${GUARD_FILE}_bck is put back # in place as ${GUARD_FILE} and on exit ${GUARD_FILE} is @@ -90,10 +88,6 @@ ENDIF() MESSAGE("Test ${TEST}: ${_stage}") -FOREACH(_line ${ADDITIONAL_OUTPUT}) - MESSAGE("Test ${TEST}: ${_line}") -ENDFOREACH() - MESSAGE("=============================== OUTPUT BEGIN ===============================") IF("${_stage}" STREQUAL "PASSED") diff --git a/deal.II/cmake/scripts/run_testsuite.cmake b/deal.II/cmake/scripts/run_testsuite.cmake index f835123a1c..6eb0713820 100644 --- a/deal.II/cmake/scripts/run_testsuite.cmake +++ b/deal.II/cmake/scripts/run_testsuite.cmake @@ -521,7 +521,12 @@ ENDIF() # # ######################################################################## -IF(NOT "${_branch}" STREQUAL "") +IF("${_branch}" STREQUAL "") + # + # If we have no branch information, just assume we are on trunk: + # + SET_PROPERTY(GLOBAL PROPERTY SubProject "trunk") +ELSE() SET_PROPERTY(GLOBAL PROPERTY SubProject ${_branch}) ENDIF() @@ -624,4 +629,4 @@ IF("${_res}" STREQUAL "0") MESSAGE("-- Submission successful. Goodbye!") ENDIF() -# .oO( This script is freaky 593 lines long... ) +# .oO( This script is freaky 632 lines long... ) diff --git a/deal.II/cmake/setup_testsuite.cmake b/deal.II/cmake/setup_testsuite.cmake index 23b0de2f46..9dc9756a74 100644 --- a/deal.II/cmake/setup_testsuite.cmake +++ b/deal.II/cmake/setup_testsuite.cmake @@ -56,6 +56,9 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake "") # Setup tests: ADD_CUSTOM_TARGET(setup_tests) +# Remove all tests: +ADD_CUSTOM_TARGET(prune_tests) + # Regenerate tests (run "make rebuild_cache" in subprojects): ADD_CUSTOM_TARGET(regen_tests COMMAND ${CMAKE_COMMAND} @@ -70,24 +73,14 @@ ADD_CUSTOM_TARGET(clean_tests -- ${MAKEOPTS} ) -# Remove all tests: -ADD_CUSTOM_TARGET(prune_tests - COMMAND ${CMAKE_COMMAND} - --build ${CMAKE_BINARY_DIR}/tests --target prune_tests - -- ${MAKEOPTS} - ) - MESSAGE(STATUS "Setup testsuite") # -# Setup the testsuite project: It is merely a wrapper around the individual -# regen_tests_*, clean_tests_* and prune_tests_* targets. -# down to it: +# Provide custom targets to setup and prune the testsuite subproject: # EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} - -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR} -DTEST_DIR=${TEST_DIR} ${CMAKE_SOURCE_DIR}/tests WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests @@ -98,11 +91,7 @@ SET(_options) LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR}) LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}) FOREACH(_var - DIFF_DIR - NUMDIFF_DIR - TEST_DIFF - TEST_OVERRIDE_LOCATION - TEST_PICKUP_REGEX + DIFF_DIR NUMDIFF_DIR TEST_DIFF TEST_OVERRIDE_LOCATION TEST_PICKUP_REGEX TEST_TIME_LIMIT ) # always undefine: @@ -125,7 +114,7 @@ LIST(REMOVE_DUPLICATES _categories) # FOREACH(_category ${_categories}) - IF(EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt) + IF(EXISTS ${CMAKE_SOURCE_DIR}/tests/${_category}/CMakeLists.txt) SET(_category_dir ${CMAKE_SOURCE_DIR}/tests/${_category}) ELSEIF(EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt) SET(_category_dir ${TEST_DIR}/${_category}) @@ -145,6 +134,12 @@ FOREACH(_category ${_categories}) ) ADD_DEPENDENCIES(setup_tests setup_tests_${_category}) + ADD_CUSTOM_TARGET(prune_tests_${_category} + COMMAND ${CMAKE_COMMAND} -E remove_directory + ${CMAKE_BINARY_DIR}/tests/${_category} + ) + ADD_DEPENDENCIES(prune_tests prune_tests_${_category}) + FILE(APPEND ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake "SUBDIRS(${_category})\n" ) diff --git a/deal.II/doc/developers/cmake-internals.html b/deal.II/doc/developers/cmake-internals.html index 9d985da5e6..b2308511d2 100644 --- a/deal.II/doc/developers/cmake-internals.html +++ b/deal.II/doc/developers/cmake-internals.html @@ -160,52 +160,51 @@ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} flags or compiler support, please respect the following note
-
-    #
-    # (./cmake/setup_compiler_flags.cmake)
-    #
-    # ####################
-    # #     FAT NOTE:    #
-    # ####################
-    #
-    # All configuration in setup_compiler_flags.cmake and
-    # setup_compiler_flags_.cmake shall ONLY modify:
-    #
-    #   CMAKE_CXX_FLAGS
-    #   DEAL_II_CXX_FLAGS_DEBUG
-    #   DEAL_II_CXX_FLAGS_RELEASE
-    #   DEAL_II_LINKER_FLAGS
-    #   DEAL_II_LINKER_FLAGS_DEBUG
-    #   DEAL_II_LINKER_FLAGS_RELEASE
-    #
-    # All modifications shall be guarded with the ENABLE_IF_SUPPORTED
-    # or ENABLE_IF_LINKS macro, e.g.
-    #
-    #   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic")
-    #   ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed")
-    #
-    # Compiler flags for platform dependent optimization (such as
-    # -march=native) must always be guarded with
-    # DEAL_II_ALLOW_PLATFORM_INTROSPECTION:
-    #
-    #   IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
-    #     ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-march=native")
-    #   ENDIF()
-    #
-    # Checks for compiler features (such as C++11 support) and compiler
-    # specific bugs that
-    #   - usually set up further configuration (such as preprocessor
-    #     definitions)
-    #   - disable a specific flag for a specific compiler version.
-    #
-    # belong the corresponding file:
-    #
-    #   ./cmake/checks/check_01_compiler_features.cmake
-    #   ./cmake/checks/check_01_cpu_features.cmake
-    #   ./cmake/checks/check_01_cxx_features.cmake
-    #   ./cmake/checks/check_01_system_features.cmake
-    #   ./cmake/checks/check_02_compiler_bugs.cmake
-    #
+#
+# (./cmake/setup_compiler_flags.cmake)
+#
+# ####################
+# #     FAT NOTE:    #
+# ####################
+#
+# All configuration in setup_compiler_flags.cmake and
+# setup_compiler_flags_.cmake shall ONLY modify:
+#
+#   CMAKE_CXX_FLAGS
+#   DEAL_II_CXX_FLAGS_DEBUG
+#   DEAL_II_CXX_FLAGS_RELEASE
+#   DEAL_II_LINKER_FLAGS
+#   DEAL_II_LINKER_FLAGS_DEBUG
+#   DEAL_II_LINKER_FLAGS_RELEASE
+#
+# All modifications shall be guarded with the ENABLE_IF_SUPPORTED
+# or ENABLE_IF_LINKS macro, e.g.
+#
+#   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic")
+#   ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed")
+#
+# Compiler flags for platform dependent optimization (such as
+# -march=native) must always be guarded with
+# DEAL_II_ALLOW_PLATFORM_INTROSPECTION:
+#
+#   IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+#     ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-march=native")
+#   ENDIF()
+#
+# Checks for compiler features (such as C++11 support) and compiler
+# specific bugs that
+#   - usually set up further configuration (such as preprocessor
+#     definitions)
+#   - disable a specific flag for a specific compiler version.
+#
+# belong the corresponding file:
+#
+#   ./cmake/checks/check_01_compiler_features.cmake
+#   ./cmake/checks/check_01_cpu_features.cmake
+#   ./cmake/checks/check_01_cxx_features.cmake
+#   ./cmake/checks/check_01_system_features.cmake
+#   ./cmake/checks/check_02_compiler_bugs.cmake
+#
 

@@ -220,26 +219,24 @@ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} there are:
-    
-    ./cmake/checks/check_01_compiler_features.cmake
-      - Search for support for compiler dependent features such as stack
-        trace support, demangler support, etc.
-
-    ./cmake/checks/check_01_cpu_features.cmake
-      - Platform introspection for CPU features goes here and must be
-        guarded with DEAL_II_ALLOW_PLATFORM_INTROSPECTION
+./cmake/checks/check_01_compiler_features.cmake
+  - Search for support for compiler dependent features such as stack
+    trace support, demangler support, etc.
 
-    ./cmake/checks/check_01_cxx_features.cmake
-      - Check for supported C++ language features such as sufficient C++11
-        support
+./cmake/checks/check_01_cpu_features.cmake
+  - Platform introspection for CPU features goes here and must be
+    guarded with DEAL_II_ALLOW_PLATFORM_INTROSPECTION
 
-    ./cmake/checks/check_01_system_features.cmake
-      - Checks for specific platform (Linux/Darwin/CYGWIN/Windows..)
-        features and support
+./cmake/checks/check_01_cxx_features.cmake
+  - Check for supported C++ language features such as sufficient C++11
+    support
 
-    ./cmake/checks/check_02_compiler_bugs.cmake
-      - Check for compiler bugs
+./cmake/checks/check_01_system_features.cmake
+  - Checks for specific platform (Linux/Darwin/CYGWIN/Windows..)
+    features and support
 
+./cmake/checks/check_02_compiler_bugs.cmake
+  - Check for compiler bugs
 
    @@ -260,51 +257,48 @@ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} There are a number of readily available platform check macros:
    -
    -    CHECK_CXX_SOURCE_COMPILES(source variable)
    -      - Checks whether it is possible to compile _and_ link the code snippet
    -        <source>. If successful, variable is set to 1.
    -
    -    CHECK_CXX_SOURCE_RUNS(source variable)
    -      - variable is set to 1 if <source> could be successfully compiled and
    -        linked and the resulting program ran and exited without error.
    -        Avoid this macro outside of a DEAL_II_ALLOW_PLATFORM_INTROSPECTION
    -        guard. A sensible fallback should be provided if the check cannot
    -        be run (e.g. when cross compiling).
    -
    -    CHECK_CXX_COMPILER_BUG(source variable)
    -      - Inverts the logic of CHECK_CXX_SOURCE_COMPILES(), i.e. variable is
    -        set to 1 if it was not possible to compile and link <source>.
    -
    -    CHECK_INCLUDE_FILE_CXX(header variable)
    -      - Check whether it is possible to compile and link a dummy program
    -        including <header>.
    -
    -    CHECK_FUNCTION_EXISTS(function variable)
    -      - Check for the existence of a function prototype with name
    -        <function>. (Don't forget to specify the link libraries, see
    -        below.) Use CHECK_CXX_SYMBOL_EXISTS to search for C++ function
    -        definitions instead, if possible.
    -
    -    CHECK_CXX_SYMBOL_EXISTS(symbol header_file variable)
    -      - Check for the existence of a symbol definition in the header_file
    -        as well as for the presence in the current link interface
    -        (Don't forget to specify the link libraries, see below.)
    -
    -    CHECK_CXX_COMPILER_FLAG(flag variable)
    -      - Sets the variable to 1 if the compiler understands the flag.
    -
    +CHECK_CXX_SOURCE_COMPILES(source variable)
    +  - Checks whether it is possible to compile _and_ link the code snippet
    +    <source>. If successful, variable is set to 1.
    +
    +CHECK_CXX_SOURCE_RUNS(source variable)
    +  - variable is set to 1 if <source> could be successfully compiled and
    +    linked and the resulting program ran and exited without error.
    +    Avoid this macro outside of a DEAL_II_ALLOW_PLATFORM_INTROSPECTION
    +    guard. A sensible fallback should be provided if the check cannot
    +    be run (e.g. when cross compiling).
    +
    +CHECK_CXX_COMPILER_BUG(source variable)
    +  - Inverts the logic of CHECK_CXX_SOURCE_COMPILES(), i.e. variable is
    +    set to 1 if it was not possible to compile and link <source>.
    +
    +CHECK_INCLUDE_FILE_CXX(header variable)
    +  - Check whether it is possible to compile and link a dummy program
    +    including <header>.
    +
    +CHECK_FUNCTION_EXISTS(function variable)
    +  - Check for the existence of a function prototype with name
    +    <function>. (Don't forget to specify the link libraries, see
    +    below.) Use CHECK_CXX_SYMBOL_EXISTS to search for C++ function
    +    definitions instead, if possible.
    +
    +CHECK_CXX_SYMBOL_EXISTS(symbol header_file variable)
    +  - Check for the existence of a symbol definition in the header_file
    +    as well as for the presence in the current link interface
    +    (Don't forget to specify the link libraries, see below.)
    +
    +CHECK_CXX_COMPILER_FLAG(flag variable)
    +  - Sets the variable to 1 if the compiler understands the flag.
     
  • Necessary compiler flags can easily set in the string variable CMAKE_REQUIRED_FLAGS. There are two small macros that do this job nicely: -
    -  
    -    PUSH_TEST_FLAG("-Werror")
    -    CHECK_CXX_SOURCE_COMPILES(...)
    -    POP_TEST_FLAG()
    +
    +PUSH_TEST_FLAG("-Werror")
    +CHECK_CXX_SOURCE_COMPILES(...)
    +POP_TEST_FLAG()
     
  • Necessary include directories and libraries necessary for @@ -314,12 +308,11 @@ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} lists and later on reset CMAKE_REQUIRED_* (including CMAKE_REQUIRED_FLAGS) to their default values: -
    -
    -    LIST(APPEND CMAKE_REQUIRED_INCLUDES <a list of includes>)
    -    LIST(APPEND CMAKE_REQUIRED_LIBRARIES <a list of libraries>)
    -    CHECK_CXX_SOURCE_COMPILES(...)
    -    RESET_CMAKE_REQUIRED()
    +
    +LIST(APPEND CMAKE_REQUIRED_INCLUDES <a list of includes>)
    +LIST(APPEND CMAKE_REQUIRED_LIBRARIES <a list of libraries>)
    +CHECK_CXX_SOURCE_COMPILES(...)
    +RESET_CMAKE_REQUIRED()
     

@@ -353,16 +346,15 @@ SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} If successful, the following uncached variables might be set:
-	
-    FEATURE_FOUND
-    FEATURE_LIBRARIES
-    FEATURE_INCLUDE_DIRS
-    FEATURE_LINKER_FLAGS
-
-    FEATURE_VERSION
-    FEATURE_VERSION_MAJOR
-    FEATURE_VERSION_MINOR
-    FEATURE_VERSION_SUBMINOR
+FEATURE_FOUND
+FEATURE_LIBRARIES
+FEATURE_INCLUDE_DIRS
+FEATURE_LINKER_FLAGS
+
+FEATURE_VERSION
+FEATURE_VERSION_MAJOR
+FEATURE_VERSION_MINOR
+FEATURE_VERSION_SUBMINOR
 
There are obviously valid exceptions from this rule, though. @@ -375,321 +367,312 @@ There are obviously valid exceptions from this rule, though. A hint with FEATURE_DIR can be set up for convenience. It is best to start the Find module by -
-
-    SET_IF_EMPTY(FEATURE_DIR "$ENV{FEATURE_DIR}")
+
+SET_IF_EMPTY(FEATURE_DIR "$ENV{FEATURE_DIR}")
 
and use FEATURE_DIR as a hint. If the external library could be found, hide it via MARK_AS_ADVANCED, if the external library could not be found, set a cache value: -
-  
-    SET(FEATURE_DIR "" CACHE PATH "An optional hint to a FEATURE directory")
+
+SET(FEATURE_DIR "" CACHE PATH "An optional hint to a FEATURE directory")
 
- -

./cmake/configure/configure_*.cmake

- + +

./cmake/configure/configure_*.cmake

+

The final step in the configuration phase is the setup of features (which refer to external or bundled libraries deal.II can optionally interface with.) -

-

- At bare minimum configure_<feature>.cmake - file for a feature just consists of a call to the - CONFIGURE_FEATURE(<FEATURE>) macro which is - implemented in - ./cmake/macros/macro_configure_feature.cmake. - In this case the corresponding Find<FEATURE>.cmake - module is used to determine whether an external dependency can be - resolved or not. Depending on the current state of - DEAL_II_WITH_<FEATURE> (see - here) the variables -

-
-    FEATURE_LIBRARIES
-    FEATURE_INCLUDE_DIRS
-    FEATURE_LINKER_FLAGS
-          
- are appended to the set of global variables - and DEAL_II_WITH_<FEATURE> is set to - TRUE. -

- -

- It is possible to override this default behaviour with the following - variables and macros (all of them are optional and will be replaced - by an appropriate default action if unset): +

+ At bare minimum configure_<feature>.cmake + file for a feature just consists of a call to the + CONFIGURE_FEATURE(<FEATURE>) macro which is + implemented in + ./cmake/macros/macro_configure_feature.cmake. + In this case the corresponding Find<FEATURE>.cmake + module is used to determine whether an external dependency can be + resolved or not. Depending on the current state of + DEAL_II_WITH_<FEATURE> (see + here) the variables +

+FEATURE_LIBRARIES
+FEATURE_INCLUDE_DIRS
+FEATURE_LINKER_FLAGS
+
+ are appended to the set of global variables + and DEAL_II_WITH_<FEATURE> is set to + TRUE. +

+ +

+ It is possible to override this default behaviour with the following + variables and macros (all of them are optional and will be replaced + by an appropriate default action if unset): +

    +
  • + <FEATURE> means all caps, + <feature> means all lowercase + +
  • + In ./cmake/configure/configure_<feature>.cmake: +
    +FEATURE_<FEATURE>_DEPENDS              (a variable)
    +  - a variable which contains an optional list of other features
    +    this feature depends on (and which have to be enabled for this feature
    +    to work.) The features must be given with the full option toggle:
    +    DEAL_II_WITH_[...]
    +
    +FEATURE_<FEATURE>_FIND_EXTERNAL(var)   (a macro)
    +  - which should set var to TRUE if all dependencies for the feature are
    +    fulfilled. In this case all necessary variables for
    +    FEATURE_<FEATURE>_CONFIGURE_EXTERNAL must be set.
    +    Otherwise var should remain unset.
    +    If this macro is undefined, FIND_PACKAGE(<FEATURES>) is
    +    called directly instead.
    +
    +FEATURE_<FEATURE>_CONFIGURE_EXTERNAL()  (a macro)
    +  - which should setup all necessary configuration for the feature with
    +    external dependencies. If something goes wrong this macro must
    +    issue a FATAL_ERROR.
    +    If this macro is undefined, the information provided in
    +    <FEATURES>_LIBRARIES, <FEATURES>_INCLUDE_DIRS and
    +    <FEATURES>_LINKER_FLAGS is used for the build.
    +
    +FEATURE_<FEATURE>_CONFIGURE_BUNDLED()  (a macro)
    +  - which should setup all necessary configuration for the feature with
    +    bundled source dependencies. If something goes wrong this macro must
    +    issue a FATAL_ERROR.
    +
    +FEATURE_<FEATURE>_ERROR_MESSAGE()      (macro)
    +  - which should print a meaningful error message (with FATAL_ERROR) for
    +    the case that no external library was found (and bundled is not
    +    allowed to be used.) If not defined, a suitable default error message
    +    will be printed.
    +
    + +
  • + In ./bundled/CMakeLists.txt: +
    +FEATURE_<FEATURE>_HAVE_BUNDLED         (a boolean)
    +  - which should either be set to TRUE if all necessary libraries of the
    +    features comes bundled with deal.II and hence can be supported
    +    without external dependencies, or unset.
    +
    +DEAL_II_FORCE_BUNDLED_<FEATURE>        (an option)
    +  - If <feature> can be set up by bundled libraries, this
    +    configuration option must be present to force a use of bundled
    +    dependencies
    +
    + +
  • + Furthermore, if + FEATURE_<FEATURE>_BUNDLED_CONFIGURED is set to + TRUE the file ./bundled/CMakeLists.txt + must compile and install the bundled package appropriately. +
+

+ + + + +

Global variables controlling the build process

+ +

+ The following list describes all global variables controlling the + build process and the visibility associated with it (internal use for + compiling deal.Ii, externally used variables will get exported in + deal.IIConfig.cmake). Lists should be manipulated with + LIST(APPEND ...), flags with ADD_FLAGS(...) + (or if it is necessary to guard them with + ENABLE_IF_SUPPORTED(...).) +

    +
  • + The general (internal) logic for variables applies:
      -
    • - <FEATURE> means all caps, - <feature> means all lowercase - -
    • - In ./cmake/configure/configure_<feature>.cmake: -
      -
      -    FEATURE_<FEATURE>_DEPENDS              (a variable)
      -      - a variable which contains an optional list of other features
      -        this feature depends on (and which have to be enabled for this feature
      -        to work.) The features must be given with the full option toggle:
      -        DEAL_II_WITH_[...]
      -
      -    FEATURE_<FEATURE>_FIND_EXTERNAL(var)   (a macro)
      -      - which should set var to TRUE if all dependencies for the feature are
      -        fulfilled. In this case all necessary variables for
      -        FEATURE_<FEATURE>_CONFIGURE_EXTERNAL must be set.
      -        Otherwise var should remain unset.
      -        If this macro is undefined, FIND_PACKAGE(<FEATURES>) is
      -        called directly instead.
      -
      -    FEATURE_<FEATURE>_CONFIGURE_EXTERNAL()  (a macro)
      -      - which should setup all necessary configuration for the feature with
      -        external dependencies. If something goes wrong this macro must
      -        issue a FATAL_ERROR.
      -        If this macro is undefined, the information provided in
      -        <FEATURES>_LIBRARIES, <FEATURES>_INCLUDE_DIRS and
      -        <FEATURES>_LINKER_FLAGS is used for the build.
      -
      -    FEATURE_<FEATURE>_CONFIGURE_BUNDLED()  (a macro)
      -      - which should setup all necessary configuration for the feature with
      -        bundled source dependencies. If something goes wrong this macro must
      -        issue a FATAL_ERROR.
      -
      -    FEATURE_<FEATURE>_ERROR_MESSAGE()      (macro)
      -      - which should print a meaningful error message (with FATAL_ERROR) for
      -        the case that no external library was found (and bundled is not
      -        allowed to be used.) If not defined, a suitable default error message
      -        will be printed.
      -	  
      - -
    • - In ./bundled/CMakeLists.txt: -
      -
      -    FEATURE_<FEATURE>_HAVE_BUNDLED         (a boolean)
      -      - which should either be set to TRUE if all necessary libraries of the
      -        features comes bundled with deal.II and hence can be supported
      -        without external dependencies, or unset.
      -
      -    DEAL_II_FORCE_BUNDLED_<FEATURE>        (an option)
      -      - If <feature> can be set up by bundled libraries, this
      -        configuration option must be present to force a use of bundled
      -        dependencies
      -	  
      - -
    • - Furthermore, if - FEATURE_<FEATURE>_BUNDLED_CONFIGURED is set to - TRUE the file ./bundled/CMakeLists.txt - must compile and install the bundled package appropriately. +
    • A variable name without _DEBUG or + _RELEASE: Used for all targets +
    • <...>_DEBUG: additionally used for debug targets +
    • <...>_RELEASE: additionally used for release targets
    -

    - +
  • + For internal use, for setting necessary linker flags for the deal.II library: +
      +
    • DEAL_II_LINKER_FLAGS +
    • DEAL_II_LINKER_FLAGS_DEBUG +
    • DEAL_II_LINKER_FLAGS_RELEASE +
    +
  • + For internal use, for setting necessary compiler flags, e.g. + -std=c++11 (if available): +
      +
    • CMAKE_CXX_FLAGS +
    • DEAL_II_CXX_FLAGS_DEBUG +
    • DEAL_II_CXX_FLAGS_RELEASE +
    +
  • + For internal use, for setting necessary include dirs for the compilation of the + deal.II library: +
      +
    • INCLUDE_DIRECTORIES(...) +
    - -

    Global variables controlling the build process

    +
  • + For internal use, for setting necessary preprocessor definitions + (-D<...>) for the compilation of the + deal.II library: +
      +
    • DEAL_II_DEFINITIONS +
    • DEAL_II_DEFINITIONS_DEBUG +
    • DEAL_II_DEFINITIONS_RELEASE +
    -

    - The following list describes all global variables controlling the - build process and the visibility associated with it (internal use for - compiling deal.Ii, externally used variables will get exported in - deal.IIConfig.cmake). Lists should be manipulated with - LIST(APPEND ...), flags with ADD_FLAGS(...) - (or if it is necessary to guard them with - ENABLE_IF_SUPPORTED(...).) +

  • + For internal and external use, used to keep track of external + libraries, the deal.II library and user + programs have to be linked against:
      -
    • - The general (internal) logic for variables applies: -
        -
      • A variable name without _DEBUG or - _RELEASE: Used for all targets -
      • <...>_DEBUG: additionally used for debug targets -
      • <...>_RELEASE: additionally used for release targets -
      - -
    • - For internal use, for setting necessary linker flags for the deal.II library: -
        -
      • DEAL_II_LINKER_FLAGS -
      • DEAL_II_LINKER_FLAGS_DEBUG -
      • DEAL_II_LINKER_FLAGS_RELEASE -
      - -
    • - For internal use, for setting necessary compiler flags, e.g. - -std=c++11 (if available): -
        -
      • CMAKE_CXX_FLAGS -
      • DEAL_II_CXX_FLAGS_DEBUG -
      • DEAL_II_CXX_FLAGS_RELEASE -
      - -
    • - For internal use, for setting necessary include dirs for the compilation of the - deal.II library: -
        -
      • INCLUDE_DIRECTORIES(...) -
      - -
    • - For internal use, for setting necessary preprocessor definitions - (-D<...>) for the compilation of the - deal.II library: -
        -
      • DEAL_II_DEFINITIONS -
      • DEAL_II_DEFINITIONS_DEBUG -
      • DEAL_II_DEFINITIONS_RELEASE -
      - -
    • - For internal and external use, used to keep track of external - libraries, the deal.II library and user - programs have to be linked against: -
        -
      • DEAL_II_EXTERNAL_LIBRARIES -
      • DEAL_II_EXTERNAL_LIBRARIES_DEBUG -
      • DEAL_II_EXTERNAL_LIBRARIES_RELEASE -
      - -
    • - For external use, used to keep track of external preprocessor - definitions, necessary for the compilation of user programs: -
        -
      • DEAL_II_USER_DEFINITIONS -
      • DEAL_II_USER_DEFINITIONS_DEBUG -
      • DEAL_II_USER_DEFINITIONS_RELEASE -
      - -
    • - Used to keep track of external include dirs, necessary for the - compilation of user programs: -
        -
      • DEAL_II_USER_INCLUDE_DIRS -
      +
    • DEAL_II_EXTERNAL_LIBRARIES +
    • DEAL_II_EXTERNAL_LIBRARIES_DEBUG +
    • DEAL_II_EXTERNAL_LIBRARIES_RELEASE
    -

    - -

    Target definition and installation

    - -

    ./include/deal.II/base/config.h.in

    +
  • + For external use, used to keep track of external preprocessor + definitions, necessary for the compilation of user programs: +
      +
    • DEAL_II_USER_DEFINITIONS +
    • DEAL_II_USER_DEFINITIONS_DEBUG +
    • DEAL_II_USER_DEFINITIONS_RELEASE +
    - In contrast to autoconf there is no intermediate step any more that - automatically generates config.h.in. The setup in this file has to be - done by hand. Please note: +
  • + Used to keep track of external include dirs, necessary for the + compilation of user programs:
      -
    • config.h.in should only contain a minimum of - necessary compile definitions to avoid unnecessary recompilation if - configuration changes. -
    • Definition toggles in config.h.in should have a - prominent comment explaining it and should be grouped by file - exporting the definition. +
    • DEAL_II_USER_INCLUDE_DIRS
    +
+

+ + +

Target definition and installation

+ +

./include/deal.II/base/config.h.in

+ +In contrast to autoconf there is no intermediate step any more that +automatically generates config.h.in. The setup in this file has to be +done by hand. Please note: +
    +
  • config.h.in should only contain a minimum of + necessary compile definitions to avoid unnecessary recompilation if + configuration changes. +
  • Definition toggles in config.h.in should have a + prominent comment explaining it and should be grouped by file + exporting the definition. +
+ + +

./source/CMakeLists.txt

+ +

+ All parts of the library are organized into logical object libraries + with their respective sources lying under + ./source/<foo>, or + ./bundled/<foo>/<...>. The actual setup of + an object library happens within that subdirectories with the help of + two macros: +

+#
+# Glob for all header files associated with the object target:
+# As this list is only for cosmetic reasons, so that associated header
+# files show up in IDEs, we don't manage an explicit list (with the
+# trade-off to have to run "make rebuild_cache" when a new header file
+# emerges...)
+#
+FILE(GLOB _header
+  ${CMAKE_SOURCE_DIR}/include/deal.II/dofs/*.h
+  )
+
+#
+# A list of source files forming the object target:
+#
+SET(_src
+  ...
+  dof_tools.cc
+  )
+
+#
+# A list of instantiations that must be expanded:
+#
+SET(_inst
+  ...
+  dof_tools.inst.in
+  )
+
+#
+# The following macro will set up an obj_dofs.debug and
+# obj_dofs.release target  with appropriate compile flags and
+# definitions for a simultaneous build of debug and release library.
+# Furthermore, the object name will be stored in
+#   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_(debug/release)
+# so that it is available in global scope.
+#
+# Header files and instatiation files (${_header}, ${_inst}) are added
+# for cosmetic reasons, so that they show up in IDEs.
+#
+DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${_src} ${_header} ${_inst})
+
+#
+# This macro will set up an obj_dofs.inst target for expanding all
+# files listed in ${inst_in_files}. Appropriate target dependencies
+# will be added to obj_dofs.debug and obj_dofs.release.
+#
+EXPAND_INSTANTIATIONS(obj_dofs "${inst_in_files}")
+
+

+ +

+ Later, all object targets are collected in + ./source/CMakeLists.txt to define the actual debug and + releases libraries. For further details, see + ./source/CMakelists.txt and + ./cmake/macros/macro_deal_ii_add_library.cmake. +

+ + +

./cmake/config/CMakeLists.txt

+ +

+ The final bits of configuration happens in + ./cmake/config/CMakeLists.txt where the templates for + the project configuration deal.IIConfig.cmake and the + compatibility file Make.global_options get expanded. + Furthermore, the configuration for the template expansion mechanism + resides under ./cmake/config/template_arguments.in. +

+ +
+
+ The deal.II Authors + $Date$ +
+
+ + Valid HTML 4.01! + + Valid CSS! +
- -

./source/CMakeLists.txt

- -

- All parts of the library are organized into logical object libraries - with their respective sources lying under - ./source/<foo>, or - ./bundled/<foo>/<...>. The actual setup of - an object library happens within that subdirectories with the help of - two macros: -

-
-    #
-    # Glob for all header files associated with the object target:
-    # As this list is only for cosmetic reasons, so that associated header
-    # files show up in IDEs, we don't manage an explicit list (with the
-    # trade-off to have to run "make rebuild_cache" when a new header file
-    # emerges...)
-    #
-    FILE(GLOB _header
-      ${CMAKE_SOURCE_DIR}/include/deal.II/dofs/*.h
-      )
-
-    #
-    # A list of source files forming the object target:
-    #
-    SET(_src
-      ...
-      dof_tools.cc
-      )
-
-    #
-    # A list of instantiations that must be expanded:
-    #
-    SET(_inst
-      ...
-      dof_tools.inst.in
-      )
-
-    #
-    # The following macro will set up an obj_dofs.debug and
-    # obj_dofs.release target  with appropriate compile flags and
-    # definitions for a simultaneous build of debug and release library.
-    # Furthermore, the object name will be stored in
-    #   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_(debug/release)
-    # so that it is available in global scope.
-    #
-    # Header files and instatiation files (${_header}, ${_inst}) are added
-    # for cosmetic reasons, so that they show up in IDEs.
-    #
-    DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${_src} ${_header} ${_inst})
-
-    #
-    # This macro will set up an obj_dofs.inst target for expanding all
-    # files listed in ${inst_in_files}. Appropriate target dependencies
-    # will be added to obj_dofs.debug and obj_dofs.release.
-    #
-    EXPAND_INSTANTIATIONS(obj_dofs "${inst_in_files}")
-      
-

- -

- Later, all object targets are collected in - ./source/CMakeLists.txt to define the actual debug and - releases libraries. For further details, see - ./source/CMakelists.txt and - ./cmake/macros/macro_deal_ii_add_library.cmake. -

- - -

./cmake/config/CMakeLists.txt

- -

- The final bits of configuration happens in - ./cmake/config/CMakeLists.txt where the templates for - the project configuration deal.IIConfig.cmake and the - compatibility file Make.global_options get expanded. - Furthermore, the configuration for the template expansion mechanism - resides under ./cmake/config/template_arguments.in. -

- -
-
- The deal.II Authors - $Date$ -
-
- - Valid HTML 4.01! - - Valid CSS! -
- - + diff --git a/deal.II/doc/developers/porting.html b/deal.II/doc/developers/porting.html index 28a71c8fa7..27fbdd8bb9 100644 --- a/deal.II/doc/developers/porting.html +++ b/deal.II/doc/developers/porting.html @@ -40,12 +40,11 @@ To start porting for an unkown compiler, specify -DDEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF and set all necessary compiler flags by hand via -
-
-    CMAKE_CXX_FLAGS           - used during all builds
-    DEAL_II_CXX_FLAGS_DEBUG   - additional flags for the debug library
-    DEAL_II_CXX_FLAGS_RELEASE - additional flags for the release library
-          
+
+CMAKE_CXX_FLAGS           - used during all builds
+DEAL_II_CXX_FLAGS_DEBUG   - additional flags for the debug library
+DEAL_II_CXX_FLAGS_RELEASE - additional flags for the release library
+
After that try to compile the library with minimal external dependencies (-DDEAL_II_ALLOW_AUTODETECTION=OFF, for further information see the deal.II CMake @@ -53,23 +52,21 @@
  • For adding permanent support for the unknown compiler to the build system, have a look at -
    -
    -    cmake/setup_compiler_flags.cmake
    -    cmake/setup_compiler_flags_gnu.cmake
    -    cmake/setup_compiler_flags_icc.cmake
    -          
    +
    +cmake/setup_compiler_flags.cmake
    +cmake/setup_compiler_flags_gnu.cmake
    +cmake/setup_compiler_flags_icc.cmake
    +
    Patches are highly welcome! See
    here for information on how to get in contact with us.
  • You might want to have a look at -
    -
    -    cmake/checks/check_for_compiler_bugs.cmake
    -    cmake/checks/check_for_compiler_features.cmake
    -    cmake/checks/check_for_cxx_features.cmake
    -    include/deal.II/base/config.h.in
    -          
    +
    +cmake/checks/check_01_for_compiler_features.cmake
    +cmake/checks/check_01_for_cxx_features.cmake
    +cmake/checks/check_03_for_compiler_bugs.cmake
    +include/deal.II/base/config.h.in
    +
    to see how compiler specific checks are done.

    @@ -105,14 +102,13 @@ and Windows and throw a compile time error on other platforms.
  • Have a look at -
    -
    -    cmake/checks/check_for_compiler_bugs.cmake
    -    cmake/checks/check_for_compiler_features.cmake
    -    cmake/checks/check_for_cxx_features.cmake
    -    cmake/checks/check_for_system_features.cmake
    -    include/deal.II/base/config.h.in
    -          
    +
    +cmake/checks/check_for_compiler_bugs.cmake
    +cmake/checks/check_for_compiler_features.cmake
    +cmake/checks/check_for_cxx_features.cmake
    +cmake/checks/check_for_system_features.cmake
    +include/deal.II/base/config.h.in
    +
    to see how platform and compiler specific checks are done.
  • Of course, we would be happy to hear about the changes you made @@ -148,13 +144,12 @@ (or for for Windows64 using MinGW). After that invoke cmake with something like: -
    -
    -    cmake -DCMAKE_TOOLCHAIN_FILE=<...>/Toolchain.sample
    -          -DDEAL_II_FORCE_BUNDLED_BOOST=ON
    -          -DDEAL_II_ALLOW_AUTODETECTION=OFF
    -          ../deal.II
    -      
    +
    +$ cmake -DCMAKE_TOOLCHAIN_FILE=<...>/Toolchain.sample \
    +        -DDEAL_II_FORCE_BUNDLED_BOOST=ON \
    +        -DDEAL_II_ALLOW_AUTODETECTION=OFF \
    +        ../deal.II
    +
    where CMAKE_TOOLCHAIN_FILE points to the toolchain file. The remaining configuration can be adjusted at will, see the documentation. diff --git a/deal.II/doc/developers/svn.html b/deal.II/doc/developers/svn.html index 50350032a2..7adc81d831 100644 --- a/deal.II/doc/developers/svn.html +++ b/deal.II/doc/developers/svn.html @@ -60,23 +60,22 @@
    1. Create the branch using -
      -	    svn copy https://svn.dealii.org/trunk/ https://svn.dealii.org/branches/new-branch-name
      -	  
      +
      +$ svn copy https://svn.dealii.org/trunk/ https://svn.dealii.org/branches/new-branch-name
      +
    2. Either check out the new branch or switch your working copy by -
      -	    svn switch https://svn.dealii.org/branches/new-branch-name
      -	  
      +
      +$ svn switch https://svn.dealii.org/branches/new-branch-name
      +
      This command assumes you are in the top level directory, the one containing deal.II and tests
    3. After some development of the branch, if you want to merge changes that have been made on mainline in the meantime, you can use this command: -
      -
      -	    svn merge ^/trunk
      -	  
      +
      +$ svn merge ^/trunk
      +
      This command will only run if you have no local changes in your working directory for the branch, and will modify all of your files by merging the changes made on mainline. If there are no conflicts that need to be diff --git a/deal.II/doc/developers/testsuite.html b/deal.II/doc/developers/testsuite.html index a77a74b014..3c55dae252 100644 --- a/deal.II/doc/developers/testsuite.html +++ b/deal.II/doc/developers/testsuite.html @@ -60,8 +60,9 @@
    4. Testsuite development
      1. General layout
      2. -
      3. Restricting tests for build configurations
      4. -
      5. Restricting tests for feature configurations
      6. +
      7. Restricting tests to specific compiler and compiler versions
      8. +
      9. Restricting tests to build configurations
      10. +
      11. Restricting tests to feature configurations
      12. Running tests with MPI
      13. Tests with binary output
      14. Changing condition for success
      15. @@ -81,18 +82,17 @@

        If you're impatient, use the following commands: -

        -
        -    $ mkdir new_directory
        -    $ cd new_directory
        -    $ svn checkout https://svn.dealii.org/trunk .
        -    $ mkdir build
        -    $ cd build
        -    $ cmake ../deal.II
        -    $ make -j16
        -    $ make -j16 setup_tests
        -    $ ctest -j16
        -      
        +
        +$ mkdir new_directory
        +$ cd new_directory
        +$ svn checkout https://svn.dealii.org/trunk .
        +$ mkdir build
        +$ cd build
        +$ cmake ../deal.II
        +$ make -j16
        +$ make -j16 setup_tests
        +$ ctest -j16
        +
        The exact meaning of all of these commands will be explained in much greater detail below.

        @@ -111,19 +111,17 @@ To download the testsuite, check it out from the subversion repository, along with deal.II. To this end, go to an empty directory where you want to test deal.II and do this: -
        -
        -    $ svn checkout https://svn.dealii.org/trunk .
        -      
        +
        +$ svn checkout https://svn.dealii.org/trunk .
        +
        (The period at the end puts everything from under trunk/ into the current directory, rather than creating a new trunk/ directory.) You will then have two folders: -
        -
        -    ./deal.II
        -    ./tests
        -      
        +
        +./deal.II
        +./tests
        +

        @@ -132,10 +130,9 @@ (../tests). If your test directory is at a different location you have to hint during configuration by specifying TEST_DIR: -

        -
        -    $ cmake -DTEST_DIR=<...>
        -      
        +
        +$ cmake -DTEST_DIR=<...>
        +

        @@ -145,10 +142,9 @@ To enable the testsuite, configure and build deal.II in a build directory as normal (installation is not necessary). After that you can setup the testsuite via the "setup_tests" target:s -
        -
        -    $ make setup_tests
        -      
        +
        +$ make setup_tests
        +
        This will set up all tests supported by the current configuration. The testsuite can now be run in the current build directory as described below. @@ -156,39 +152,32 @@

        Setup can be fine-tuned using the following commands: -

        -
        -    $ make regen_tests - reruns configure stage in every testsuite subproject
        +
        +$ make regen_tests - reruns configure stage in every testsuite subproject
         
        -    $ make clean_tests - runs the 'clean' target in every testsuite subproject
        +$ make clean_tests - runs the 'clean' target in every testsuite subproject
         
        -    $ make prune_tests - removes all testsuite subprojects
        -      
        +$ make prune_tests - removes all testsuite subprojects +

        In addition, when setting up the testsuite, the following environment variables can be used to override default behavior when calling make setup_tests: -

        +
        +TEST_DIFF
        +  - The diff tool and command line to use for comparison. If numdiff is
        +    available it defaults to "numdiff -a 1e-6 -q", otherwise plain diff
        +    is used.
         
        -    TEST_DIFF
        -      - The diff tool and command line to use for comparison. If numdiff is
        -        available it defaults to "numdiff -a 1e-6 -q", otherwise plain diff
        -        is used.
        +TEST_TIME_LIMIT
        +  - The time limit (in seconds) a single test is allowed to take. Defaults
        +    to 180 seconds
         
        -    TEST_TIME_LIMIT
        -      - The time limit (in seconds) a single test is allowed to take. Defaults
        -        to 180 seconds
        -
        -    TEST_PICKUP_REGEX
        -      - A regular expression to select only a subset of tests during setup.
        -        An empty string is interpreted as a catchall (this is the default).
        -
        -    TEST_OVERRIDE_LOCATION
        -      - If TEST_OVERRIDE_LOCATION is set, a comparison file category/test.output
        -        will be substituted by ${TEST_OVERRIDE_LOCATION}/category/test.output if
        -        the latter exists.
        -      
        +TEST_PICKUP_REGEX + - A regular expression to select only a subset of tests during setup. + An empty string is interpreted as a catchall (this is the default). +

        @@ -196,10 +185,9 @@

        The testsuite can now be run in the build directory via -

        -
        -    $ ctest [-j N]
        -      
        +
        +$ ctest [-j N]
        +
        Here, N is the number of concurrent tests that should be run, in the same way as you can say make -jN. The testsuite is huge and will need around 12h on current computers @@ -210,11 +198,10 @@ If you only want to run a subset of tests matching a regular expression, or if you want to exclude tests matching a regular expression, you can use -
        -
        -    $ ctest [-j N] -R '<positive regular expression>'
        -    $ ctest [-j N] -E '<negative regular expression>'
        -      
        +
        +$ ctest [-j N] -R '<positive regular expression>'
        +$ ctest [-j N] -E '<negative regular expression>'
        +

        @@ -236,69 +223,67 @@

        A typical output of a ctest invocation looks like: -

        -
        -    $ ctest -j4 -R "base/thread_validity"
        -    Test project /tmp/trunk/build
        -          Start 747: base/thread_validity_01.debug
        -          Start 748: base/thread_validity_01.release
        -          Start 775: base/thread_validity_05.debug
        -          Start 776: base/thread_validity_05.release
        -     1/24 Test #776: base/thread_validity_05.release ...   Passed    1.89 sec
        -     2/24 Test #748: base/thread_validity_01.release ...   Passed    1.89 sec
        -          Start 839: base/thread_validity_03.debug
        -          Start 840: base/thread_validity_03.release
        -     3/24 Test #747: base/thread_validity_01.debug .....   Passed    2.68 sec
        -    [...]
        -          Start 1077: base/thread_validity_08.debug
        -          Start 1078: base/thread_validity_08.release
        -    16/24 Test #1078: base/thread_validity_08.release ...***Failed    2.86 sec
        -    18/24 Test #1077: base/thread_validity_08.debug .....***Failed    3.97 sec
        -    [...]
        -
        -    92% tests passed, 2 tests failed out of 24
        -
        -    Total Test time (real) =  20.43 sec
        -
        -    The following tests FAILED:
        -            1077 - base/thread_validity_08.debug (Failed)
        -            1078 - base/thread_validity_08.release (Failed)
        -    Errors while running CTest
        -      
        +
        +$ ctest -j4 -R "base/thread_validity"
        +Test project /tmp/trunk/build
        +      Start 747: base/thread_validity_01.debug
        +      Start 748: base/thread_validity_01.release
        +      Start 775: base/thread_validity_05.debug
        +      Start 776: base/thread_validity_05.release
        + 1/24 Test #776: base/thread_validity_05.release ...   Passed    1.89 sec
        + 2/24 Test #748: base/thread_validity_01.release ...   Passed    1.89 sec
        +      Start 839: base/thread_validity_03.debug
        +      Start 840: base/thread_validity_03.release
        + 3/24 Test #747: base/thread_validity_01.debug .....   Passed    2.68 sec
        +[...]
        +      Start 1077: base/thread_validity_08.debug
        +      Start 1078: base/thread_validity_08.release
        +16/24 Test #1078: base/thread_validity_08.release ...***Failed    2.86 sec
        +18/24 Test #1077: base/thread_validity_08.debug .....***Failed    3.97 sec
        +[...]
        +
        +92% tests passed, 2 tests failed out of 24
        +
        +Total Test time (real) =  20.43 sec
        +
        +The following tests FAILED:
        +        1077 - base/thread_validity_08.debug (Failed)
        +        1078 - base/thread_validity_08.release (Failed)
        +Errors while running CTest
        +
        If a test failed (like base/thread_validity_08.debug in above example output), you might want to find out what exactly went wrong. To this end, you can search through Testing/Temporary/LastTest.log for the exact output of the test, or you can rerun this one test, specifying -V to select verbose output of tests: -
        -
        -    $ ctest -V -R "base/thread_validity_08.debug"
        -    [...]
        -    test 1077
        -        Start 1077: base/thread_validity_08.debug
        -
        -    1077: Test command: [...]
        -    1077: Test timeout computed to be: 600
        -    1077: Test base/thread_validity_08.debug: RUN
        -    1077: ===============================   OUTPUT BEGIN  ===============================
        -    1077: Built target thread_validity_08.debug
        -    1077: Generating thread_validity_08.debug/output
        -    1077: terminate called without an active exception
        -    1077: /bin/sh: line 1: 18030 Aborted [...]/thread_validity_08.debug
        -    1077: base/thread_validity_08.debug: BUILD successful.
        -    1077: base/thread_validity_08.debug: RUN failed. Output:
        -    1077: DEAL::OK.
        -    1077: gmake[3]: *** [thread_validity_08.debug/output] Error 1
        -    1077: gmake[2]: *** [CMakeFiles/thread_validity_08.debug.diff.dir/all] Error 2
        -    1077: gmake[1]: *** [CMakeFiles/thread_validity_08.debug.diff.dir/rule] Error 2
        -    1077: gmake: *** [thread_validity_08.debug.diff] Error 2
        -    1077:
        -    1077:
        -    1077: base/thread_validity_08.debug: ******    RUN failed    *******
        -    1077:
        -    1077: ===============================    OUTPUT END   ===============================
        -      
        +
        +$ ctest -V -R "base/thread_validity_08.debug"
        +[...]
        +test 1077
        +    Start 1077: base/thread_validity_08.debug
        +
        +1077: Test command: [...]
        +1077: Test timeout computed to be: 600
        +1077: Test base/thread_validity_08.debug: RUN
        +1077: ===============================   OUTPUT BEGIN  ===============================
        +1077: Built target thread_validity_08.debug
        +1077: Generating thread_validity_08.debug/output
        +1077: terminate called without an active exception
        +1077: /bin/sh: line 1: 18030 Aborted [...]/thread_validity_08.debug
        +1077: base/thread_validity_08.debug: BUILD successful.
        +1077: base/thread_validity_08.debug: RUN failed. Output:
        +1077: DEAL::OK.
        +1077: gmake[3]: *** [thread_validity_08.debug/output] Error 1
        +1077: gmake[2]: *** [CMakeFiles/thread_validity_08.debug.diff.dir/all] Error 2
        +1077: gmake[1]: *** [CMakeFiles/thread_validity_08.debug.diff.dir/rule] Error 2
        +1077: gmake: *** [thread_validity_08.debug.diff] Error 2
        +1077:
        +1077:
        +1077: base/thread_validity_08.debug: ******    RUN failed    *******
        +1077:
        +1077: ===============================    OUTPUT END   ===============================
        +
        So this specific test aborted in the RUN stage.

        @@ -306,25 +291,23 @@ The general output for a successful test <test> in category <category> for build type <build> is -
        -
        -    xx: Test <category>/<test>.<build>: PASSED
        -    xx: ===============================   OUTPUT BEGIN  ===============================
        -    xx: [...]
        -    xx: <category>/<test>.<build>: PASSED.
        -    xx: ===============================    OUTPUT END   ===============================
        -      
        +
        +xx: Test <category>/<test>.<build>: PASSED
        +xx: ===============================   OUTPUT BEGIN  ===============================
        +xx: [...]
        +xx: <category>/<test>.<build>: PASSED.
        +xx: ===============================    OUTPUT END   ===============================
        +
        And for a test that fails in stage <stage>: -
        -
        -    xx: Test <category>/<test>.<build>: <stage>
        -    xx: ===============================   OUTPUT BEGIN  ===============================
        -    xx: [...]
        -    xx: <category>/<test>.<build>: <stage> failed. [...]
        -    xx:
        -    xx: <category>/<test>.<build>: ******    <stage> failed    *******
        -    xx: ===============================    OUTPUT END   ===============================
        -      
        +
        +xx: Test <category>/<test>.<build>: <stage>
        +xx: ===============================   OUTPUT BEGIN  ===============================
        +xx: [...]
        +xx: <category>/<test>.<build>: <stage> failed. [...]
        +xx:
        +xx: <category>/<test>.<build>: ******    <stage> failed    *******
        +xx: ===============================    OUTPUT END   ===============================
        +
        Hereby, <stage> indicates the stage in which the test failed:
          @@ -387,11 +370,10 @@

          A test usually consists of a source file and an output file for comparison (under the testsuite directory tests): -

          -
          -    category/test.cc
          -    category/test.output
          -      
          +
          +category/test.cc
          +category/test.output
          +
          category will be one of the existing subdirectory under tests/, e.g., lac/, base/, or mpi/. Historically, we have grouped tests into the @@ -441,61 +423,70 @@ -

          Restricting tests for build configurations

          +

          Restricting tests to build configurations

          Comparison file can actually be named in a more complex way than just category/test.output: -

          -
          -    category/test.[with_<feature>=<on|off>.]*[mpirun=<x>.][expect=<y>.][binary.][<debug|release>.]output
          -      
          +
          +category/test.[compiler=<regex>=<yes|no>.]*[with_<feature>=<on|off>.]*[mpirun=<x>.][expect=<y>.][binary.][<debug|release>.]output
          +
          Normally, a test will be set up so that it runs twice, once in debug and once in release configuration. If a specific test can only be run in debug or release configurations but not in both it is possible to restrict the setup by prepeding .debug or .release directly before .output, e.g.: -
          -
          -    category/test.debug.output
          -      
          +
          +category/test.debug.output
          +
          This way, the test will only be set up to build and run against the debug library. If a test should run in both configurations but, for some reason, produces different output (e.g., because it triggers an assertion in debug mode), then you can just provide two different output files: -
          -
          -    category/test.debug.output
          -    category/test.release.output
          -      
          +
          +category/test.debug.output
          +category/test.release.output
          +

          + +

          Restricting tests to specific compiler and compiler versions

          +

          + In a similar vain as for build configurations, it is possible to restrict + tests to specific compiler versions, e.g.: +

          +category/test.compiler=GNU=yes.output, or
          +category/test.compiler=ICC-14=no.output
          +
          + These tests will only be set up if the specified regular expression + matches (in case of =yes), or doesn't match + (=no) the string + ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}. + Common compiler names are GNU, Clang or + Intel. -

          Restricting tests for feature configurations

          +

          Restricting tests to feature configurations

          In a similar vain as for build configurations, it is possible to restrict tests to specific feature configurations, e.g.: -

          -
          -    category/test.with_umfpack=on.output, or
          -    category/test.with_zlib=off.output
          -      
          +
          +category/test.with_umfpack=on.output, or
          +category/test.with_zlib=off.output
          +
          These tests will only be set up if the specified feature was configured. It is possible to provide different output files for disabled/enabled features, e.g. -
          -
          -    category/test.with_64bit_indices=on.output
          -    category/test.with_64bit_indices=off.output
          -      
          +
          +category/test.with_64bit_indices=on.output
          +category/test.with_64bit_indices=off.output
          +
          It is also possible to declare multiple constraints subsequently, e.g. -
          -
          -    category/test.with_umfpack=on.with_zlib=on.output
          -      
          +
          +category/test.with_umfpack=on.with_zlib=on.output
          +

          Note: The tests in some subdirectories of tests/ are @@ -516,10 +507,9 @@ If a test should be run with MPI in parallel, the number of MPI processes N with which a program needs to be run for comparison with a given output file is specified as follows: -

          -
          -    category/test.mpirun=N.output
          -      
          +
          +category/test.mpirun=N.output
          +
          It is quite typical for an MPI-enabled test to have multiple output files for different numbers of MPI processes.

          @@ -529,10 +519,9 @@

          If a test produces binary output add binary to the output file to indicate this: -

          -
          -    category/test.binary.output
          -      
          +
          +category/test.binary.output
          +
          The testsuite ensures that a diff tool suitable for comparing binary output files is used instead of the default diff tool, which (as in the case of numdiff) might be unable to compare binary @@ -548,10 +537,9 @@ If (for some reason) the test should succeed ending at a specific test stage different than PASSED you can specify it via expect=<stage>, e.g.: -
          -
          -    category/test.expect=run.output
          -      
          +
          +category/test.expect=run.output
          +

          @@ -572,8 +560,7 @@ For the testcase, we usually start from one of the existing tests, copy and modify it to where it does what we'd like to test. Alternatively, you can also start from a template like this: -
          -
          +
           // ---------------------------------------------------------------------
           // $Id$
           //
          @@ -590,7 +577,6 @@
           //
           // ---------------------------------------------------------------------
           
          -
           // a short (a few lines) description of what the program does
           
           #include "../tests.h"
          @@ -599,7 +585,6 @@
           
           // all include files you need here
           
          -
           int main ()
           {
             std::ofstream logfile("output");
          @@ -612,7 +597,7 @@ int main ()
           
             return 0;
           }
          -    
          +

          This code opens an output file output in the current working directory and then writes all output you generate to it, through the @@ -640,22 +625,19 @@ int main ()

          In order to run your new test, copy it to an appropriate category and create an empty comparison file for it: -

          -
          -    category/my_new_test.cc
          -    category/my_new_test.output
          -      
          +
          +category/my_new_test.cc
          +category/my_new_test.output
          +
          Now, rerun -
          -
          -    $ make setup_tests
          -      
          +
          +$ make setup_tests
          +
          so that your new test is picked up. After that it is possible to invoke it with -
          -
          -    $ ctest -V -R "category/my_new_test"
          -      
          +
          +$ ctest -V -R "category/my_new_test"
          +

          @@ -672,15 +654,13 @@ int main ()

          The next step is to copy and rename this output file to the source directory and replace the original comparison file with it: -

          -
          -    category/my_new_test.output
          -      
          +
          +category/my_new_test.output
          +
          At this point running the test again should be successful: -
          -
          -    $ ctest -V -R "category/my_new_test"
          -      
          +
          +$ ctest -V -R "category/my_new_test"
          +

          @@ -692,12 +672,11 @@ int main () interested in getting new tests. If you have subversion write access already, you can add the new test and the expected output file: -
          -
          -    svn add category/my_new_test.cc
          -    svn add category/my_new_test.output
          -    svn commit -m "New test"
          -      
          +
          +svn add category/my_new_test.cc
          +svn add category/my_new_test.output
          +svn commit -m "New test"
          +
          If you don't have subversion write access, talk to us in the discussion group; writing testcases is a worthy and laudable task, and we would like to encourage it by giving people the opportunity to @@ -714,14 +693,13 @@ int main () folder under ./tests that is named accordingly and put a CMakeLists.txt file into it containing

          -
          -
          -    CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
          -    INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake)
          -    PROJECT(testsuite CXX)
          -    INCLUDE(${DEAL_II_TARGET_CONFIG})
          -    DEAL_II_PICKUP_TESTS()
          -    
          +
          +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
          +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake)
          +PROJECT(testsuite CXX)
          +INCLUDE(${DEAL_II_TARGET_CONFIG})
          +DEAL_II_PICKUP_TESTS()
          +
          @@ -733,10 +711,9 @@ int main () href="http://cdash.kyomu.43-1.org/index.php?project=deal.II">CDash instance just invoke ctest within a build directory (or designated build directory) with the -S option pointing to the - run_testsuite.cmake script:
          -
          -      $ ctest [...] -V -S ../tests/run_testsuite.cmake
          -      
          +
          +$ ctest [...] -V -S ../tests/run_testsuite.cmake
          +
          The script will run configure, build and ctest and submit the results to the CDash server. It does not matter whether the configure, build or ctest stages were run before that. Also in script mode, you can @@ -751,60 +728,58 @@ int main ()

          Note: The following variables can be set to via -

          -
          -    ctest -D<variable>=<value> [...]
          -      
          +
          +ctest -D<variable>=<value> [...]
          +
          to control the behaviour of the run_testsuite.cmake script: -
          -
          -    CTEST_SOURCE_DIRECTORY
          -      - The source directory of deal.II (usually ending in "[...]/deal.II"
          -        (equivalent to https://svn.dealii.org/trunk/deal.II)
          -        Note: This is _not_ the test directory ending in "[...]/tests"
          -      - If unspecified, "../deal.II" and "../../$ relative to the location
          -        of this script is used. If this is not a source directory, an error
          -        thrown.
          -
          -    CTEST_BINARY_DIRECTORY
          -      - The designated build directory (already configured, empty, or non
          -        existent - see the information about TRACKs what will happen)
          -      - If unspecified the current directory is used. If the current
          -        directory is equal to CTEST_SOURCE_DIRECTORY or the "tests"
          -        directory, an error is thrown.
          -
          -    CTEST_CMAKE_GENERATOR
          -      - The CMake Generator to use (e.g. "Unix Makefiles", or "Ninja", see
          -        $ man cmake)
          -      - If unspecified the current generator of a configured build directory
          -        will be used, otherwise "Unix Makefiles".
          -
          -    TRACK
          -      - The track the test should be submitted to. Defaults to "Experimental".
          -        Possible values are:
          -
          -        "Experimental"     - all tests that are not specifically "build" or
          -                             "regression" tests should go into this track
          -
          -        "Build Tests"      - Build tests that configure and build in a
          -                             clean directory and run the build tests
          -                             "build_tests/*"
          -
          -        "Nightly"          - Reserved for nightly regression tests for
          -                             build bots on various architectures
          -
          -        "Regression Tests" - Reserved for the regression tester
          -
          -    CONFIG_FILE
          -      - A configuration file (see docs/development/Config.sample)
          -        that will be used during the configuration stage (invokes
          -        $ cmake -C ${CONFIG_FILE}). This only has an effect if
          -        CTEST_BINARY_DIRECTORY is empty.
          -
          -    MAKEOPTS
          -      - Additional options that will be passed directly to make (or ninja).
          -      
          +
          +CTEST_SOURCE_DIRECTORY
          +  - The source directory of deal.II (usually ending in "[...]/deal.II"
          +    (equivalent to https://svn.dealii.org/trunk/deal.II)
          +    Note: This is _not_ the test directory ending in "[...]/tests"
          +  - If unspecified, "../deal.II" and "../../$ relative to the location
          +    of this script is used. If this is not a source directory, an error
          +    thrown.
          +
          +CTEST_BINARY_DIRECTORY
          +  - The designated build directory (already configured, empty, or non
          +    existent - see the information about TRACKs what will happen)
          +  - If unspecified the current directory is used. If the current
          +    directory is equal to CTEST_SOURCE_DIRECTORY or the "tests"
          +    directory, an error is thrown.
          +
          +CTEST_CMAKE_GENERATOR
          +  - The CMake Generator to use (e.g. "Unix Makefiles", or "Ninja", see
          +    $ man cmake)
          +  - If unspecified the current generator of a configured build directory
          +    will be used, otherwise "Unix Makefiles".
          +
          +TRACK
          +  - The track the test should be submitted to. Defaults to "Experimental".
          +    Possible values are:
          +
          +    "Experimental"     - all tests that are not specifically "build" or
          +                         "regression" tests should go into this track
          +
          +    "Build Tests"      - Build tests that configure and build in a
          +                         clean directory and run the build tests
          +                         "build_tests/*"
          +
          +    "Nightly"          - Reserved for nightly regression tests for
          +                         build bots on various architectures
          +
          +    "Regression Tests" - Reserved for the regression tester
          +
          +CONFIG_FILE
          +  - A configuration file (see docs/development/Config.sample)
          +    that will be used during the configuration stage (invokes
          +    $ cmake -C ${CONFIG_FILE}). This only has an effect if
          +    CTEST_BINARY_DIRECTORY is empty.
          +
          +MAKEOPTS
          +  - Additional options that will be passed directly to make (or ninja).
          +
          Furthermore, the variables described above can also be set and will be handed automatically down to cmake.

          @@ -826,13 +801,12 @@ int main () href="http://www.dealii.org/testsuite.html">test suite page to participate. Assuming you checked out deal.II into the directory deal.II, running it is as simple as: -
          -
          -    cd deal.II
          -    mkdir build
          -    cd build
          -    ctest -j4 -S ../cmake/scripts/run_buildtest.cmake
          -      
          +
          +cd deal.II
          +mkdir build
          +cd build
          +ctest -j4 -S ../cmake/scripts/run_buildtest.cmake
          +

          @@ -848,10 +822,9 @@ int main () version control. If you want to specify a build configuration for cmake use a configuration file to preseed the cache as explained above: -

          -
          -    $ ctest -DCONFIG_FILE="[...]/Config.sample" [...]
          -      
          +
          +$ ctest -DCONFIG_FILE="[...]/Config.sample" [...]
          +

          diff --git a/deal.II/doc/developers/toc.html b/deal.II/doc/developers/toc.html index 2e7da24f67..ca6902a604 100644 --- a/deal.II/doc/developers/toc.html +++ b/deal.II/doc/developers/toc.html @@ -11,94 +11,97 @@ - - -

          -
          - This page provides documentation for deal.II developers. At present, we - have the following resources available: -

          - -

          Documentation

          - -
            -
          • Documentation of the SVN Archive and - information on recent changes to the library. - -

          • - Build system internals: - This page provides implementation and development details about - the CMake build system. - -

          • Writing - documentation: To document the library and our - application programs, we use - doxygen. - This page documents the basics of the format in - which the documentation needs to be written in order to - enable automatic documentation generation. -

            - -
          • Porting - deal.II to a new system: - - deal.II uses CMake as build system - and is fairly ISO (1998) C++ Standard compliant. - So, porting to a reasonably POSIX compliant - system with a reasonably ISO C++ compliant compiler shouldn't be - much work. Other (mostly proprietary) systems might require more - work. See the ReadMe - file for more information on already supported systems. This - resource gives some hints for porting to unknown platforms. -

            - -
          • Coding conventions: We try to adhere to a - set of coding conventions to ensure that the use of different - parts of the library is as uniform as possible. Please read - through them if you think about contributing code. - -

          • Running the testsuite: - deal.II has a testsuite that we run to - make sure that our tests don't break any existing - functionality. This page explains its use. -

            -
          - -

          Resources

          - -
            -
          • Results of regression tests: Every night, - the regression tests are run on some of our machines. The log of the - results can be seen here. -

            - -
          • - Results of build tests: We also build the library each night on - a variety of computers, using different compilers. The results of - these builds is listed as well. -

            - -
          • - Results of benchmarks: We run a certain number of tests - and track the performance over time. -

            -
          - -
          -
          - The deal.II Authors - $Date$ -
          -
          - - Valid HTML 4.01! - - Valid CSS! -
          - - + + +

          + +

          Information for Developers

          + +
          +This page provides documentation for deal.II developers. At present, we +have the following resources available: +

          + +

          Documentation

          + +
            +
          • Documentation of the SVN Archive and + information on recent changes to the library. + +

          • + Build system internals: + This page provides implementation and development details about + the CMake build system. + +

          • Writing + documentation: To document the library and our + application programs, we use + doxygen. + This page documents the basics of the format in + which the documentation needs to be written in order to + enable automatic documentation generation. +

            + +
          • Porting + deal.II to a new system: + + deal.II uses CMake as build system + and is fairly ISO (1998) C++ Standard compliant. + So, porting to a reasonably POSIX compliant + system with a reasonably ISO C++ compliant compiler shouldn't be + much work. Other (mostly proprietary) systems might require more + work. See the ReadMe + file for more information on already supported systems. This + resource gives some hints for porting to unknown platforms. +

            + +
          • Coding conventions: We try to adhere to a + set of coding conventions to ensure that the use of different + parts of the library is as uniform as possible. Please read + through them if you think about contributing code. + +

          • Running the testsuite: + deal.II has a testsuite that we run to + make sure that our tests don't break any existing + functionality. This page explains its use. +

            +
          + +

          Resources

          + +
            +
          • Results of regression tests: Every night, + the regression tests are run on some of our machines. The log of the + results can be seen here. +

            + +
          • + Results of build tests: We also build the library each night on + a variety of computers, using different compilers. The results of + these builds is listed as well. +

            + +
          • + Results of benchmarks: We run a certain number of tests + and track the performance over time. +

            +
          + +
          +
          + The deal.II Authors + $Date$ +
          +
          + + Valid HTML 4.01! + + Valid CSS! +
          + + diff --git a/deal.II/doc/developers/writing-documentation.html b/deal.II/doc/developers/writing-documentation.html index 30a938abc1..249194b52c 100644 --- a/deal.II/doc/developers/writing-documentation.html +++ b/deal.II/doc/developers/writing-documentation.html @@ -74,31 +74,31 @@ function/variable declaration, global function or namespace, may be preceded by a comment of the following form:

          -
          -      /**
          -       * This is an example documentation.
          -       *
          -       * @author Wolfgang Bangerth, 2000
          -       */
          -      class TestClass
          -      {
          -        public:
          -                 /**
          -                  * Constructor
          -                  */
          -          TestClass ();
          -
          -                 /**
          -                  * Example function
          -                  */
          -          virtual void test () const = 0;
          -
          -                 /**
          -                  * Member variable
          -                  */
          -          const unsigned int abc;
          -      };
          -    
          +
          +/**
          + * This is an example documentation.
          + *
          + * @author Wolfgang Bangerth, 2000
          + */
          +class TestClass
          +{
          +  public:
          +           /**
          +            * Constructor
          +            */
          +    TestClass ();
          +
          +           /**
          +            * Example function
          +            */
          +    virtual void test () const = 0;
          +
          +           /**
          +            * Member variable
          +            */
          +    const unsigned int abc;
          +};
          +

          doxygen will then generate a page for the class TestClass and document each of the member functions @@ -128,14 +128,14 @@

        • Itemized lists: By writing comments like the following, -
          -           /**
          -            * <ul>
          -            *   <li> foo
          -            *   <li> bar
          -            * </ul>
          -            */
          -         
          +
          +/**
          + * <ul>
          + *   <li> foo
          + *   <li> bar
          + * </ul>
          + */
          +
          you can get itemized lists both in the online and printed documentation:
            @@ -153,24 +153,24 @@

            If you write comments like this,

            -
            -           /**
            -            * @verbatim
            -            *   void foobar ()
            -            *   {
            -            *     i = 0;
            -            *   }
            -            * @endverbatim
            -            */
            -         
            +
            +/**
            + * @verbatim
            + *   void foobar ()
            + *   {
            + *     i = 0;
            + *   }
            + * @endverbatim
            + */
            +
            you will get the lines between the verbatim environment with the same formatting and in typewriter font: -
            -     void foobar ()
            -     {
            -       i = 0;
            -     }
            -         
            +
            +void foobar ()
            +{
            +  i = 0;
            +}
            +
            This is useful if you want to include small sample code snippets into your documentation. In particular, it is important that the formatting is preserved, which is not the case for all @@ -232,15 +232,15 @@ preprocessor symbol DOXYGEN when running doxygen. Therefore, the following template can be used to avoid documentation:

            -
            -         documented code here
            +
            +/* documented code here */
             
            -         #ifndef DOXYGEN
            +#ifndef DOXYGEN
             
            -         code here is compiled, but ignored by doxygen
            +/* code here is compiled, but ignored by doxygen */
             
            -         #endif // DOXYGEN
            -         
            +#endif // DOXYGEN +

          Code examples for the usage of single classes

          diff --git a/deal.II/doc/documentation.html b/deal.II/doc/documentation.html index 6ba9d79a25..564bf7288b 100644 --- a/deal.II/doc/documentation.html +++ b/deal.II/doc/documentation.html @@ -18,53 +18,45 @@ documentation. It can be grouped into the following categories:

          - - - - - - - - - - - - + - - -
          Information for usersInformation for developers
          + +
          - -
          -
          + + + +
          +

          The deal.II Authors @@ -76,6 +68,7 @@ Valid CSS!
          + diff --git a/deal.II/doc/doxygen/CMakeLists.txt b/deal.II/doc/doxygen/CMakeLists.txt index b7e726df44..84e4226d20 100644 --- a/deal.II/doc/doxygen/CMakeLists.txt +++ b/deal.II/doc/doxygen/CMakeLists.txt @@ -36,22 +36,49 @@ CONFIGURE_FILE( ) CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/header.html.in - ${CMAKE_CURRENT_BINARY_DIR}/header.html + ${CMAKE_CURRENT_SOURCE_DIR}/deal.css + ${CMAKE_CURRENT_BINARY_DIR}/deal.II/deal.css + COPYONLY ) CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/footer.html - ${CMAKE_CURRENT_BINARY_DIR}/footer.html + ${CMAKE_CURRENT_SOURCE_DIR}/stylesheet.css + ${CMAKE_CURRENT_BINARY_DIR}/stylesheet.css COPYONLY ) CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/deal.css - ${CMAKE_CURRENT_BINARY_DIR}/deal.II/deal.css + ${CMAKE_CURRENT_SOURCE_DIR}/images/logo200.png + ${CMAKE_CURRENT_BINARY_DIR}/logo200.png COPYONLY ) +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/scripts/mod_header.pl + ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_header.pl + ) + +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/scripts/mod_footer.pl + ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_footer.pl + ) + + +# +# Generate header, footer and style files for doxygen +# +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/header.html + ${CMAKE_CURRENT_BINARY_DIR}/footer.html + COMMAND ${DOXYGEN_EXECUTABLE} -w html header.html footer.html style.css options.dox + COMMAND ${PERL_EXECUTABLE} -pi~ ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_header.pl header.html + COMMAND ${PERL_EXECUTABLE} -pi~ ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_footer.pl footer.html + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/options.dox + ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_header.pl + ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_footer.pl + ) + # # Finalize the doxygen configuration: # @@ -102,8 +129,10 @@ ADD_CUSTOM_COMMAND( tutorial images ${CMAKE_CURRENT_BINARY_DIR}/options.dox + ${CMAKE_CURRENT_BINARY_DIR}/header.html + ${CMAKE_CURRENT_BINARY_DIR}/footer.html ${_doxygen_input} - COMMENT "Generating documentation via doxygen. This may take a _really_ long time..." + COMMENT "Generating documentation via doxygen." VERBATIM ) ADD_CUSTOM_TARGET(doxygen ALL diff --git a/deal.II/doc/doxygen/footer.html b/deal.II/doc/doxygen/footer.html deleted file mode 100644 index de1963a514..0000000000 --- a/deal.II/doc/doxygen/footer.html +++ /dev/null @@ -1,11 +0,0 @@ -
          -
          - - deal.II - documentation generated on $datetime by - doxygen - $doxygenversion - -
          - - diff --git a/deal.II/doc/doxygen/header.html.in b/deal.II/doc/doxygen/header.html.in deleted file mode 100644 index 3c95a1d965..0000000000 --- a/deal.II/doc/doxygen/header.html.in +++ /dev/null @@ -1,20 +0,0 @@ - - - - - $title - - - - - - - - - - - - - - - diff --git a/deal.II/doc/doxygen/headers/main.h b/deal.II/doc/doxygen/headers/main.h index 8f4995fa9a..dd728dd433 100644 --- a/deal.II/doc/doxygen/headers/main.h +++ b/deal.II/doc/doxygen/headers/main.h @@ -18,8 +18,6 @@ /** * @mainpage * - * @image html logo200.png - * * This is the main starting page for the deal.II class and function * documentation. Documentation on other aspects, such as the build system, * can be found elsewhere. In addition, there are dof_handler.begin_active() to * dof_handler.end()), and a function that would do the work on * each item (the function MyClass::assemble_on_one_cell) * together with an object if it is a member function. * - * Essentially, the way the MyClass::assemble_system - * function could be written then is like this (note that this is not quite + * In the following, let us lay out a rationale for why the functions in the + * WorkStream namespace are implemented the way they are. More information on + * their implementation can be found in the @ref workstream_paper . + * To see the WorkStream class used in practice on tasks like the ones + * outlined above, take a look at the step-9, step-13, step-14, step-32, step-35 or step-37 + * tutorial programs. + * + * To begin with, given the brief description above, + * the way the MyClass::assemble_system + * function could then be written is like this (note that this is not quite * the correct syntax, as will be described below): * @code template @@ -1071,9 +1079,19 @@ * function with the cell and scratch and per task objects which will be filled * in at the positions indicated by std_cxx1x::_1, std_cxx1x::_2 and std_cxx1x::_3. * - * To see the WorkStream class used in practice on tasks like the ones - * outlined above, take a look at the step-32, step-35 or step-37 - * tutorial programs. + * There are refinements to the WorkStream::run function shown above. + * For example, one may realize that the basic idea above can only scale + * if the copy-local-to-global function is much quicker than the + * local assembly function because the former has to run sequentially. + * This limitation can only be improved upon by scheduling more work + * in parallel. This leads to the notion of coloring the graph of + * cells (or, more generally, iterators) we work on by recording + * which write operations conflict with each other. Consequently, there + * is a third version of WorkStream::run that doesn't just take a + * range of iterators, but instead a vector of vectors consisting of + * elements that can be worked on at the same time. This concept + * is explained in great detail in the @ref workstream_paper , along + * with performance evaluations for common examples. * * * @anchor MTTaskSynchronization diff --git a/deal.II/doc/doxygen/options.dox.in b/deal.II/doc/doxygen/options.dox.in index da03da80a6..9f691ebb7d 100644 --- a/deal.II/doc/doxygen/options.dox.in +++ b/deal.II/doc/doxygen/options.dox.in @@ -1,8 +1,9 @@ # This file contains project-specific configurations for the # deal.II documentation. -PROJECT_NAME = "The deal.II library" +PROJECT_NAME = "The deal.II Library" PROJECT_NUMBER = "Reference documentation for deal.II version @DEAL_II_PACKAGE_VERSION@" +PROJECT_LOGO = "logo200.png" OUTPUT_DIRECTORY = . # The doxygen documentation says this about the following flag: @@ -97,7 +98,12 @@ HTML_OUTPUT = deal.II HTML_FILE_EXTENSION = .html HTML_HEADER = header.html HTML_FOOTER = footer.html - +USE_MATHJAX = YES +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 200 +HTML_EXTRA_STYLESHEET = stylesheet.css #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- @@ -117,7 +123,7 @@ LATEX_BATCHMODE = YES GENERATE_RTF = NO GENERATE_MAN = NO -GENERATE_XML = NO +GENERATE_XML = YES GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO @@ -184,8 +190,8 @@ CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = NO DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -MAX_DOT_GRAPH_DEPTH = 3 +DOT_IMAGE_FORMAT = svg +MAX_DOT_GRAPH_DEPTH = 5 DOT_TRANSPARENT = NO GENERATE_LEGEND = YES diff --git a/deal.II/doc/doxygen/scripts/mod_footer.pl b/deal.II/doc/doxygen/scripts/mod_footer.pl new file mode 100644 index 0000000000..149545d707 --- /dev/null +++ b/deal.II/doc/doxygen/scripts/mod_footer.pl @@ -0,0 +1,15 @@ + +use Sys::Hostname; +my $host = hostname; + +my $hosting = << 'EOT' +   Hosting provided by +IWR +Universität Heidelberg +EOT + ; + +if ($host eq "simweb") +{ + s/\$doxygenversion/\$doxygenversion $hosting/; +} diff --git a/deal.II/doc/doxygen/scripts/mod_header.pl b/deal.II/doc/doxygen/scripts/mod_header.pl new file mode 100644 index 0000000000..6007349ce1 --- /dev/null +++ b/deal.II/doc/doxygen/scripts/mod_header.pl @@ -0,0 +1,16 @@ + + +# Modify these to enter the current data automatically +my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; +$year += 1900; + +if (m'') +{ + print '', "\n"; + print '', "\n"; + print '', "\n"; + print '', "\n"; + print '', "\n"; +} + +s/\$projectname// unless (m//); diff --git a/deal.II/doc/doxygen/stylesheet.css b/deal.II/doc/doxygen/stylesheet.css index ba968f6bbd..5ac8648c74 100644 --- a/deal.II/doc/doxygen/stylesheet.css +++ b/deal.II/doc/doxygen/stylesheet.css @@ -1,324 +1,6 @@ -// -// Copyright (C) 1998 - 2013 by the deal.II authors -// -h1, h2, h3, h4, h5, h6 { - color: Black; - background: none; - font-weight: normal; - margin: 0; - padding-top: 0.5em; - padding-bottom: 0.17em; - border-bottom: 1px solid #aaaaaa; -} - -h1 { - font-size: 175%; -} - -h2 { - font-size: 144%; - font-weight: bold; -} - -h3 { font-size: 120%; - padding-bottom: 0.17em; - font-weight: bold; - border-bottom: 1px dashed #aaaaaa; } -h4 { font-size: 110%; - border-bottom: none; - font-weight: bold; -} -h5 { font-size: 100%; - border-bottom: none; - font-weight: bold; -} -h6 { font-size: 80%; - border-bottom: none; - font-weight: bold; -} - -h1.head { - position:relative; - text-align:center; - font-weight: bold; - color:black; - padding-top: 10px; - padding-bottom: 10px; - border-bottom: 0; -} - -div.head { - background-color: #CCD8E8; - border: 1px solid #B0B0B0; - width: 100%; - margin: 2px; - padding: 2px; - text-align:center; -} - -CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #eeeeff; - border: 1px solid #B0B0B0; - text-align: center; - margin: 2px; - padding: 2px; -} -A.qindex { - text-decoration: none; - font-weight: bold; - color: #1A419D; - padding: 2px; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; - color: #1A419D - padding: 2px; -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; - padding: 2px; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - padding: 2 6px; - border: 1px double #9295C2; - } -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; - padding: 2px 6px; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } -A.el { text-decoration: none; font-weight: normal; color: #1A41FF; } -A.el:visited { text-decoration: none; font-weight: normal; color: #1A41B0; } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #1A419D} -A.codeRef { font-weight: normal; color: #1A419D} -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -PRE.fragment { - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; -} -DIV.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - padding: 6px; -} -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: #F4F4FB; font-weight: bold; } -TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } -TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } -DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; - font-family: sans-serif; -} -TD.indexkey { - background-color: #eeeeff; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #eeeeff; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #008000 } -SPAN.keywordtype { color: #604020 } -SPAN.keywordflow { color: #e08000 } -SPAN.comment { color: #800000 } -SPAN.preprocessor { color: #806020 } -SPAN.stringliteral { color: #002080 } -SPAN.charliteral { color: #008080 } -.mdTable { - border: 1px solid #868686; - background-color: #F4F4FB; -} -.mdRow { - padding: 8px 10px; -} -.mdescLeft { - font-size: smaller; - font-family: Arial, Helvetica, sans-serif; - background-color: #FAFAFA; - padding-left: 8px; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - font-size: smaller; - font-family: Arial, Helvetica, sans-serif; - font-style: italic; - background-color: #FAFAFA; - padding-left: 4px; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; - padding-bottom: 0px; - padding-right: 8px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 12px; -} -.memItemRight { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 13px; -} -.memTemplItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 12px; -} -.memTemplParams { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 12px; -} -.memTemplItemRight { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 13px; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #eeeeff; -} -TD.tiny { font-size: 75%; -} - -dt.glossary { - font-size: large; - font-weight: bold; -} -table.tutorial { - color: black; - border: 1px solid #aaa; - background-color: #f9f9f9; - padding: 5px; - font-size: 95%; +#titlearea +{ + background-color: #0000ff; + color: #80ff00; } diff --git a/deal.II/doc/license.html b/deal.II/doc/license.html index 2eddcdf5ee..13cab62b72 100644 --- a/deal.II/doc/license.html +++ b/deal.II/doc/license.html @@ -24,7 +24,7 @@ <p> <b>However, <acronym>deal.II</acronym> is not in the public domain, it is property of and copyrighted by the - <a href="authors.html"><acronym>deal.II</acronym> authors</a>, and + <a href="authors.html"><acronym>deal.II</acronym> Authors</a>, and there are restrictions on its use:</b> The legally binding license is the <a href="#license-text">GNU Lesser General Public License</a> (LGPL) as published by the Free Software diff --git a/deal.II/doc/navbar.html b/deal.II/doc/navbar.html index 68c14b59cf..9fe716955d 100644 --- a/deal.II/doc/navbar.html +++ b/deal.II/doc/navbar.html @@ -30,7 +30,7 @@ <a href="doxygen/tutorial/index.html" target="_top">Tutorial</a><br /> <a href="doxygen/deal.II/index.html" target="_top">Manual</a><br /> <a href="http://www.math.tamu.edu/~bangerth/videos.html" - target="_top">Video lectures</a><br /> + target="_top">Wolfgang's lectures</a><br /> </p> <hr> diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 9dbadb924b..4101eeb4bc 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -40,6 +40,19 @@ inconvenience this causes. </p> <ol> + <li> + Changed: The kinds of template arguments for the VectorTools::interpolate + function taking a Mapping as first argument has changed. This was done to + work around a bug in the Intel ICC compiler which led to linker errors. Since + the actual function argument list remains unchanged, the only way you will + notice this change is if you <i>explicitly</i> specify template arguments. + The only place one would typically do that is if you take the address of + a template function. Since this is not a common operation, the impact of this + change is probably limited. + <br> + (Wolfgang Bangerth, 2013/11/27) + </li> + <li> Changed: The ghost handling of the parallel::distributed::Vector class has been reworked: The vector now carries a global state that stores whether @@ -94,6 +107,11 @@ inconvenience this causes. <ol> + <li> Fixed: Missing instantiations of SparseDirectMUMPS have been added. + <br> + (Timo Heister, 2013/11/25) + </li> + <li> New: introduced "make test" that runs a minimal set of tests. We encourage every user to run this, especially if they run in to problems. The tests are automatically picked depending on the configuration and @@ -116,7 +134,8 @@ inconvenience this causes. </li> <li> Changed: step-9, step-13 and step-14 have been converted to use the - more modern WorkStream concept for assembling linear systems in parallel. + more modern WorkStream concept for assembling linear systems and computing + error indicators in parallel. <br> (Bruno Turcksin, Wolfgang Bangerth, 2013/10/26) </li> @@ -211,6 +230,37 @@ inconvenience this causes. <h3>Specific improvements</h3> <ol> + <li> Improved: When attempting operations such as FEValues::get_function_values() + or FEValues::shape_value(), the FEValues object needs to know that what these + functions return has been computed previously. What is computed is specified + by the update flags that are passed to the constructor of all FEValues, FEFaceValues + and FESubfaceValues objects. If a user attempts an operation for which the + corresponding flag was not specified, an exception is generated. This exception + did say previously what the cause was, but it was not overly explicit. + The exception now generates a message that says exactly what is going wrong. + <br> + (Wolfgang Bangerth, 2013/12/01) + </li> + + <li> Fixed: GridGenerator::truncated_cone() failed if half_length < 0.5*radius in 3d. + <br> + (Timo Heister, 2013/11/25) + </li> + + <li> Fixed: make_hanging_node_constraints failed with an exception in a + parallel::distributed computation if the element is + RaviartThomas (and probably others). + <br> + (Timo Heister, 2013/11/23) + </li> + + <li> Improved: CMake: Added a configuration check for incompatible ninja + + icc setup, fixed several setup and performance issues with the + testsuite. + <br> + (Matthias Maier, 2013/11/20) + </li> + <li> Changed: when a dealii::Exception is thrown, defer the symbol lookup of the stack trace to when it is needed. This improves performance if what() is never called. @@ -219,7 +269,7 @@ inconvenience this causes. </li> <li> Fixed: GridGenerator::parallelogram was not instantiated properly - on intel compilers. + when using intel compilers. <br> (Timo Heister, 2013/11/17) </li> @@ -264,6 +314,13 @@ inconvenience this causes. (Wolfgang Bangerth, 2013/11/13) </li> + <li> Cleanup: Removed obsolete files and files with unknown licensing + status from the source tree. Along the way, parameter_gui now uses + default icons from the desktop environment instead of bundled ones. + <br> + (Matthias Maier, 2013/11/11) + </li> + <li> New: There is now a framework for coloring graphs, with functions in namespace GraphColoring. <br> diff --git a/deal.II/doc/publications/dealii.bib b/deal.II/doc/publications/dealii.bib index 2f79be661e..08d39692c9 100644 --- a/deal.II/doc/publications/dealii.bib +++ b/deal.II/doc/publications/dealii.bib @@ -133,5 +133,16 @@ journal = {ACM Trans. Math. Softw.}, year = 2011, volume = 38, - pages = {14/1--28}} + pages = {14/1--28} +} + +@Article{KronbichlerKormann2012, + author = {M. Kronbichler and K. Kormann}, + title = {A generic interface for parallel cell-based finite element operator application}, + journal = {Comput. Fluids}, + year = 2012, + volume = 63, + pages = {135--147}, + doi = {10.1016/j.compfluid.2012.04.012} +} diff --git a/deal.II/doc/publications/index.html b/deal.II/doc/publications/index.html index 50f18dcc96..bd0feb08cb 100644 --- a/deal.II/doc/publications/index.html +++ b/deal.II/doc/publications/index.html @@ -15,7 +15,7 @@ <body> - <h2>Publications on and with <acronym>deal.II</acronym></h2> + <h1>Publications on and with <acronym>deal.II</acronym></h1> <p> Our institutes are evaluated at regular intervals. Consequently, @@ -68,7 +68,7 @@ <a name="referencing"> </a> - <h3>Referencing <acronym>deal.II</acronym></h3> + <h2>Referencing <acronym>deal.II</acronym></h2> <p> If you write a paper using results obtained with the help of @@ -94,16 +94,17 @@ (<a href="http://www.isc.tamu.edu/publications-reports/tr/0602.pdf">Preprint</a>) <br> - <pre> - @Article{BangerthHartmannKanschat2007, - author = {W. Bangerth and R. Hartmann and G. Kanschat}, - title = {{deal.II} -- a General Purpose Object Oriented Finite Element Library}, - journal = {ACM Trans. Math. Softw.}, - year = 2007, - volume = 33, - number = 4, - pages = {24/1--24/27} - }</pre> +<pre> +@Article{BangerthHartmannKanschat2007, + author = {W. Bangerth and R. Hartmann and G. Kanschat}, + title = {{deal.II} -- a General Purpose Object Oriented Finite Element Library}, + journal = {ACM Trans. Math. Softw.}, + year = 2007, + volume = 33, + number = 4, + pages = {24/1--24/27} +} +</pre> </li> <li> <a href="http://www.math.tamu.edu/~bangerth" target="_top">W. Bangerth</a>, @@ -120,14 +121,14 @@ To be found on the project webpage <a href="http://www.dealii.org" target="_top">http://www.dealii.org</a> <br> - <pre> - @Manual{DealIIReference, - title = {{\tt deal.{I}{I}} Differential Equations Analysis Library, - Technical Reference}, - author = {W. Bangerth and T. Heister and G. Kanschat and others}, - note = {\texttt{http://www.dealii.org}}, - url = {http://www.dealii.org} - }</pre> +<pre> +@Manual{DealIIReference, + title = {{\tt deal.{I}{I}} Differential Equations Analysis Library, Technical Reference}, + author = {W. Bangerth and T. Heister and G. Kanschat and others}, + note = {\texttt{http://www.dealii.org}}, + url = {http://www.dealii.org} +} +</pre> </li> </ol> @@ -154,8 +155,8 @@ <p> The following publications explain in great detail the - implementation of algorithms and data structures of the hp, multigrid and - distributed mesh components of deal.II: + implementation of algorithms and data structures of the hp, multigrid, + distributed mesh, and matrix-free components of deal.II: </p> <ol> @@ -207,6 +208,17 @@ Comput. & Struct., vol. 82, pp. 2437-2445, 2004 </li> + <li> M. Kronbichler, K. Kormann + <br> + <strong>A generic interface for parallel cell-based finite element + operator application + </strong> + <br> + Computers and Fluids, vol. 63, pp. 135-147, 2012 + <br> + DOI: <a href="http://dx.doi.org/10.1016/j.compfluid.2012.04.012">10.1016/j.compfluid.2012.04.012</a> + </li> + <li> W. Bangerth, T. Heister <br> <strong>What makes computational open source software libraries successful?</strong> @@ -239,7 +251,7 @@ </ul> <a name="2013"> </a> - <h3>Publications in 2013</h3> + <h2>Publications in 2013</h2> <!-- Please enter alphabetically by name --> <ol> @@ -286,6 +298,15 @@ Msc thesis, University of Göttingen, Germany, 2013. </li> + <li> O. Axelsson, P. Boyanova, M. Kronbichler, M. Neytcheva, X. Wu + <br> + <strong>Numerical and computational efficiency of solvers for + two-phase problems + </strong> + <br> + Comput. Math. Appl., 65, 301-314, 2013. + </li> + <li> A. Barker, T. Rees, M. Stoll <br> <strong>A fast solver for an H<sub>1</sub> regularized @@ -855,7 +876,7 @@ a monolithic ALE framework </ol> <a name="2012"> </a> - <h3>Publications in 2012</h3> + <h2>Publications in 2012</h2> <!-- Please enter alphabetically by name --> <ol> @@ -1216,15 +1237,6 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with University of Uppsala, research report, 2012. </li> - <li> M. Kronbichler, K. Kormann - <br> - <strong>A generic interface for parallel cell-based finite element - operator application - </strong> - <br> - Computers and Fluids, vol. 63, pp. 135-147, 2012. - </li> - <li> M. Kunkel <br> <strong>Nonsmooth Newton Methods and Convergence of @@ -1455,7 +1467,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with </ol> <a name="2011"> </a> - <h3>Publications in 2011</h3> + <h2>Publications in 2011</h2> <!-- Please enter alphabetically by name --> <ol> @@ -2045,7 +2057,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2010"> </a> - <h3>Publications in 2010</h3> + <h2>Publications in 2010</h2> <!-- Please enter alphabetically by name --> <ol> @@ -2591,7 +2603,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with </ol> <a name="2009"> </a> - <h3>Publications in 2009</h3> + <h2>Publications in 2009</h2> <!-- Please enter alphabetically by name --> <ol> @@ -3045,7 +3057,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2008"> </a> - <h3>Publications in 2008</h3> + <h2>Publications in 2008</h2> <!-- Please enter alphabetically by name --> <ol> @@ -3412,7 +3424,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2007"> </a> - <h3>Publications in 2007</h3> + <h2>Publications in 2007</h2> <!-- Please enter alphabetically by name --> <ol> <li> N. Antonic, M. Vrdoljak @@ -3750,7 +3762,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2006"> </a> - <h3>Publications in 2006</h3> + <h2>Publications in 2006</h2> <ol> @@ -4044,7 +4056,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2005"> </a> - <h3>Publications in 2005</h3> + <h2>Publications in 2005</h2> <ol> @@ -4270,7 +4282,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2004"> </a> - <h3>Publications in 2004</h3> + <h2>Publications in 2004</h2> <ol> <li> <a href="http://www.math.tamu.edu/~bangerth" @@ -4449,7 +4461,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2003"> </a> - <h3>Publications in 2003</h3> + <h2>Publications in 2003</h2> <ol> <li> @@ -4630,7 +4642,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2002"> </a> - <h3>Publications in 2002</h3> + <h2>Publications in 2002</h2> <ol> @@ -4763,7 +4775,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2001"> </a> - <h3>Publications in 2001</h3> + <h2>Publications in 2001</h2> <ol> <li> A. Barinka, T. Barsch, P. Charton, A. Cohen, S. Dahlke, @@ -4803,7 +4815,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="2000"> </a> - <h3>Publications in 2000</h3> + <h2>Publications in 2000</h2> <ol> @@ -4871,7 +4883,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="1999"> </a> - <h3>Publications in 1999</h3> + <h2>Publications in 1999</h2> <ol> <li> @@ -4929,7 +4941,7 @@ A Goal Oriented Software Library for Solving PDEs and Optimization Problems with <a name="1998"> </a> - <h3>Publications in 1998</h3> + <h2>Publications in 1998</h2> <ol> <li> diff --git a/deal.II/doc/readme.html b/deal.II/doc/readme.html index 571859682d..5ea8cc3d06 100644 --- a/deal.II/doc/readme.html +++ b/deal.II/doc/readme.html @@ -78,7 +78,7 @@ </p> <ul> <li>GNU/Linux: GCC version 4.1 or later; Clang version 3.0 or later; - ICC versions 12* or 14* (version 13 is not supported)</li> + ICC versions 13* or 14*</li> <li>Mac OS X: GCC version 4.1 or later; Clang version 3.0 or later. Please see the <a href="https://code.google.com/p/dealii/wiki/MacOSX" target="_top">deal.II Wiki</a> for installation instructions.</li> @@ -178,10 +178,10 @@ </li> </ul> - <a name="installation"/> + <a name="installation"></a> <h2>Installation</h2> - <a name="unpacking"/> + <a name="unpacking"></a> <h3>Unpacking</h3> <p> diff --git a/deal.II/doc/reports/index.html b/deal.II/doc/reports/index.html index 9a2246b474..cbc166127d 100644 --- a/deal.II/doc/reports/index.html +++ b/deal.II/doc/reports/index.html @@ -18,7 +18,7 @@ <p> There are a number of papers that describe the overall design or individual aspects of <acronym>deal.II</acronym>. Please refer to the - papers listed at the top of the <a href="publications/index.html" + papers listed at the top of the <a href="../publications/index.html" target="body">publications page</a> for full references. In addition, there are the following reports: <ul> @@ -78,15 +78,17 @@ </li> </ul> - <hr /> - <address> - <a href="authors.html" target="body">The deal.II Authors</a> - </address> - <div class="right"> - <a href="http://validator.w3.org/check?uri=referer" target="_top"> - <img style="border:0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> - <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_top"> - <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> - </div> +<hr /> +<address> + <a href="../authors.html" target="body">The deal.II Authors</a> + $Date$ +</address> +<div class="right"> + <a href="http://validator.w3.org/check?uri=referer" target="_top"> + <img style="border:0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> + <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_top"> + <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> +</div> + </body> </html> diff --git a/deal.II/doc/screen.css b/deal.II/doc/screen.css index 66e3fdeec9..2abc65f177 100644 --- a/deal.II/doc/screen.css +++ b/deal.II/doc/screen.css @@ -3,33 +3,33 @@ // body { - background-image: none; - background-color: #ECF0F4; - color: Black; - margin: 10px; - padding: 0; - font-family: sans-serif; - counter-reset: section; + background-image: none; + background-color: #ECF0F4; + color: Black; + margin: 10px; + padding: 0; + font-family: sans-serif; + counter-reset: section; } body.title { - background-color: #CCD8E8; - margin: 0; - padding: 2px; + background-color: #CCD8E8; + margin: 0; + padding: 2px; } body.gallery { - background-color: #CCD8E8; - margin: 0; - padding: 2px; + background-color: #CCD8E8; + margin: 0; + padding: 2px; } body.navbar { - background-color: #CCD8E8; - margin: 2px; - padding: 2px; - font-family: sans-serif; - font-size: 12px; + background-color: #CCD8E8; + margin: 2px; + padding: 2px; + font-family: sans-serif; + font-size: 12px; } div.toc { @@ -67,9 +67,9 @@ div.quick:before { } frameset { - background-color: white; - border-color: black; - border: 2px; + background-color: white; + border-color: black; + border: 2px; } a:hover { text-decoration: underline; } @@ -102,13 +102,13 @@ div.fixedhead { } h1.head { - position:relative; + position:relative; text-align:center; - font-weight: bold; - color:black; - padding-top: 0; - padding-bottom: 0; - border-bottom: 0; + font-weight: bold; + color:black; + padding-top: 0; + padding-bottom: 0; + border-bottom: 0; } h1, h2, h3, h4, h5, h6 { @@ -207,52 +207,52 @@ q { } .figure { font-weight: bold; - font-size: larger; - } + font-size: larger; + } .pagetoc {} .chapter_title {} span.parhead { - font-weight: bold; -} + font-weight: bold; +} span.example { - font-weight: bold; - font-style: italic; + font-weight: bold; + font-style: italic; } pre { - padding: 0em; - text-align: left; - text-indent: 0; - border: 1px dashed #2f6fab; - color: Black; - background-color: #f9f9f9; - line-height: 1.1em; -} - + padding: 1em; + text-align: left; + text-indent: 0; + border: 1px dashed #2f6fab; + color: Black; + background-color: #f9f9f9; + line-height: 1.1em; +} + pre.cmake { - padding: 1em; - text-align: left; - text-indent: 0; - border: 1px solid #d06fab; - color: Black; - background-color: #f9f9f9; - line-height: 1.1em; -} - + padding: 1em; + text-align: left; + text-indent: 0; + border: 1px solid #d06fab; + color: Black; + background-color: #f9f9f9; + line-height: 1.1em; +} + pre.sample { - padding: 1em; - text-align: left; - text-indent: 0; - border: 1px dashed #2f6fab; - color: Black; - background-color: #f9f9f9; - line-height: 1.1em; -} - + padding: 1em; + text-align: left; + text-indent: 0; + border: 1px dashed #2f6fab; + color: Black; + background-color: #f9f9f9; + line-height: 1.1em; +} + table.navbar { } table.tutorial { color: black; @@ -281,9 +281,9 @@ code { } td.build { - text-align: center; - vertical-align: middle; - font-size: small; + text-align: center; + vertical-align: middle; + font-size: small; } @@ -308,8 +308,8 @@ td.build { } .weak { - color: #808080; - text-decoration: line-through; + color: #808080; + text-decoration: line-through; } .todo:before { @@ -321,16 +321,30 @@ td.build { } .deprecated { - text-decoration: line-through; + text-decoration: line-through; } .attention { - color: #f00080; - font-weight: bold; + color: #f00080; + font-weight: bold; } .shout { - color: #e000ff; - text-decoration: blink; - font-weight: bold; + color: #e000ff; + text-decoration: blink; + font-weight: bold; +} + +div.border { + clear: both; + margin: auto; +} + +div.infobox { + float: left; + width: 250px; + text-align: center; + margin-top: 1em; + margin-left: 20px; + margin-right: 20px; } diff --git a/deal.II/doc/users/cmake.html b/deal.II/doc/users/cmake.html index c4df8f5d04..7a571607ef 100644 --- a/deal.II/doc/users/cmake.html +++ b/deal.II/doc/users/cmake.html @@ -80,13 +80,12 @@ necessary; <i>values for variables that are already in the cache are not re-evaluated</i>. This means that calling <code>cmake</code> a second time without any arguments at all in a situation like this - <pre> - - mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II - cmake ../deal.II - </pre> +<pre class="cmake"> +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II +cmake ../deal.II +</pre> has no effect: In particular, the <code>CMAKE_INSTALL_PREFIX</code> specified on the first invocation of <code>cmake</code> is cached and therefore still valid after the second invocation @@ -99,33 +98,30 @@ configuration parameters and thereby interact with the configuration system in rather powerful (and, possibly, destructive) ways. For example, the following commands - <pre> - - mkdir build - cd build - cmake ../deal.II - ccmake - </pre> +<pre class="cmake"> +mkdir build +cd build +cmake ../deal.II +ccmake +</pre> first configure a bare-bone setup and then call the <code>ccmake</code> program -- an interactive editor for the cached variables. Similarly, - <pre> - - mkdir build - cd build - cmake ../deal.II - cmake -D<OPTION>=<VALUE> [...] ../deal.II - </pre> +<pre class="cmake"> +mkdir build +cd build +cmake ../deal.II +cmake -D<OPTION>=<VALUE> [...] ../deal.II +</pre> sets a variable the second time around without destroying all the configuration that has happened the first time around. Likewise, - <pre> - - mkdir build - cd build - cmake ../deal.II - cmake -DDEAL_II_WITH_METIS=OFF . - cmake -DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=/path/to/trilinos . - </pre> +<pre class="cmake"> +mkdir build +cd build +cmake ../deal.II +cmake -DDEAL_II_WITH_METIS=OFF . +cmake -DDEAL_II_WITH_TRILINOS=ON -DTRILINOS_DIR=/path/to/trilinos . +</pre> switches off support for the METIS library that may have been automatically detected during the first invocation of <code>cmake</code> and enables support for Trilinos by enabling @@ -138,23 +134,20 @@ <p> A cached variable can be set on the command line via - <pre> - - cmake -D<VARIABLE>=<VALUE> . - </pre> +<pre class="cmake"> +cmake -D<VARIABLE>=<VALUE> . +</pre> Cached variables can be removed from the cache via - <pre> - - cmake -U<VARIABLE> . - </pre> +<pre class="cmake"> +cmake -U<VARIABLE> . +</pre> It is possible to use <code>-U</code> together with a globbing expression. E.g. to remove the current feature configuration and rerun the autodetection one can invoke - <pre> - - cmake -U"DEAL_II_WITH_*" . - </pre> +<pre class="cmake"> +cmake -U"DEAL_II_WITH_*" . +</pre> </p> <a name="operatingccmake"></a> @@ -164,21 +157,18 @@ A very convenient way to alter the configuration is to use the graphical user interface <code>ccmake</code> to the variables <code>cmake</code> stores upon running. It can be invoked via - <pre> - - ccmake . - </pre> +<pre class="cmake"> +ccmake . +</pre> or by - <pre> - - make edit_cache - </pre> +<pre class="cmake"> +make edit_cache +</pre> A reconfiguration (without editing the cache) can be run via - <pre> - - make rebuild_cache - </pre> +<pre class="cmake"> +make rebuild_cache +</pre> </p> <a name="operatingshortcuts"></a> @@ -187,15 +177,13 @@ <p> All variables starting with <code>WITH_</code> will be automatically renamed to <code>DEAL_II_WITH_*</code>. So, it suffices to specify - <pre> - - cmake -DWITH_MPI=ON <...> - </pre> +<pre class="cmake"> +cmake -DWITH_MPI=ON <...> +</pre> instead of the longer - <pre> - - cmake -DDEAL_II_WITH_MPI=ON <...> - </pre> +<pre class="cmake"> +cmake -DDEAL_II_WITH_MPI=ON <...> +</pre> The same holds for all variables starting with <code>COMPONENT_</code> and all individual component names: <code>COMPAT_FILES</code>, <code>DOCUMENTATION</code>, <code>EXAMPLES</code>, @@ -219,37 +207,36 @@ <p> The current list of primary build targets can be queried via <code>make info</code>: - <pre> - - ### - # - # The following targets are available (invoke via $ make <target>): - # - # all - compiles the library and all enabled components - # clean - removes all generated files - # install - installs into CMAKE_INSTALL_PREFIX - # help - prints a list of valid top level targets - # info - prints this help message - # - # edit_cache - runs ccmake for changing (cached) configuration variables - # and reruns the configure and generate phases of CMake - # rebuild_cache - reruns the configure and generate phases of CMake - # - # compat_files - builds and installs the 'compat_files' component - # documentation - builds and installs the 'documentation' component - # examples - builds and installs the 'examples' component - # library - builds and installs the 'library' component - # mesh_converter - builds and installs the 'mesh_converter' component - # parameter_gui - builds and installs the 'parameter_gui' component - # - # test - runs a minimal set of tests - # - # setup_test - sets up the testsuite subprojects - # clean_test - runs the 'clean' target in every testsuite subproject - # prune_test - removes all testsuite subprojects - # - ### - </pre> +<pre class="cmake"> +### +# +# The following targets are available (invoke via $ make <target>): +# +# all - compiles the library and all enabled components +# clean - removes all generated files +# install - installs into CMAKE_INSTALL_PREFIX +# help - prints a list of valid top level targets +# info - prints this help message +# +# edit_cache - runs ccmake for changing (cached) configuration variables +# and reruns the configure and generate phases of CMake +# rebuild_cache - reruns the configure and generate phases of CMake +# +# compat_files - builds and installs the 'compat_files' component +# documentation - builds and installs the 'documentation' component +# examples - builds and installs the 'examples' component +# library - builds and installs the 'library' component +# mesh_converter - builds and installs the 'mesh_converter' component +# parameter_gui - builds and installs the 'parameter_gui' component +# +# test - runs a minimal set of tests +# +# setup_test - sets up the testsuite subprojects +# clean_test - runs the 'clean' target in every testsuite subproject +# prune_test - removes all testsuite subprojects +# +### +</pre> <a name="buildinformation"></a> @@ -259,38 +246,37 @@ A configuration run of <code>cmake</code> (or <code>ccmake</code>) writes a short summary of the current configuration into <code>CMAKE_BUILD_DIR/summary.log</code>: - <pre> - - ### - # - # deal.II configuration: - # CMAKE_BUILD_TYPE: DebugRelease - # BUILD_SHARED_LIBS: ON - # CMAKE_INSTALL_PREFIX: /tmp/deal.II/install - # CMAKE_SOURCE_DIR: /tmp/deal.II/deal.II (Version 8.1.pre) - # CMAKE_BINARY_DIR: /tmp/deal.II/build - # CMAKE_CXX_COMPILER: GNU 4.7.3 on platform Linux x86_64 - # /usr/bin/c++ - # - # Configured Features (DEAL_II_ALLOW_BUNDLED = ON, DEAL_II_ALLOW_AUTODETECTION = ON): - # ( DEAL_II_WITH_64BIT_INDICES = OFF ) - # DEAL_II_WITH_ARPACK set up with external dependencies - # DEAL_II_WITH_BOOST set up with external dependencies - # [...] - # - # Component configuration: - # DEAL_II_COMPONENT_COMPAT_FILES - # ( DEAL_II_COMPONENT_DOCUMENTATION = OFF ) - # DEAL_II_COMPONENT_EXAMPLES - # DEAL_II_COMPONENT_MESH_CONVERTER - # ( DEAL_II_COMPONENT_PARAMETER_GUI = OFF ) - # - # Detailed information (compiler flags, feature configuration) can be found in detailed.log - # - # Run $ make info to print a help message with a list of top level targets - # - ### - </pre> +<pre class="cmake"> +### +# +# deal.II configuration: +# CMAKE_BUILD_TYPE: DebugRelease +# BUILD_SHARED_LIBS: ON +# CMAKE_INSTALL_PREFIX: /tmp/deal.II/install +# CMAKE_SOURCE_DIR: /tmp/deal.II/deal.II (Version 8.1.pre) +# CMAKE_BINARY_DIR: /tmp/deal.II/build +# CMAKE_CXX_COMPILER: GNU 4.7.3 on platform Linux x86_64 +# /usr/bin/c++ +# +# Configured Features (DEAL_II_ALLOW_BUNDLED = ON, DEAL_II_ALLOW_AUTODETECTION = ON): +# ( DEAL_II_WITH_64BIT_INDICES = OFF ) +# DEAL_II_WITH_ARPACK set up with external dependencies +# DEAL_II_WITH_BOOST set up with external dependencies +# [...] +# +# Component configuration: +# DEAL_II_COMPONENT_COMPAT_FILES +# ( DEAL_II_COMPONENT_DOCUMENTATION = OFF ) +# DEAL_II_COMPONENT_EXAMPLES +# DEAL_II_COMPONENT_MESH_CONVERTER +# ( DEAL_II_COMPONENT_PARAMETER_GUI = OFF ) +# +# Detailed information (compiler flags, feature configuration) can be found in detailed.log +# +# Run $ make info to print a help message with a list of top level targets +# +### +</pre> This summary is also printed at the end of the configuration phase. It tells you about build and install directory locations, feature configuration (whether a feature is enabled with external/internal @@ -298,15 +284,14 @@ A more detailed version can be found in <code>CMAKE_BUILD_DIR/detailed.log</code> that also includes detailed information about feature configuration, e.g. - <pre> - - # DEAL_II_WITH_BOOST set up with external dependencies - # BOOST_VERSION = 1.52.0 - # BOOST_DIR = - # Boost_INCLUDE_DIRS = /usr/include - # Boost_LIBRARIES = /usr/lib64/libboost_serialization-mt.so;/usr/lib64/libboost_system-mt.so; - # [...] - </pre> +<pre class="cmake"> +# DEAL_II_WITH_BOOST set up with external dependencies +# BOOST_VERSION = 1.52.0 +# BOOST_DIR = +# Boost_INCLUDE_DIRS = /usr/include +# Boost_LIBRARIES = /usr/lib64/libboost_serialization-mt.so;/usr/lib64/libboost_system-mt.so; +# [...] +</pre> If this information is not sufficient, you might want to have a look at the following files in <code>CMAKE_BUILD_DIR</code> <ul> @@ -332,12 +317,11 @@ <code>cmake</code> (or <code>ccmake</code>) from the designated build directory, so for example (a build directory under the source directory): - <pre> - - $ mkdir build - $ cd build - $ cmake .. - </pre> +<pre class="cmake"> +$ mkdir build +$ cd build +$ cmake .. +</pre> The big advantage is that source files and intermediate files are strictly separated (highly desired for version control) and that you can have multiple build directories (with different configuration) at @@ -347,10 +331,9 @@ <p> <b>Note:</b> However, under rare occasions an in-source build might be useful or needed , so it is supported - <pre> - - $ cmake . - </pre> +<pre class="cmake"> +$ cmake . +</pre> But we highly discourage it! </p> @@ -361,10 +344,9 @@ Cmake is a <i>Makefile Generator</i>. This allows to switch the generator that is used to something different. If you for example want to automatically generate an Eclipse project of deal.II, you can run - <pre> - - $ cmake -G"Eclipse CDT4 - Unix Makefiles" [...] - </pre> +<pre class="cmake"> +$ cmake -G"Eclipse CDT4 - Unix Makefiles" [...] +</pre> and load up the build directory as a project directly into Eclipse. Have a look at the <a href="https://code.google.com/p/dealii/w/list" target="_top">Wiki</a> for more information. @@ -373,10 +355,9 @@ <p> An interesting alternative to (GNU) Make might also be <a href="http://martine.github.io/ninja/">Ninja</a>. Configure via - <pre> - - $ cmake -GNinja [...] - </pre> +<pre class="cmake"> +$ cmake -GNinja [...] +</pre> and run <code>ninja</code> instead of <code>make</code>. </p> @@ -421,15 +402,14 @@ If you want to only generate, compile and install a specific component (most notably the documentation) you can use one of the following top level targets: - <pre> - - compat_files - builds and installs the 'compat_files' component - documentation - builds and installs the 'documentation' component - examples - builds and installs the 'examples' component - library - builds and installs the 'library' component - mesh_converter - builds and installs the 'mesh_converter' component - parameter_gui - builds and installs the 'parameter_gui' component - </pre> + <pre class="cmake"> +compat_files - builds and installs the 'compat_files' component +documentation - builds and installs the 'documentation' component +examples - builds and installs the 'examples' component +library - builds and installs the 'library' component +mesh_converter - builds and installs the 'mesh_converter' component +parameter_gui - builds and installs the 'parameter_gui' component +</pre> <a name="configure"></a> @@ -462,25 +442,24 @@ <p> Specifically, the following variables exist (the list may grow over time, but names are standardized): - <pre> - - DEAL_II_WITH_ARPACK - DEAL_II_WITH_BOOST - DEAL_II_WITH_FUNCTIONPARSER - DEAL_II_WITH_LAPACK - DEAL_II_WITH_METIS - DEAL_II_WITH_MUMPS - DEAL_II_WITH_MPI - DEAL_II_WITH_NETCDF - DEAL_II_WITH_P4EST - DEAL_II_WITH_PETSC - DEAL_II_WITH_SLEPC - DEAL_II_WITH_THREADS - DEAL_II_WITH_TRILINOS - DEAL_II_WITH_UMFPACK - DEAL_II_WITH_ZLIB - DEAL_II_WITH_64BIT_INDICES - </pre> +<pre class="cmake"> +DEAL_II_WITH_ARPACK +DEAL_II_WITH_BOOST +DEAL_II_WITH_FUNCTIONPARSER +DEAL_II_WITH_LAPACK +DEAL_II_WITH_METIS +DEAL_II_WITH_MUMPS +DEAL_II_WITH_MPI +DEAL_II_WITH_NETCDF +DEAL_II_WITH_P4EST +DEAL_II_WITH_PETSC +DEAL_II_WITH_SLEPC +DEAL_II_WITH_THREADS +DEAL_II_WITH_TRILINOS +DEAL_II_WITH_UMFPACK +DEAL_II_WITH_ZLIB +DEAL_II_WITH_64BIT_INDICES +</pre> They all have standard meaning with the exception of two: <ul> @@ -584,10 +563,9 @@ <p> Paths specified via <code>CMAKE_PREFIX_PATH</code> take precedence, e.g. with - <pre> - - cmake -DCMAKE_PREFIX_PATH=~/workspace/local ../deal.II - </pre> +<pre class="cmake"> +make -DCMAKE_PREFIX_PATH=~/workspace/local ../deal.II +</pre> libraries from <code>~/workspace/local</code> will be preferred for dependency resolution. </p> @@ -596,37 +574,34 @@ <p> Hints given by <code><library>_DIR</code> via command line or environment for <i>some</i> libraries: - <pre> - - cmake -DP4EST_DIR=~/workspace/p4est-install/ ../deal.II - </pre> +<pre class="cmake"> +make -DP4EST_DIR=~/workspace/p4est-install/ ../deal.II +</pre> or - <pre> - - export P4EST_DIR=~/workspace/p4est-install/ - cmake ../deal.II - </pre> +<pre class="cmake"> +export P4EST_DIR=~/workspace/p4est-install/ +cmake ../deal.II +</pre> where <code>-D<library>_DIR</code> takes precedence over environment. </p> <p> Currently, the following variables will be considered: - <pre> - - ARPACK_DIR, - BOOST_DIR, - HDF5_DIR, - LAPACK_DIR (and BLAS_DIR), - METIS_DIR, - MUMPS_DIR (and SCALAPACK_DIR, BLACS_DIR), - P4EST_DIR (and SC_DIR), - PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}), - SLEPC_DIR (forming ${SLEPC_DIR}/${PETSC_ARCH}), - TBB_DIR, - TRILINOS_DIR, - UMFPACK_DIR and SUITESPARSE_DIR (AMD_DIR, CHOLMOD_DIR, COLAMD_DIR, SUITESPARSECONFIG_DIR) - </pre> +<pre class="cmake"> +ARPACK_DIR, +BOOST_DIR, +HDF5_DIR, +LAPACK_DIR (and BLAS_DIR), +METIS_DIR, +MUMPS_DIR (and SCALAPACK_DIR, BLACS_DIR), +P4EST_DIR (and SC_DIR), +PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}), +SLEPC_DIR (forming ${SLEPC_DIR}/${PETSC_ARCH}), +TBB_DIR, +TRILINOS_DIR, +UMFPACK_DIR and SUITESPARSE_DIR (AMD_DIR, CHOLMOD_DIR, COLAMD_DIR, SUITESPARSECONFIG_DIR) +</pre> </p> <li> @@ -641,10 +616,9 @@ <code>Find<Module></code> mechanism may be set, hinted or overwritten directly (variable names are highly dependent on the actual library). You can get a list via - <pre> - - make edit_cache - </pre> +<pre class="cmake"> +make edit_cache +</pre> and entering advanced configuration mode by pressing [t]. Variables that could not be determined are suffixed with <code>-NOTFOUND</code> and may be set by hand. @@ -657,18 +631,16 @@ need different revisions sometimes, in your own library directory, you may receive an error message of the form:</p> -<pre> - - CMake Warning at source/CMakeLists.txt:65 (ADD_LIBRARY): - Cannot generate a safe runtime search path for target deal_II.g because - files in some directories may conflict with libraries in implicit - directories: - - runtime library [libtbb.so.2] in /usr/lib may be hidden by files in: - /my/private/lib +<pre class="cmake"> +CMake Warning at source/CMakeLists.txt:65 (ADD_LIBRARY): + Cannot generate a safe runtime search path for target deal_II.g because + files in some directories may conflict with libraries in implicit + directories: - Some of these libraries may not be found correctly. + runtime library [libtbb.so.2] in /usr/lib may be hidden by files in: + /my/private/lib + Some of these libraries may not be found correctly. </pre> <p>This is not a problem of CMake or deal.II, but rather a general @@ -689,14 +661,13 @@ <code>FIND_PACKAGE(...)</code> mechanism. In this case you can set by hand: - <pre> - - cmake -D<feature>_FOUND=true \ - -D<feature>_LIBRARIES="library;and;complete;link;interface" \ - ( -D<feature>_INCLUDE_DIRS="semicolon;separated;list;of;include;dirs" \ - -D<feature>_LINKER_FLAGS="..." \ - -D<feature>_<...depending on library...> ) - </pre> +<pre class="cmake"> +cmake -D<feature>_FOUND=true \ + -D<feature>_LIBRARIES="library;and;complete;link;interface" \ + ( -D<feature>_INCLUDE_DIRS="semicolon;separated;list;of;include;dirs" \ + -D<feature>_LINKER_FLAGS="..." \ + -D<feature>_<...depending on library...> ) +</pre> The first define ensures that <code>cmake</code> does not call the corresponding <code>Find<lib>.cmake</code> module. @@ -710,12 +681,11 @@ configuration: (Here, these libraries have been compiled with the gfortran compiler and need its support library): - <pre> - - cmake -DLAPACK_FOUND=true \ - -DLAPACK_LIBRARIES="/tmp/petsc-3.3-p6/arch-linux2-c-debug/lib/libflapack.a;/tmp/petsc-3.3-p6/arch-linux2-c-debug/lib/libfblas.a" \ - -DLAPACK_LINKER_FLAGS="-lgfortran -lm" - </pre> +<pre class="cmake"> +cmake -DLAPACK_FOUND=true \ + -DLAPACK_LIBRARIES="/tmp/petsc-3.3-p6/arch-linux2-c-debug/lib/libflapack.a;/tmp/petsc-3.3-p6/arch-linux2-c-debug/lib/libfblas.a" \ + -DLAPACK_LINKER_FLAGS="-lgfortran -lm" +</pre> You can set these values on the command line, with <code>ccmake</code> or by providing an initial cache file, see @@ -864,12 +834,11 @@ </p> Compilers can be switched either by command line or by setting <code>CMAKE_(C|CXX|Fortran)_COMPILER</code>: - <pre> +<pre class="cmake"> +CC=mpicc CXX=mpicxx FC=mpif90 cmake <...> - CC=mpicc CXX=mpicxx cmake <...> - - cmake -DCMAKE_C_COMPILER="mpicc" -DCMAKE_CXX_COMPILER="mpicxx" -DCMAKE_Fortran_COMPILER="mpif90" <...> - </pre> +cmake -DCMAKE_C_COMPILER="mpicc" -DCMAKE_CXX_COMPILER="mpicxx" -DCMAKE_Fortran_COMPILER="mpif90" <...> +</pre> Please note that <ul> <li> @@ -890,22 +859,20 @@ <li> Override the default configuration by setting the following cached variables: - <pre> - - CMAKE_CXX_FLAGS - used during all builds - DEAL_II_CXX_FLAGS_DEBUG - additional flags for the debug library - DEAL_II_CXX_FLAGS_RELEASE - additional flags for the release library - </pre> +<pre class="cmake"> +CMAKE_CXX_FLAGS - used during all builds +DEAL_II_CXX_FLAGS_DEBUG - additional flags for the debug library +DEAL_II_CXX_FLAGS_RELEASE - additional flags for the release library +</pre> The content of the cached variables will be preserved and added <i>to the end</i> of the default compiler flags, hence providing the possibility for overriding a flag. E.g.: <code>-Wsign-compare</code>, set by the build system, can be overwritten by specifying: - <pre> - - cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...> - </pre> +<pre class="cmake"> +cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...> +</pre> <li> Set the corresponding environment variables: <code>CFLAGS</code>, @@ -934,10 +901,9 @@ the location, where the <acronym>deal.II</acronym> library will be installed when invoking <code>make install</code> to is set with the help of - <pre> - - CMAKE_INSTALL_PREFIX - </pre> +<pre class="cmake"> +CMAKE_INSTALL_PREFIX +</pre> Please note that depending on whether <code>DEAL_II_COMPONENT_COMPAT_FILES</code> is set, there will be @@ -945,52 +911,49 @@ <ul> <li> With <code>DEAL_II_COMPONENT_COMPAT_FILES=ON</code>: - <pre> - - ${CMAKE_INSTALL_PREFIX}/ - bin - cmake/macros - common - common/scripts - doc - examples - include - lib - lib/cmake/deal.II - </pre> +<pre class="cmake"> +${CMAKE_INSTALL_PREFIX}/ + bin + cmake/macros + common + common/scripts + doc + examples + include + lib + lib/cmake/deal.II +</pre> <li> With <code>DEAL_II_COMPONENT_COMPAT_FILES=OFF</code>: - <pre> - - ${CMAKE_INSTALL_PREFIX}/ - bin - include - lib${LIB_SUFFIX} - lib${LIB_SUFFIX}/cmake/deal.II - share/deal.II/ - share/deal.II/cmake/macros - share/deal.II/examples - share/doc/deal.II/html - </pre> +<pre class="cmake"> +${CMAKE_INSTALL_PREFIX}/ + bin + include + lib${LIB_SUFFIX} + lib${LIB_SUFFIX}/cmake/deal.II + share/deal.II/ + share/deal.II/cmake/macros + share/deal.II/examples + share/doc/deal.II/html +</pre> </ul> </p> <p> The default directory structure can be changed by by setting the following variables: - <pre> - - DEAL_II_CMAKE_MACROS_RELDIR - DEAL_II_COMMON_RELDIR - DEAL_II_DOCHTML_RELDIR - DEAL_II_DOCREADME_RELDIR - DEAL_II_EXAMPLES_RELDIR - DEAL_II_EXECUTABLE_RELDIR - DEAL_II_INCLUDE_RELDIR - DEAL_II_LIBRARY_RELDIR - DEAL_II_PROJECT_CONFIG_RELDIR - </pre> +<pre class="cmake"> +DEAL_II_CMAKE_MACROS_RELDIR +DEAL_II_COMMON_RELDIR +DEAL_II_DOCHTML_RELDIR +DEAL_II_DOCREADME_RELDIR +DEAL_II_EXAMPLES_RELDIR +DEAL_II_EXECUTABLE_RELDIR +DEAL_II_INCLUDE_RELDIR +DEAL_II_LIBRARY_RELDIR +DEAL_II_PROJECT_CONFIG_RELDIR +</pre> </p> @@ -998,10 +961,9 @@ <h2>Initial cache file and advanced options</h2> A sample configuration file for preloading the CMake cache with - <pre> - - $ cmake -C Config.sample <...> - </pre> +<pre class="cmake"> +$ cmake -C Config.sample <...> +</pre> can be found <a href="Config.sample" target="_top">here</a>. This sample configuration covers all options mentioned in this documentation as well as some advanced aspects in feature @@ -1019,32 +981,29 @@ A common scenario is that you only want to build debug or optimized libraries. This can be achieved using the following commands in the build directory: - <pre> +<pre class="cmake"> +make deal_II.g # only debug library +make deal_II # only release (optimized) library +make all # both - make deal_II.g # only debug library - make deal_II # only release (optimized) library - make all # both - - make obj_grid.release # all objects in ./source/grid in release configuration - </pre> +make obj_grid.release # all objects in ./source/grid in release configuration +</pre> </p> <p> For a complete list of possible targets that allow even finer-grained control, do - <pre> - - make help - </pre> +<pre class="cmake"> +make help +</pre> </p> <p> It is frequently useful to be able to see what a particular command does. In that case, use the following: - <pre> - - make deal_II.g VERBOSE=ON - </pre> +<pre class="cmake"> +make deal_II.g VERBOSE=ON +</pre> This will show, for every command executed, the exact command line with which it was invoked, including compiler arguments, etc. Every command <code>cmake</code> executes starts with diff --git a/deal.II/doc/users/cmakelists.html b/deal.II/doc/users/cmakelists.html index 60e5b260f4..19d5686899 100644 --- a/deal.II/doc/users/cmakelists.html +++ b/deal.II/doc/users/cmakelists.html @@ -14,6 +14,16 @@ <body> <h1>How to use CMake to configure your projects with <acronym>deal.II</acronym></h1> +<p> + <code>cmake</code> is controlled by input files that by convention are + called <code>CMakeLists.txt</code>, listing both configuration commands + as well as dependencies between source files and targets. + This page presents some <code>CMakeLists.txt</code> examples for + potential use in your projects. (A detailed description of the + <acronym>deal.II</acronym> project configuration is given in the + <a href="cmake.html" target="body">deal.II CMake ReadMe</a>.) +</p> + <div class="toc"> <ol> <li><a href="#cmakesimple">Simple <code>CMakeLists.txt</code></a> @@ -43,26 +53,6 @@ </ol> </div> -<p> - <code>cmake</code> is the configuration and build tool we use - in <acronym>deal.II</acronym>. Its advantage is not only that it makes - configuration of <acronym>deal.II</acronym> itself simpler across - platforms (compared to the older <code>autoconf/make</code> combination) - but also that it <i>exports</i> information about the deal.II - configuration that makes it particularly simple for projects - using <acronym>deal.II</acronym> to configure and link against it. -</p> - -<p> - <code>cmake</code> is controlled by input files that by convention are - called <code>CMakeLists.txt</code>, listing both configuration commands - as well as dependencies between source files and targets. - This page presents some <code>CMakeLists.txt</code> examples for - potential use in your projects. (A detailed description of the - <acronym>deal.II</acronym> project configuration is given in the - <a href="cmake.html" target="body">deal.II CMake ReadMe</a>.) -</p> - <a name="cmakesimple"></a> <h2>Simple CMakeLists.txt</h2> @@ -827,21 +817,19 @@ DEAL_II_WITH_ZLIB the <acronym>deal.II</acronym> directory tree. The CMake build system sets up the following compatibility files (if <code>DEAL_II_COMPONENT_COMPAT_FILES</code> is set, which is default): - <pre> - - ${CMAKE_INSTALL_PREFIX} - ./common/Make.global_options - ./common/scripts/expand_instantiations - ./common/scripts/make_dependencies - ./common/scripts/report_features - </pre> +<pre> +${CMAKE_INSTALL_PREFIX}/ + common/Make.global_options + common/scripts/expand_instantiations + common/scripts/make_dependencies + common/scripts/report_features +</pre> Therefore, it should be sufficient to set <code>D</code> in the old user Makefiles to: - <pre> - - D=/path/install/dir - </pre> +<pre> +D=/path/install/dir +</pre> where <code>/path/install/dir</code> is the directory set up via <code>CMAKE_INSTALL_PREFIX</code> (the path <acronym>deal.II</acronym> was installed to). diff --git a/deal.II/doc/users/doxygen.html b/deal.II/doc/users/doxygen.html index 26f102d3ef..3b226823ba 100644 --- a/deal.II/doc/users/doxygen.html +++ b/deal.II/doc/users/doxygen.html @@ -41,10 +41,8 @@ <li>Once your <code>deal.tag</code> file is in a location where Doxygen can find it, add the following line to your Doxygen configuration file: - <pre> - +<pre> TAGFILES = deal.tag=http://www.dealii.org/X.Y.Z/doxygen/deal.II - </pre> where <code>X.Y.Z</code> refers to the release number for which you downloaded the tag file. diff --git a/deal.II/doc/users/navbar.html b/deal.II/doc/users/navbar.html index 079a515a9f..8b55b4c263 100644 --- a/deal.II/doc/users/navbar.html +++ b/deal.II/doc/users/navbar.html @@ -43,7 +43,7 @@ <a href="../doxygen/tutorial/index.html" target="_top">Tutorial</a><br /> <a href="../doxygen/deal.II/index.html" target="_top">Manual</a><br /> <a href="http://www.math.tamu.edu/~bangerth/videos.html" - target="_top">Video lectures</a><br /> + target="_top">Wolfgang's lectures</a><br /> </p> <hr> diff --git a/deal.II/doc/users/toc.html b/deal.II/doc/users/toc.html index b9ff5b4ee4..417b838e03 100644 --- a/deal.II/doc/users/toc.html +++ b/deal.II/doc/users/toc.html @@ -12,120 +12,122 @@ <meta name="keywords" content="deal dealii finite elements fem triangulation"> <meta http-equiv="content-language" content="en"> </head> - <body> - - <p> - <br /> - This page gathers some information on developing programs based on - <acronym>deal.II</acronym>, as well as on how to configure and use - <acronym>deal.II</acronym>. At present, we have the following resources - available: - </p> - - - <h2>Documentation</h2> - - <ul> - - <li> <p> - <a href="cmake.html">deal.II CMake documentation</a>: - This page provides extensive information about configuration and - installation with the CMake build system. - - <li> <p><a href="cmakelists.html" target="body">Using CMake and - <acronym>deal.II</acronym> in a user project</a>: - This page covers how to use CMake in your own project. - An overview of how to retrieve necessary information - from a <acronym>deal.II</acronym> installation as well as how to - write a <code>CMakeLists.txt</code> for a client project is given. - </p> - - <li> <p><a href="doxygen.html">Linking your online documentation - to the deal.II online manual</a>: After spending a lot of time - writing good documentation for your code and putting it online, - here we explain how to put links to the deal.II online manual into - your documentation, so that readers can click through. - </p> - - <li> <p><a href="https://code.google.com/p/dealii/issues/list" target="_top">Bugs</a>: - Though well tested, <acronym>deal.II</acronym> certainly has - bugs. If you want to report a bug (or enhancement request), - go to the <a href="https://code.google.com/p/dealii/issues/list" - target="_top">bug tracking system</a> and enter a new ticket - for your issue. - </p> - - </ul> - - - <h2>Tutorials</h2> - - <p> - The <a href="../doxygen/tutorial/index.html" - target="_top">tutorial</a> is for new users of the - library. It explains the basic elements of finite element - programs based on the library, and provides small example - programs. You can also reach the tutorial link from the - menu bar at the left. There is also an extensive set of - Youtube-hosted video lectures that provide both the - context of the mathematical and computational methods of - deal.II as well as demonstrate parts of the - tutorial. These video lectures are also reachable from - the menu bar at the left. - </p> - - <p> - As all other documentation, the HTML pages - of the tutorials can be generated locally on your computer and - can then be read offline. Please follow the - instructions in the - <a href="../readme.html" target="body">ReadMe</a> on how to - generate them locally. - </p> - - - <h2>Programming interface</h2> - - <p> - The <a href="../doxygen/deal.II/index.html" target="_top">programming - interface/manual</a> pages are what you will need most often as a - reference of all classes, functions and variables in the library. They - are extensively documented (presently more than 5000 pages if - printed), and generated by <a href="http://www.doxygen.org/" - target="_top">Doxygen</a>. There is also a quick link to these pages from - the menu bar at the left. - </p> - - <p> - The documentation uses many of the features of Doxygen. In particular, - the link takes you straight to a page that lists <i>modules</i>, a way - to group classes with similar purposes. This may be what you are probably - interested in when you are not yet familiar with the library. If you - already know your way around and want to look up the signature of a - particular member function, for example, you may go to the class view or - choose any of the other ways in which Doxygen allows you to navigate - through the documentation. - </p> - - <p> - Just as for the tutorials, the API docs need to be generated first, - if you download <acronym>deal.II</acronym>. Please follow the - instructions in the - <a href="../readme.html" target="body">ReadMe</a> on how to do - this. - </p> - - <hr /> - <address> - <a href="../authors.html" target="body">The deal.II Authors</a> - $Date$ - </address> - <div class="right"> - <a href="http://validator.w3.org/check?uri=referer" target="_top"> - <img style="border:0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> - <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_top"> - <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> - </div> - - </body> +<body> + +<h1>Information for Users</h1> + +<p> +<br /> +This page gathers some information on developing programs based on +<acronym>deal.II</acronym>, as well as on how to configure and use +<acronym>deal.II</acronym>. At present, we have the following resources +available: +</p> + + +<h2>Documentation</h2> + +<ul> + +<li> <p> + <a href="cmake.html">deal.II CMake documentation</a>: + This page provides extensive information about configuration and + installation with the CMake build system. + + <li> <p><a href="cmakelists.html" target="body">Using CMake and + <acronym>deal.II</acronym> in a user project</a>: + This page covers how to use CMake in your own project. + An overview of how to retrieve necessary information + from a <acronym>deal.II</acronym> installation as well as how to + write a <code>CMakeLists.txt</code> for a client project is given. + </p> + +<li> <p><a href="doxygen.html">Linking your online documentation + to the deal.II online manual</a>: After spending a lot of time + writing good documentation for your code and putting it online, + here we explain how to put links to the deal.II online manual into + your documentation, so that readers can click through. + </p> + +<li> <p><a href="https://code.google.com/p/dealii/issues/list" target="_top">Bugs</a>: + Though well tested, <acronym>deal.II</acronym> certainly has + bugs. If you want to report a bug (or enhancement request), + go to the <a href="https://code.google.com/p/dealii/issues/list" + target="_top">bug tracking system</a> and enter a new ticket + for your issue. + </p> + +</ul> + + +<h2>Tutorials</h2> + +<p> + The <a href="../doxygen/tutorial/index.html" + target="_top">tutorial</a> is for new users of the + library. It explains the basic elements of finite element + programs based on the library, and provides small example + programs. You can also reach the tutorial link from the + menu bar at the left. There is also an extensive set of + Youtube-hosted video lectures that provide both the + context of the mathematical and computational methods of + deal.II as well as demonstrate parts of the + tutorial. These video lectures are also reachable from + the menu bar at the left. +</p> + +<p> + As all other documentation, the HTML pages + of the tutorials can be generated locally on your computer and + can then be read offline. Please follow the + instructions in the + <a href="../readme.html" target="body">ReadMe</a> on how to + generate them locally. +</p> + + +<h2>Programming interface</h2> + +<p> +The <a href="../doxygen/deal.II/index.html" target="_top">programming + interface/manual</a> pages are what you will need most often as a +reference of all classes, functions and variables in the library. They +are extensively documented (presently more than 5000 pages if +printed), and generated by <a href="http://www.doxygen.org/" + target="_top">Doxygen</a>. There is also a quick link to these pages from +the menu bar at the left. +</p> + +<p> +The documentation uses many of the features of Doxygen. In particular, +the link takes you straight to a page that lists <i>modules</i>, a way +to group classes with similar purposes. This may be what you are probably +interested in when you are not yet familiar with the library. If you +already know your way around and want to look up the signature of a +particular member function, for example, you may go to the class view or +choose any of the other ways in which Doxygen allows you to navigate +through the documentation. +</p> + +<p> +Just as for the tutorials, the API docs need to be generated first, +if you download <acronym>deal.II</acronym>. Please follow the +instructions in the +<a href="../readme.html" target="body">ReadMe</a> on how to do +this. +</p> + +<hr /> +<address> + <a href="../authors.html" target="body">The deal.II Authors</a> + $Date$ +</address> +<div class="right"> + <a href="http://validator.w3.org/check?uri=referer" target="_top"> + <img style="border:0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> + <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_top"> + <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> +</div> + +</body> </html> diff --git a/deal.II/examples/step-14/doc/results.dox b/deal.II/examples/step-14/doc/results.dox index 16af19d8e7..0921fdac31 100644 --- a/deal.II/examples/step-14/doc/results.dox +++ b/deal.II/examples/step-14/doc/results.dox @@ -30,20 +30,20 @@ Refinement cycle: 4 Point value=0.0333675 Estimated error=7.4912e-05 Refinement cycle: 5 - Number of degrees of freedom=1691 - Point value=0.0334104 - Estimated error=3.47976e-05 + Number of degrees of freedom=1665 + Point value=0.0334083 + Estimated error=3.69111e-05 Refinement cycle: 6 - Number of degrees of freedom=4065 - Point value=0.0334315 - Estimated error=1.49476e-05 + Number of degrees of freedom=3975 + Point value=0.033431 + Estimated error=1.54218e-05 Refinement cycle: 7 - Number of degrees of freedom=9113 - Point value=0.0334407 - Estimated error=6.23712e-06 + Number of degrees of freedom=8934 + Point value=0.0334406 + Estimated error=6.28359e-06 Refinement cycle: 8 - Number of degrees of freedom=22303 - Point value=0.0334445 + Number of degrees of freedom=21799 + Point value=0.0334444 @endcode diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index f09e56019a..23590f9d8b 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -497,8 +497,8 @@ namespace Step14 void local_assemble_matrix (const typename DoFHandler<dim>::active_cell_iterator &cell, - AssemblyScratchData &scratch_data, - AssemblyCopyData ©_data) const; + AssemblyScratchData &scratch_data, + AssemblyCopyData ©_data) const; void @@ -568,22 +568,22 @@ namespace Step14 Solver<dim>::assemble_linear_system (LinearSystem &linear_system) { Threads::Task<> rhs_task = Threads::new_task (&Solver<dim>::assemble_rhs, - *this, - linear_system.rhs); + *this, + linear_system.rhs); WorkStream::run(dof_handler.begin_active(), - dof_handler.end(), - std_cxx1x::bind(&Solver<dim>::local_assemble_matrix, - this, - std_cxx1x::_1, - std_cxx1x::_2, - std_cxx1x::_3), - std_cxx1x::bind(&Solver<dim>::copy_local_to_global, - this, - std_cxx1x::_1, - std_cxx1x::ref(linear_system)), - AssemblyScratchData(*fe, *quadrature), - AssemblyCopyData()); + dof_handler.end(), + std_cxx1x::bind(&Solver<dim>::local_assemble_matrix, + this, + std_cxx1x::_1, + std_cxx1x::_2, + std_cxx1x::_3), + std_cxx1x::bind(&Solver<dim>::copy_local_to_global, + this, + std_cxx1x::_1, + std_cxx1x::ref(linear_system)), + AssemblyScratchData(*fe, *quadrature), + AssemblyCopyData()); rhs_task.join (); @@ -607,29 +607,29 @@ namespace Step14 template <int dim> Solver<dim>::AssemblyScratchData:: AssemblyScratchData (const FiniteElement<dim> &fe, - const Quadrature<dim> &quadrature) - : - fe_values (fe, - quadrature, - update_gradients | update_JxW_values) + const Quadrature<dim> &quadrature) + : + fe_values (fe, + quadrature, + update_gradients | update_JxW_values) {} template <int dim> Solver<dim>::AssemblyScratchData:: AssemblyScratchData (const AssemblyScratchData &scratch_data) - : - fe_values (scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_gradients | update_JxW_values) + : + fe_values (scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_gradients | update_JxW_values) {} template <int dim> void Solver<dim>::local_assemble_matrix (const typename DoFHandler<dim>::active_cell_iterator &cell, - AssemblyScratchData &scratch_data, - AssemblyCopyData ©_data) const + AssemblyScratchData &scratch_data, + AssemblyCopyData ©_data) const { const unsigned int dofs_per_cell = fe->dofs_per_cell; const unsigned int n_q_points = quadrature->size(); @@ -644,8 +644,8 @@ namespace Step14 for (unsigned int i=0; i<dofs_per_cell; ++i) for (unsigned int j=0; j<dofs_per_cell; ++j) copy_data.cell_matrix(i,j) += (scratch_data.fe_values.shape_grad(i,q_point) * - scratch_data.fe_values.shape_grad(j,q_point) * - scratch_data.fe_values.JxW(q_point)); + scratch_data.fe_values.shape_grad(j,q_point) * + scratch_data.fe_values.JxW(q_point)); cell->get_dof_indices (copy_data.local_dof_indices); } @@ -658,10 +658,10 @@ namespace Step14 LinearSystem &linear_system) const { for (unsigned int i=0; i<copy_data.local_dof_indices.size(); ++i) - for (unsigned int j=0; j<copy_data.local_dof_indices.size(); ++j) - linear_system.matrix.add (copy_data.local_dof_indices[i], - copy_data.local_dof_indices[j], - copy_data.cell_matrix(i,j)); + for (unsigned int j=0; j<copy_data.local_dof_indices.size(); ++j) + linear_system.matrix.add (copy_data.local_dof_indices[i], + copy_data.local_dof_indices[j], + copy_data.cell_matrix(i,j)); } @@ -707,17 +707,17 @@ namespace Step14 hanging_node_constraints.clear (); void (*mhnc_p) (const DoFHandler<dim> &, - ConstraintMatrix &) + ConstraintMatrix &) = &DoFTools::make_hanging_node_constraints; Threads::Task<> side_task - = Threads::new_task (mhnc_p, - dof_handler, - hanging_node_constraints); + = Threads::new_task (mhnc_p, + dof_handler, + hanging_node_constraints); sparsity_pattern.reinit (dof_handler.n_dofs(), - dof_handler.n_dofs(), - dof_handler.max_couplings_between_dofs()); + dof_handler.n_dofs(), + dof_handler.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); side_task.join(); @@ -1970,31 +1970,28 @@ namespace Step14 // variables of this class; third, as arguments passed to that function. // // These three alternatives all have drawbacks: the third that their - // number is not neglectable and would make calling these functions a + // number is not negligible and would make calling these functions a // lengthy enterprise. The second has the drawback that it disallows // parallelization, since the threads that will compute the error // estimate have to have their own copies of these variables each, so // member variables of the enclosing class will not work. The first // approach, although straightforward, has a subtle but important // drawback: we will call these functions over and over again, many - // thousands of times maybe; it has now turned out that allocating + // thousands of times maybe; it now turns out that allocating // vectors and other objects that need memory from the heap is an // expensive business in terms of run-time, since memory allocation is - // expensive when several threads are involved. In our experience, more - // than 20 per cent of the total run time of error estimation functions - // are due to memory allocation, if done on a per-call level. It is thus + // expensive when several threads are involved. It is thus // significantly better to allocate the memory only once, and recycle // the objects as often as possible. // - // What to do? Our answer is to use a variant of the third strategy, - // namely generating these variables once in the main function of each - // thread, and passing them down to the functions that do the actual - // work. To avoid that we have to give these functions a dozen or so + // What to do? Our answer is to use a variant of the third strategy. + // In fact, this is exactly what the WorkStream concept is supposed to + // do (we have already introduced it above, but see also @ref threads). + // To avoid that we have to give these functions a dozen or so // arguments, we pack all these variables into two structures, one which // is used for the computations on cells, the other doing them on the - // faces. Instead of many individual objects, we will then only pass one - // such object to these functions, making their calling sequence - // simpler. + // faces. Both are then joined into the WeightedResidualScratchData class + // that will serve as the "scratch data" class of the WorkStream concept: struct CellData { FEValues<dim> fe_values; @@ -2025,8 +2022,6 @@ namespace Step14 FaceData (const FaceData &face_data); }; - - struct WeightedResidualScratchData { WeightedResidualScratchData(const PrimalSolver<dim> &primal_solver, @@ -2043,28 +2038,28 @@ namespace Step14 }; - // Dummy structure + // WorkStream::run generally wants both a scratch object and a copy object. + // Here, for reasons similar to what we had in step-9 when discussing the + // computation of an approximation of the gradient, we don't actually + // need a "copy data" structure. Since WorkStream insists on having one of + // these, we just declare an empty structure that does nothing other than + // being there. struct WeightedResidualCopyData - { - WeightedResidualCopyData() {} - }; + {}; - // Regarding the evaluation of the error estimator, we have two driver - // functions that do this: the first is called to generate the cell-wise - // estimates, and splits up the task in a number of threads each of - // which work on a subset of the cells. The first function will run the - // second for each of these threads: + // Regarding the evaluation of the error estimator, we have one driver + // function that uses WorkStream::run to call the second function on every + // cell. The concept of using SynchronousIterators was already explained + // in step-9: void estimate_error (Vector<float> &error_indicators) const; - void estimate_some (const SynchronousIterators<std_cxx1x::tuple< - active_cell_iterator,Vector<float>::iterator> > &cell_and_error, - WeightedResidualScratchData &scratch_data, - WeightedResidualCopyData ©_data, - FaceIntegrals &face_integrals) const; - - void dummy_copy(const WeightedResidualCopyData ©_data) const {}; + void estimate_on_one_cell (const SynchronousIterators<std_cxx1x::tuple< + active_cell_iterator,Vector<float>::iterator> > &cell_and_error, + WeightedResidualScratchData &scratch_data, + WeightedResidualCopyData ©_data, + FaceIntegrals &face_integrals) const; // Then we have functions that do the actual integration of the error // representation formula. They will treat the terms on the cell @@ -2098,8 +2093,8 @@ namespace Step14 // In the implementation of this class, we first have the constructors of // the <code>CellData</code> and <code>FaceData</code> member classes, and // the <code>WeightedResidual</code> constructor. They only initialize - // fields to their correct lengths, so we do not have to discuss them to - // length. + // fields to their correct lengths, so we do not have to discuss them in + // too much detail: template <int dim> WeightedResidual<dim>::CellData:: CellData (const FiniteElement<dim> &fe, @@ -2122,7 +2117,7 @@ namespace Step14 template <int dim> WeightedResidual<dim>::CellData:: - CellData (const CellData &cell_data) + CellData (const CellData &cell_data) : fe_values (cell_data.fe_values.get_fe(), cell_data.fe_values.get_quadrature(), @@ -2201,24 +2196,24 @@ namespace Step14 const DualSolver<dim> &dual_solver, const Vector<double> &primal_solution, const Vector<double> &dual_weights) - : - cell_data (*dual_solver.fe, - *dual_solver.quadrature, - *primal_solver.rhs_function), - face_data (*dual_solver.fe, - *dual_solver.face_quadrature), - primal_solution(primal_solution), - dual_weights(dual_weights) + : + cell_data (*dual_solver.fe, + *dual_solver.quadrature, + *primal_solver.rhs_function), + face_data (*dual_solver.fe, + *dual_solver.face_quadrature), + primal_solution(primal_solution), + dual_weights(dual_weights) {} template <int dim> WeightedResidual<dim>::WeightedResidualScratchData:: WeightedResidualScratchData (const WeightedResidualScratchData &scratch_data) - : - cell_data(scratch_data.cell_data), - face_data(scratch_data.face_data), - primal_solution(scratch_data.primal_solution), - dual_weights(scratch_data.dual_weights) + : + cell_data(scratch_data.cell_data), + face_data(scratch_data.face_data), + primal_solution(scratch_data.primal_solution), + dual_weights(scratch_data.dual_weights) {} @@ -2254,9 +2249,9 @@ namespace Step14 { Threads::TaskGroup<> tasks; tasks += Threads::new_task (&WeightedResidual<dim>::solve_primal_problem, - *this); + *this); tasks += Threads::new_task (&WeightedResidual<dim>::solve_dual_problem, - *this); + *this); tasks.join_all(); } @@ -2294,7 +2289,7 @@ namespace Step14 - // Now, it is becoming more interesting: the <code>refine_grid</code> + // Now, it is becoming more interesting: the <code>refine_grid()</code> // function asks the error estimator to compute the cell-wise error // indicators, then uses their absolute values for mesh refinement. template <int dim> @@ -2415,7 +2410,6 @@ namespace Step14 // As for the actual computation of error estimates, let's start with the // function that drives all this, i.e. calls those functions that actually // do the work, and finally collects the results. - template <int dim> void WeightedResidual<dim>:: @@ -2482,12 +2476,14 @@ namespace Step14 // afterwards when looping over all cells a second time. // // We initialize this map already with a value of -1e20 for all faces, - // since this value will strike in the results if something should go + // since this value will stand out in the results if something should go // wrong and we fail to compute the value for a face for some - // reason. Secondly, we initialize the map once before we branch to - // different threads since this way the map's structure is no more - // modified by the individual threads, only existing entries are set to - // new values. This relieves us from the necessity to synchronise the + // reason. Secondly, this initialization already makes the std::map + // object allocate all objects it may possibly need. This is important + // since we will write into this structure from parallel threads, + // and doing so would not be thread-safe if the map needed to allocate + // memory and thereby reshape its data structures. In other words, the + // initial initialization relieves us from the necessity to synchronize the // threads through a mutex each time they write to (and modify the // structure of) this map. FaceIntegrals face_integrals; @@ -2499,26 +2495,39 @@ namespace Step14 ++face_no) face_integrals[cell->face(face_no)] = -1e20; - // Then set up a vector with error indicators. Reserve one slot for - // each cell and set it to zero. + // Then set up a vector with error indicators and reserve one slot for + // each cell and set it to zero. With this, we can then set up the + // parallel iterator range just as we did in step-9, and hand it + // all off to WorkStream::run to compute the estimators for all + // cells in parallel: error_indicators.reinit (dual_solver.dof_handler .get_tria().n_active_cells()); - typedef std_cxx1x::tuple<active_cell_iterator,Vector<float>::iterator> Iterators; - SynchronousIterators<Iterators> cell_and_error_begin(Iterators ( - dual_solver.dof_handler.begin_active(),error_indicators.begin())); - SynchronousIterators<Iterators> cell_and_error_end(Iterators ( - dual_solver.dof_handler.end(),error_indicators.begin())); - - WeightedResidualScratchData scratch_data(primal_solver,dual_solver,primal_solution,dual_weights); - WeightedResidualCopyData copy_data; - - // Compute the error formula on all the cells - WorkStream::run(cell_and_error_begin,cell_and_error_end, - std_cxx1x::bind(&WeightedResidual<dim>::estimate_some,this,std_cxx1x::_1, - std_cxx1x::_2,std_cxx1x::_3,std_cxx1x::ref(face_integrals)), - std_cxx1x::bind(&WeightedResidual<dim>::dummy_copy,this,std_cxx1x::_1), - scratch_data,copy_data); + typedef + std_cxx1x::tuple<active_cell_iterator,Vector<float>::iterator> + IteratorTuple; + + SynchronousIterators<IteratorTuple> + cell_and_error_begin(IteratorTuple (dual_solver.dof_handler.begin_active(), + error_indicators.begin())); + SynchronousIterators<IteratorTuple> + cell_and_error_end (IteratorTuple (dual_solver.dof_handler.end(), + error_indicators.begin())); + + WorkStream::run(cell_and_error_begin, + cell_and_error_end, + std_cxx1x::bind(&WeightedResidual<dim>::estimate_on_one_cell, + this, + std_cxx1x::_1, + std_cxx1x::_2, + std_cxx1x::_3, + std_cxx1x::ref(face_integrals)), + std_cxx1x::function<void (const WeightedResidualCopyData &)>(), + WeightedResidualScratchData (primal_solver, + dual_solver, + primal_solution, + dual_weights), + WeightedResidualCopyData()); // Once the error contributions are computed, sum them up. For this, // note that the cell terms are already set, and that only the edge @@ -2546,30 +2555,30 @@ namespace Step14 } - // @sect4{Estimating on a subset of cells} + // @sect4{Estimating on a single cell} // Next we have the function that is called to estimate the error on a - // subset of cells. The function may be called multiple times if the library was + // single cell. The function may be called multiple times if the library was // configured to use multithreading. Here it goes: template <int dim> void WeightedResidual<dim>:: - estimate_some (const SynchronousIterators<std_cxx1x::tuple< - active_cell_iterator,Vector<float>::iterator> > &cell_and_error, - WeightedResidualScratchData &scratch_data, - WeightedResidualCopyData ©_data, - FaceIntegrals &face_integrals) const + estimate_on_one_cell (const SynchronousIterators<std_cxx1x::tuple< + active_cell_iterator,Vector<float>::iterator> > &cell_and_error, + WeightedResidualScratchData &scratch_data, + WeightedResidualCopyData ©_data, + FaceIntegrals &face_integrals) const { // First task on each cell is to compute the cell residual // contributions of this cell, and put them into the // <code>error_indicators</code> variable: active_cell_iterator cell = std_cxx1x::get<0>(cell_and_error.iterators); - + integrate_over_cell (cell_and_error, scratch_data.primal_solution, scratch_data.dual_weights, scratch_data.cell_data); - + // After computing the cell terms, turn to the face terms. For this, // loop over all faces of the present cell, and see whether // something needs to be computed on it: diff --git a/deal.II/examples/step-42/doc/intro.dox b/deal.II/examples/step-42/doc/intro.dox index 5c9c2b9219..e9dbabb604 100644 --- a/deal.II/examples/step-42/doc/intro.dox +++ b/deal.II/examples/step-42/doc/intro.dox @@ -207,7 +207,7 @@ the following equation (still an inequality, but linearized): where the rank-4 tensor $I_\Pi=I_\Pi(\varepsilon^D(\mathbf u^{i-1}))$ given by @f{align} I_\Pi = \begin{cases} - C_{\mu} + C_{\kappa}, & \hspace{-8em}\hfill \text{if } \vert C\varepsilon^D(\mathbf u^{i-1}) \vert \leq \sigma_0, + C_{\mu} + C_{\kappa}, & \hspace{-8em} \text{if } \vert C\varepsilon^D(\mathbf u^{i-1}) \vert \leq \sigma_0, \\ \frac{\gamma^{\text{iso}}}{2\mu + \gamma^{\text{iso}}} C_{\mu} + \frac{\left(1-\frac{\gamma^{\text{iso}}}{2\mu + \gamma^{\text{iso}}}\right)\sigma_0}{\vert C\varepsilon^D(\mathbf u^{i-1}) \vert}\left(C_{\mu} - 2\mu\dfrac{C\varepsilon^D(\mathbf u^{i-1})\otimes C\varepsilon^D(\mathbf @@ -328,7 +328,7 @@ method for the contact. It works as follows: from the undisplaced configuration of the body. <li> If $\mathcal{A}_{i+1} = \mathcal{A}_k$ and $\left\| - {\hat R}\left({\mathbf u}^{i}\right)\right) \right\|_{\ell_2} < \delta$ then stop, else set $i=i+1$ and go to + {\hat R}\left({\mathbf u}^{i}\right) \right\|_{\ell_2} < \delta$ then stop, else set $i=i+1$ and go to step (1). This step ensures that we only stop iterations if both the correct active set has been found and the plasticity has been iterated to sufficient accuracy. diff --git a/deal.II/examples/step-51/doc/intro.dox b/deal.II/examples/step-51/doc/intro.dox index 6d476e0c78..e0d9cebf92 100644 --- a/deal.II/examples/step-51/doc/intro.dox +++ b/deal.II/examples/step-51/doc/intro.dox @@ -56,7 +56,7 @@ solution process. The above procedure also has a linear algebra interpretation and is referred to as static condensation. Let us write the complete linear system associated to -the HDG problem as a block system with the discrete DG variables <i>U</i> as +the HDG problem as a block system with the discrete DG variables $U$ as first block and the skeleton variables $\Lambda$ as the second block: @f{eqnarray*} \begin{pmatrix} A & B \\ C & D \end{pmatrix} @@ -64,7 +64,7 @@ first block and the skeleton variables $\Lambda$ as the second block: = \begin{pmatrix} F \\ G \end{pmatrix}. @f} -Our aim is now to eliminate the <i>U</i> block with a Schur complement +Our aim is now to eliminate the $U$ block with a Schur complement approach similar to step-20, which results in the following two steps: @f{eqnarray*} (D - C A^{-1} B) \Lambda &=& G - C A^{-1} F, \\ @@ -74,15 +74,15 @@ The point is that the presence of $A^{-1}$ is not a problem because $A$ is a block diagonal matrix where each block corresponds to one cell and is therefore easy enough to invert. The coupling to other cells is introduced by the matrices -<i>B</i> and <i>C</i> over the skeleton variable. The block-diagonality of -<i>A</i> and the structure in <i>B</i> and <i>C</i> allow us to invert the -matrix <i>A</i> element by element (the local solution of the Dirichlet +$B$ and $C$ over the skeleton variable. The block-diagonality of +$A$ and the structure in $B$ and $C$ allow us to invert the +matrix $A$ element by element (the local solution of the Dirichlet problem) and subtract $CA^{-1}B$ from $D$. The steps in the Dirichlet-to-Neumann map concept hence correspond to <ol> <li> constructing the Schur complement matrix $D-C A^{-1} B$ and right hand side $G - C A^{-1} F$ <i>locally on each cell</i> and inserting the contribution into the global trace matrix in the usual way, <li> solving the Schur complement system for $\Lambda$, and - <li> solving for <i>U</i> using the second equation, given $\Lambda$. + <li> solving for $U$ using the second equation, given $\Lambda$. </ol> @@ -227,11 +227,11 @@ both elements sharing a face, the above equation yields terms familiar from the DG method, with jumps of the solution over the cell boundaries. In the equation above, the space $\mathcal {W}_h^{p}$ for the scalar variable -<i>u<sub>h</sub></i> is defined as the space of functions that are tensor -product polynomials of degree <i>p</i> on each cell and discontinuous over the +$u_h$ is defined as the space of functions that are tensor +product polynomials of degree $p$ on each cell and discontinuous over the element boundaries $\mathcal Q_{-p}$, i.e., the space described by <code>FE_DGQ<dim>(p)</code>. The space for the gradient or flux variable -<b>q</b><i><sub>h</sub></i> is a vector element space where each component is +$\mathbf{q}_i$ is a vector element space where each component is a locally polynomial and discontinuous $\mathcal Q_{-p}$. In the code below, we collect these two local parts together in one FESystem where the first @p dim components denote the gradient part and the last scalar component @@ -263,18 +263,18 @@ One special feature of the HDG methods is that they typically allow for constructing an enriched solution that gains accuracy. This post-processing takes the HDG solution in an element-by-element fashion and combines it such that one can get $\mathcal O(h^{p+2})$ order of accuracy when using -polynomials of degree <i>p</i>. For this to happen, there are two necessary +polynomials of degree $p$. For this to happen, there are two necessary ingredients: <ol> <li> The computed solution gradient $\mathbf{q}_h$ converges at optimal rate, i.e., $\mathcal{O}(h^{p+1})$. <li> The average of the scalar part of the solution, <i>u<sub>h</sub></i>, - on each cell <i>K</i> super-converges at rate $\mathcal{O}(h^{p+2})$. + on each cell $K$ super-converges at rate $\mathcal{O}(h^{p+2})$. </ol> We now introduce a new variable $u_h^* \in \mathcal{V}_h^{p+1}$, which we find by minimizing the expression $|\kappa \nabla u_h^* + \mathbf{q}_h|^2$ over the cell -<i>K</i> under the constraint $\left(1, u_h^*\right)_K &=& \left(1, +$K$ under the constraint $\left(1, u_h^*\right)_K = \left(1, u_h\right)_K$. The constraint is necessary because the minimization functional does not determine the constant part of $u_h^*$. This translates to the following system of equations: @@ -286,7 +286,7 @@ translates to the following system of equations: @f} Since we test by the whole set of basis functions in the space of tensor -product polynomials of degree <i>p</i>+1 in the second set of equations, this +product polynomials of degree $p+1$ in the second set of equations, this is an overdetermined system with one more equation than unknowns. We fix this in the code below by omitting one of these equations (since the rows in the Laplacian are linearly dependent when representing a constant function). As we @@ -312,7 +312,7 @@ separately and uses the gradient as the main source of information. For this tutorial program, we consider almost the same test case as in step-7. The computational domain is $\Omega := [-1,1]^d$ and the exact solution corresponds to the one in step-7, except for a scaling. We use the -following source centers <i>x<sub>i</sub></i> for the exponentials +following source centers $x_i$ for the exponentials <ul> <li> 1D: $\{x_i\}^1 = \{ -\frac{1}{3}, 0, \frac{1}{3} \}$, <li> 2D: $\{\mathbf{x}_i\}^2 = \{ (-\frac{1}{2},\frac{1}{2}), diff --git a/deal.II/examples/step-51/doc/results.dox b/deal.II/examples/step-51/doc/results.dox index 56a040d44f..b202132fa1 100644 --- a/deal.II/examples/step-51/doc/results.dox +++ b/deal.II/examples/step-51/doc/results.dox @@ -3,7 +3,7 @@ <h3>Program output</h3> We first have a look at the output generated by the program when run in 2D. In -the four images below, we show the solution for polynomial degree <i>p</i>=1 +the four images below, we show the solution for polynomial degree $p=1$ and cycles 2, 3, 4, and 8 of the program. In the plots, we overlay the data generated from the internal data (DG part) with the skeleton part ($\hat{u}$) into the same plot. We had to generate two different data sets because cells @@ -76,7 +76,7 @@ analytical solution. </tr> </table> -Finally, we look at the solution for <i>p</i>=3 at cycle 2. Despite the coarse +Finally, we look at the solution for $p=3$ at cycle 2. Despite the coarse mesh with only 64 cells, the post-processed solution is similar in quality to the linear solution (not post-processed) at cycle 8 with 4,096 cells. This clearly shows the superiority of high order methods for smooth @@ -147,8 +147,8 @@ convergence rates of Q1 elements in the $L_2$ norm for both the scalar variable and the gradient variable is apparent, as is the cubic rate for the postprocessed scalar variable in the $L_2$ norm. Note this distinctive feature of an HDG solution. In typical continuous finite elements, the -gradient of the solution of order <i>p</i> converges at rate <i>p</i> only, as -opposed to <i>p</i>+1 for the actual solution. Even though superconvergence +gradient of the solution of order $p$ converges at rate $p$ only, as +opposed to $p+1$ for the actual solution. Even though superconvergence results for finite elements are also available (e.g. superconvergent patch recovery first introduced by Zienkiewicz and Zhu), these are typically limited to structured meshes and other special cases. For Q3 HDG variables, the scalar @@ -230,14 +230,14 @@ block structure in the matrix on the finest level. </table> The results in the graphs show that the HDG method is slower than continuous -finite elements at <i>p</i>=1, about equally fast for cubic elements and +finite elements at $p=1$, about equally fast for cubic elements and faster for sixth order elements. However, we have seen above that the HDG method actually produces solutions which are more accurate than what is represented in the original variables. Therefore, in the next two plots below we instead display the error of the post-processed solution for HDG (denoted by $p=1^*$ for example). We now see a clear advantage of HDG for the same -amount of work for both <i>p</i>=3 and <i>p</i>=6, and about the same quality -for <i>p</i>=1. +amount of work for both $p=3$ and $p=6$, and about the same quality +for $p=1$. <table align="center" border="1" cellspacing="3" cellpadding="3"> <tr> @@ -251,9 +251,9 @@ for <i>p</i>=1. </table> Since the HDG method actually produces results converging as -<i>h</i><sup><i>p</i>+2</sup>, we should compare it to a continuous Galerkin +$h^{p+2}$, we should compare it to a continuous Galerkin solution with the same asymptotic convergence behavior, i.e., FE_Q with degree -<i>p</i>+1. If we do this, we get the convergence curves below. We see that +$p+1$. If we do this, we get the convergence curves below. We see that CG with second order polynomials is again clearly better than HDG with linears. However, the advantage of HDG for higher orders remains. @@ -270,7 +270,7 @@ linears. However, the advantage of HDG for higher orders remains. The results are in line with properties of DG methods in general: Best performance is typically not achieved for linear elements, but rather at -somewhat higher order, usually around <i>p</i>=3. This is because of a +somewhat higher order, usually around $p=3$. This is because of a volume-to-surface effect for discontinuous solutions with too much of the solution living on the surfaces and hence duplicating work when the elements are linear. Put in other words, DG methods are often most efficient when used @@ -281,16 +281,16 @@ seemingly low accurate) representation of solutions. We now show the same figures in 3D: The first row shows the number of degrees of freedom and computing time versus the $L_2$ error in the scalar variable -<i>u</i> for CG and HDG at order <i>p</i>, the second row shows the +$u$ for CG and HDG at order $p$, the second row shows the post-processed HDG solution instead of the original one, and the third row -compares the post-processed HDG solution with CG at order <i>p</i>+1. In 3D, +compares the post-processed HDG solution with CG at order $p+1$. In 3D, the volume-to-surface effect makes the cost of HDG somewhat higher and the CG solution is clearly better than HDG for linears by any metric. For cubics, HDG and CG are of similar quality, whereas HDG is again more efficient for sixth order polynomials. One can alternatively also use the combination of FE_DGP and FE_FaceP instead of (FE_DGQ, FE_FaceQ), which do not use tensor product -polynomials of degree <i>p</i> but Legendre polynomials of <i>complete</i> -degree <i>p</i>. There are fewer degrees of freedom on the skeleton variable +polynomials of degree $p$ but Legendre polynomials of <i>complete</i> +degree $p$. There are fewer degrees of freedom on the skeleton variable for FE_FaceP for a given mesh size, but the solution quality (error vs. number of DoFs) is very similar to the results for FE_FaceQ. @@ -326,7 +326,7 @@ sparse matrix structures and similar solvers (optimal AMG preconditioners for both without particular tuning of the AMG parameters on any of them) to give a fair picture of the cost versus accuracy of two methods, on a toy example. It should be noted however that geometric multigrid (GMG) for continuous finite elements is about a -factor four to five faster for <i>p</i>=3 and <i>p</i>=6. The authors of this +factor four to five faster for $p=3$ and $p=6$. The authors of this tutorial have not seen similarly advanced solvers for the HDG linear systems. Also, there are other implementation aspects for CG available such as fast matrix-free approaches as shown in step-37 that make higher order diff --git a/deal.II/examples/step-9/doc/results.dox b/deal.II/examples/step-9/doc/results.dox index 13ff02506b..d0e541a513 100644 --- a/deal.II/examples/step-9/doc/results.dox +++ b/deal.II/examples/step-9/doc/results.dox @@ -12,17 +12,17 @@ Cycle 1: Number of active cells: 643 Number of degrees of freedom: 793 Cycle 2: - Number of active cells: 1663 - Number of degrees of freedom: 1946 + Number of active cells: 1669 + Number of degrees of freedom: 1950 Cycle 3: - Number of active cells: 4219 - Number of degrees of freedom: 4905 + Number of active cells: 4231 + Number of degrees of freedom: 4923 Cycle 4: - Number of active cells: 10708 - Number of degrees of freedom: 12128 + Number of active cells: 10753 + Number of degrees of freedom: 12175 Cycle 5: - Number of active cells: 26908 - Number of degrees of freedom: 29698 + Number of active cells: 27004 + Number of degrees of freedom: 29810 @endcode As can be seen, quite a number of cells is used on the finest level to resolve the features of the solution. The final grid showing this is @@ -42,7 +42,7 @@ solution itself: Note that the solution is created by that part that is transported -along the wiggled advection field from the left and lower boundaries +along the wiggly advection field from the left and lower boundaries to the top right, and the part that is created by the source in the lower left corner, and the results of which are also transported along. The grid shown above is well-adapted to resolve these diff --git a/deal.II/examples/step-9/step-9.cc b/deal.II/examples/step-9/step-9.cc index d0e92e6c75..e162811691 100644 --- a/deal.II/examples/step-9/step-9.cc +++ b/deal.II/examples/step-9/step-9.cc @@ -77,7 +77,7 @@ namespace Step9 // @sect3{AdvectionProblem class declaration} // Following we declare the main class of this program. It is very much - // alike the main classes of previous examples, so we again only comment on + // like the main classes of previous examples, so we again only comment on // the differences. template <int dim> class AdvectionProblem @@ -144,8 +144,8 @@ namespace Step9 void assemble_system (); void local_assemble_system (const typename DoFHandler<dim>::active_cell_iterator &cell, - AssemblyScratchData &scratch, - AssemblyCopyData ©_data); + AssemblyScratchData &scratch, + AssemblyCopyData ©_data); void copy_local_to_global (const AssemblyCopyData ©_data); @@ -407,21 +407,15 @@ namespace Step9 // of the mesh size, as described in the introduction. This class is a // simple version of the <code>DerivativeApproximation</code> class in the // library, that uses similar techniques to obtain finite difference - // approximations of the gradient of a finite element field, or if higher + // approximations of the gradient of a finite element field, or of higher // derivatives. // // The class has one public static function <code>estimate</code> that is - // called to compute a vector of error indicators, and one private function - // that does the actual work on an interval of all active cells. The latter - // is called by the first one in order to be able to do the computations in - // parallel if your computer has more than one processor. While the first - // function accepts as parameter a vector into which the error indicator is - // written for each cell. This vector is passed on to the second function - // that actually computes the error indicators on some cells, and the - // respective elements of the vector are written. By the way, we made it - // somewhat of a convention to use vectors of floats for error indicators - // rather than the common vectors of doubles, as the additional accuracy is - // not necessary for estimated values. + // called to compute a vector of error indicators, and a few private functions + // that do the actual work on all active cells. As in other parts of the + // library, we follow an informal convention to use vectors of floats for + // error indicators rather than the common vectors of doubles, as the + // additional accuracy is not necessary for estimated values. // // In addition to these two functions, the class declares two exceptions // which are raised when a cell has no neighbors in each of the space @@ -430,26 +424,66 @@ namespace Step9 // more common case of invalid parameters to a function, namely a vector of // wrong size. // - // Two annotations to this class are still in order: the first is that the - // class has no non-static member functions or variables, so this is not - // really a class, but rather serves the purpose of a <code>namespace</code> - // in C++. The reason that we chose a class over a namespace is that this - // way we can declare functions that are private, i.e. visible to the - // outside world but not callable. This can be done with namespaces as well, - // if one declares some functions in header files in the namespace and - // implements these and other functions in the implementation file. The - // functions not declared in the header file are still in the namespace but - // are not callable from outside. However, as we have only one file here, it - // is not possible to hide functions in the present case. + // Two other comments: first, the class has no non-static member functions + // or variables, so this is not really a class, but rather serves the + // purpose of a <code>namespace</code> in C++. The reason that we chose a + // class over a namespace is that this way we can declare functions that are + // private. This can be done with namespaces as well, if one declares some + // functions in header files in the namespace and implements these and other + // functions in the implementation file. The functions not declared in the + // header file are still in the namespace but are not callable from + // outside. However, as we have only one file here, it is not possible to + // hide functions in the present case. // - // The second is that the dimension template parameter is attached to the - // function rather than to the class itself. This way, you don't have to - // specify the template parameter yourself as in most other cases, but the - // compiler can figure its value out itself from the dimension of the DoF - // handler object that one passes as first argument. + // The second comment is that the dimension template parameter is attached + // to the function rather than to the class itself. This way, you don't have + // to specify the template parameter yourself as in most other cases, but + // the compiler can figure its value out itself from the dimension of the + // DoF handler object that one passes as first argument. // - // Finally note that the <code>IndexInterval</code> typedef is introduced as - // a convenient abbreviation for an otherwise lengthy type name. + // Before jumping into the fray with the implementation, let us also comment + // on the parallelization strategy. We have already introduced the necessary + // framework for using the WorkStream concept in the declaration of the main + // class of this program above. We will use it again here. In the current + // context, this means that we have to define (i) classes for scratch and + // copy objects, (ii) a function that does the local computation on one + // cell, and (iii) a function that copies the local result into a global + // object. Given this general framework, we will, however, deviate from it a + // bit. In particular, WorkStream was generally invented for cases where + // each local computation on a cell <i>adds</i> to a global object -- for + // example, when assembling linear systems where we add local contributions + // into a global matrix and right hand side. Here, however, the situation is + // slightly different: we compute contributions from every cell + // individually, but then all we need to do is put them into an element of + // an output vector that is unique to each cell. Consequently, there is no + // risk that the write operations from two cells might conflict, and the + // elaborate machinery of WorkStream to avoid conflicting writes is not + // necessary. Consequently, what we will do is this: We still need a scratch + // object that holds, for example, the FEValues object. However, we only + // create an fake, empty copy data structure. Likewise, we do need the + // function that computes local contributions, but since it can already put + // the result into its final location, we do not need a copy-local-to-global + // function and will instead give the WorkStream::run function an empty + // function object -- the equivalent to a NULL function pointer. + // + // The second idea to make this approach work is this: If we want to write + // the result into its final destination right away, then the local worker + // function needs to already know where this destination is. Here, this is + // an element of a vector -- but which element is something that the local + // worker function (or, if we wanted to use one, a copy-local-to-global + // function) can not determine easily just knowing an iterator to a cell it + // is supposed to work on. Consequently, in addition to a cell, we need to + // pass a second piece of identifying information along: the element of the + // output vector to write into. What this means is that the work items are + // identified by two iterators: to a cell, and to an output vector + // element. Moving from one work item to the next requires incrementing both + // iterators. deal.II has a class for this, called SynchronousIterators, + // that takes a tuple of iterator types as arguments and stores an iterator + // of each type. Whenever the SynchronousIterators object is incremented, it + // increments the stored iterators in turn. Thus, this class is exactly what + // we need to do our work, and we consequently use it as the first argument + // of the worker function. We will further down below show how to create + // such an object. class GradientEstimation { public: @@ -466,7 +500,7 @@ namespace Step9 private: template <int dim> - struct EstimateScratchData + struct EstimateScratchData { EstimateScratchData (const FiniteElement<dim> &fe, const Vector<double> &solution); @@ -476,22 +510,15 @@ namespace Step9 Vector<double> solution; }; - // There is nothing to copy but WorkStream requires a CopyData structure - template <int dim> - struct EstimateCopyData - { - EstimateCopyData () {} - }; + struct EstimateCopyData + {}; template <int dim> - static void estimate_cell ( - const SynchronousIterators<std_cxx1x::tuple<typename DoFHandler<dim>::active_cell_iterator, - Vector<float>::iterator> > &cell, - EstimateScratchData<dim> &scratch_data, - const EstimateCopyData<dim> ©_data); - // There is nothing to copy but WorkStream required a copy function - template <int dim> - static void dummy_copy(const EstimateCopyData<dim> ©_data) {} + static + void estimate_cell (const SynchronousIterators<std_cxx1x::tuple<typename DoFHandler<dim>::active_cell_iterator, + Vector<float>::iterator> > &cell, + EstimateScratchData<dim> &scratch_data, + const EstimateCopyData ©_data); }; @@ -503,7 +530,8 @@ namespace Step9 // the function <code>setup_system</code> follow the same pattern that was // used previously, so we need not comment on these three function: template <int dim> - AdvectionProblem<dim>::AdvectionProblem () : + AdvectionProblem<dim>::AdvectionProblem () + : dof_handler (triangulation), fe(1) {} @@ -562,12 +590,12 @@ namespace Step9 void AdvectionProblem<dim>::assemble_system () { WorkStream::run(dof_handler.begin_active(), - dof_handler.end(), - *this, - &AdvectionProblem::local_assemble_system, - &AdvectionProblem::copy_local_to_global, - AssemblyScratchData(fe), - AssemblyCopyData()); + dof_handler.end(), + *this, + &AdvectionProblem::local_assemble_system, + &AdvectionProblem::copy_local_to_global, + AssemblyScratchData(fe), + AssemblyCopyData()); // After the matrix has been assembled in parallel, we still have to @@ -601,15 +629,15 @@ namespace Step9 template <int dim> AdvectionProblem<dim>::AssemblyScratchData:: AssemblyScratchData (const FiniteElement<dim> &fe) - : - fe_values (fe, - QGauss<dim>(2), - update_values | update_gradients | - update_quadrature_points | update_JxW_values), - fe_face_values (fe, - QGauss<dim-1>(2), - update_values | update_quadrature_points | - update_JxW_values | update_normal_vectors) + : + fe_values (fe, + QGauss<dim>(2), + update_values | update_gradients | + update_quadrature_points | update_JxW_values), + fe_face_values (fe, + QGauss<dim-1>(2), + update_values | update_quadrature_points | + update_JxW_values | update_normal_vectors) {} @@ -617,15 +645,15 @@ namespace Step9 template <int dim> AdvectionProblem<dim>::AssemblyScratchData:: AssemblyScratchData (const AssemblyScratchData &scratch_data) - : - fe_values (scratch_data.fe_values.get_fe(), - scratch_data.fe_values.get_quadrature(), - update_values | update_gradients | - update_quadrature_points | update_JxW_values), - fe_face_values (scratch_data.fe_face_values.get_fe(), - scratch_data.fe_face_values.get_quadrature(), - update_values | update_quadrature_points | - update_JxW_values | update_normal_vectors) + : + fe_values (scratch_data.fe_values.get_fe(), + scratch_data.fe_values.get_quadrature(), + update_values | update_gradients | + update_quadrature_points | update_JxW_values), + fe_face_values (scratch_data.fe_face_values.get_fe(), + scratch_data.fe_face_values.get_quadrature(), + update_values | update_quadrature_points | + update_JxW_values | update_normal_vectors) {} @@ -668,8 +696,8 @@ namespace Step9 void AdvectionProblem<dim>:: local_assemble_system (const typename DoFHandler<dim>::active_cell_iterator &cell, - AssemblyScratchData &scratch_data, - AssemblyCopyData ©_data) + AssemblyScratchData &scratch_data, + AssemblyCopyData ©_data) { // First of all, we will need some objects that describe boundary values, // right hand side function and the advection field. As we will only @@ -821,12 +849,12 @@ namespace Step9 { for (unsigned int i=0; i<copy_data.local_dof_indices.size(); ++i) { - for (unsigned int j=0; j<copy_data.local_dof_indices.size(); ++j) - system_matrix.add (copy_data.local_dof_indices[i], - copy_data.local_dof_indices[j], - copy_data.cell_matrix(i,j)); + for (unsigned int j=0; j<copy_data.local_dof_indices.size(); ++j) + system_matrix.add (copy_data.local_dof_indices[i], + copy_data.local_dof_indices[j], + copy_data.cell_matrix(i,j)); - system_rhs(copy_data.local_dof_indices[i]) += copy_data.cell_rhs(i); + system_rhs(copy_data.local_dof_indices[i]) += copy_data.cell_rhs(i); } } @@ -933,126 +961,144 @@ namespace Step9 data_out.add_data_vector (solution, "solution"); data_out.build_patches (); - std::ofstream output ("final-solution.gmv"); - data_out.write_gmv (output); + std::ofstream output ("final-solution.vtk"); + data_out.write_vtk (output); } // @sect3{GradientEstimation class implementation} - // ScratchData used by estimate_cell + // Now for the implementation of the <code>GradientEstimation</code> class. + // Let us start by defining constructors for the + // <code>EstimateScratchData</code> class used by the + // <code>estimate_cell()</code> function: template <int dim> - GradientEstimation::EstimateScratchData<dim> - ::EstimateScratchData (const FiniteElement<dim> &fe, + GradientEstimation::EstimateScratchData<dim>:: + EstimateScratchData (const FiniteElement<dim> &fe, const Vector<double> &solution) - : - fe_midpoint_value(fe, - QMidpoint<dim> (), - update_values | update_quadrature_points), - solution(solution) + : + fe_midpoint_value(fe, + QMidpoint<dim> (), + update_values | update_quadrature_points), + solution(solution) {} - - // ScratchData used by estimate_cell template <int dim> - GradientEstimation::EstimateScratchData<dim> - ::EstimateScratchData(const EstimateScratchData &scratch_data) - : - fe_midpoint_value(scratch_data.fe_midpoint_value.get_fe(), - scratch_data.fe_midpoint_value.get_quadrature(), - update_values | update_quadrature_points), - solution(scratch_data.solution) + GradientEstimation::EstimateScratchData<dim>:: + EstimateScratchData(const EstimateScratchData &scratch_data) + : + fe_midpoint_value(scratch_data.fe_midpoint_value.get_fe(), + scratch_data.fe_midpoint_value.get_quadrature(), + update_values | update_quadrature_points), + solution(scratch_data.solution) {} - // Now for the implementation of the <code>GradientEstimation</code> + // Next for the implementation of the <code>GradientEstimation</code> // class. The first function does not much except for delegating work to the - // other function: + // other function, but there is a bit of setup at the top. + // + // Before starting with the work, we check that the vector into which the + // results are written has the right size. It is a common error that such + // parameters have the wrong size, but the resulting damage by not + // catching these errors are very subtle as they are usually corruption of + // data somewhere in memory. Often, the problems emerging from this are + // not reproducible, and it is well worth the effort to + // check for such things. + // + // The second piece is to set up the iterator that goes in lockstep over the + // cells of the domain and the corresponding elements of the output vector + // (see above where we introduced the <code>SynchronousIterators</code> + // class). We can abbreviate the process slightly by introducing a + // <code>typedef</code> that denotes a pair of iterators. This being set up, + // we can hand the whole thing off to WorkStream::run, keeping in mind that + // we do not need a copy-local-to-global function here but can get away by + // simply using a default-constructed function object (the equivalent to a + // NULL function pointer). template <int dim> void GradientEstimation::estimate (const DoFHandler<dim> &dof_handler, const Vector<double> &solution, Vector<float> &error_per_cell) { - // Before starting with the work, we check that the vector into which the - // results are written, has the right size. It is a common error that such - // parameters have the wrong size, but the resulting damage by not - // catching these errors are very subtle as they are usually corruption of - // data somewhere in memory. Often, the problems emerging from this are - // not reproducible, and we found that it is well worth the effort to - // check for such things. Assert (error_per_cell.size() == dof_handler.get_tria().n_active_cells(), ExcInvalidVectorLength (error_per_cell.size(), dof_handler.get_tria().n_active_cells())); - // In the same way as before, we use a <code>Threads::ThreadGroup</code> - // object to collect the descriptor objects of different threads. Note - // that as the function called is not a member function, but rather a - // static function, we need not (and can not) pass a <code>this</code> - // pointer to the <code>new_thread</code> function in this case. - // - // Taking pointers to templated functions seems to be notoriously - // difficult for many compilers (since there are several functions with - // the same name -- just as with overloaded functions). It therefore - // happens quite frequently that we can't directly insert taking the - // address of a function in the call to <code>encapsulate</code> for one - // or the other compiler, but have to take a temporary variable for that - // purpose. Here, in this case, Compaq's <code>cxx</code> compiler choked - // on the code so we use this workaround with the function pointer: - void (*estimate_cell_ptr) (const SynchronousIterators<std_cxx1x::tuple< - typename DoFHandler<dim>::active_cell_iterator,Vector<float>::iterator> > &cell, - EstimateScratchData<dim> &scratch_data, - const EstimateCopyData<dim> ©_data) - = &GradientEstimation::template estimate_cell<dim>; - - void (*dummy_copy) (const EstimateCopyData<dim> ©_data) - = &GradientEstimation::template dummy_copy<dim>; - typedef std_cxx1x::tuple<typename DoFHandler<dim>::active_cell_iterator,Vector<float>::iterator> - Iterators; - SynchronousIterators<Iterators> begin_sync_it(Iterators(dof_handler.begin_active(), - error_per_cell.begin())); - SynchronousIterators<Iterators> end_sync_it(Iterators(dof_handler.end(),error_per_cell.end())); - - WorkStream::run(begin_sync_it,end_sync_it, - estimate_cell_ptr, - dummy_copy, - EstimateScratchData<dim> (dof_handler.get_fe(),solution), - EstimateCopyData<dim> ()); - - // Note that if the value of the variable - // <code>multithread_info.n_threads()</code> was one, or if the - // library was not configured to use threads, then the sequence of - // commands above reduced to a complicated way to simply call the - // <code>estimate_interval</code> function with the whole range of cells - // to work on. However, using the way above, we are able to write the - // program such that it makes no difference whether we presently work with - // multiple threads or in single-threaded mode, thus eliminating the need - // to write code included in conditional preprocessor sections. + IteratorTuple; + + SynchronousIterators<IteratorTuple> + begin_sync_it (IteratorTuple (dof_handler.begin_active(), + error_per_cell.begin())), + end_sync_it (IteratorTuple (dof_handler.end(), + error_per_cell.end())); + + WorkStream::run (begin_sync_it, + end_sync_it, + &GradientEstimation::template estimate_cell<dim>, + std_cxx1x::function<void (const EstimateCopyData &)> (), + EstimateScratchData<dim> (dof_handler.get_fe(), + solution), + EstimateCopyData ()); } // Following now the function that actually computes the finite difference // approximation to the gradient. The general outline of the function is to - // loop over all the cells in the range of iterators designated by the third - // argument, and on each cell first compute the list of active neighbors of - // the present cell and then compute the quantities described in the - // introduction for each of the neighbors. The reason for this order is that - // it is not a one-liner to find a given neighbor with locally refined - // meshes. In principle, an optimized implementation would find neighbors - // and the quantities depending on them in one step, rather than first - // building a list of neighbors and in a second step their contributions. + // first compute the list of active neighbors of the present cell and then + // compute the quantities described in the introduction for each of the + // neighbors. The reason for this order is that it is not a one-liner to + // find a given neighbor with locally refined meshes. In principle, an + // optimized implementation would find neighbors and the quantities + // depending on them in one step, rather than first building a list of + // neighbors and in a second step their contributions but we will gladly + // leave this as an exercise. As discussed before, the worker function + // passed to WorkStream::run works on "scratch" objects that keep all + // temporary objects. This way, we do not need to create and initialize + // objects that are expensive to initialize within the function that does + // the work, every time it is called for a given cell. Such an argument is + // passed as the second argument. The third argument would be a "copy-data" + // object (see @ref threads for more information) but we do not actually use + // any of these here. Because WorkStream::run insists on passing three + // arguments, we declare this function with three arguments, but simply + // ignore the last one. + // + // (This is unsatisfactory from an esthetic perspective. It can be avoided, + // at the cost of some other trickery. If you allow, let us here show + // how. First, assume that we had declared this function to only take two + // arguments by omitting the unused last one. Now, WorkStream::run still + // wants to call this function with three arguments, so we need to find a + // way to "forget" the third argument in the call. Simply passing + // WorkStream::run the pointer to the function as we do above will not do + // this -- the compiler will complain that a function declared to have two + // arguments is called with three arguments. However, we can do this by + // passing the following as the third argument when calling WorkStream::run + // above: + // @code + // std_cxx1x::function<void (const SynchronousIterators<IteratorTuple> &, + // EstimateScratchData<dim> &, + // EstimateCopyData &)> + // (std_cxx1x::bind (&GradientEstimation::template estimate_cell<dim>, + // std_cxx1x::_1, + // std_cxx1x::_2)) + // @endcode + // This creates a function object taking three arguments, but when it calls + // the underlying function object, it simply only uses the first and second + // argument -- we simply "forget" to use the third argument :-) + // In the end, this isn't completely obvious either, and so we didn't implement + // it, but hey -- it can be done!) // // Now for the details: template <int dim> void - GradientEstimation::estimate_cell (const SynchronousIterators<std_cxx1x::tuple< - typename DoFHandler<dim>::active_cell_iterator,Vector<float>::iterator> > &cell, - EstimateScratchData<dim> &scratch_data, - const EstimateCopyData<dim> ©_data) - { + GradientEstimation::estimate_cell (const SynchronousIterators<std_cxx1x::tuple<typename DoFHandler<dim>::active_cell_iterator, + Vector<float>::iterator> > &cell, + EstimateScratchData<dim> &scratch_data, + const EstimateCopyData &) + { // We need space for the tensor <code>Y</code>, which is the sum of // outer products of the y-vectors. Tensor<2,dim> Y; @@ -1067,7 +1113,7 @@ namespace Step9 GeometryInfo<dim>::max_children_per_face); typename DoFHandler<dim>::active_cell_iterator cell_it(std_cxx1x::get<0>(cell.iterators)); - + // First initialize the <code>FEValues</code> object, as well as the // <code>Y</code> tensor: scratch_data.fe_midpoint_value.reinit (cell_it); @@ -1151,7 +1197,7 @@ namespace Step9 // as an internal error. We therefore use a predefined // exception class to throw here. Assert (neighbor_child->neighbor(face_no==0 ? 1 : 0) - ==std_cxx1x::get<0>(cell.iterators),ExcInternalError()); + ==std_cxx1x::get<0>(cell.iterators),ExcInternalError()); // If the check succeeded, we push the active neighbor // we just found to the stack we keep: @@ -1204,7 +1250,7 @@ namespace Step9 const Point<dim> neighbor_center = scratch_data.fe_midpoint_value.quadrature_point(0); scratch_data.fe_midpoint_value.get_function_values (scratch_data.solution, - neighbor_midpoint_value); + neighbor_midpoint_value); // Compute the vector <code>y</code> connecting the centers of the // two cells. Note that as opposed to the introduction, we denote @@ -1259,10 +1305,16 @@ namespace Step9 Point<dim> gradient; contract (gradient, Y_inverse, projected_gradient); + // The last part of this function is the one where we + // write into the element of the output vector what + // we have just computed. As above, we need to get + // at the second element of the pair of iterators, which requires + // slightly awkward syntax but is not otherwise particularly + // difficult: *(std_cxx1x::get<1>(cell.iterators)) = (std::pow(std_cxx1x::get<0>(cell.iterators)->diameter(), - 1+1.0*dim/2) * - std::sqrt(gradient.square())); - + 1+1.0*dim/2) * + std::sqrt(gradient.square())); + } } diff --git a/deal.II/include/deal.II/base/derivative_form.h b/deal.II/include/deal.II/base/derivative_form.h index 87ef8c844d..793bdd3ba3 100644 --- a/deal.II/include/deal.II/base/derivative_form.h +++ b/deal.II/include/deal.II/base/derivative_form.h @@ -178,9 +178,9 @@ DerivativeForm<order, dim, spacedim>::DerivativeForm(const Tensor<2,dim> &T) { Assert( (dim == spacedim) && (order==1), ExcMessage("Only allowed for square tensors.")); - - for (unsigned int j=0; j<dim; ++j) - (*this)[j] = T[j]; + if ((dim == spacedim) && (order==1)) + for (unsigned int j=0; j<dim; ++j) + (*this)[j] = T[j]; } @@ -206,8 +206,9 @@ operator = (const Tensor<2,dim> &ta) Assert( (dim == spacedim) && (order==1), ExcMessage("Only allowed for square tensors.")); - for (unsigned int j=0; j<dim; ++j) - (*this)[j] = ta[j]; + if ((dim == spacedim) && (order==1)) + for (unsigned int j=0; j<dim; ++j) + (*this)[j] = ta[j]; return *this; } @@ -274,10 +275,13 @@ DerivativeForm<order, dim, spacedim>::operator Tensor<2,dim>() const Assert( (dim == spacedim) && (order==1), ExcMessage("Only allowed for square tensors.")); + + Tensor<2,dim> t; - for (unsigned int j=0; j<dim; ++j) - t[j] = (*this)[j]; + if ((dim == spacedim) && (order==1)) + for (unsigned int j=0; j<dim; ++j) + t[j] = (*this)[j]; return t; @@ -456,7 +460,7 @@ apply_transformation (const DerivativeForm<1,dim,spacedim> &DF1, /** - Traspose of a rectangular DerivativeForm DF, + Transpose of a rectangular DerivativeForm DF, mostly for compatibility reasons. @relates DerivativeForm @author Sebastian Pauletti, 2011 diff --git a/deal.II/include/deal.II/base/exceptions.h b/deal.II/include/deal.II/base/exceptions.h index 8c5efbd859..73506c7b0e 100644 --- a/deal.II/include/deal.II/base/exceptions.h +++ b/deal.II/include/deal.II/base/exceptions.h @@ -155,7 +155,7 @@ private: * A pointer to the c_string that will be printed by what(). It is * populated by generate_message() */ - mutable char* what_str; + mutable std::string what_str; }; diff --git a/deal.II/include/deal.II/base/polynomials_nedelec.h b/deal.II/include/deal.II/base/polynomials_nedelec.h index 7fa2cce6e7..21542309f5 100644 --- a/deal.II/include/deal.II/base/polynomials_nedelec.h +++ b/deal.II/include/deal.II/base/polynomials_nedelec.h @@ -34,10 +34,10 @@ DEAL_II_NAMESPACE_OPEN /** * This class implements the first family <i>H<sup>curl</sup></i>-conforming, - * vector-valued polynomials, proposed by J.-C. Nédélec in 1980 + * vector-valued polynomials, proposed by J.-C. Nédélec in 1980 * (Numer. Math. 35). * - * The Nédélec polynomials are constructed such that the curl + * The Nédélec polynomials are constructed such that the curl * is in the tensor product polynomial space <i>Q<sub>k</sub></i>. * Therefore, the polynomial order of each component must be one * order higher in the corresponding two directions, @@ -46,7 +46,7 @@ DEAL_II_NAMESPACE_OPEN * Q<sub>k+1,k,k+1</sub>, Q<sub>k+1,k+1,k</sub>)</i> in 2D and 3D, resp. * * @ingroup Polynomials - * @author Markus Bürg + * @author Markus Bürg * @date 2009, 2010 */ template <int dim> @@ -55,11 +55,11 @@ class PolynomialsNedelec public: /** * Constructor. Creates all basis - * functions for Nédélec polynomials + * functions for Nédélec polynomials * of given degree. * * @arg k: the degree of the - * Nédélec space, which is the degree + * Nédélec space, which is the degree * of the largest tensor product * polynomial space * <i>Q<sub>k</sub></i> contained. @@ -69,7 +69,7 @@ public: /** * Computes the value and the * first and second derivatives - * of each Nédélec + * of each Nédélec * polynomial at @p unit_point. * * The size of the vectors must @@ -93,13 +93,13 @@ public: void compute (const Point<dim> &unit_point, std::vector<Tensor<1, dim> > &values, std::vector<Tensor<2, dim> > &grads, std::vector<Tensor<3, dim> > &grad_grads) const; /** - * Returns the number of Nédélec + * Returns the number of Nédélec * polynomials. */ unsigned int n () const; /** - * Returns the degree of the Nédélec + * Returns the degree of the Nédélec * space, which is one less than * the highest polynomial degree. */ @@ -139,7 +139,7 @@ private: const AnisotropicPolynomials<dim> polynomial_space; /** - * Number of Nédélec polynomials. + * Number of Nédélec polynomials. */ const unsigned int n_pols; diff --git a/deal.II/include/deal.II/base/quadrature.h b/deal.II/include/deal.II/base/quadrature.h index 58dd4fbc1d..688fc6aa32 100644 --- a/deal.II/include/deal.II/base/quadrature.h +++ b/deal.II/include/deal.II/base/quadrature.h @@ -29,16 +29,16 @@ DEAL_II_NAMESPACE_OPEN /*@{*/ /** - * Base class for quadrature formulæ in arbitrary dimensions. This class + * Base class for quadrature formulæ in arbitrary dimensions. This class * stores quadrature points and weights on the unit line [0,1], unit * square [0,1]x[0,1], etc. * * There are a number of derived classes, denoting concrete - * integration formulæ. Their names names prefixed by + * integration formulæ. Their names names prefixed by * <tt>Q</tt>. Refer to the list of derived classes for more details. * * The schemes for higher dimensions are typically tensor products of the - * one-dimensional formulæ, but refer to the section on implementation + * one-dimensional formulæ, but refer to the section on implementation * detail below. * * In order to allow for dimension independent programming, a @@ -48,7 +48,7 @@ DEAL_II_NAMESPACE_OPEN * point with weight one. Access to the weight is possible, while * access to the quadrature point is not permitted, since a Point of * dimension zero contains no information. The main purpose of these - * formulæ is their use in QProjector, which will create a useful + * formulæ is their use in QProjector, which will create a useful * formula of dimension one out of them. * * <h3>Mathematical background</h3> @@ -59,20 +59,20 @@ DEAL_II_NAMESPACE_OPEN * error is <tt>m+1</tt>, that is, the error is the size of the cell * to the <tt>m+1</tt> by the Bramble-Hilbert Lemma. The number * <tt>m</tt> is to be found in the documentation of each concrete - * formula. For the optimal formulæ QGauss we have $m = 2N-1$, where + * formula. For the optimal formulæ QGauss we have $m = 2N-1$, where * N is the constructor parameter to QGauss. The tensor product - * formulæ are exact on tensor product polynomials of degree + * formulæ are exact on tensor product polynomials of degree * <tt>m</tt> in each space direction, but they are still only of * <tt>m+1</tt>st order. * * <h3>Implementation details</h3> * - * Most integration formulæ in more than one space dimension are - * tensor products of quadrature formulæ in one space dimension, or + * Most integration formulæ in more than one space dimension are + * tensor products of quadrature formulæ in one space dimension, or * more generally the tensor product of a formula in <tt>(dim-1)</tt> * dimensions and one in one dimension. There is a special constructor * to generate a quadrature formula from two others. For example, the - * QGauss@<dim@> formulæ include <i>N<sup>dim</sup></i> quadrature + * QGauss@<dim@> formulæ include <i>N<sup>dim</sup></i> quadrature * points in <tt>dim</tt> dimensions, where N is the constructor * parameter of QGauss. * @@ -330,7 +330,7 @@ public: * of the weights of the left- and the rightmost quadrature point. * * Since all dimensions higher than one are built up by tensor products of - * one dimensional and <tt>dim-1</tt> dimensional quadrature formulæ, the + * one dimensional and <tt>dim-1</tt> dimensional quadrature formulæ, the * argument given to the constructor needs to be a quadrature formula in * one space dimension, rather than in <tt>dim</tt> dimensions. * diff --git a/deal.II/include/deal.II/base/quadrature_lib.h b/deal.II/include/deal.II/base/quadrature_lib.h index f8759a4a9d..a448a80c9e 100644 --- a/deal.II/include/deal.II/base/quadrature_lib.h +++ b/deal.II/include/deal.II/base/quadrature_lib.h @@ -177,7 +177,7 @@ public: /** * Milne-rule. Closed Newton-Cotes formula, exact for polynomials of degree 5. - * See Stoer: Einführung in die Numerische Mathematik I, p. 102 + * See Stoer: Einführung in die Numerische Mathematik I, p. 102 */ template <int dim> class QMilne : public Quadrature<dim> @@ -189,7 +189,7 @@ public: /** * Weddle-rule. Closed Newton-Cotes formula, exact for polynomials of degree 7. - * See Stoer: Einführung in die Numerische Mathematik I, p. 102 + * See Stoer: Einführung in die Numerische Mathematik I, p. 102 */ template <int dim> class QWeddle : public Quadrature<dim> diff --git a/deal.II/include/deal.II/base/tensor_product_polynomials.h b/deal.II/include/deal.II/base/tensor_product_polynomials.h index 8f74b0aa68..bda2c89a97 100644 --- a/deal.II/include/deal.II/base/tensor_product_polynomials.h +++ b/deal.II/include/deal.II/base/tensor_product_polynomials.h @@ -320,7 +320,7 @@ private: unsigned int n_tensor_pols; /** - * Each tensor product polynomial @þ{i} is a product of one-dimensional + * Each tensor product polynomial @þ{i} is a product of one-dimensional * polynomials in each space direction. Compute the indices of these * one-dimensional polynomials for each space direction, given the index * <tt>i</tt>. diff --git a/deal.II/include/deal.II/base/work_stream.h b/deal.II/include/deal.II/base/work_stream.h index 71cadb7536..4236b80911 100644 --- a/deal.II/include/deal.II/base/work_stream.h +++ b/deal.II/include/deal.II/base/work_stream.h @@ -280,6 +280,12 @@ namespace WorkStream */ const ScratchData *sample_scratch_data; + /** + * Flag is true if the buffer is used and false if the buffer can be + * used. + */ + bool currently_in_use; + /** * Default constructor. @@ -290,7 +296,8 @@ namespace WorkStream : n_items (0), scratch_data (0), - sample_scratch_data (0) + sample_scratch_data (0), + currently_in_use (false) {} }; @@ -309,23 +316,23 @@ namespace WorkStream : tbb::filter (/*is_serial=*/true), remaining_iterator_range (begin, end), - ring_buffer (buffer_size), + item_buffer (buffer_size), sample_scratch_data (sample_scratch_data), - n_emitted_items (0), chunk_size (chunk_size) { // initialize the elements of the ring buffer - for (unsigned int element=0; element<ring_buffer.size(); ++element) + for (unsigned int element=0; element<item_buffer.size(); ++element) { - Assert (ring_buffer[element].n_items == 0, + Assert (item_buffer[element].n_items == 0, ExcInternalError()); - ring_buffer[element].work_items.resize (chunk_size, + item_buffer[element].work_items.resize (chunk_size, remaining_iterator_range.second); - ring_buffer[element].scratch_data = &thread_local_scratch; - ring_buffer[element].sample_scratch_data = &sample_scratch_data; - ring_buffer[element].copy_datas.resize (chunk_size, + item_buffer[element].scratch_data = &thread_local_scratch; + item_buffer[element].sample_scratch_data = &sample_scratch_data; + item_buffer[element].copy_datas.resize (chunk_size, sample_copy_data); + item_buffer[element].currently_in_use = false; } } @@ -336,10 +343,20 @@ namespace WorkStream */ virtual void *operator () (void *) { - // store the current - // position of the pointer - ItemType *current_item - = &ring_buffer[n_emitted_items % ring_buffer.size()]; + // find first unused item. we know that there must be one + // because we have set the maximal number of tokens in flight + // and have set the ring buffer to have exactly this size. so + // if this function is called, we know that less than the + // maximal number of items in currently in flight + ItemType *current_item = 0; + for (unsigned int i=0; i<item_buffer.size(); ++i) + if (item_buffer[i].currently_in_use == false) + { + item_buffer[i].currently_in_use = true; + current_item = &item_buffer[i]; + break; + } + Assert (current_item != 0, ExcMessage ("This can't be. There must be a free item!")); // initialize the next item. it may // consist of at most chunk_size @@ -362,10 +379,7 @@ namespace WorkStream // left. terminate the pipeline return 0; else - { - ++n_emitted_items; - return current_item; - } + return current_item; } private: @@ -377,9 +391,9 @@ namespace WorkStream std::pair<Iterator,Iterator> remaining_iterator_range; /** - * A ring buffer that will store items. + * A buffer that will store items. */ - std::vector<ItemType> ring_buffer; + std::vector<ItemType> item_buffer; /** * Pointer to a thread local variable identifying the scratch data objects @@ -421,13 +435,6 @@ namespace WorkStream */ const ScratchData &sample_scratch_data; - /** - * Counter for the number of emitted - * items. Each item may consist of up - * to chunk_size iterator elements. - */ - unsigned int n_emitted_items; - /** * Number of elements of the * iterator range that each @@ -445,21 +452,21 @@ namespace WorkStream /** * Initialize the pointers and vector * elements in the specified entry of - * the ring buffer. + * the item_buffer. */ void init_buffer_elements (const unsigned int element, const CopyData &sample_copy_data) { - Assert (ring_buffer[element].n_items == 0, + Assert (item_buffer[element].n_items == 0, ExcInternalError()); - ring_buffer[element].work_items + item_buffer[element].work_items .resize (chunk_size, remaining_iterator_range.second); - ring_buffer[element].scratch_data + item_buffer[element].scratch_data = &thread_local_scratch; - ring_buffer[element].sample_scratch_data + item_buffer[element].sample_scratch_data = &sample_scratch_data; - ring_buffer[element].copy_datas + item_buffer[element].copy_datas .resize (chunk_size, sample_copy_data); } }; @@ -489,10 +496,12 @@ namespace WorkStream */ Worker (const std_cxx1x::function<void (const Iterator &, ScratchData &, - CopyData &)> &worker) + CopyData &)> &worker, + bool copier_exist=true) : tbb::filter (/* is_serial= */ false), - worker (worker) + worker (worker), + copier_exist (copier_exist) {} @@ -587,6 +596,9 @@ namespace WorkStream } } + // if there is no copier, mark current item as usable again + if (copier_exist==false) + current_item->currently_in_use = false; // then return the original pointer @@ -604,6 +616,12 @@ namespace WorkStream const std_cxx1x::function<void (const Iterator &, ScratchData &, CopyData &)> worker; + + /** + * This flag is true if the copier stage exist. If it does not, + * the worker has to free the buffer. Otherwise the copier will do it. + */ + bool copier_exist; }; @@ -672,6 +690,9 @@ namespace WorkStream } } + // mark current item as useable again + current_item->currently_in_use = false; + // return an invalid item since we are at the end of the // pipeline @@ -782,7 +803,7 @@ namespace WorkStream * and copy data objects this thread will use. The same considerations * apply as documented in the Implementation2::IteratorRangeToItemStream * class as well as in the paper by Turcksin, Kronbichler and Bangerth - * (see @ref workstream_paper). + * (see @ref workstream_paper). */ Threads::ThreadLocalStorage<ScratchAndCopyDataList> *scratch_and_copy_data; @@ -916,7 +937,7 @@ namespace WorkStream std::pair<typename std::vector<Iterator>::const_iterator,typename std::vector<Iterator>::const_iterator> remaining_iterator_range; /** - * A ring buffer that will store items. + * A buffer that will store items. */ std::vector<ItemType> item_buffer; @@ -1150,7 +1171,8 @@ namespace WorkStream * * This function that can be used for worker and copier objects that * are either pointers to non-member functions or objects that allow to be - * called with an operator(), for example objects created by std::bind. + * called with an operator(), for example objects created by std::bind. If + * the copier is an empty function, it is ignored in the pipeline. * * The argument passed as @p end must be convertible to the same type as @p * begin, but doesn't have to be of the same type itself. This allows to @@ -1237,20 +1259,37 @@ namespace WorkStream sample_scratch_data, sample_copy_data); + // Check that the copier exist + if (static_cast<const std_cxx1x::function<void (const CopyData &)>& >(copier)) + { + internal::Implementation2::Worker<Iterator, ScratchData, CopyData> worker_filter (worker); + internal::Implementation2::Copier<Iterator, ScratchData, CopyData> copier_filter (copier); - internal::Implementation2::Worker<Iterator, ScratchData, CopyData> worker_filter (worker); - internal::Implementation2::Copier<Iterator, ScratchData, CopyData> copier_filter (copier); + // now create a pipeline from these stages + tbb::pipeline assembly_line; + assembly_line.add_filter (iterator_range_to_item_stream); + assembly_line.add_filter (worker_filter); + assembly_line.add_filter (copier_filter); - // now create a pipeline from these stages - tbb::pipeline assembly_line; - assembly_line.add_filter (iterator_range_to_item_stream); - assembly_line.add_filter (worker_filter); - assembly_line.add_filter (copier_filter); + // and run it + assembly_line.run (queue_length); - // and run it - assembly_line.run (queue_length); + assembly_line.clear (); + } + else + { + internal::Implementation2::Worker<Iterator, ScratchData, CopyData> worker_filter (worker,false); - assembly_line.clear (); + // now create a pipeline from these stages + tbb::pipeline assembly_line; + assembly_line.add_filter (iterator_range_to_item_stream); + assembly_line.add_filter (worker_filter); + + // and run it + assembly_line.run (queue_length); + + assembly_line.clear (); + } } #endif } @@ -1382,7 +1421,8 @@ namespace WorkStream * and Bangerth (see @ref workstream_paper). * * This is the function that can be used for worker and copier functions - * that are member functions of a class. + * that are member functions of a class. If the copier is an empty function, + * it is ignored in the pipeline. * * The argument passed as @p end must be convertible to the same type as @p * begin, but doesn't have to be of the same type itself. This allows to @@ -1414,10 +1454,10 @@ namespace WorkStream ScratchData &, CopyData &), void (MainClass::*copier) (const CopyData &), - const ScratchData &sample_scratch_data, - const CopyData &sample_copy_data, - const unsigned int queue_length = 2*multithread_info.n_threads(), - const unsigned int chunk_size = 8) + const ScratchData &sample_scratch_data, + const CopyData &sample_copy_data, + const unsigned int queue_length = 2*multithread_info.n_threads(), + const unsigned int chunk_size = 8) { // forward to the other function run (begin, end, diff --git a/deal.II/include/deal.II/dofs/dof_renumbering.h b/deal.II/include/deal.II/dofs/dof_renumbering.h index 9484864df3..063ed91f78 100644 --- a/deal.II/include/deal.II/dofs/dof_renumbering.h +++ b/deal.II/include/deal.II/dofs/dof_renumbering.h @@ -891,19 +891,6 @@ namespace DoFRenumbering const Point<DH::space_dimension> &direction, const bool dof_wise_renumbering = false); - /** - * This function does the downstream numbering for the individual levels of - * a multigrid hierarchy, but not for the global degrees of freedom. - * - * @deprecated Call downstream() function that takes a level argument for - * each of the levels of the multigrid hierarchy. - */ - template <int dim, int spacedim> - void - downstream (MGDoFHandler<dim,spacedim> &dof_handler, - const Point<spacedim> &direction, - const bool dof_wise_renumbering = false) DEAL_II_DEPRECATED; - /** * @deprecated Use downstream() instead. */ @@ -1155,6 +1142,29 @@ namespace DoFRenumbering DeclException0 (ExcNotDGFEM); } +/* ------------------------- inline functions -------------- */ + +#ifndef DOXYGEN +namespace DoFRenumbering +{ + template <class DH> + void + inline + downstream (DH &dof, + const Point<DH::space_dimension> &direction, + const bool dof_wise_renumbering) + { + std::vector<types::global_dof_index> renumbering(dof.n_dofs()); + std::vector<types::global_dof_index> reverse(dof.n_dofs()); + compute_downstream(renumbering, reverse, dof, direction, + dof_wise_renumbering); + + dof.renumber_dofs(renumbering); + } +} +#endif + + DEAL_II_NAMESPACE_CLOSE #endif diff --git a/deal.II/include/deal.II/fe/fe_face.h b/deal.II/include/deal.II/fe/fe_face.h index 64bb4e4f2b..5199cc13c1 100644 --- a/deal.II/include/deal.II/fe/fe_face.h +++ b/deal.II/include/deal.II/fe/fe_face.h @@ -57,7 +57,7 @@ public: * shape functions created using this constructor correspond to Lagrange * polynomials in each coordinate direction. */ - FE_FaceQ(unsigned int p); + FE_FaceQ (const unsigned int p); virtual FiniteElement<dim,spacedim> *clone() const; diff --git a/deal.II/include/deal.II/fe/fe_nedelec.h b/deal.II/include/deal.II/fe/fe_nedelec.h index 4a8fe4824b..6b15aa1be6 100644 --- a/deal.II/include/deal.II/fe/fe_nedelec.h +++ b/deal.II/include/deal.II/fe/fe_nedelec.h @@ -61,10 +61,10 @@ template <int dim, int spacedim> class MappingQ; * DGQ_{k} * @f] * Consequently, approximation order of - * the Nedelec space equals the value <i>degree</i> given to the constructor. + * the Nédélec space equals the value <i>degree</i> given to the constructor. * In this scheme, the lowest order element would be created by the call * FE_Nedelec<dim>(0). Note that this follows the convention of Brezzi and - * Raviart, though not the one used in the original paper by Nedelec. + * Raviart, though not the one used in the original paper by Nédélec. * * This class is not implemented for the codimension one case * (<tt>spacedim != dim</tt>). @@ -82,14 +82,14 @@ template <int dim, int spacedim> class MappingQ; * inverse) is needed already to generate the values of the shape * functions on the cells in real space. This is in contrast to most * other elements, where you only need the Jacobian for the - * gradients. Thus, to generate the gradients of Nedelec shape + * gradients. Thus, to generate the gradients of Nédélec shape * functions, one would need to have the derivatives of the inverse of * the Jacobian matrix. * - * Basically, the Nedelec shape functions can be understood as the + * Basically, the Nédélec shape functions can be understood as the * gradients of scalar shape functions on the real cell. They are thus * the inverse Jacobian matrix times the gradients of scalar shape - * functions on the unit cell. The gradient of Nedelec shape functions + * functions on the unit cell. The gradient of Nédélec shape functions * is then, by the product rule, the sum of first the derivative (with * respect to true coordinates) of the inverse Jacobian times the * gradient (in unit coordinates) of the scalar shape function, plus @@ -106,7 +106,7 @@ template <int dim, int spacedim> class MappingQ; * drop this first term. * * What this means for the present case: first the computation of - * gradients of Nedelec shape functions is wrong in general. Second, + * gradients of Nédélec shape functions is wrong in general. Second, * in the following two cases you will not notice this: * * - If the cell is a parallelogram, then the usual bi-/trilinear mapping @@ -114,7 +114,7 @@ template <int dim, int spacedim> class MappingQ; * and the gradient of the shape functions is computed exactly, since the * first term is zero. * - * - With the Nedelec elements, you will usually want to compute + * - With the Nédélec elements, you will usually want to compute * the curl, not the general derivative tensor. However, the curl of the * Jacobian vanishes, so for the curl of shape functions the first term * is irrelevant, and the curl will always be computed correctly even on @@ -323,7 +323,7 @@ private: * cells onto the father * cell. According to the * philosophy of the - * Nédélec element, this + * Nédélec element, this * restriction operator preserves * the curl of a function * weakly. diff --git a/deal.II/include/deal.II/fe/fe_values.h b/deal.II/include/deal.II/fe/fe_values.h index 994f7885f2..153c1b5721 100644 --- a/deal.II/include/deal.II/fe/fe_values.h +++ b/deal.II/include/deal.II/fe/fe_values.h @@ -2218,7 +2218,15 @@ public: * * @ingroup Exceptions */ - DeclException0 (ExcAccessToUninitializedField); + DeclException1 (ExcAccessToUninitializedField, + char *, + << ("You are requesting information from an FEValues/FEFaceValues/FESubfaceValues " + "object for which this kind of information has not been computed. What " + "information these objects compute is determined by the update_* flags you " + "pass to the constructor. Here, the operation you are attempting requires " + "the <") + << arg1 + << "> flag to be set, but it was apparently not specified upon construction."); /** * @todo Document this * @@ -2843,7 +2851,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // an adaptation of the FEValuesBase::shape_value_component function // except that here we know the component as fixed and we have @@ -2869,7 +2877,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // an adaptation of the // FEValuesBase::shape_grad_component @@ -2896,7 +2904,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); // an adaptation of the // FEValuesBase::shape_grad_component @@ -2922,7 +2930,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // same as for the scalar case except // that we have one more index @@ -2960,7 +2968,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except // that we have one more index @@ -3000,7 +3008,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except // that we have one more index @@ -3035,7 +3043,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except that we have one more index const int snc = shape_function_data[shape_function].single_nonzero_component; @@ -3173,7 +3181,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); // same as for the scalar case except // that we have one more index @@ -3289,7 +3297,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except // that we have one more index @@ -3323,7 +3331,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // similar to the vector case where we // have more then one index and we need @@ -3370,7 +3378,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); const int snc = shape_function_data[shape_function].single_nonzero_component; @@ -3460,7 +3468,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // similar to the vector case where we // have more then one index and we need @@ -3510,7 +3518,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); const int snc = shape_function_data[shape_function].single_nonzero_component; @@ -3636,7 +3644,7 @@ FEValuesBase<dim,spacedim>::shape_value (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_values, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_values")); Assert (fe->is_primitive (i), ExcShapeFunctionNotPrimitive(i)); @@ -3672,7 +3680,7 @@ FEValuesBase<dim,spacedim>::shape_value_component (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_values, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_values")); Assert (component < fe->n_components(), ExcIndexRange(component, 0, fe->n_components())); @@ -3701,7 +3709,7 @@ FEValuesBase<dim,spacedim>::shape_grad (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_gradients, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_gradients")); Assert (fe->is_primitive (i), ExcShapeFunctionNotPrimitive(i)); Assert (i<this->shape_gradients.size(), @@ -3741,7 +3749,7 @@ FEValuesBase<dim,spacedim>::shape_grad_component (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_gradients, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_gradients")); Assert (component < fe->n_components(), ExcIndexRange(component, 0, fe->n_components())); @@ -3770,7 +3778,7 @@ FEValuesBase<dim,spacedim>::shape_hessian (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_hessians, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_hessians")); Assert (fe->is_primitive (i), ExcShapeFunctionNotPrimitive(i)); Assert (i<this->shape_hessians.size(), @@ -3821,7 +3829,7 @@ FEValuesBase<dim,spacedim>::shape_hessian_component (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_hessians, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_hessians")); Assert (component < fe->n_components(), ExcIndexRange(component, 0, fe->n_components())); @@ -3887,7 +3895,8 @@ inline const std::vector<Point<spacedim> > & FEValuesBase<dim,spacedim>::get_quadrature_points () const { - Assert (this->update_flags & update_quadrature_points, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_quadrature_points, + ExcAccessToUninitializedField("update_quadrature_points")); return this->quadrature_points; } @@ -3898,7 +3907,8 @@ inline const std::vector<double> & FEValuesBase<dim,spacedim>::get_JxW_values () const { - Assert (this->update_flags & update_JxW_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_JxW_values, + ExcAccessToUninitializedField("update_JxW_values")); return this->JxW_values; } @@ -3909,7 +3919,8 @@ inline const std::vector<DerivativeForm<1,dim,spacedim> > & FEValuesBase<dim,spacedim>::get_jacobians () const { - Assert (this->update_flags & update_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobians, + ExcAccessToUninitializedField("update_jacobians")); return this->jacobians; } @@ -3920,7 +3931,8 @@ inline const std::vector<DerivativeForm<2,dim,spacedim> > & FEValuesBase<dim,spacedim>::get_jacobian_grads () const { - Assert (this->update_flags & update_jacobian_grads, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobian_grads, + ExcAccessToUninitializedField("update_jacobians_grads")); return this->jacobian_grads; } @@ -3931,7 +3943,8 @@ inline const std::vector<DerivativeForm<1,spacedim,dim> > & FEValuesBase<dim,spacedim>::get_inverse_jacobians () const { - Assert (this->update_flags & update_inverse_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_inverse_jacobians, + ExcAccessToUninitializedField("update_inverse_jacobians")); return this->inverse_jacobians; } @@ -3942,7 +3955,8 @@ inline const Point<spacedim> & FEValuesBase<dim,spacedim>::quadrature_point (const unsigned int i) const { - Assert (this->update_flags & update_quadrature_points, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_quadrature_points, + ExcAccessToUninitializedField("update_quadrature_points")); Assert (i<this->quadrature_points.size(), ExcIndexRange(i, 0, this->quadrature_points.size())); return this->quadrature_points[i]; @@ -3956,7 +3970,8 @@ inline double FEValuesBase<dim,spacedim>::JxW (const unsigned int i) const { - Assert (this->update_flags & update_JxW_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_JxW_values, + ExcAccessToUninitializedField("update_JxW_values")); Assert (i<this->JxW_values.size(), ExcIndexRange(i, 0, this->JxW_values.size())); return this->JxW_values[i]; @@ -3969,7 +3984,8 @@ inline const DerivativeForm<1,dim,spacedim> & FEValuesBase<dim,spacedim>::jacobian (const unsigned int i) const { - Assert (this->update_flags & update_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobians, + ExcAccessToUninitializedField("update_jacobians")); Assert (i<this->jacobians.size(), ExcIndexRange(i, 0, this->jacobians.size())); return this->jacobians[i]; @@ -3982,7 +3998,8 @@ inline const DerivativeForm<2,dim,spacedim> & FEValuesBase<dim,spacedim>::jacobian_grad (const unsigned int i) const { - Assert (this->update_flags & update_jacobian_grads, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobian_grads, + ExcAccessToUninitializedField("update_jacobians_grads")); Assert (i<this->jacobian_grads.size(), ExcIndexRange(i, 0, this->jacobian_grads.size())); return this->jacobian_grads[i]; @@ -3995,7 +4012,8 @@ inline const DerivativeForm<1,spacedim,dim> & FEValuesBase<dim,spacedim>::inverse_jacobian (const unsigned int i) const { - Assert (this->update_flags & update_inverse_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_inverse_jacobians, + ExcAccessToUninitializedField("update_inverse_jacobians")); Assert (i<this->inverse_jacobians.size(), ExcIndexRange(i, 0, this->inverse_jacobians.size())); return this->inverse_jacobians[i]; @@ -4090,7 +4108,7 @@ FEValuesBase<dim,spacedim>::normal_vector (const unsigned int i) const { typedef FEValuesBase<dim,spacedim> FVB; Assert (this->update_flags & update_normal_vectors, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_normal_vectors")); Assert (i<this->normal_vectors.size(), ExcIndexRange(i, 0, this->normal_vectors.size())); @@ -4185,7 +4203,7 @@ FEFaceValuesBase<dim,spacedim>::boundary_form (const unsigned int i) const Assert (i<this->boundary_forms.size(), ExcIndexRange(i, 0, this->boundary_forms.size())); Assert (this->update_flags & update_boundary_forms, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_boundary_forms")); return this->boundary_forms[i]; } diff --git a/deal.II/include/deal.II/integrators/laplace.h b/deal.II/include/deal.II/integrators/laplace.h index fd9564c374..61a58afbb8 100644 --- a/deal.II/include/deal.II/integrators/laplace.h +++ b/deal.II/include/deal.II/integrators/laplace.h @@ -230,7 +230,9 @@ namespace LocalIntegrators * valued version, namely on the face <i>F</i> * the vector * @f[ - * \int_F \Bigl(\gamma (u-g) v - \partial_n u v - (u-g) \partial_n v\Bigr)\;ds. + * \int_F \Bigl(\gamma (\mathbf u- \mathbf g) \cdot \mathbf v + - \partial_n \mathbf u \cdot \mathbf v + - (\mathbf u-\mathbf g) \cdot \partial_n \mathbf v\Bigr)\;ds. * @f] * * Here, <i>u</i> is the finite element function whose values and @@ -349,6 +351,20 @@ namespace LocalIntegrators } } + /** + * Flux for the interior penalty method for the Laplacian applied + * to the tangential components of a vector field, namely on + * the face <i>F</i> the matrices associated with the bilinear form + * @f[ + * \int_F \Bigl( \gamma [u_\tau][v_\tau] - \{\nabla u_\tau\}[v_\tau\mathbf n] - [u_\tau\mathbf + * n]\{\nabla v_\tau\} \Bigr) \; ds. + * @f] + * + * @warning This function is still under development! + * + * @author Bärbel Janssen, Guido Kanschat + * @date 2013 + */ template <int dim> void ip_tangential_matrix ( FullMatrix<double> &M11, @@ -421,7 +437,11 @@ namespace LocalIntegrators } /** - * Residual term for the symmetric interior penalty method. + * Residual term for the symmetric interior penalty method: + * @f[ + * \int_F \Bigl( \gamma [u][v] - \{\nabla u\}[v\mathbf n] - [u\mathbf + * n]\{\nabla v\} \Bigr) \; ds. + * @f] * * @author Guido Kanschat * @date 2012 @@ -483,7 +503,12 @@ namespace LocalIntegrators /** - * Vector-valued residual term for the symmetric interior penalty method. + * Vector-valued residual term for the symmetric interior penalty method: + * @f[ + * \int_F \Bigl( \gamma [\mathbf u]\cdot[\mathbf v] + - \{\nabla \mathbf u\}[\mathbf v\otimes \mathbf n] + - [\mathbf u\otimes \mathbf n]\{\nabla \mathbf v\} \Bigr) \; ds. + * @f] * * @author Guido Kanschat * @date 2012 diff --git a/deal.II/include/deal.II/lac/constraint_matrix.h b/deal.II/include/deal.II/lac/constraint_matrix.h index 4bb240c83c..7020842c8a 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.h @@ -660,6 +660,14 @@ public: */ std::size_t memory_consumption () const; + /** + * Add the constraint indices associated to the indices in the given vector. + * After a call to this function, the indices vector contains the + * initial elements and all the associated constrained indices. This + * function sorts the elements and suppresses duplicates. + */ + void resolve_indices(std::vector<types::global_dof_index> &indices) const; + /** * @} */ diff --git a/deal.II/include/deal.II/lac/sparse_direct.h b/deal.II/include/deal.II/lac/sparse_direct.h index 8ef14a7a38..c9df62991f 100644 --- a/deal.II/include/deal.II/lac/sparse_direct.h +++ b/deal.II/include/deal.II/lac/sparse_direct.h @@ -346,7 +346,7 @@ private: #endif // DEAL_II_WITH_MUMPS double *a; - double *rhs; + std::vector<double> rhs; int *irn; int *jcn; types::global_dof_index n; @@ -364,6 +364,11 @@ private: */ void copy_solution (Vector<double> &vector); + /** + * + */ + void copy_rhs_to_mumps(const Vector<double> &rhs); + /** * Flags storing whether the function <tt>initialize ()</tt> has already * been called. @@ -409,7 +414,8 @@ public: /** * A function in which the linear system is solved and the solution - * vector is copied into the given <tt>vector</tt>. + * vector is copied into the given <tt>vector</tt>. The right-hand side + * need to be supplied in initialize(matrix, vector); */ void solve (Vector<double> &vector); diff --git a/deal.II/include/deal.II/matrix_free/fe_evaluation.h b/deal.II/include/deal.II/matrix_free/fe_evaluation.h index 7a18e32fd2..6e75bc5331 100644 --- a/deal.II/include/deal.II/matrix_free/fe_evaluation.h +++ b/deal.II/include/deal.II/matrix_free/fe_evaluation.h @@ -5442,9 +5442,17 @@ FEEvaluation<dim,fe_degree,n_q_points_1d,n_components_,Number> ::apply_values (const VectorizedArray<Number> in [], VectorizedArray<Number> out []) { - internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d, + // for linear elements, the even-odd decomposition is slower than the plain + // evaluation (additions to create the symmetric and anti-symmetric part), + // for all other orders, we choose even-odd + if (fe_degree > 1 || n_q_points_1d > 3) + internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d, VectorizedArray<Number>, direction, dof_to_quad, add, 0> (shape_val_evenodd, in, out); + else + internal::apply_tensor_product_values<dim,fe_degree,n_q_points_1d, + VectorizedArray<Number>, direction, dof_to_quad, add> + (this->data.shape_values.begin(), in, out); } @@ -5458,9 +5466,14 @@ FEEvaluation<dim,fe_degree,n_q_points_1d,n_components_,Number> ::apply_gradients (const VectorizedArray<Number> in [], VectorizedArray<Number> out []) { - internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d, + if (fe_degree > 1 || n_q_points_1d > 3) + internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d, VectorizedArray<Number>, direction, dof_to_quad, add, 1> (shape_gra_evenodd, in, out); + else + internal::apply_tensor_product_gradients<dim,fe_degree,n_q_points_1d, + VectorizedArray<Number>, direction, dof_to_quad, add> + (this->data.shape_gradients.begin(), in, out); } @@ -5477,9 +5490,14 @@ FEEvaluation<dim,fe_degree,n_q_points_1d,n_components_,Number> ::apply_hessians (const VectorizedArray<Number> in [], VectorizedArray<Number> out []) { - internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d, + if (fe_degree > 1 || n_q_points_1d > 3) + internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d, VectorizedArray<Number>, direction, dof_to_quad, add, 2> (shape_hes_evenodd, in, out); + else + internal::apply_tensor_product_hessians<dim,fe_degree,n_q_points_1d, + VectorizedArray<Number>, direction, dof_to_quad, add> + (this->data.shape_hessians.begin(), in, out); } 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 4e3d3c463a..193df65ef7 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 @@ -142,7 +142,8 @@ internal_reinit(const Mapping<dim> &mapping, // initialize the basic multithreading information that needs to be // passed to the DoFInfo structure #ifdef DEAL_II_WITH_THREADS - if (additional_data.tasks_parallel_scheme != AdditionalData::none) + if (additional_data.tasks_parallel_scheme != AdditionalData::none && + multithread_info.n_threads() > 1) { task_info.use_multithreading = true; task_info.block_size = additional_data.tasks_block_size; @@ -263,7 +264,8 @@ internal_reinit(const Mapping<dim> &mapping, // initialize the basic multithreading information that needs to be // passed to the DoFInfo structure #ifdef DEAL_II_WITH_THREADS - if (additional_data.tasks_parallel_scheme != AdditionalData::none) + if (additional_data.tasks_parallel_scheme != AdditionalData::none && + multithread_info.n_threads() > 1) { task_info.use_multithreading = true; task_info.block_size = additional_data.tasks_block_size; diff --git a/deal.II/include/deal.II/numerics/vector_tools.h b/deal.II/include/deal.II/numerics/vector_tools.h index daf77a045d..28c5fa3f10 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.h +++ b/deal.II/include/deal.II/numerics/vector_tools.h @@ -451,11 +451,11 @@ namespace VectorTools * replaced by a hp::MappingCollection in * case of a hp::DoFHandler. */ - template <class VECTOR, class DH> - void interpolate (const Mapping<DH::dimension,DH::space_dimension> &mapping, - const DH &dof, - const Function<DH::space_dimension> &function, - VECTOR &vec); + template <class VECTOR, int dim, int spacedim, template <int,int> class DH> + void interpolate (const Mapping<dim,spacedim> &mapping, + const DH<dim,spacedim> &dof, + const Function<spacedim> &function, + VECTOR &vec); /** * Calls the @p interpolate() diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h index a3748c86b8..77cc717739 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -74,24 +74,22 @@ DEAL_II_NAMESPACE_OPEN namespace VectorTools { - template <class VECTOR, class DH> - void interpolate (const Mapping<DH::dimension,DH::space_dimension> &mapping, - const DH &dof, - const Function<DH::space_dimension> &function, - VECTOR &vec) + template <class VECTOR, int dim, int spacedim, template <int,int> class DH> + void interpolate (const Mapping<dim,spacedim> &mapping, + const DH<dim,spacedim> &dof, + const Function<spacedim> &function, + VECTOR &vec) { - const unsigned int dim=DH::dimension; - Assert (dof.get_fe().n_components() == function.n_components, ExcDimensionMismatch(dof.get_fe().n_components(), function.n_components)); - const hp::FECollection<DH::dimension,DH::space_dimension> fe (dof.get_fe()); + const hp::FECollection<dim,spacedim> fe (dof.get_fe()); const unsigned int n_components = fe.n_components(); const bool fe_is_system = (n_components != 1); - typename DH::active_cell_iterator cell = dof.begin_active(), - endc = dof.end(); + typename DH<dim,spacedim>::active_cell_iterator cell = dof.begin_active(), + endc = dof.end(); // For FESystems many of the // unit_support_points will appear @@ -180,7 +178,7 @@ namespace VectorTools const unsigned int max_rep_points = *std::max_element (n_rep_points.begin(), n_rep_points.end()); std::vector<types::global_dof_index> dofs_on_cell (fe.max_dofs_per_cell()); - std::vector<Point<DH::space_dimension> > rep_points (max_rep_points); + std::vector<Point<spacedim> > rep_points (max_rep_points); // get space for the values of the // function at the rep support points. @@ -199,9 +197,9 @@ namespace VectorTools // Transformed support points are computed by // FEValues - hp::MappingCollection<dim,DH::space_dimension> mapping_collection (mapping); + hp::MappingCollection<dim,spacedim> mapping_collection (mapping); - hp::FEValues<dim, DH::space_dimension> fe_values (mapping_collection, + hp::FEValues<dim,spacedim> fe_values (mapping_collection, fe, support_quadrature, update_quadrature_points); for (; cell!=endc; ++cell) @@ -213,7 +211,7 @@ namespace VectorTools // get location of finite element // support_points fe_values.reinit(cell); - const std::vector<Point<DH::space_dimension> > &support_points = + const std::vector<Point<spacedim> > &support_points = fe_values.get_present_fe_values().get_quadrature_points(); // pick out the representative @@ -5218,11 +5216,11 @@ namespace VectorTools case H1_norm: exponent = 2.; break; - + case L1_norm: exponent = 1.; break; - + default: break; } @@ -5247,7 +5245,7 @@ namespace VectorTools if (spacedim == dim+1) update_flags |= UpdateFlags (update_normal_vectors); // no break! - + default: update_flags |= UpdateFlags (update_values); break; diff --git a/deal.II/source/base/data_out_base.cc b/deal.II/source/base/data_out_base.cc index b000b1435e..210e8e7f53 100644 --- a/deal.II/source/base/data_out_base.cc +++ b/deal.II/source/base/data_out_base.cc @@ -6996,7 +6996,7 @@ void DataOutBase::write_filtered_data (const std::vector<Patch<dim,spacedim> > & while (n_th_vector < vector_data_ranges.size() && std_cxx1x::get<0>(vector_data_ranges[n_th_vector]) < data_set) n_th_vector++; // Determine the dimension of this data - if (std_cxx1x::get<0>(vector_data_ranges[n_th_vector]) == data_set) + if (n_th_vector < vector_data_ranges.size() && std_cxx1x::get<0>(vector_data_ranges[n_th_vector]) == data_set) { // Multiple dimensions pt_data_vector_dim = std_cxx1x::get<1>(vector_data_ranges[n_th_vector]) - std_cxx1x::get<0>(vector_data_ranges[n_th_vector])+1; diff --git a/deal.II/source/base/exceptions.cc b/deal.II/source/base/exceptions.cc index 22278be947..e98a4d89b9 100644 --- a/deal.II/source/base/exceptions.cc +++ b/deal.II/source/base/exceptions.cc @@ -67,9 +67,9 @@ ExceptionBase::ExceptionBase () function(""), cond(""), exc(""), - stacktrace (0), + stacktrace (NULL), n_stacktrace_frames (0), - what_str(0) + what_str("") {} @@ -81,25 +81,17 @@ ExceptionBase::ExceptionBase (const ExceptionBase &exc) function(exc.function), cond(exc.cond), exc(exc.exc), - stacktrace (0), // don't copy stacktrace to avoid double de-allocation problem + stacktrace (NULL), // don't copy stacktrace to avoid double de-allocation problem n_stacktrace_frames (0), - what_str(0) // don't copy the error message, it gets generated dynamically by what() + what_str("") // don't copy the error message, it gets generated dynamically by what() {} ExceptionBase::~ExceptionBase () throw () { - if (stacktrace != 0) - { - free (stacktrace); - stacktrace = 0; - } - if (what_str != 0) - { - delete[] what_str; - what_str = 0; - } + free (stacktrace); // free(NULL) is allowed + stacktrace = NULL; } @@ -117,12 +109,6 @@ void ExceptionBase::set_fields (const char *f, exc = e; // If the system supports this, get a stacktrace how we got here: - if (stacktrace != 0) - { - free (stacktrace); - stacktrace = 0; - } - // Note that we defer the symbol lookup done by backtrace_symbols() // to when we need it (see what() below). This is for performance // reasons, as this requires loading libraries and can take in the @@ -135,19 +121,22 @@ void ExceptionBase::set_fields (const char *f, const char* ExceptionBase::what() const throw() { // If no error c_string was generated so far, do it now: - if (what_str == 0) + if (what_str == "") { #ifdef HAVE_GLIBC_STACKTRACE // We have deferred the symbol lookup to this point to avoid costly // runtime penalties due to linkage of external libraries by // backtrace_symbols. + + // first delete old stacktrace if necessary + free (stacktrace); // free(NULL) is allowed stacktrace = backtrace_symbols(raw_stacktrace, n_stacktrace_frames); #endif generate_message(); } - return what_str; + return what_str.c_str(); } @@ -309,14 +298,12 @@ void ExceptionBase::generate_message () const converter << "--------------------------------------------------------" << std::endl; - if (what_str != 0) - delete[] what_str; - what_str = new char[converter.str().size()+1]; // beware of the terminating \0 character - strcpy(what_str, converter.str().c_str()); + what_str = converter.str(); } catch (...) { // On error, resume next. There is nothing better we can do... + what_str = "ExceptionBase::generate_message () failed"; } } diff --git a/deal.II/source/dofs/dof_renumbering.cc b/deal.II/source/dofs/dof_renumbering.cc index 1dde827f29..60d0453536 100644 --- a/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/source/dofs/dof_renumbering.cc @@ -1515,30 +1515,8 @@ namespace DoFRenumbering - template <class DH> - void - downstream (DH &dof, - const Point<DH::space_dimension> &direction, - const bool dof_wise_renumbering) - { - std::vector<types::global_dof_index> renumbering(dof.n_dofs()); - std::vector<types::global_dof_index> reverse(dof.n_dofs()); - compute_downstream(renumbering, reverse, dof, direction, - dof_wise_renumbering); - - dof.renumber_dofs(renumbering); - } - template <int dim, int spacedim> - void - downstream (MGDoFHandler<dim,spacedim> &dof_handler, - const Point<spacedim> &direction, - const bool dof_wise_renumbering) - { - for (unsigned int level=0; level<dof_handler.n_levels(); ++level) - downstream(dof_handler, level, direction, dof_wise_renumbering); - } template <class DH> diff --git a/deal.II/source/dofs/dof_renumbering.inst.in b/deal.II/source/dofs/dof_renumbering.inst.in index 2f977adbee..49a0cc5841 100644 --- a/deal.II/source/dofs/dof_renumbering.inst.in +++ b/deal.II/source/dofs/dof_renumbering.inst.in @@ -207,11 +207,6 @@ namespace DoFRenumbering const DoFHandler<deal_II_dimension>&, unsigned int, const std::vector<DoFHandler<deal_II_dimension>::level_cell_iterator>&); - template void - downstream<DoFHandler<deal_II_dimension> > - (DoFHandler<deal_II_dimension>&, const Point<DoFHandler<deal_II_dimension>::space_dimension>&, - const bool); - template void compute_downstream<DoFHandler<deal_II_dimension> > (std::vector<types::global_dof_index>&,std::vector<types::global_dof_index>&, @@ -242,18 +237,6 @@ namespace DoFRenumbering const hp::DoFHandler<deal_II_dimension>&, const std::vector<hp::DoFHandler<deal_II_dimension>::active_cell_iterator>&); - template void - downstream<hp::DoFHandler<deal_II_dimension> > - (hp::DoFHandler<deal_II_dimension>&, - const Point<hp::DoFHandler<deal_II_dimension>::space_dimension>&, - const bool); - - template void - downstream<MGDoFHandler<deal_II_dimension> > - (MGDoFHandler<deal_II_dimension>&, - const Point<MGDoFHandler<deal_II_dimension>::space_dimension>&, - const bool); - template void downstream<MGDoFHandler<deal_II_dimension> > (MGDoFHandler<deal_II_dimension>&, diff --git a/deal.II/source/dofs/dof_tools_constraints.cc b/deal.II/source/dofs/dof_tools_constraints.cc index 25c01c21cf..4ef7047725 100644 --- a/deal.II/source/dofs/dof_tools_constraints.cc +++ b/deal.II/source/dofs/dof_tools_constraints.cc @@ -809,7 +809,10 @@ namespace DoFTools n_dofs_on_children = fe.dofs_per_vertex + 2*fe.dofs_per_line; dofs_on_mother.resize (n_dofs_on_mother); - dofs_on_children.resize (n_dofs_on_children); + // we might not use all of those in case of artificial cells, + // so do not resize(), but reserve() and use push_back later. + dofs_on_children.clear(); + dofs_on_children.reserve (n_dofs_on_children); Assert(n_dofs_on_mother == fe.constraints().n(), ExcDimensionMismatch(n_dofs_on_mother, @@ -831,15 +834,20 @@ namespace DoFTools dofs_on_mother[next_index++] = this_face->dof_index(dof, fe_index); AssertDimension (next_index, dofs_on_mother.size()); - next_index = 0; for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) - dofs_on_children[next_index++] - = this_face->child(0)->vertex_dof_index(1,dof,fe_index); + dofs_on_children.push_back( + this_face->child(0)->vertex_dof_index(1,dof,fe_index)); for (unsigned int child=0; child<2; ++child) - for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->child(child)->dof_index(dof, fe_index); - AssertDimension (next_index, dofs_on_children.size()); + { + // skip artificial cells + if (cell->neighbor_child_on_subface (face, child)->is_artificial()) + continue; + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_children.push_back( + this_face->child(child)->dof_index(dof, fe_index)); + } + // note: can get fewer DoFs when we have artificial cells + Assert(dofs_on_children.size() <= n_dofs_on_children, ExcInternalError()); // for each row in the constraint matrix for this line: for (unsigned int row=0; row!=dofs_on_children.size(); ++row) @@ -964,7 +972,10 @@ namespace DoFTools //TODO[TL]: think about this and the following in case of anisotropic refinement dofs_on_mother.resize (n_dofs_on_mother); - dofs_on_children.resize (n_dofs_on_children); + // we might not use all of those in case of artificial cells, + // so do not resize(), but reserve() and use push_back later. + dofs_on_children.clear(); + dofs_on_children.reserve (n_dofs_on_children); Assert(n_dofs_on_mother == fe.constraints().n(), ExcDimensionMismatch(n_dofs_on_mother, @@ -990,9 +1001,7 @@ namespace DoFTools dofs_on_mother[next_index++] = this_face->dof_index(dof, fe_index); AssertDimension (next_index, dofs_on_mother.size()); - next_index = 0; - - // assert some consistency assumptions + //TODO: assert some consistency assumptions //TODO[TL]: think about this in case of anisotropic //refinement @@ -1005,46 +1014,56 @@ namespace DoFTools (this_face->child(0)->vertex_index(3) == this_face->child(3)->vertex_index(0))), ExcInternalError()); + for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) - dofs_on_children[next_index++] - = this_face->child(0)->vertex_dof_index(3,dof); + dofs_on_children.push_back( + this_face->child(0)->vertex_dof_index(3,dof)); // dof numbers on the centers of the lines bounding this // face for (unsigned int line=0; line<4; ++line) for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) - dofs_on_children[next_index++] - = this_face->line(line)->child(0)->vertex_dof_index(1,dof, fe_index); + dofs_on_children.push_back( + this_face->line(line)->child(0)->vertex_dof_index(1,dof, fe_index)); // next the dofs on the lines interior to the face; the // order of these lines is laid down in the FiniteElement // class documentation for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->child(0)->line(1)->dof_index(dof, fe_index); + dofs_on_children.push_back( + this_face->child(0)->line(1)->dof_index(dof, fe_index)); for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->child(2)->line(1)->dof_index(dof, fe_index); + dofs_on_children.push_back( + this_face->child(2)->line(1)->dof_index(dof, fe_index)); for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->child(0)->line(3)->dof_index(dof, fe_index); + dofs_on_children.push_back( + this_face->child(0)->line(3)->dof_index(dof, fe_index)); for (unsigned int dof=0; dof<fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->child(1)->line(3)->dof_index(dof, fe_index); + dofs_on_children.push_back( + this_face->child(1)->line(3)->dof_index(dof, fe_index)); // dofs on the bordering lines for (unsigned int line=0; line<4; ++line) for (unsigned int child=0; child<2; ++child) - for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->line(line)->child(child)->dof_index(dof, fe_index); + { + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_children.push_back( + this_face->line(line)->child(child)->dof_index(dof, fe_index)); + } // finally, for the dofs interior to the four child faces for (unsigned int child=0; child<4; ++child) - for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof) - dofs_on_children[next_index++] - = this_face->child(child)->dof_index(dof, fe_index); - AssertDimension (next_index, dofs_on_children.size()); + { + // skip artificial cells + if (cell->neighbor_child_on_subface (face, child)->is_artificial()) + continue; + for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof) + dofs_on_children.push_back( + this_face->child(child)->dof_index(dof, fe_index)); + } + + // note: can get fewer DoFs when we have artificial cells: + Assert(dofs_on_children.size() <= n_dofs_on_children, ExcInternalError()); // for each row in the constraint matrix for this line: for (unsigned int row=0; row!=dofs_on_children.size(); ++row) @@ -1971,7 +1990,7 @@ namespace DoFTools } - + template<typename DH> void make_periodicity_constraints (const DH &dof_handler, @@ -2121,64 +2140,35 @@ namespace DoFTools { namespace Assembler { - struct Scratch - { - Scratch() {}; - }; + struct Scratch {}; template <int dim,int spacedim> struct CopyData { - CopyData(unsigned int const &coarse_component, - std::vector<types::global_dof_index> const &weight_mapping); - - CopyData(CopyData const &data); - - unsigned int coarse_component; - unsigned int dofs_per_cell; + unsigned int dofs_per_cell; std::vector<types::global_dof_index> parameter_dof_indices; - std::vector<types::global_dof_index> weight_mapping; std::vector<dealii::Vector<double> > global_parameter_representation; }; - - - - template <int dim,int spacedim> - CopyData<dim,spacedim>::CopyData(unsigned int const &coarse_component, - std::vector<types::global_dof_index> const &weight_mapping) : - coarse_component(coarse_component), - weight_mapping(weight_mapping) - {} - - - - template <int dim,int spacedim> - CopyData<dim,spacedim>::CopyData(CopyData const &data) : - coarse_component(data.coarse_component), - dofs_per_cell(data.dofs_per_cell), - parameter_dof_indices(data.parameter_dof_indices), - weight_mapping(data.weight_mapping), - global_parameter_representation(data.global_parameter_representation) - {} } namespace { /** * This is a function that is called by the _2 function and that - * operates on one cell only. It is worked in parallel if + * operates on one cell only. It is worked in parallel if * multhithreading is available. */ template <int dim, int spacedim> void compute_intergrid_weights_3 ( - typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator const &cell, - Assembler::Scratch const &scratch, + const typename dealii::DoFHandler<dim,spacedim>::active_cell_iterator &cell, + const Assembler::Scratch &, Assembler::CopyData<dim,spacedim> ©_data, - FiniteElement<dim,spacedim> const &coarse_fe, - InterGridMap<dealii::DoFHandler<dim,spacedim> > const &coarse_to_fine_grid_map, - std::vector<dealii::Vector<double> > const ¶meter_dofs) - + const unsigned int coarse_component, + const FiniteElement<dim,spacedim> &coarse_fe, + const InterGridMap<dealii::DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map, + const std::vector<dealii::Vector<double> > ¶meter_dofs, + const std::vector<types::global_dof_index> &weight_mapping) { // for each cell on the parameter grid: find out which degrees of // freedom on the fine grid correspond in which way to the degrees @@ -2226,22 +2216,24 @@ namespace DoFTools // vector to hold the representation of a single degree of freedom // on the coarse grid (for the selected fe) on the fine grid - const types::global_dof_index n_fine_dofs = copy_data.weight_mapping.size(); + const types::global_dof_index n_fine_dofs = weight_mapping.size(); copy_data.dofs_per_cell = coarse_fe.dofs_per_cell; copy_data.parameter_dof_indices.resize(copy_data.dofs_per_cell); - // get the global indices of the parameter dofs on this // parameter grid cell cell->get_dof_indices (copy_data.parameter_dof_indices); + // reset the output array to a pristine state + copy_data.global_parameter_representation.clear (); + // loop over all dofs on this cell and check whether they are // interesting for us for (unsigned int local_dof=0; local_dof<copy_data.dofs_per_cell; ++local_dof) if (coarse_fe.system_to_component_index(local_dof).first == - copy_data.coarse_component) + coarse_component) { // the how-many-th parameter is this on this cell? const unsigned int local_parameter_dof @@ -2263,19 +2255,21 @@ namespace DoFTools /** * This is a function that is called by the _2 function and that - * operates on one cell only. It is worked in parallel if + * operates on one cell only. It is worked in parallel if * multhithreading is available. */ template <int dim,int spacedim> - void copy_intergrid_weights_3(Assembler::CopyData<dim,spacedim> const ©_data, - FiniteElement<dim,spacedim> const &coarse_fe, + void copy_intergrid_weights_3(const Assembler::CopyData<dim,spacedim> ©_data, + const unsigned int coarse_component, + const FiniteElement<dim,spacedim> &coarse_fe, + const std::vector<types::global_dof_index> &weight_mapping, std::vector<std::map<types::global_dof_index, float> > &weights) { - unsigned int pos(0); + unsigned int pos = 0; for (unsigned int local_dof=0; local_dof<copy_data.dofs_per_cell; ++local_dof) if (coarse_fe.system_to_component_index(local_dof).first == - copy_data.coarse_component) + coarse_component) { // now that we've got the global representation of each // parameter dof, we've only got to clobber the non-zero @@ -2300,32 +2294,32 @@ namespace DoFTools // since it should happen rather rarely that there are // several threads operating on different intergrid // weights, have only one mutex for all of them - for (types::global_dof_index i=0; i<copy_data.global_parameter_representation[pos].size(); + for (types::global_dof_index i=0; i<copy_data.global_parameter_representation[pos].size(); ++i) // set this weight if it belongs to a parameter dof. - if (copy_data.weight_mapping[i] != numbers::invalid_dof_index) + if (weight_mapping[i] != numbers::invalid_dof_index) { // only overwrite old value if not by zero if (copy_data.global_parameter_representation[pos](i) != 0) { const types::global_dof_index wi = copy_data.parameter_dof_indices[local_dof], - wj = copy_data.weight_mapping[i]; + wj = weight_mapping[i]; weights[wi][wj] = copy_data.global_parameter_representation[pos](i); - }; + } } else Assert (copy_data.global_parameter_representation[pos](i) == 0, ExcInternalError()); ++pos; } - + } /** * This is a helper function that is used in the computation of - * integrid constraints. See the function for a thorough description + * intergrid constraints. See the function for a thorough description * of how it works. */ template <int dim, int spacedim> @@ -2339,25 +2333,25 @@ namespace DoFTools std::vector<std::map<types::global_dof_index,float> > &weights) { Assembler::Scratch scratch; - Assembler::CopyData<dim,spacedim> copy_data(coarse_component,weight_mapping); - - WorkStream::run(coarse_grid.begin_active(),coarse_grid.end(), - static_cast<std_cxx1x::function<void (typename dealii::DoFHandler<dim,spacedim> - ::active_cell_iterator const &,Assembler::Scratch const &,Assembler::CopyData<dim,spacedim> - &)> > ( - std_cxx1x::bind(&compute_intergrid_weights_3<dim,spacedim>, - std_cxx1x::_1, - std_cxx1x::_2, - std_cxx1x::_3, - std_cxx1x::cref(coarse_grid.get_fe()), - std_cxx1x::cref(coarse_to_fine_grid_map), - std_cxx1x::cref(parameter_dofs))), - static_cast<std_cxx1x::function<void (Assembler - ::CopyData<dim,spacedim> const &)> > ( - std_cxx1x::bind(©_intergrid_weights_3<dim,spacedim>, - std_cxx1x::_1, - std_cxx1x::cref(coarse_grid.get_fe()), - std_cxx1x::ref(weights))), + Assembler::CopyData<dim,spacedim> copy_data; + + WorkStream::run(coarse_grid.begin_active(), + coarse_grid.end(), + std_cxx1x::bind(&compute_intergrid_weights_3<dim,spacedim>, + std_cxx1x::_1, + std_cxx1x::_2, + std_cxx1x::_3, + coarse_component, + std_cxx1x::cref(coarse_grid.get_fe()), + std_cxx1x::cref(coarse_to_fine_grid_map), + std_cxx1x::cref(parameter_dofs), + std_cxx1x::cref(weight_mapping)), + std_cxx1x::bind(©_intergrid_weights_3<dim,spacedim>, + std_cxx1x::_1, + coarse_component, + std_cxx1x::cref(coarse_grid.get_fe()), + std_cxx1x::cref(weight_mapping), + std_cxx1x::ref(weights)), scratch, copy_data); } @@ -2870,16 +2864,16 @@ namespace DoFTools cell->at_boundary ()) { const FiniteElement<dim,spacedim> &fe = cell->get_fe(); - + // get global indices of dofs on the cell cell_dofs.resize (fe.dofs_per_cell); cell->get_dof_indices (cell_dofs); - + for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell; ++face_no) { const typename DH<dim,spacedim>::face_iterator face = cell->face(face_no); - + // if face is on the boundary and satisfies the correct // boundary id property if (face->at_boundary () @@ -2898,7 +2892,7 @@ namespace DoFTools { // Find out if a dof has a contribution in this // component, and if so, add it to the list - const std::vector<types::global_dof_index>::iterator it_index_on_cell + const std::vector<types::global_dof_index>::iterator it_index_on_cell = std::find (cell_dofs.begin(), cell_dofs.end(), face_dofs[i]); Assert (it_index_on_cell != cell_dofs.end(), ExcInvalidIterator()); const unsigned int index_on_cell = std::distance(cell_dofs.begin(), diff --git a/deal.II/source/fe/fe_values.cc b/deal.II/source/fe/fe_values.cc index a94336f669..23534addf4 100644 --- a/deal.II/source/fe/fe_values.cc +++ b/deal.II/source/fe/fe_values.cc @@ -1265,7 +1265,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1289,7 +1289,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1313,7 +1313,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1337,7 +1337,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1361,7 +1361,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1386,7 +1386,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1410,7 +1410,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1435,7 +1435,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1459,7 +1459,7 @@ namespace FEValuesViews typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get () != 0, ExcMessage ("FEValues object is not reinited to any cell")); AssertDimension (fe_function.size (), @@ -1482,7 +1482,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1506,7 +1506,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim,spacedim> FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (laplacians.size() == fe_values.n_quadrature_points, ExcDimensionMismatch(laplacians.size(), fe_values.n_quadrature_points)); Assert (fe_values.present_cell.get() != 0, @@ -1533,7 +1533,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim, spacedim> FVB; Assert(fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -1557,7 +1557,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim, spacedim> FVB; Assert(fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -1580,7 +1580,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim, spacedim> FVB; Assert(fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -1604,7 +1604,7 @@ namespace FEValuesViews { typedef FEValuesBase<dim, spacedim> FVB; Assert(fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -2575,7 +2575,8 @@ void FEValuesBase<dim,spacedim>::get_function_values ( const InputVector &fe_function, std::vector<number> &values) const { - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); AssertDimension (fe->n_components(), 1); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); @@ -2598,7 +2599,8 @@ void FEValuesBase<dim,spacedim>::get_function_values ( const VectorSlice<const std::vector<types::global_dof_index> > &indices, std::vector<number> &values) const { - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); AssertDimension (fe->n_components(), 1); AssertDimension (indices.size(), dofs_per_cell); @@ -2631,7 +2633,8 @@ void FEValuesBase<dim,spacedim>::get_function_values ( Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); // get function values of dofs on this cell @@ -2655,7 +2658,8 @@ void FEValuesBase<dim,spacedim>::get_function_values ( // number of function values is generated in each point. Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); VectorSlice<std::vector<Vector<number> > > val(values); if (indices.size() <= 100) @@ -2688,7 +2692,8 @@ void FEValuesBase<dim,spacedim>::get_function_values ( VectorSlice<std::vector<std::vector<double> > > values, bool quadrature_points_fastest) const { - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); // Size of indices must be a multiple of dofs_per_cell such that an integer // number of function values is generated in each point. @@ -2726,7 +2731,8 @@ FEValuesBase<dim,spacedim>::get_function_gradients ( const InputVector &fe_function, std::vector<Tensor<1,spacedim> > &gradients) const { - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); AssertDimension (fe->n_components(), 1); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); @@ -2748,7 +2754,8 @@ void FEValuesBase<dim,spacedim>::get_function_gradients ( const VectorSlice<const std::vector<types::global_dof_index> > &indices, std::vector<Tensor<1,spacedim> > &gradients) const { - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); AssertDimension (fe->n_components(), 1); AssertDimension (indices.size(), dofs_per_cell); if (dofs_per_cell <= 100) @@ -2779,7 +2786,8 @@ FEValuesBase<dim,spacedim>::get_function_gradients ( const InputVector &fe_function, std::vector<std::vector<Tensor<1,spacedim> > > &gradients) const { - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -2807,7 +2815,9 @@ void FEValuesBase<dim,spacedim>::get_function_gradients ( // number of function values is generated in each point. Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); + if (indices.size() <= 100) { double dof_values[100]; @@ -2840,7 +2850,8 @@ get_function_hessians (const InputVector &fe_function, std::vector<Tensor<2,spacedim> > &hessians) const { AssertDimension (fe->n_components(), 1); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -2861,8 +2872,8 @@ void FEValuesBase<dim,spacedim>::get_function_hessians ( const VectorSlice<const std::vector<types::global_dof_index> > &indices, std::vector<Tensor<2,spacedim> > &hessians) const { - Assert (this->update_flags & update_second_derivatives, - ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); AssertDimension (indices.size(), dofs_per_cell); if (dofs_per_cell <= 100) @@ -2894,7 +2905,8 @@ get_function_hessians (const InputVector &fe_function, std::vector<std::vector<Tensor<2,spacedim> > > &hessians, bool quadrature_points_fastest) const { - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -2918,8 +2930,8 @@ void FEValuesBase<dim, spacedim>::get_function_hessians ( VectorSlice<std::vector<std::vector<Tensor<2,spacedim> > > > hessians, bool quadrature_points_fastest) const { - Assert (this->update_flags & update_second_derivatives, - ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); if (indices.size() <= 100) @@ -2952,7 +2964,8 @@ void FEValuesBase<dim,spacedim>::get_function_laplacians ( const InputVector &fe_function, std::vector<number> &laplacians) const { - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe->n_components(), 1); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); @@ -2974,7 +2987,8 @@ void FEValuesBase<dim,spacedim>::get_function_laplacians ( const VectorSlice<const std::vector<types::global_dof_index> > &indices, std::vector<number> &laplacians) const { - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe->n_components(), 1); AssertDimension (indices.size(), dofs_per_cell); if (dofs_per_cell <= 100) @@ -3005,7 +3019,8 @@ void FEValuesBase<dim,spacedim>::get_function_laplacians ( { Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); // get function values of dofs on this cell @@ -3029,7 +3044,8 @@ void FEValuesBase<dim,spacedim>::get_function_laplacians ( // number of function values is generated in each point. Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); if (indices.size() <= 100) { double dof_values[100]; @@ -3064,7 +3080,8 @@ void FEValuesBase<dim,spacedim>::get_function_laplacians ( { Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); if (indices.size() <= 100) { double dof_values[100]; @@ -3104,7 +3121,7 @@ FEValuesBase<dim,spacedim>::get_normal_vectors () const { typedef FEValuesBase<dim,spacedim> FEVB; Assert (this->update_flags & update_normal_vectors, - typename FEVB::ExcAccessToUninitializedField()); + typename FEVB::ExcAccessToUninitializedField("update_normal_vectors")); return this->normal_vectors; } @@ -3356,6 +3373,37 @@ FEValues<dim,spacedim>::initialize (const UpdateFlags update_flags) } +namespace +{ + // Reset a std::auto_ptr. If we can, do not de-allocate the previously + // held memory but re-use it for the next item to avoid the repeated + // memory allocation. We do this because FEValues objects are heavily + // used in multithreaded contexts where memory allocations are evil. + template <typename Type, typename Pointer, typename Iterator> + void + reset_pointer_in_place_if_possible + (std::auto_ptr<Pointer> &present_cell, + const Iterator &new_cell) + { + // see if the existing pointer is non-null and if the type of + // the old object pointed to matches that of the one we'd + // like to create + if (present_cell.get() + && + (typeid(*present_cell.get()) == typeid(Type))) + { + // call destructor of the old object + static_cast<const Type*>(present_cell.get())->~Type(); + + // then construct a new object in-place + new(const_cast<void *>(static_cast<const void *>(present_cell.get()))) Type(new_cell); + } + else + // if the types don't match, there is nothing we can do here + present_cell.reset (new Type(new_cell)); + } +} + template <int dim, int spacedim> void FEValues<dim,spacedim>::reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell) @@ -3369,9 +3417,10 @@ void FEValues<dim,spacedim>::reinit (const typename Triangulation<dim,spacedim>: // care that old object gets // destroyed and also that this // object gets destroyed in the - // destruction of this class - this->present_cell.reset - (new typename FEValuesBase<dim,spacedim>::TriaCellIterator (cell)); + // destruction of the current object + reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator> + (this->present_cell, cell); + // this was the part of the work // that is dependent on the actual // data type of the iterator. now @@ -3403,10 +3452,9 @@ FEValues<dim,spacedim>::reinit (const TriaIterator<DoFCellAccessor<DH, lda> > ce // care that old object gets // destroyed and also that this // object gets destroyed in the - // destruction of this class - this->present_cell.reset - (new typename FEValuesBase<dim,spacedim>::template - CellIterator<TriaIterator<DoFCellAccessor<DH, lda> > > (cell)); + // destruction of the current object + reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template CellIterator<TriaIterator<DoFCellAccessor<DH, lda> > > > + (this->present_cell, cell); // this was the part of the work // that is dependent on the actual @@ -3482,7 +3530,7 @@ FEFaceValuesBase<dim,spacedim>::get_boundary_forms () const { typedef FEValuesBase<dim,spacedim> FEVB; Assert (this->update_flags & update_boundary_forms, - typename FEVB::ExcAccessToUninitializedField()); + typename FEVB::ExcAccessToUninitializedField("update_boundary_forms")); return this->boundary_forms; } @@ -3581,11 +3629,10 @@ FEFaceValues<dim,spacedim>::reinit (const TriaIterator<DoFCellAccessor<DH, lda> // care that old object gets // destroyed and also that this // object gets destroyed in the - // destruction of this class + // destruction of the current object this->maybe_invalidate_previous_present_cell (cell); - this->present_cell.reset - (new typename FEValuesBase<dim,spacedim>::template - CellIterator<TriaIterator<DoFCellAccessor<DH, lda> > > (cell)); + reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template CellIterator<TriaIterator<DoFCellAccessor<DH, lda> > > > + (this->present_cell, cell); // this was the part of the work // that is dependent on the actual @@ -3608,10 +3655,10 @@ void FEFaceValues<dim,spacedim>::reinit (const typename Triangulation<dim,spaced // care that old object gets // destroyed and also that this // object gets destroyed in the - // destruction of this class + // destruction of the current object this->maybe_invalidate_previous_present_cell (cell); - this->present_cell.reset - (new typename FEValuesBase<dim,spacedim>::TriaCellIterator (cell)); + reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator> + (this->present_cell, cell); // this was the part of the work // that is dependent on the actual @@ -3756,11 +3803,10 @@ void FESubfaceValues<dim,spacedim>::reinit (const TriaIterator<DoFCellAccessor<D // care that old object gets // destroyed and also that this // object gets destroyed in the - // destruction of this class + // destruction of the current object this->maybe_invalidate_previous_present_cell (cell); - this->present_cell.reset - (new typename FEValuesBase<dim,spacedim>::template - CellIterator<TriaIterator<DoFCellAccessor<DH, lda> > > (cell)); + reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::template CellIterator<TriaIterator<DoFCellAccessor<DH, lda> > > > + (this->present_cell, cell); // this was the part of the work // that is dependent on the actual @@ -3785,10 +3831,10 @@ void FESubfaceValues<dim,spacedim>::reinit (const typename Triangulation<dim,spa // care that old object gets // destroyed and also that this // object gets destroyed in the - // destruction of this class + // destruction of the current object this->maybe_invalidate_previous_present_cell (cell); - this->present_cell.reset - (new typename FEValuesBase<dim,spacedim>::TriaCellIterator (cell)); + reset_pointer_in_place_if_possible<typename FEValuesBase<dim,spacedim>::TriaCellIterator> + (this->present_cell, cell); // this was the part of the work // that is dependent on the actual diff --git a/deal.II/source/fe/mapping_cartesian.cc b/deal.II/source/fe/mapping_cartesian.cc index 814b0385df..6bf62d9315 100644 --- a/deal.II/source/fe/mapping_cartesian.cc +++ b/deal.II/source/fe/mapping_cartesian.cc @@ -604,7 +604,7 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_covariant: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d=0; d<dim; ++d) @@ -615,7 +615,7 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_contravariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d=0; d<dim; ++d) @@ -625,9 +625,9 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_piola: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d=0; d<dim; ++d) @@ -659,7 +659,7 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_covariant: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d1=0; d1<dim; ++d1) @@ -671,7 +671,7 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_contravariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d1=0; d1<dim; ++d1) @@ -683,7 +683,7 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_covariant_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d1=0; d1<dim; ++d1) @@ -695,7 +695,7 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_contravariant_gradient: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d1=0; d1<dim; ++d1) @@ -707,9 +707,9 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_piola: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d1=0; d1<dim; ++d1) @@ -746,9 +746,9 @@ MappingCartesian<dim,spacedim>::transform ( case mapping_piola_gradient: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements")); for (unsigned int i=0; i<output.size(); ++i) for (unsigned int d1=0; d1<dim; ++d1) diff --git a/deal.II/source/fe/mapping_q1.cc b/deal.II/source/fe/mapping_q1.cc index d6524930d8..69537d32b5 100644 --- a/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/source/fe/mapping_q1.cc @@ -1203,7 +1203,7 @@ void MappingQ1<dim,spacedim>::transform_fields( case mapping_contravariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) output[i] = apply_transformation(data.contravariant[i], input[i]); @@ -1214,10 +1214,13 @@ void MappingQ1<dim,spacedim>::transform_fields( case mapping_piola: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements")); Assert (rank==1, ExcMessage("Only for rank 1")); + if (rank!=1) + return; + for (unsigned int i=0; i<output.size(); ++i) { output[i] = apply_transformation(data.contravariant[i], input[i]); @@ -1233,7 +1236,7 @@ void MappingQ1<dim,spacedim>::transform_fields( case mapping_covariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) output[i] = apply_transformation(data.covariant[i], input[i]); @@ -1265,9 +1268,9 @@ void MappingQ1<dim,spacedim>::transform_gradients( case mapping_contravariant_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation")); Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (rank==2, ExcMessage("Only for rank 2")); for (unsigned int i=0; i<output.size(); ++i) @@ -1283,9 +1286,9 @@ void MappingQ1<dim,spacedim>::transform_gradients( case mapping_covariant_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation")); Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (rank==2, ExcMessage("Only for rank 2")); for (unsigned int i=0; i<output.size(); ++i) @@ -1305,11 +1308,11 @@ void MappingQ1<dim,spacedim>::transform_gradients( case mapping_piola_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_covariant_transformation")); Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_volume_elements")); Assert (rank==2, ExcMessage("Only for rank 2")); for (unsigned int i=0; i<output.size(); ++i) @@ -1353,7 +1356,7 @@ void MappingQ1<dim,spacedim>::transform_differential_forms( case mapping_covariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase<dim>::ExcAccessToUninitializedField()); + typename FEValuesBase<dim>::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i<output.size(); ++i) output[i] = apply_transformation(data.covariant[i], input[i]); @@ -1717,8 +1720,8 @@ transform_real_to_unit_cell_internal const double eps = 1.e-11; const unsigned int newton_iteration_limit = 20; - unsigned int newton_iteration=0; - double last_f_weighted_norm = -1./0.; + unsigned int newton_iteration = 0; + double last_f_weighted_norm; do { #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL diff --git a/deal.II/source/grid/grid_generator.cc b/deal.II/source/grid/grid_generator.cc index b129a9d711..158ef79423 100644 --- a/deal.II/source/grid/grid_generator.cc +++ b/deal.II/source/grid/grid_generator.cc @@ -2499,10 +2499,9 @@ namespace GridGenerator { // Determine number of cells and vertices const unsigned int - n_cells = static_cast<unsigned int>(std::floor (half_length / + n_cells = static_cast<unsigned int>(std::ceil (half_length / std::max (radius_0, - radius_1) + - 0.5)); + radius_1))); const unsigned int n_vertices = 4 * (n_cells + 1); std::vector<Point<3> > vertices_tmp(n_vertices); diff --git a/deal.II/source/grid/grid_tools.inst.in b/deal.II/source/grid/grid_tools.inst.in index 58602fe7cd..3d1076e57a 100644 --- a/deal.II/source/grid/grid_tools.inst.in +++ b/deal.II/source/grid/grid_tools.inst.in @@ -69,6 +69,20 @@ for (X : TRIANGULATION_AND_DOFHANDLERS; deal_II_dimension : DIMENSIONS ; deal_II } +for (deal_II_space_dimension : SPACE_DIMENSIONS) +{ + + parallel::distributed::Triangulation<deal_II_space_dimension>::active_cell_iterator + find_active_cell_around_point (const parallel::distributed::Triangulation<deal_II_space_dimension> &, + const Point<deal_II_space_dimension> &p); + + + std::pair<parallel::distributed::Triangulation<deal_II_space_dimension>::active_cell_iterator, Point<deal_II_space_dimension> > + find_active_cell_around_point (const Mapping<deal_II_space_dimension> &, + const parallel::distributed::Triangulation<deal_II_space_dimension> &, + const Point<deal_II_space_dimension> &); +} + for (deal_II_dimension : DIMENSIONS ; deal_II_space_dimension : SPACE_DIMENSIONS) { diff --git a/deal.II/source/lac/constraint_matrix.cc b/deal.II/source/lac/constraint_matrix.cc index 4c1a7e8fac..5ace029bd2 100644 --- a/deal.II/source/lac/constraint_matrix.cc +++ b/deal.II/source/lac/constraint_matrix.cc @@ -1549,7 +1549,7 @@ bool ConstraintMatrix::is_identity_constrained (const size_type index) const bool ConstraintMatrix::are_identity_constrained (const size_type index1, - const size_type index2) const + const size_type index2) const { if (is_constrained(index1) == true) { @@ -1559,8 +1559,8 @@ bool ConstraintMatrix::are_identity_constrained (const size_type index1, // return if an entry for this line was found and if it has only one // entry equal to 1.0 and that one is index2 return ((p.entries.size() == 1) && - (p.entries[0].first == index2) && - (p.entries[0].second == 1.0)); + (p.entries[0].first == index2) && + (p.entries[0].second == 1.0)); } else if (is_constrained(index2) == true) { @@ -1570,8 +1570,8 @@ bool ConstraintMatrix::are_identity_constrained (const size_type index1, // return if an entry for this line was found and if it has only one // entry equal to 1.0 and that one is index1 return ((p.entries.size() == 1) && - (p.entries[0].first == index1) && - (p.entries[0].second == 1.0)); + (p.entries[0].first == index1) && + (p.entries[0].second == 1.0)); } else return false; @@ -1675,6 +1675,31 @@ ConstraintMatrix::memory_consumption () const +void +ConstraintMatrix::resolve_indices (std::vector<types::global_dof_index> &indices) const +{ + const unsigned int indices_size = indices.size(); + const std::vector<std::pair<types::global_dof_index,double> > * line_ptr; + for (unsigned int i=0; i<indices_size; ++i) + { + line_ptr = get_constraint_entries(indices[i]); + // if the index is constraint, the constraints indices are added to the + // indices vector + if (line_ptr!=NULL) + { + const unsigned int line_size = line_ptr->size(); + for (unsigned int j=0; j<line_size; ++j) + indices.push_back((*line_ptr)[j].first); + } + } + + // keep only the unique elements + std::sort(indices.begin(),indices.end()); + std::vector<types::global_dof_index>::iterator it; + it = std::unique(indices.begin(),indices.end()); + indices.resize(it-indices.begin()); +} + // explicit instantiations diff --git a/deal.II/source/lac/sparse_direct.cc b/deal.II/source/lac/sparse_direct.cc index ed801cea31..4333b64fa1 100644 --- a/deal.II/source/lac/sparse_direct.cc +++ b/deal.II/source/lac/sparse_direct.cc @@ -25,6 +25,7 @@ #include <iostream> #include <list> #include <typeinfo> +#include <vector> DEAL_II_NAMESPACE_OPEN @@ -513,6 +514,9 @@ SparseDirectMUMPS::~SparseDirectMUMPS () template <class Matrix> void SparseDirectMUMPS::initialize_matrix (const Matrix &matrix) { + Assert(matrix.n() == matrix.m(), ExcMessage("Matrix needs to be square.")); + + // Check we haven't been here before: Assert (initialize_called == false, ExcInitializeAlreadyCalled()); @@ -586,27 +590,35 @@ void SparseDirectMUMPS::initialize (const Matrix &matrix, // Hand over matrix and right-hand side initialize_matrix (matrix); + copy_rhs_to_mumps(vector); +} + +void SparseDirectMUMPS::copy_rhs_to_mumps(const Vector<double> &new_rhs) +{ + Assert(n == new_rhs.size(), ExcMessage("Matrix size and rhs length must be equal.")); + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { - // Object denoting a MUMPS data structure - rhs = new double[n]; - + rhs.resize(n); for (size_type i = 0; i < n; ++i) - rhs[i] = vector (i); + rhs[i] = new_rhs (i); - id.rhs = rhs; + id.rhs = &rhs[0]; } } void SparseDirectMUMPS::copy_solution (Vector<double> &vector) { + Assert(n == vector.size(), ExcMessage("Matrix size and solution vector length must be equal.")); + Assert(n == rhs.size(), ExcMessage("Class not initialized with a rhs vector.")); + // Copy solution into the given vector if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { for (size_type i=0; i<n; ++i) vector(i) = rhs[i]; - delete[] rhs; + rhs.resize(0); // remove rhs again } } @@ -622,6 +634,10 @@ void SparseDirectMUMPS::initialize (const Matrix &matrix) void SparseDirectMUMPS::solve (Vector<double> &vector) { + //TODO: this could be implemented similar to SparseDirectUMFPACK where + // the given vector will be used as the RHS. Sadly, there is no easy + // way to do this without breaking the interface. + // Check that the solver has been initialized by the routine above: Assert (initialize_called == true, ExcNotInitialized()); @@ -629,7 +645,7 @@ void SparseDirectMUMPS::solve (Vector<double> &vector) Assert (nz != 0, ExcNotInitialized()); // Start solver - id.job = 6; + id.job = 6; // 6 = analysis, factorization, and solve dmumps_c (&id); copy_solution (vector); } @@ -643,17 +659,11 @@ void SparseDirectMUMPS::vmult (Vector<double> &dst, // and that the matrix has at least one nonzero element: Assert (nz != 0, ExcNotInitialized()); - // Hand over right-hand side - if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) - { - // Object denoting a MUMPS data structure: - rhs = new double[n]; - - for (size_type i = 0; i < n; ++i) - rhs[i] = src (i); + Assert(n == dst.size(), ExcMessage("Destination vector has the wrong size.")); + Assert(n == src.size(), ExcMessage("Source vector has the wrong size.")); - id.rhs = rhs; - } + // Hand over right-hand side + copy_rhs_to_mumps(src); // Start solver id.job = 3; @@ -691,7 +701,9 @@ InstantiateUMFPACK(BlockSparseMatrix<float>) #ifdef DEAL_II_WITH_MUMPS #define InstantiateMUMPS(MATRIX) \ template \ - void SparseDirectMUMPS::initialize (const MATRIX &, const Vector<double> &); + void SparseDirectMUMPS::initialize (const MATRIX &, const Vector<double> &);\ + template \ + void SparseDirectMUMPS::initialize (const MATRIX &); InstantiateMUMPS(SparseMatrix<double>) InstantiateMUMPS(SparseMatrix<float>) diff --git a/deal.II/source/numerics/data_out.cc b/deal.II/source/numerics/data_out.cc index 816a41f320..d242eaa816 100644 --- a/deal.II/source/numerics/data_out.cc +++ b/deal.II/source/numerics/data_out.cc @@ -55,15 +55,6 @@ namespace internal false), cell_to_patch_index_map (&cell_to_patch_index_map) {} - - - - /** - * Dummy function used for WorkStream. - */ - template <int dim, int spacedim> - void - copy(const DataOutBase::Patch<dim,spacedim> &patch) {} } } @@ -306,7 +297,7 @@ build_one_patch (const std::pair<cell_iterator, unsigned int> *cell_and_index, (*data.cell_to_patch_index_map)[cell_and_index->first->level()][cell_and_index->first->index()]; // did we mess up the indices? Assert(patch_idx < patches.size(), ExcInternalError()); - + // Put the patch in the patches vector patches[patch_idx] = patch; patches[patch_idx].patch_index = patch_idx; @@ -460,10 +451,18 @@ void DataOut<dim,DH>::build_patches (const Mapping<DH::dimension,DH::space_dimen std_cxx1x::bind(&DataOut<dim,DH>::build_one_patch, this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, curved_cell_region,std_cxx1x::ref(this->patches)), - std_cxx1x::bind(&internal::DataOut::copy<dim,DH::space_dimension>, - std_cxx1x::_1), + // no copy-local-to-global function needed here + std_cxx1x::function<void (const ::dealii::DataOutBase::Patch<DH::dimension, DH::space_dimension> &)>(), thread_data, - sample_patch); + sample_patch, + // experimenting shows that we can make things run a bit + // faster if we increase the number of cells we work on + // per item (i.e., WorkStream's chunk_size argument, + // about 10% improvement) and the items in flight at any + // given time (another 5% on the testcase discussed in + // @ref workstream_paper, on 32 cores) and if + 8*multithread_info.n_threads(), + 64); } diff --git a/deal.II/source/numerics/derivative_approximation.cc b/deal.II/source/numerics/derivative_approximation.cc index e1358c3abb..79884b4258 100644 --- a/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/source/numerics/derivative_approximation.cc @@ -79,8 +79,6 @@ namespace internal { CopyData() {} }; - - void copier(CopyData const &) {} } } @@ -669,9 +667,8 @@ approximate_derivative (const Mapping<dim,spacedim> &mapping, std_cxx1x::cref(mapping), std_cxx1x::cref(dof_handler), std_cxx1x::cref(solution),component)), - static_cast<std_cxx1x::function<void (internal::Assembler::CopyData const &)> > - (internal::Assembler::copier),internal::Assembler::Scratch (), - internal::Assembler::CopyData ()); + std_cxx1x::function<void (internal::Assembler::CopyData const &)> (), + internal::Assembler::Scratch (),internal::Assembler::CopyData ()); } diff --git a/deal.II/source/numerics/vector_tools_interpolate.inst.in b/deal.II/source/numerics/vector_tools_interpolate.inst.in index e44dd85c4e..bbc0d6b237 100644 --- a/deal.II/source/numerics/vector_tools_interpolate.inst.in +++ b/deal.II/source/numerics/vector_tools_interpolate.inst.in @@ -22,7 +22,7 @@ for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimens template void interpolate - (const Mapping<DoFHandler<deal_II_dimension,deal_II_space_dimension>::dimension,DoFHandler<deal_II_dimension,deal_II_space_dimension>::space_dimension>&, + (const Mapping<deal_II_dimension,deal_II_space_dimension> &, const DoFHandler<deal_II_dimension,deal_II_space_dimension>&, const Function<deal_II_space_dimension>&, VEC&); diff --git a/deal.II/tests/CMakeLists.txt b/deal.II/tests/CMakeLists.txt index 14d41b5410..44787e72f4 100644 --- a/deal.II/tests/CMakeLists.txt +++ b/deal.II/tests/CMakeLists.txt @@ -14,7 +14,13 @@ ## ## --------------------------------------------------------------------- -IF(NOT DEFINED DEAL_II_BINARY_DIR) +# +# This is a small project that provides some custom targets that need a +# working, independent subproject because they are called back during +# configure phase. +# + +IF(NOT DEFINED TEST_DIR) MESSAGE(FATAL_ERROR "\n The testsuite cannot be set up as an independent project. Please configure \"deal.II\" directly instead.\n\n" @@ -24,39 +30,16 @@ ENDIF() CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) PROJECT(testsuite NONE) -# -# This is a small project that provides some custom targets that need a -# working, independent subproject because they are called back during -# configure phase. -# - -# Setup tests: -ADD_CUSTOM_TARGET(setup_tests - COMMAND ${CMAKE_COMMAND} - --build ${DEAL_II_BINARY_DIR} --target setup_tests - ) - # Regenerate tests (run "make rebuild_cache" in subprojects): ADD_CUSTOM_TARGET(regen_tests) # Clean all tests ADD_CUSTOM_TARGET(clean_tests) -# Remove all tests: -ADD_CUSTOM_TARGET(prune_tests) - -# -# Glob together a list of all subfolders to set up: -# - FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*) SET(_categories all-headers build_tests mesh_converter ${_categories}) LIST(REMOVE_DUPLICATES _categories) -# -# Define a subproject for every enabled category: -# - FOREACH(_category ${_categories}) IF( EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt OR EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt ) @@ -73,11 +56,5 @@ FOREACH(_category ${_categories}) ) ADD_DEPENDENCIES(clean_tests clean_tests_${_category}) - ADD_CUSTOM_TARGET(prune_tests_${_category} - COMMAND ${CMAKE_COMMAND} -E remove_directory - ${CMAKE_BINARY_DIR}/${_category} - ) - ADD_DEPENDENCIES(prune_tests prune_tests_${_category}) - ENDIF() ENDFOREACH() -- 2.39.5