From aab10dd77295f9673d06779ae7dc035b8910d630 Mon Sep 17 00:00:00 2001
From: heltai
Date: Wed, 20 Nov 2013 20:01:09 +0000
Subject: [PATCH] Merged from trunk to branch manifold_id
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@31736 0785d39b-7218-0410-832d-ea1e28bc413d
---
deal.II/CMakeLists.txt | 2 +-
.../macro_deal_ii_invoke_autopilot.cmake | 40 +
deal.II/cmake/scripts/run_testsuite.cmake | 25 +-
deal.II/cmake/setup_testsubproject.cmake | 128 +
deal.II/cmake/setup_testsuite.cmake | 190 +-
deal.II/doc/developers/testsuite.html | 44 +
deal.II/doc/doxygen/headers/glossary.h | 11 +
deal.II/doc/news/changes.h | 7 +
deal.II/doc/publications/index.html | 14 +
deal.II/include/deal.II/base/exceptions.h | 31 +-
deal.II/include/deal.II/base/graph_coloring.h | 3 +
deal.II/include/deal.II/base/work_stream.h | 26 +-
deal.II/include/deal.II/dofs/dof_handler.h | 28 +-
.../include/deal.II/dofs/dof_handler_policy.h | 22 -
deal.II/include/deal.II/fe/fe_values.h | 3295 ++++++-----------
deal.II/include/deal.II/lac/slepc_solver.h | 2 +-
deal.II/include/deal.II/lac/solver_control.h | 52 +
.../deal.II/numerics/vector_tools.templates.h | 10 +-
deal.II/source/base/exceptions.cc | 99 +-
deal.II/source/dofs/dof_handler.cc | 17 +
deal.II/source/dofs/dof_handler.inst.in | 5 +
deal.II/source/dofs/dof_handler_policy.cc | 17 +-
deal.II/source/dofs/dof_tools_constraints.cc | 28 +-
deal.II/source/grid/grid_generator.inst.in | 11 +-
deal.II/source/lac/solver_control.cc | 37 +
deal.II/tests/CMakeLists.txt | 124 +-
deal.II/tests/all-headers/CMakeLists.txt | 2 +-
deal.II/tests/build_tests/CMakeLists.txt | 2 +-
deal.II/tests/mesh_converter/CMakeLists.txt | 2 +-
29 files changed, 1727 insertions(+), 2547 deletions(-)
create mode 100644 deal.II/cmake/setup_testsubproject.cmake
diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt
index c5e09474bc..4caaebe4c8 100644
--- a/deal.II/CMakeLists.txt
+++ b/deal.II/CMakeLists.txt
@@ -145,7 +145,7 @@ ADD_SUBDIRECTORY(cmake/config) # has to be included after source
ADD_SUBDIRECTORY(contrib) # has to be included after source
ADD_SUBDIRECTORY(examples)
-ADD_SUBDIRECTORY(tests)
+INCLUDE(setup_testsuite)
#
# And finally, print the configuration:
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 29867f93f8..46a05912e0 100644
--- a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
+++ b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
@@ -71,7 +71,9 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT)
SET(_command
${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
)
+
ELSE()
+
SET(_command ${TARGET_RUN})
ENDIF()
@@ -86,6 +88,44 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT)
)
ENDIF()
+
+ #
+ # Provide a target to sign the generated executable with a Mac OSX
+ # developer key. This avoids problems with an enabled firewall and MPI
+ # tasks that need networking.
+ #
+
+ IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ IF(DEFINED OSX_CERTIFICATE_NAME)
+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/${TARGET}.signed
+ COMMAND codesign -f -s ${OSX_CERTIFICATE_NAME} ${TARGET}
+ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/${TARGET}.signed
+ COMMENT "Digitally signing ${TARGET}"
+ DEPENDS ${TARGET}
+ VERBATIM
+ )
+ ADD_CUSTOM_TARGET(sign ALL
+ DEPENDS ${CMAKE_BINARY_DIR}/${TARGET}.signed
+ )
+ ADD_DEPENDENCIES(run sign)
+ ELSE()
+ ADD_CUSTOM_TARGET(sign
+ COMMAND
+ ${CMAKE_COMMAND} -E echo ''
+ && ${CMAKE_COMMAND} -E echo '***************************************************************************'
+ && ${CMAKE_COMMAND} -E echo '** Error: No Mac OSX developer certificate specified'
+ && ${CMAKE_COMMAND} -E echo '** Please reconfigure with -DOSX_CERTIFICATE_NAME="<...>"'
+ && ${CMAKE_COMMAND} -E echo '***************************************************************************'
+ && ${CMAKE_COMMAND} -E echo ''
+ COMMENT "Digitally signing ${TARGET}"
+ )
+ ENDIF()
+
+ SET(_run_targets
+ "${_run_targets}#\n# $ make sign - to sign the executable with the supplied OSX developer key\n"
+ )
+ ENDIF()
+
# Define custom targets to easily switch the build type:
ADD_CUSTOM_TARGET(debug
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
diff --git a/deal.II/cmake/scripts/run_testsuite.cmake b/deal.II/cmake/scripts/run_testsuite.cmake
index e952fb81cb..f835123a1c 100644
--- a/deal.II/cmake/scripts/run_testsuite.cmake
+++ b/deal.II/cmake/scripts/run_testsuite.cmake
@@ -86,6 +86,9 @@
# CTEST_COVERAGE() stage will be run. Test results must go into the
# "Experimental" section.
#
+# MAKEOPTS
+# - Additional options that will be passed directly to make (or ninja).
+#
# Furthermore, the following variables controlling the testsuite can be set
# and will be automatically handed down to cmake:
#
@@ -162,10 +165,12 @@ IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "")
#
SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- IF( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIRECTORY}")
+ IF( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIRECTORY}"
+ AND NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeCache.txt )
MESSAGE(FATAL_ERROR "
-ctest was invoked in the source directory (or test source directory) and CTEST_BINARY_DIRECTORY is not set.
-Please either call ctest from within a designated build directory, or set CTEST_BINARY_DIRECTORY accordingly.
+ctest was invoked in the source directory and CTEST_BINARY_DIRECTORY is not
+set. Please either call ctest from within a designated build directory, or
+set CTEST_BINARY_DIRECTORY accordingly.
"
)
ENDIF()
@@ -252,6 +257,10 @@ ENDIF()
# Assemble configuration options, we need it now:
#
+IF("${MAKEOPTS}" STREQUAL "")
+ SET(MAKEOPTS $ENV{MAKEOPTS})
+ENDIF()
+
IF(NOT "${CONFIG_FILE}" STREQUAL "")
SET(_options "-C${CONFIG_FILE}")
ENDIF()
@@ -270,6 +279,7 @@ FOREACH(_var ${_variables})
_var MATCHES "^(UMFPACK|ZLIB|LAPACK)_" OR
_var MATCHES "^(CMAKE|DEAL_II)_(C|CXX|Fortran|BUILD)_(COMPILER|FLAGS)" OR
_var MATCHES "^CMAKE_BUILD_TYPE$" OR
+ _var MATCHES "MAKEOPTS" OR
( NOT _var MATCHES "^[_]*CMAKE" AND _var MATCHES "_DIR$" ) )
LIST(APPEND _options "-D${_var}=${${_var}}")
ENDIF()
@@ -498,7 +508,11 @@ MACRO(CLEAR_TARGETDIRECTORIES_TXT)
)
ENDMACRO()
-MESSAGE("-- CMake Options: ${_options}")
+MESSAGE("-- CMake Options: ${_options}")
+
+IF(NOT "${MAKEOPTS}" STREQUAL "")
+ MESSAGE("-- MAKEOPTS: ${MAKEOPTS}")
+ENDIF()
########################################################################
@@ -520,7 +534,7 @@ IF("${_res}" STREQUAL "0")
# Only run the build stage if configure was successful:
MESSAGE("-- Running CTEST_BUILD()")
- CTEST_BUILD(TARGET NUMBER_ERRORS _res)
+ CTEST_BUILD(TARGET ${MAKEOPTS} NUMBER_ERRORS _res)
IF("${_res}" STREQUAL "0")
# Only run tests if the build was successful:
@@ -528,6 +542,7 @@ IF("${_res}" STREQUAL "0")
MESSAGE("-- Running make setup_tests")
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
--build ${CTEST_BINARY_DIRECTORY} --target setup_tests
+ -- ${MAKEOPTS}
OUTPUT_QUIET RESULT_VARIABLE _res
)
IF(NOT "${_res}" STREQUAL "0")
diff --git a/deal.II/cmake/setup_testsubproject.cmake b/deal.II/cmake/setup_testsubproject.cmake
new file mode 100644
index 0000000000..e40a167517
--- /dev/null
+++ b/deal.II/cmake/setup_testsubproject.cmake
@@ -0,0 +1,128 @@
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# Setup necessary configuration in the testsuite subprojects.
+# This file is directly included by the test subprojects and not by the
+# main project.
+#
+# It is assumed that the following variables are set:
+#
+# DEAL_II_BINARY_DIR
+# DEAL_II_SOURCE_DIR
+# - pointing to a source and binary directory of a deal.II build
+#
+# This file sets up the following options, that can be overwritten by
+# environment or command line:
+#
+# TEST_DIFF
+# TEST_OVERRIDE_LOCATION
+# TEST_PICKUP_REGEX
+# TEST_TIME_LIMIT
+#
+
+#
+# Load all macros:
+#
+FILE(GLOB _macro_files ${DEAL_II_SOURCE_DIR}/cmake/macros/*.cmake)
+FOREACH(_file ${_macro_files})
+ INCLUDE(${_file})
+ENDFOREACH()
+
+#
+# Pick up values from environment:
+#
+FOREACH(_var
+ DEAL_II_BINARY_DIR
+ DEAL_II_SOURCE_DIR
+ TEST_DIFF
+ TEST_TIME_LIMIT
+ TEST_PICKUP_REGEX
+ TEST_OVERRIDE_LOCATION
+ )
+ # Environment wins:
+ IF(DEFINED ENV{${_var}})
+ SET(${_var} $ENV{${_var}})
+ ENDIF()
+ IF(NOT "${_var}" STREQUAL "")
+ SET(${_var} "${${_var}}" CACHE STRING "")
+ ENDIF()
+ENDFOREACH()
+
+#
+# We need deal.II and Perl as external packages:
+#
+
+FIND_PACKAGE(deal.II 8.0 REQUIRED
+ HINTS ${DEAL_II_BINARY_DIR} ${DEAL_II_DIR}
+ )
+SET(CMAKE_CXX_COMPILER ${DEAL_II_CXX_COMPILER} CACHE STRING "CXX Compiler.")
+
+FIND_PACKAGE(Perl REQUIRED)
+
+#
+# We need a diff tool, preferably numdiff:
+#
+
+FIND_PROGRAM(DIFF_EXECUTABLE
+ NAMES diff
+ HINTS ${DIFF_DIR}
+ PATH_SUFFIXES bin
+ )
+
+FIND_PROGRAM(NUMDIFF_EXECUTABLE
+ NAMES numdiff
+ HINTS ${NUMDIFF_DIR}
+ PATH_SUFFIXES bin
+ )
+
+MARK_AS_ADVANCED(DIFF_EXECUTABLE NUMDIFF_EXECUTABLE)
+
+IF("${TEST_DIFF}" STREQUAL "")
+ #
+ # No TEST_DIFF is set, specify one:
+ #
+
+ IF(NOT NUMDIFF_EXECUTABLE MATCHES "-NOTFOUND")
+ SET(TEST_DIFF ${NUMDIFF_EXECUTABLE} -a 1e-6 -r 1e-8 -s ' \\t\\n:')
+ ELSEIF(NOT DIFF_EXECUTABLE MATCHES "-NOTFOUND")
+ SET(TEST_DIFF ${DIFF_EXECUTABLE})
+ ELSE()
+ MESSAGE(FATAL_ERROR
+ "Could not find diff or numdiff. One of those are required for running the testsuite.\n"
+ "Please specify TEST_DIFF by hand."
+ )
+ ENDIF()
+ENDIF()
+
+#
+# Set a default time limit of 600 seconds:
+#
+
+SET_IF_EMPTY(TEST_TIME_LIMIT 600)
+
+#
+# And finally, enable testing:
+#
+
+ENABLE_TESTING()
+
+#
+# A custom target that does absolutely nothing. It is used in the main
+# project to trigger a "make rebuild_cache" if necessary.
+#
+
+ADD_CUSTOM_TARGET(regenerate)
diff --git a/deal.II/cmake/setup_testsuite.cmake b/deal.II/cmake/setup_testsuite.cmake
index e40a167517..23b0de2f46 100644
--- a/deal.II/cmake/setup_testsuite.cmake
+++ b/deal.II/cmake/setup_testsuite.cmake
@@ -15,114 +15,150 @@
## ---------------------------------------------------------------------
#
-# Setup necessary configuration in the testsuite subprojects.
-# This file is directly included by the test subprojects and not by the
-# main project.
+# This is a bloody hack to avoid a severe performance penalty when using
+# 12k top level targets with GNU Make that really does not like that...
#
-# It is assumed that the following variables are set:
-#
-# DEAL_II_BINARY_DIR
-# DEAL_II_SOURCE_DIR
-# - pointing to a source and binary directory of a deal.II build
-#
-# This file sets up the following options, that can be overwritten by
-# environment or command line:
-#
-# TEST_DIFF
-# TEST_OVERRIDE_LOCATION
-# TEST_PICKUP_REGEX
-# TEST_TIME_LIMIT
+# The only choice we have is to set up every test subdirectory as an
+# independent project. Unfortunately this adds quite a significant amount
+# of complexity :-(
#
#
-# Load all macros:
+# Setup the testsuite.
#
-FILE(GLOB _macro_files ${DEAL_II_SOURCE_DIR}/cmake/macros/*.cmake)
-FOREACH(_file ${_macro_files})
- INCLUDE(${_file})
-ENDFOREACH()
-#
-# Pick up values from environment:
-#
-FOREACH(_var
- DEAL_II_BINARY_DIR
- DEAL_II_SOURCE_DIR
- TEST_DIFF
- TEST_TIME_LIMIT
- TEST_PICKUP_REGEX
- TEST_OVERRIDE_LOCATION
+SET_IF_EMPTY(MAKEOPTS $ENV{MAKEOPTS})
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "Setup testsuite with TEST_DIR ${TEST_DIR}")
+
+ADD_SUBDIRECTORY(
+ ${CMAKE_SOURCE_DIR}/tests/quick_tests
+ ${CMAKE_BINARY_DIR}/tests/quick_tests
)
- # Environment wins:
- IF(DEFINED ENV{${_var}})
- SET(${_var} $ENV{${_var}})
- ENDIF()
- IF(NOT "${_var}" STREQUAL "")
- SET(${_var} "${${_var}}" CACHE STRING "")
- ENDIF()
-ENDFOREACH()
#
-# We need deal.II and Perl as external packages:
+# Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR and
+# CMAKE_BINARY_DIR/tests:
#
-FIND_PACKAGE(deal.II 8.0 REQUIRED
- HINTS ${DEAL_II_BINARY_DIR} ${DEAL_II_DIR}
+FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
+ "SUBDIRS(tests)"
)
-SET(CMAKE_CXX_COMPILER ${DEAL_II_CXX_COMPILER} CACHE STRING "CXX Compiler.")
-FIND_PACKAGE(Perl REQUIRED)
+FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
+FILE(WRITE ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake "")
#
-# We need a diff tool, preferably numdiff:
+# Custom targets to set and clean up the testsuite:
#
-FIND_PROGRAM(DIFF_EXECUTABLE
- NAMES diff
- HINTS ${DIFF_DIR}
- PATH_SUFFIXES bin
+# Setup tests:
+ADD_CUSTOM_TARGET(setup_tests)
+
+# Regenerate tests (run "make rebuild_cache" in subprojects):
+ADD_CUSTOM_TARGET(regen_tests
+ COMMAND ${CMAKE_COMMAND}
+ --build ${CMAKE_BINARY_DIR}/tests --target regen_tests
+ -- ${MAKEOPTS}
)
-FIND_PROGRAM(NUMDIFF_EXECUTABLE
- NAMES numdiff
- HINTS ${NUMDIFF_DIR}
- PATH_SUFFIXES bin
+# Clean all tests
+ADD_CUSTOM_TARGET(clean_tests
+ COMMAND ${CMAKE_COMMAND}
+ --build ${CMAKE_BINARY_DIR}/tests --target clean_tests
+ -- ${MAKEOPTS}
)
-MARK_AS_ADVANCED(DIFF_EXECUTABLE NUMDIFF_EXECUTABLE)
+# Remove all tests:
+ADD_CUSTOM_TARGET(prune_tests
+ COMMAND ${CMAKE_COMMAND}
+ --build ${CMAKE_BINARY_DIR}/tests --target prune_tests
+ -- ${MAKEOPTS}
+ )
-IF("${TEST_DIFF}" STREQUAL "")
- #
- # No TEST_DIFF is set, specify one:
- #
-
- IF(NOT NUMDIFF_EXECUTABLE MATCHES "-NOTFOUND")
- SET(TEST_DIFF ${NUMDIFF_EXECUTABLE} -a 1e-6 -r 1e-8 -s ' \\t\\n:')
- ELSEIF(NOT DIFF_EXECUTABLE MATCHES "-NOTFOUND")
- SET(TEST_DIFF ${DIFF_EXECUTABLE})
- ELSE()
- MESSAGE(FATAL_ERROR
- "Could not find diff or numdiff. One of those are required for running the testsuite.\n"
- "Please specify TEST_DIFF by hand."
- )
- ENDIF()
-ENDIF()
+MESSAGE(STATUS "Setup testsuite")
#
-# Set a default time limit of 600 seconds:
+# Setup the testsuite project: It is merely a wrapper around the individual
+# regen_tests_*, clean_tests_* and prune_tests_* targets.
+# down to it:
#
-SET_IF_EMPTY(TEST_TIME_LIMIT 600)
+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
+ OUTPUT_QUIET
+ )
+
+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
+ TEST_TIME_LIMIT
+ )
+ # always undefine:
+ LIST(APPEND _options "-U${_var}")
+ IF(DEFINED ${_var})
+ LIST(APPEND _options "-D${_var}=${${_var}}")
+ ENDIF()
+ENDFOREACH()
#
-# And finally, enable testing:
+# Glob together a list of all subfolders to set up:
#
-ENABLE_TESTING()
+FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*)
+SET(_categories all-headers build_tests mesh_converter ${_categories})
+LIST(REMOVE_DUPLICATES _categories)
#
-# A custom target that does absolutely nothing. It is used in the main
-# project to trigger a "make rebuild_cache" if necessary.
+# Define a subproject for every enabled category:
#
-ADD_CUSTOM_TARGET(regenerate)
+FOREACH(_category ${_categories})
+ IF(EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt)
+ SET(_category_dir ${CMAKE_SOURCE_DIR}/tests/${_category})
+ ELSEIF(EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt)
+ SET(_category_dir ${TEST_DIR}/${_category})
+ ELSE()
+ SET(_category_dir)
+ ENDIF()
+
+ IF(NOT "${_category_dir}" STREQUAL "")
+ ADD_CUSTOM_TARGET(setup_tests_${_category}
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ ${CMAKE_BINARY_DIR}/tests/${_category}
+ COMMAND cd ${CMAKE_BINARY_DIR}/tests/${_category} &&
+ ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir}
+ > /dev/null
+ DEPENDS ${_category_dir}
+ COMMENT "Processing tests/${_category}"
+ )
+ ADD_DEPENDENCIES(setup_tests setup_tests_${_category})
+
+ FILE(APPEND ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake
+ "SUBDIRS(${_category})\n"
+ )
+ ENDIF()
+ENDFOREACH()
+MESSAGE(STATUS "Setup testsuite - Done")
+
+MESSAGE(STATUS "Regenerating testsuite subprojects")
+EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND}
+ --build ${CMAKE_BINARY_DIR}/tests --target regen_tests
+ -- ${MAKEOPTS}
+ OUTPUT_QUIET
+ )
+MESSAGE(STATUS "Regenerating testsuite subprojects - Done")
+
+MESSAGE(STATUS "")
diff --git a/deal.II/doc/developers/testsuite.html b/deal.II/doc/developers/testsuite.html
index c2691aa449..a77a74b014 100644
--- a/deal.II/doc/developers/testsuite.html
+++ b/deal.II/doc/developers/testsuite.html
@@ -55,6 +55,7 @@
Running the testsuite
- How to interpret the output
+ - Parallelize testsuite configuration
Testsuite development
@@ -65,6 +66,7 @@
- Tests with binary output
- Changing condition for success
- Adding new tests
+ - Adding new categories
Submitting test results
Build tests
@@ -348,6 +350,26 @@
+
+ Parallelize testsuite configuration
+
+
+ If you have set up a good portion of the testsuite you'll notice that a
+ reconfiguration of the build directory takes a noticeable time (in the
+ order of minutes instead of seconds) with
+ Reconfiguring testsuite subprojects
.
+ By default (with the "Unix Makefiles" generator) this is due to the
+ fact that the reconfiguration processes the subprojects sequentally.
+ If you want to increase the parallelism, specify e.g.
+ MAKEOPTS="-j8"
as environment variable or as CMake
+ variable.
+
+
+ Alternatively, you can use Ninja
.
+
+
+
+
Testsuite development
@@ -684,6 +706,25 @@ int main ()
+
+ Adding new categories
+
+
+ If you want to create a new category in the testsuite, create an new
+ 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()
+
+
+
+
Submitting test results
@@ -760,6 +801,9 @@ int main ()
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
.
diff --git a/deal.II/doc/doxygen/headers/glossary.h b/deal.II/doc/doxygen/headers/glossary.h
index d2e256d624..2e3fda1ce7 100644
--- a/deal.II/doc/doxygen/headers/glossary.h
+++ b/deal.II/doc/doxygen/headers/glossary.h
@@ -1340,6 +1340,17 @@ Article{JK10,
* @note The usual warning about the missing type safety of @p void pointers are
* obviously in place here; responsibility for correctness of types etc
* lies entirely with the user of the pointer.
+ *
+ *
+ * @anchor workstream_paper %WorkStream paper
+ * The "%WorkStream paper" is a paper by B. Turcksin, M. Kronbichler and W. Bangerth
+ * that discusses the design and implementation of WorkStream. WorkStream is, at its
+ * core, a design pattern, i.e., something that is used over and over in finite element
+ * codes and that can, consequently, be implemented generically. In particular, the
+ * paper lays out the motivation for this pattern and then proposes different ways
+ * of implementing it. It also compares the performance of different implementations.
+ *
+ * The paper is currently in preparation.
*
*
*
diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h
index 80b7a85a8f..9dbadb924b 100644
--- a/deal.II/doc/news/changes.h
+++ b/deal.II/doc/news/changes.h
@@ -211,6 +211,13 @@ inconvenience this causes.
Specific improvements
+ - 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.
+
+ (Timo Heister, 2013/11/17)
+
+
- Fixed: GridGenerator::parallelogram was not instantiated properly
on intel compilers.
diff --git a/deal.II/doc/publications/index.html b/deal.II/doc/publications/index.html
index 080dc17f7a..50f18dcc96 100644
--- a/deal.II/doc/publications/index.html
+++ b/deal.II/doc/publications/index.html
@@ -206,6 +206,13 @@
Comput. & Struct., vol. 82, pp. 2437-2445, 2004
+
+ - W. Bangerth, T. Heister
+
+ What makes computational open source software libraries successful?
+
+ Computational Science & Discovery, vol. 6, article 015010, 2013.
+
For massively parallel
@@ -287,6 +294,13 @@
submitted, 2013.
+
W. Bangerth, T. Heister
+
+ What makes computational open source software libraries successful?
+
+ Computational Science & Discovery, vol. 6, article 015010, 2013.
+
+
S. Bartels, R. H. Nochetto, A. J. Salgado
A total variation diminishing interpolation operator
diff --git a/deal.II/include/deal.II/base/exceptions.h b/deal.II/include/deal.II/base/exceptions.h
index fceafdd46c..8c5efbd859 100644
--- a/deal.II/include/deal.II/base/exceptions.h
+++ b/deal.II/include/deal.II/base/exceptions.h
@@ -24,7 +24,7 @@
#include
-#include
+#include
#include
#include
@@ -43,7 +43,7 @@ DEAL_II_NAMESPACE_OPEN
* @ingroup Exceptions
* @author Wolfgang Bangerth, 1997, 1998, Matthias Maier, 2013
*/
-class ExceptionBase : public std::runtime_error
+class ExceptionBase : public std::exception
{
public:
/**
@@ -72,6 +72,12 @@ public:
const char *cond,
const char *exc_name);
+
+ /**
+ * Override the standard function that returns the description of the error.
+ */
+ virtual const char* what() const throw();
+
/**
* Get exception name.
*/
@@ -124,7 +130,7 @@ protected:
* A backtrace to the position where the problem happened, if the
* system supports this.
*/
- char **stacktrace;
+ mutable char **stacktrace;
/**
* The number of stacktrace frames that are stored in the previous
@@ -132,13 +138,24 @@ protected:
*/
int n_stacktrace_frames;
+#ifdef HAVE_GLIBC_STACKTRACE
+ /**
+ * array of pointers that contains the raw stack trace
+ */
+ void *raw_stacktrace[25];
+#endif
+
private:
/**
- * Internal function that generates the c_string that gets printed by
- * exception::what(). Called by the ExceptionBase constructor and
- * set_fields.
+ * Internal function that generates the c_string. Called by what().
+ */
+ void generate_message() const;
+
+ /**
+ * A pointer to the c_string that will be printed by what(). It is
+ * populated by generate_message()
*/
- void generate_message();
+ mutable char* what_str;
};
diff --git a/deal.II/include/deal.II/base/graph_coloring.h b/deal.II/include/deal.II/base/graph_coloring.h
index 86601c87b5..d8cc56d27a 100644
--- a/deal.II/include/deal.II/base/graph_coloring.h
+++ b/deal.II/include/deal.II/base/graph_coloring.h
@@ -491,6 +491,9 @@ namespace GraphColoring
* conflict indicator sets have overlap will not be assigned to the same
* color.
*
+ * @note The algorithm used in this function is described in a paper by
+ * Turcksin, Kronbichler and Bangerth, see @ref workstream_paper .
+ *
* @param[in] begin The first element of a range of iterators for which a
* coloring is sought.
* @param[in] end The element past the end of the range of iterators.
diff --git a/deal.II/include/deal.II/base/work_stream.h b/deal.II/include/deal.II/base/work_stream.h
index 330afcf1ce..71cadb7536 100644
--- a/deal.II/include/deal.II/base/work_stream.h
+++ b/deal.II/include/deal.II/base/work_stream.h
@@ -125,9 +125,9 @@ DEAL_II_NAMESPACE_OPEN
* are considered unused and may be re-used for the next invokation of
* the worker function, on this or another thread.
*
- * This class only really works in parallel when multithread mode was selected
- * during deal.II configuration. Otherwise it simply works on each item
- * sequentially.
+ * The functions in this namespace only really work in parallel when
+ * multithread mode was selected during deal.II configuration. Otherwise they
+ * simply work on each item sequentially.
*
* @ingroup threads
* @author Wolfgang Bangerth, 2007, 2008, 2009, 2013. Bruno Turcksin, 2013.
@@ -149,7 +149,7 @@ namespace WorkStream
* A namespace for the implementation of details of the WorkStream pattern
* and function. This namespace holds classes that deal with the second
* implementation described in the paper by Turcksin, Kronbichler and
- * Bangerth.
+ * Bangerth (see @ref workstream_paper).
*
* Even though this implementation is slower than the third implementation
* discussed in that paper, we need to keep it around for two reasons:
@@ -693,7 +693,7 @@ namespace WorkStream
* A namespace for the implementation of details of the WorkStream pattern
* and function. This namespace holds classes that deal with the third
* implementation described in the paper by Turcksin, Kronbichler and
- * Bangerth.
+ * Bangerth (see @ref workstream_paper).
*/
namespace Implementation3
{
@@ -781,7 +781,8 @@ namespace WorkStream
* Pointer to a thread local variable identifying the scratch
* 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.
+ * class as well as in the paper by Turcksin, Kronbichler and Bangerth
+ * (see @ref workstream_paper).
*/
Threads::ThreadLocalStorage *scratch_and_copy_data;
@@ -924,7 +925,7 @@ namespace WorkStream
* copy data objects each thread will use. The same is true as
* discussed for the implementation in the
* Implementation2::IteratorRangeToItemStream class and the paper
- * by Turcksin, Kronbichler and Bangerth.
+ * by Turcksin, Kronbichler and Bangerth (see @ref workstream_paper).
*/
Threads::ThreadLocalStorage thread_local_scratch_and_copy;
@@ -1144,7 +1145,8 @@ namespace WorkStream
/**
* This is one of two main functions of the WorkStream concept, doing work as
* described in the introduction to this namespace. It corresponds to
- * implementation 2 of the paper by Turcksin, Kronbichler and Bangerth.
+ * implementation 2 of the paper by Turcksin, Kronbichler and Bangerth
+ * (see @ref workstream_paper).
*
* 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
@@ -1257,7 +1259,8 @@ namespace WorkStream
/**
* This is one of two main functions of the WorkStream concept, doing work as
* described in the introduction to this namespace. It corresponds to
- * implementation 3 of the paper by Turcksin, Kronbichler and Bangerth.
+ * implementation 3 of the paper by Turcksin, Kronbichler and Bangerth,
+ * see @ref workstream_paper .
* As such, it takes not a range of iterators described by a begin
* and end iterator, but a "colored" graph of iterators where each
* color represents cells for which writing the cell contributions into
@@ -1265,7 +1268,8 @@ namespace WorkStream
* are not neighbors). Each "color" is represented by std::vectors of cells.
* The first argument to this function, a set of sets of cells (which are
* represent as a vector of vectors, for efficiency), is typically
- * constructed by calling GraphColoring::make_graph_coloring().
+ * constructed by calling GraphColoring::make_graph_coloring(). See there
+ * for more information.
*
* 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
@@ -1375,7 +1379,7 @@ namespace WorkStream
* This is a variant of one of the two main functions of the WorkStream
* concept, doing work as described in the introduction to this namespace.
* It corresponds to implementation 2 of the paper by Turcksin, Kronbichler
- * and Bangerth.
+ * 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.
diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h
index a6a1d88142..c56d20ed5e 100644
--- a/deal.II/include/deal.II/dofs/dof_handler.h
+++ b/deal.II/include/deal.II/dofs/dof_handler.h
@@ -28,7 +28,6 @@
#include
#include
#include
-#include
#include
@@ -46,6 +45,12 @@ namespace internal
template class DoFFaces;
struct Implementation;
+
+ namespace Policy
+ {
+ template class PolicyBase;
+ struct Implementation;
+ }
}
namespace DoFAccessor
@@ -1248,6 +1253,21 @@ DoFHandler::block_info () const
}
+namespace internal
+{
+ /**
+ * returns a string representing the dynamic type of the given argument. This is
+ * basically the same what typeid(...).name() does, but it turns out this is broken
+ * on Intel 13+.
+ *
+ * Defined in dof_handler.cc.
+ */
+ template
+ std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase & policy);
+
+}
+
+
template
template
void DoFHandler::save (Archive &ar,
@@ -1264,7 +1284,7 @@ void DoFHandler::save (Archive &ar,
// identifies the FE and the policy
unsigned int n_cells = tria->n_cells();
std::string fe_name = selected_fe->get_name();
- std::string policy_name = policy->to_string();
+ std::string policy_name = internal::policy_to_string(*policy);
ar &n_cells &fe_name &policy_name;
}
@@ -1305,9 +1325,9 @@ void DoFHandler::load (Archive &ar,
AssertThrow (fe_name == selected_fe->get_name(),
ExcMessage ("The finite element associated with this DoFHandler does not match "
"the one that was associated with the DoFHandler previously stored."));
- AssertThrow (policy_name == policy->to_string(),
+ AssertThrow (policy_name == internal::policy_to_string(*policy),
ExcMessage (std::string ("The policy currently associated with this DoFHandler (")
- + policy->to_string()
+ + internal::policy_to_string(*policy)
+std::string(") does not match the one that was associated with the "
"DoFHandler previously stored (")
+ policy_name
diff --git a/deal.II/include/deal.II/dofs/dof_handler_policy.h b/deal.II/include/deal.II/dofs/dof_handler_policy.h
index 39a07a544f..42eecf8afa 100644
--- a/deal.II/include/deal.II/dofs/dof_handler_policy.h
+++ b/deal.II/include/deal.II/dofs/dof_handler_policy.h
@@ -64,13 +64,6 @@ namespace internal
*/
virtual ~PolicyBase ();
- /**
- * Convert type of policy to a string. This is used as a
- * workaround in serialization because the intel compiler can
- * not handle typeid correctly.
- */
- virtual std::string to_string () const = 0;
-
/**
* Distribute degrees of freedom on
* the object given as last argument.
@@ -115,14 +108,6 @@ namespace internal
virtual
NumberCache
distribute_dofs (dealii::DoFHandler &dof_handler) const;
-
- /**
- * Convert type of policy to a string. This is used as a
- * workaround in serialization because the intel compiler can
- * not handle typeid correctly.
- */
- virtual std::string to_string () const;
-
/**
* Distribute multigrid DoFs.
@@ -162,13 +147,6 @@ namespace internal
NumberCache
distribute_dofs (dealii::DoFHandler &dof_handler) const;
- /**
- * Convert type of policy to a string. This is used as a
- * workaround in serialization because the intel compiler can
- * not handle typeid correctly.
- */
- virtual std::string to_string () const;
-
/**
* Distribute multigrid DoFs.
*/
diff --git a/deal.II/include/deal.II/fe/fe_values.h b/deal.II/include/deal.II/fe/fe_values.h
index 4963d54c30..994f7885f2 100644
--- a/deal.II/include/deal.II/fe/fe_values.h
+++ b/deal.II/include/deal.II/fe/fe_values.h
@@ -60,19 +60,15 @@ template class BlockVector;
namespace internal
{
/**
- * A class whose specialization is
- * used to define what type the
- * curl of a vector valued function
- * corresponds to.
+ * A class whose specialization is used to define what type the curl of a
+ * vector valued function corresponds to.
*/
template
struct CurlType;
/**
- * A class whose specialization is
- * used to define what type the
- * curl of a vector valued function
- * corresponds to.
+ * A class whose specialization is used to define what type the curl of a
+ * vector valued function corresponds to.
*
* In 1d, the curl is a scalar.
*/
@@ -83,10 +79,8 @@ namespace internal
};
/**
- * A class whose specialization is
- * used to define what type the
- * curl of a vector valued function
- * corresponds to.
+ * A class whose specialization is used to define what type the curl of a
+ * vector valued function corresponds to.
*
* In 2d, the curl is a scalar.
*/
@@ -97,10 +91,8 @@ namespace internal
};
/**
- * A class whose specialization is
- * used to define what type the
- * curl of a vector valued function
- * corresponds to.
+ * A class whose specialization is used to define what type the curl of a
+ * vector valued function corresponds to.
*
* In 3d, the curl is a vector.
*/
@@ -124,10 +116,10 @@ namespace internal
* FEValuesExtractors objects to a FEValues, FEFaceValues or FESubfaceValues
* objects using the square bracket operator.
*
- * There are classes that present views for single scalar components,
- * vector components consisting of dim
elements, and
- * symmetric second order tensor components
- * consisting of (dim*dim + dim)/2
elements
+ * There are classes that present views for single scalar components, vector
+ * components consisting of dim
elements, and symmetric second
+ * order tensor components consisting of (dim*dim + dim)/2
+ * elements
*
* See the description of the @ref vector_valued module for examples how to
* use the features of this namespace.
@@ -137,16 +129,12 @@ namespace internal
namespace FEValuesViews
{
/**
- * A class representing a view to a single
- * scalar component of a possibly
- * vector-valued finite element. Views are
- * discussed in the @ref vector_valued
- * module.
+ * A class representing a view to a single scalar component of a possibly
+ * vector-valued finite element. Views are discussed in the @ref
+ * vector_valued module.
*
- * You get an object of this type if you
- * apply a FEValuesExtractors::Scalar to an
- * FEValues, FEFaceValues or
- * FESubfaceValues object.
+ * You get an object of this type if you apply a FEValuesExtractors::Scalar
+ * to an FEValues, FEFaceValues or FESubfaceValues object.
*
* @ingroup feaccess vector_valued
*/
@@ -155,131 +143,93 @@ namespace FEValuesViews
{
public:
/**
- * A typedef for the data type of
- * values of the view this class
- * represents. Since we deal with a
- * single components, the value type is
- * a scalar double.
+ * A typedef for the data type of values of the view this class
+ * represents. Since we deal with a single components, the value type is a
+ * scalar double.
*/
typedef double value_type;
/**
- * A typedef for the type of gradients
- * of the view this class
- * represents. Here, for a scalar
- * component of the finite element, the
- * gradient is a
- * Tensor@<1,dim@>
.
+ * A typedef for the type of gradients of the view this class
+ * represents. Here, for a scalar component of the finite element, the
+ * gradient is a Tensor@<1,dim@>
.
*/
typedef dealii::Tensor<1,spacedim> gradient_type;
/**
- * A typedef for the type of second
- * derivatives of the view this class
- * represents. Here, for a scalar
- * component of the finite element, the
- * Hessian is a
- * Tensor@<2,dim@>
.
+ * A typedef for the type of second derivatives of the view this class
+ * represents. Here, for a scalar component of the finite element, the
+ * Hessian is a Tensor@<2,dim@>
.
*/
typedef dealii::Tensor<2,spacedim> hessian_type;
/**
- * A structure where for each shape
- * function we pre-compute a bunch of
- * data that will make later accesses
- * much cheaper.
+ * A structure where for each shape function we pre-compute a bunch of
+ * data that will make later accesses much cheaper.
*/
struct ShapeFunctionData
{
/**
- * For each shape function, store
- * whether the selected vector
- * component may be nonzero. For
- * primitive shape functions we
- * know for sure whether a certain
- * scalar component of a given
- * shape function is nonzero,
- * whereas for non-primitive shape
- * functions this may not be
- * entirely clear (e.g. for RT
- * elements it depends on the shape
- * of a cell).
+ * For each shape function, store whether the selected vector component
+ * may be nonzero. For primitive shape functions we know for sure
+ * whether a certain scalar component of a given shape function is
+ * nonzero, whereas for non-primitive shape functions this may not be
+ * entirely clear (e.g. for RT elements it depends on the shape of a
+ * cell).
*/
bool is_nonzero_shape_function_component;
/**
- * For each shape function, store
- * the row index within the
- * shape_values, shape_gradients,
- * and shape_hessians tables (the
- * column index is the quadrature
- * point index). If the shape
- * function is primitive, then we
- * can get this information from
- * the shape_function_to_row_table
- * of the FEValues object;
- * otherwise, we have to work a bit
- * harder to compute this
- * information.
+ * For each shape function, store the row index within the shape_values,
+ * shape_gradients, and shape_hessians tables (the column index is the
+ * quadrature point index). If the shape function is primitive, then we
+ * can get this information from the shape_function_to_row_table of the
+ * FEValues object; otherwise, we have to work a bit harder to compute
+ * this information.
*/
unsigned int row_index;
};
/**
- * Default constructor. Creates an
- * invalid object.
+ * Default constructor. Creates an invalid object.
*/
Scalar ();
/**
- * Constructor for an object that
- * represents a single scalar component
- * of a FEValuesBase object (or of one
- * of the classes derived from
+ * Constructor for an object that represents a single scalar component of
+ * a FEValuesBase object (or of one of the classes derived from
* FEValuesBase).
*/
Scalar (const FEValuesBase &fe_values_base,
const unsigned int component);
/**
- * Copy operator. This is not a
- * lightweight object so we don't allow
- * copying and generate an exception if
- * this function is called.
+ * Copy operator. This is not a lightweight object so we don't allow
+ * copying and generate an exception if this function is called.
*/
Scalar &operator= (const Scalar &);
/**
- * Return the value of the vector
- * component selected by this view, for
- * the shape function and quadrature
- * point selected by the arguments.
+ * Return the value of the vector component selected by this view, for the
+ * shape function and quadrature point selected by the arguments.
*
- * @param shape_function Number
- * of the shape function to be
- * evaluated. Note that this
- * number runs from zero to
- * dofs_per_cell, even in the
- * case of an FEFaceValues or
- * FESubfaceValues object.
+ * @param shape_function Number of the shape function to be
+ * evaluated. Note that this number runs from zero to dofs_per_cell, even
+ * in the case of an FEFaceValues or FESubfaceValues object.
*
- * @param q_point Number of
- * the quadrature point at which
- * function is to be evaluated
+ * @param q_point Number of the quadrature point at which function is to
+ * be evaluated
*/
value_type
value (const unsigned int shape_function,
const unsigned int q_point) const;
/**
- * Return the gradient (a tensor of
- * rank 1) of the vector component
- * selected by this view, for the shape
- * function and quadrature point
+ * Return the gradient (a tensor of rank 1) of the vector component
+ * selected by this view, for the shape function and quadrature point
* selected by the arguments.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
gradient_type
@@ -287,15 +237,11 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the Hessian (the tensor of
- * rank 2 of all second derivatives) of
- * the vector component selected by
- * this view, for the shape function
- * and quadrature point selected by the
- * arguments.
+ * Return the Hessian (the tensor of rank 2 of all second derivatives) of
+ * the vector component selected by this view, for the shape function and
+ * quadrature point selected by the arguments.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
hessian_type
@@ -303,19 +249,13 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the values of the selected
- * scalar component of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the values of the selected scalar component of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_values
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_values function but it only works on the
* selected scalar component.
*/
template
@@ -323,19 +263,13 @@ namespace FEValuesViews
std::vector &values) const;
/**
- * Return the gradients of the selected
- * scalar component of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the gradients of the selected scalar component of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_gradients
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_gradients function but it only works on the
* selected scalar component.
*/
template
@@ -343,19 +277,13 @@ namespace FEValuesViews
std::vector &gradients) const;
/**
- * Return the Hessians of the selected
- * scalar component of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the Hessians of the selected scalar component of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_hessians
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_hessians function but it only works on the
* selected scalar component.
*/
template
@@ -363,25 +291,15 @@ namespace FEValuesViews
std::vector &hessians) const;
/**
- * Return the Laplacians of the
- * selected scalar component of
- * the finite element function
- * characterized by
- * fe_function at the
- * quadrature points of the
- * cell, face or subface
- * selected the last time the
- * reinit function of
- * the FEValues object was
- * called. The Laplacians are
- * the trace of the Hessians.
+ * Return the Laplacians of the selected scalar component of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called. The
+ * Laplacians are the trace of the Hessians.
*
- * This function is the
- * equivalent of the
- * FEValuesBase::get_function_laplacians
- * function but it only works
- * on the selected scalar
- * component.
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_laplacians function but it only works on the
+ * selected scalar component.
*/
template
void get_function_laplacians (const InputVector &fe_function,
@@ -389,21 +307,18 @@ namespace FEValuesViews
private:
/**
- * A reference to the FEValuesBase object
- * we operate on.
+ * A reference to the FEValuesBase object we operate on.
*/
const FEValuesBase &fe_values;
/**
- * The single scalar component this
- * view represents of the FEValuesBase
+ * The single scalar component this view represents of the FEValuesBase
* object.
*/
const unsigned int component;
/**
- * Store the data about shape
- * functions.
+ * Store the data about shape functions.
*/
std::vector shape_function_data;
};
@@ -411,50 +326,29 @@ namespace FEValuesViews
/**
- * A class representing a view to a set of
- * spacedim
components forming a
- * vector part of a vector-valued finite
- * element. Views are discussed in the
- * @ref vector_valued module.
+ * A class representing a view to a set of spacedim
components
+ * forming a vector part of a vector-valued finite element. Views are
+ * discussed in the @ref vector_valued module.
*
- * Note that in the current context, a
- * vector is meant in the sense physics
- * uses it: it has spacedim
- * components that behave in specific ways
- * under coordinate system
- * transformations. Examples include
- * velocity or displacement fields. This is
- * opposed to how mathematics uses the word
- * "vector" (and how we use this word in
- * other contexts in the library, for
- * example in the Vector class), where it
- * really stands for a collection of
- * numbers. An example of this latter use
- * of the word could be the set of
- * concentrations of chemical species in a
- * flame; however, these are really just a
- * collection of scalar variables, since
- * they do not change if the coordinate
- * system is rotated, unlike the components
- * of a velocity vector, and consequently,
- * this class should not be used for this
- * context.
+ * Note that in the current context, a vector is meant in the sense physics
+ * uses it: it has spacedim
components that behave in specific
+ * ways under coordinate system transformations. Examples include velocity
+ * or displacement fields. This is opposed to how mathematics uses the word
+ * "vector" (and how we use this word in other contexts in the library, for
+ * example in the Vector class), where it really stands for a collection of
+ * numbers. An example of this latter use of the word could be the set of
+ * concentrations of chemical species in a flame; however, these are really
+ * just a collection of scalar variables, since they do not change if the
+ * coordinate system is rotated, unlike the components of a velocity vector,
+ * and consequently, this class should not be used for this context.
*
- * This class allows to query the
- * value, gradient and divergence of
- * (components of) shape functions
- * and solutions representing
- * vectors. The
- * gradient of a vector
- * $d_{k}, 0\le k<\text{dim}$ is
- * defined as
- * $S_{ij} = \frac{\partial d_{i}}{\partial x_j},
- * 0\le i,j<\text{dim}$.
+ * This class allows to query the value, gradient and divergence of
+ * (components of) shape functions and solutions representing vectors. The
+ * gradient of a vector $d_{k}, 0\le k<\text{dim}$ is defined as $S_{ij} =
+ * \frac{\partial d_{i}}{\partial x_j}, 0\le i,j<\text{dim}$.
*
- * You get an object of this type if you
- * apply a FEValuesExtractors::Vector to an
- * FEValues, FEFaceValues or
- * FESubfaceValues object.
+ * You get an object of this type if you apply a FEValuesExtractors::Vector
+ * to an FEValues, FEFaceValues or FESubfaceValues object.
*
* @ingroup feaccess vector_valued
*/
@@ -463,209 +357,144 @@ namespace FEValuesViews
{
public:
/**
- * A typedef for the data type of
- * values of the view this class
- * represents. Since we deal with a set
- * of dim
components, the
- * value type is a Tensor<1,spacedim>.
+ * A typedef for the data type of values of the view this class
+ * represents. Since we deal with a set of dim
components,
+ * the value type is a Tensor<1,spacedim>.
*/
typedef dealii::Tensor<1,spacedim> value_type;
/**
- * A typedef for the type of gradients
- * of the view this class
- * represents. Here, for a set of
- * dim
components of the
- * finite element, the gradient is a
- * Tensor@<2,spacedim@>
.
+ * A typedef for the type of gradients of the view this class
+ * represents. Here, for a set of dim
components of the
+ * finite element, the gradient is a Tensor@<2,spacedim@>
.
*
- * See the general documentation of this class for how exactly
- * the gradient of a vector is defined.
+ * See the general documentation of this class for how exactly the
+ * gradient of a vector is defined.
*/
typedef dealii::Tensor<2,spacedim> gradient_type;
/**
- * A typedef for the type of
- * symmetrized gradients of the view
- * this class represents. Here, for a
- * set of dim
components
- * of the finite element, the
- * symmetrized gradient is a
+ * A typedef for the type of symmetrized gradients of the view this class
+ * represents. Here, for a set of dim
components of the
+ * finite element, the symmetrized gradient is a
* SymmetricTensor@<2,spacedim@>
.
*
- * The symmetric gradient of a vector
- * field $\mathbf v$ is defined as
- * $\varepsilon(\mathbf v)=\frac 12
- * (\nabla \mathbf v + \nabla \mathbf
+ * The symmetric gradient of a vector field $\mathbf v$ is defined as
+ * $\varepsilon(\mathbf v)=\frac 12 (\nabla \mathbf v + \nabla \mathbf
* v^T)$.
*/
typedef dealii::SymmetricTensor<2,spacedim> symmetric_gradient_type;
/**
- * A typedef for the type of the
- * divergence of the view this class
- * represents. Here, for a set of
- * dim
components of the
- * finite element, the divergence of
- * course is a scalar.
+ * A typedef for the type of the divergence of the view this class
+ * represents. Here, for a set of dim
components of the
+ * finite element, the divergence of course is a scalar.
*/
typedef double divergence_type;
/**
- * A typedef for the type of the
- * curl of the view this class
- * represents. Here, for a set of
- * spacedim=2
components
- * of the finite element, the curl is
- * a Tensor@<1, 1@>
. For
- * spacedim=3
it is a
- * Tensor@<1, dim@>
.
+ * A typedef for the type of the curl of the view this class
+ * represents. Here, for a set of spacedim=2
components of
+ * the finite element, the curl is a Tensor@<1, 1@>
. For
+ * spacedim=3
it is a Tensor@<1, dim@>
.
*/
typedef typename dealii::internal::CurlType::type curl_type;
/**
- * A typedef for the type of second
- * derivatives of the view this class
- * represents. Here, for a set of
- * dim
components of the
- * finite element, the Hessian is a
- * Tensor@<3,dim@>
.
+ * A typedef for the type of second derivatives of the view this class
+ * represents. Here, for a set of dim
components of the
+ * finite element, the Hessian is a Tensor@<3,dim@>
.
*/
typedef dealii::Tensor<3,spacedim> hessian_type;
/**
- * A structure where for each shape
- * function we pre-compute a bunch of
- * data that will make later accesses
- * much cheaper.
+ * A structure where for each shape function we pre-compute a bunch of
+ * data that will make later accesses much cheaper.
*/
struct ShapeFunctionData
{
/**
- * For each pair (shape
- * function,component within
- * vector), store whether the
- * selected vector component may be
- * nonzero. For primitive shape
- * functions we know for sure
- * whether a certain scalar
- * component of a given shape
- * function is nonzero, whereas for
- * non-primitive shape functions
- * this may not be entirely clear
- * (e.g. for RT elements it depends
- * on the shape of a cell).
+ * For each pair (shape function,component within vector), store whether
+ * the selected vector component may be nonzero. For primitive shape
+ * functions we know for sure whether a certain scalar component of a
+ * given shape function is nonzero, whereas for non-primitive shape
+ * functions this may not be entirely clear (e.g. for RT elements it
+ * depends on the shape of a cell).
*/
bool is_nonzero_shape_function_component[spacedim];
/**
- * For each pair (shape function,
- * component within vector), store
- * the row index within the
- * shape_values, shape_gradients,
- * and shape_hessians tables (the
- * column index is the quadrature
- * point index). If the shape
- * function is primitive, then we
- * can get this information from
- * the shape_function_to_row_table
- * of the FEValues object;
- * otherwise, we have to work a bit
- * harder to compute this
+ * For each pair (shape function, component within vector), store the
+ * row index within the shape_values, shape_gradients, and
+ * shape_hessians tables (the column index is the quadrature point
+ * index). If the shape function is primitive, then we can get this
+ * information from the shape_function_to_row_table of the FEValues
+ * object; otherwise, we have to work a bit harder to compute this
* information.
*/
unsigned int row_index[spacedim];
/**
- * For each shape function say the
- * following: if only a single
- * entry in
- * is_nonzero_shape_function_component
- * for this shape function is
- * nonzero, then store the
- * corresponding value of row_index
- * and
- * single_nonzero_component_index
- * represents the index between 0
- * and dim for which it is
- * attained. If multiple components
- * are nonzero, then store -1. If
- * no components are nonzero then
- * store -2.
+ * For each shape function say the following: if only a single entry in
+ * is_nonzero_shape_function_component for this shape function is
+ * nonzero, then store the corresponding value of row_index and
+ * single_nonzero_component_index represents the index between 0 and dim
+ * for which it is attained. If multiple components are nonzero, then
+ * store -1. If no components are nonzero then store -2.
*/
int single_nonzero_component;
unsigned int single_nonzero_component_index;
};
/**
- * Default constructor. Creates an
- * invalid object.
+ * Default constructor. Creates an invalid object.
*/
Vector ();
/**
- * Constructor for an object that
- * represents dim components of a
- * FEValuesBase object (or of one of
- * the classes derived from
- * FEValuesBase), representing a
- * vector-valued variable.
+ * Constructor for an object that represents dim components of a
+ * FEValuesBase object (or of one of the classes derived from
+ * FEValuesBase), representing a vector-valued variable.
*
- * The second argument denotes the
- * index of the first component of the
+ * The second argument denotes the index of the first component of the
* selected vector.
*/
Vector (const FEValuesBase &fe_values_base,
const unsigned int first_vector_component);
/**
- * Copy operator. This is not a
- * lightweight object so we don't allow
- * copying and generate an exception if
- * this function is called.
+ * Copy operator. This is not a lightweight object so we don't allow
+ * copying and generate an exception if this function is called.
*/
Vector &operator= (const Vector &);
/**
- * Return the value of the vector
- * components selected by this view,
- * for the shape function and
- * quadrature point selected by the
- * arguments. Here, since the view
- * represents a vector-valued part of
- * the FEValues object with
- * dim
components, the
- * return type is a tensor of rank 1
- * with dim
components.
+ * Return the value of the vector components selected by this view, for
+ * the shape function and quadrature point selected by the
+ * arguments. Here, since the view represents a vector-valued part of the
+ * FEValues object with dim
components, the return type is a
+ * tensor of rank 1 with dim
components.
*
- * @param shape_function Number
- * of the shape function to be
- * evaluated. Note that this
- * number runs from zero to
- * dofs_per_cell, even in the
- * case of an FEFaceValues or
- * FESubfaceValues object.
+ * @param shape_function Number of the shape function to be
+ * evaluated. Note that this number runs from zero to dofs_per_cell, even
+ * in the case of an FEFaceValues or FESubfaceValues object.
*
- * @param q_point Number of
- * the quadrature point at which
- * function is to be evaluated
+ * @param q_point Number of the quadrature point at which function is to
+ * be evaluated
*/
value_type
value (const unsigned int shape_function,
const unsigned int q_point) const;
/**
- * Return the gradient (a tensor of
- * rank 2) of the vector component
- * selected by this view, for the shape
- * function and quadrature point
+ * Return the gradient (a tensor of rank 2) of the vector component
+ * selected by this view, for the shape function and quadrature point
* selected by the arguments.
*
- * See the general documentation of this class for how exactly
- * the gradient of a vector is defined.
+ * See the general documentation of this class for how exactly the
+ * gradient of a vector is defined.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
gradient_type
@@ -673,24 +502,16 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the symmetric gradient (a
- * symmetric tensor of rank 2) of the
- * vector component selected by this
- * view, for the shape function and
- * quadrature point selected by the
- * arguments.
+ * Return the symmetric gradient (a symmetric tensor of rank 2) of the
+ * vector component selected by this view, for the shape function and
+ * quadrature point selected by the arguments.
*
- * The symmetric gradient is defined as
- * $\frac 12 [(\nabla \phi_i(x_q)) +
- * (\nabla \phi_i(x_q))^T]$, where
- * $\phi_i$ represents the
- * dim
components selected
- * from the FEValuesBase object, and
- * $x_q$ is the location of the $q$-th
- * quadrature point.
+ * The symmetric gradient is defined as $\frac 12 [(\nabla \phi_i(x_q)) +
+ * (\nabla \phi_i(x_q))^T]$, where $\phi_i$ represents the
+ * dim
components selected from the FEValuesBase object, and
+ * $x_q$ is the location of the $q$-th quadrature point.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
symmetric_gradient_type
@@ -698,14 +519,11 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the scalar divergence of
- * the vector components selected by
- * this view, for the shape function
- * and quadrature point selected by the
+ * Return the scalar divergence of the vector components selected by this
+ * view, for the shape function and quadrature point selected by the
* arguments.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
divergence_type
@@ -713,31 +531,17 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the vector curl of
- * the vector components selected by
- * this view, for the shape function
- * and quadrature point selected by the
- * arguments. For 1d this function does
- * not make any sense. Thus it is not
- * implemented for spacedim=1
.
- * In 2d the curl is defined as
- * @f{equation*}
- * \operatorname{curl}(u):=\frac{du_2}{dx}
- * -\frac{du_1}{dy},
- * @f}
- * whereas in 3d it is given by
- * @f{equation*}
- * \operatorname{curl}(u):=\left(
- * \begin{array}{c}
- * \frac{du_3}{dy}-\frac{du_2}{dz}\\
- * \frac{du_1}{dz}-\frac{du_3}{dx}\\
- * \frac{du_2}{dx}-\frac{du_1}{dy}
- * \end{array}
- * \right).
- * @f}
+ * Return the vector curl of the vector components selected by this view,
+ * for the shape function and quadrature point selected by the
+ * arguments. For 1d this function does not make any sense. Thus it is not
+ * implemented for spacedim=1
. In 2d the curl is defined as
+ * @f{equation*} \operatorname{curl}(u):=\frac{du_2}{dx} -\frac{du_1}{dy},
+ * @f} whereas in 3d it is given by @f{equation*}
+ * \operatorname{curl}(u):=\left( \begin{array}{c}
+ * \frac{du_3}{dy}-\frac{du_2}{dz}\\ \frac{du_1}{dz}-\frac{du_3}{dx}\\
+ * \frac{du_2}{dx}-\frac{du_1}{dy} \end{array} \right). @f}
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
curl_type
@@ -745,15 +549,11 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the Hessian (the tensor of
- * rank 2 of all second derivatives) of
- * the vector components selected by
- * this view, for the shape function
- * and quadrature point selected by the
- * arguments.
+ * Return the Hessian (the tensor of rank 2 of all second derivatives) of
+ * the vector components selected by this view, for the shape function and
+ * quadrature point selected by the arguments.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
hessian_type
@@ -761,19 +561,13 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the values of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the values of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_values
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_values function but it only works on the
* selected vector components.
*/
template
@@ -781,19 +575,13 @@ namespace FEValuesViews
std::vector &values) const;
/**
- * Return the gradients of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the gradients of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_gradients
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_gradients function but it only works on the
* selected vector components.
*/
template
@@ -801,29 +589,19 @@ namespace FEValuesViews
std::vector &gradients) const;
/**
- * Return the symmetrized gradients of
- * the selected vector components of
- * the finite element function
- * characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the symmetrized gradients of the selected vector components of
+ * the finite element function characterized by fe_function at
+ * the quadrature points of the cell, face or subface selected the last
+ * time the reinit function of the FEValues object was called.
*
- * The symmetric gradient of a vector
- * field $\mathbf v$ is defined as
- * $\varepsilon(\mathbf v)=\frac 12
- * (\nabla \mathbf v + \nabla \mathbf
+ * The symmetric gradient of a vector field $\mathbf v$ is defined as
+ * $\varepsilon(\mathbf v)=\frac 12 (\nabla \mathbf v + \nabla \mathbf
* v^T)$.
*
- * @note There is no equivalent
- * function such as
- * FEValuesBase::get_function_symmetric_gradients
- * in the FEValues classes but the
- * information can be obtained from
- * FEValuesBase::get_function_gradients,
- * of course.
+ * @note There is no equivalent function such as
+ * FEValuesBase::get_function_symmetric_gradients in the FEValues classes
+ * but the information can be obtained from
+ * FEValuesBase::get_function_gradients, of course.
*/
template
void
@@ -831,21 +609,14 @@ namespace FEValuesViews
std::vector &symmetric_gradients) const;
/**
- * Return the divergence of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the divergence of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * There is no equivalent function such
- * as
- * FEValuesBase::get_function_divergences
- * in the FEValues classes but the
- * information can be obtained from
- * FEValuesBase::get_function_gradients,
+ * There is no equivalent function such as
+ * FEValuesBase::get_function_divergences in the FEValues classes but the
+ * information can be obtained from FEValuesBase::get_function_gradients,
* of course.
*/
template
@@ -853,21 +624,14 @@ namespace FEValuesViews
std::vector &divergences) const;
/**
- * Return the curl of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the curl of the selected vector components of the finite element
+ * function characterized by fe_function at the quadrature points
+ * of the cell, face or subface selected the last time the reinit
+ * function of the FEValues object was called.
*
- * There is no equivalent function such
- * as
- * FEValuesBase::get_function_curls
- * in the FEValues classes but the
- * information can be obtained from
- * FEValuesBase::get_function_gradients,
+ * There is no equivalent function such as
+ * FEValuesBase::get_function_curls in the FEValues classes but the
+ * information can be obtained from FEValuesBase::get_function_gradients,
* of course.
*/
template
@@ -875,19 +639,13 @@ namespace FEValuesViews
std::vector &curls) const;
/**
- * Return the Hessians of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the Hessians of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_hessians
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_hessians function but it only works on the
* selected vector components.
*/
template
@@ -895,25 +653,15 @@ namespace FEValuesViews
std::vector &hessians) const;
/**
- * Return the Laplacians of the
- * selected vector components
- * of the finite element
- * function characterized by
- * fe_function at the
- * quadrature points of the
- * cell, face or subface
- * selected the last time the
- * reinit function of
- * the FEValues object was
- * called. The Laplacians are
- * the trace of the Hessians.
+ * Return the Laplacians of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called. The
+ * Laplacians are the trace of the Hessians.
*
- * This function is the
- * equivalent of the
- * FEValuesBase::get_function_laplacians
- * function but it only works
- * on the selected vector
- * components.
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_laplacians function but it only works on the
+ * selected vector components.
*/
template
void get_function_laplacians (const InputVector &fe_function,
@@ -921,21 +669,18 @@ namespace FEValuesViews
private:
/**
- * A reference to the FEValuesBase object
- * we operate on.
+ * A reference to the FEValuesBase object we operate on.
*/
const FEValuesBase &fe_values;
/**
- * The first component of the vector
- * this view represents of the
+ * The first component of the vector this view represents of the
* FEValuesBase object.
*/
const unsigned int first_vector_component;
/**
- * Store the data about shape
- * functions.
+ * Store the data about shape functions.
*/
std::vector shape_function_data;
};
@@ -945,34 +690,21 @@ namespace FEValuesViews
class SymmetricTensor;
/**
- * A class representing a view to a set of
- * (dim*dim + dim)/2
components forming a
- * symmetric second-order tensor from a
- * vector-valued finite
- * element. Views are discussed in the
- * @ref vector_valued module.
+ * A class representing a view to a set of (dim*dim + dim)/2
+ * components forming a symmetric second-order tensor from a vector-valued
+ * finite element. Views are discussed in the @ref vector_valued module.
*
- * This class allows to query the
- * value and divergence of
- * (components of) shape functions
- * and solutions representing
- * symmetric tensors. The
- * divergence of a symmetric tensor
- * $S_{ij}, 0\le i,j<\text{dim}$ is
- * defined as
- * $d_i = \sum_j \frac{\partial S_{ij}}{\partial x_j},
- * 0\le i<\text{dim}$,
- * which due to the symmetry of the tensor is also
- * $d_i = \sum_j \frac{\partial S_{ji}}{\partial x_j}$.
- * In other words, it due to the symmetry
- * of $S$ it does not matter whether
- * we apply the nabla operator by row
- * or by column to get the divergence.
+ * This class allows to query the value and divergence of (components of)
+ * shape functions and solutions representing symmetric tensors. The
+ * divergence of a symmetric tensor $S_{ij}, 0\le i,j<\text{dim}$ is defined
+ * as $d_i = \sum_j \frac{\partial S_{ij}}{\partial x_j}, 0\le
+ * i<\text{dim}$, which due to the symmetry of the tensor is also $d_i =
+ * \sum_j \frac{\partial S_{ji}}{\partial x_j}$. In other words, it due to
+ * the symmetry of $S$ it does not matter whether we apply the nabla
+ * operator by row or by column to get the divergence.
*
- * You get an object of this type if you
- * apply a
- * FEValuesExtractors::SymmetricTensor to
- * an FEValues, FEFaceValues or
+ * You get an object of this type if you apply a
+ * FEValuesExtractors::SymmetricTensor to an FEValues, FEFaceValues or
* FESubfaceValues object.
*
* @ingroup feaccess vector_valued
@@ -984,149 +716,100 @@ namespace FEValuesViews
{
public:
/**
- * A typedef for the data type of
- * values of the view this class
- * represents. Since we deal with a set
- * of (dim*dim + dim)/2
components
- * (i.e. the unique components of a symmetric second-order
+ * A typedef for the data type of values of the view this class
+ * represents. Since we deal with a set of (dim*dim + dim)/2
+ * components (i.e. the unique components of a symmetric second-order
* tensor), the value type is a SymmetricTensor<2,spacedim>.
*/
typedef dealii::SymmetricTensor<2, spacedim> value_type;
/**
- * A typedef for the type of the
- * divergence of the view this class
- * represents. Here, for a set of
- * of (dim*dim + dim)/2
unique components
- * of the finite element representing a symmetric second-order
- * tensor, the divergence of
- * course is a * Tensor@<1,dim@>
.
+ * A typedef for the type of the divergence of the view this class
+ * represents. Here, for a set of of (dim*dim + dim)/2
unique
+ * components of the finite element representing a symmetric second-order
+ * tensor, the divergence of course is a * Tensor@<1,dim@>
.
*
- * See the general discussion
- * of this class for a
- * definition of the
+ * See the general discussion of this class for a definition of the
* divergence.
*/
typedef dealii::Tensor<1, spacedim> divergence_type;
/**
- * A structure where for each shape
- * function we pre-compute a bunch of
- * data that will make later accesses
- * much cheaper.
+ * A structure where for each shape function we pre-compute a bunch of
+ * data that will make later accesses much cheaper.
*/
struct ShapeFunctionData
{
/**
- * For each pair (shape
- * function,component within
- * vector), store whether the
- * selected vector component may be
- * nonzero. For primitive shape
- * functions we know for sure
- * whether a certain scalar
- * component of a given shape
- * function is nonzero, whereas for
- * non-primitive shape functions
- * this may not be entirely clear
- * (e.g. for RT elements it depends
- * on the shape of a cell).
+ * For each pair (shape function,component within vector), store whether
+ * the selected vector component may be nonzero. For primitive shape
+ * functions we know for sure whether a certain scalar component of a
+ * given shape function is nonzero, whereas for non-primitive shape
+ * functions this may not be entirely clear (e.g. for RT elements it
+ * depends on the shape of a cell).
*/
bool is_nonzero_shape_function_component[value_type::n_independent_components];
/**
- * For each pair (shape function,
- * component within vector), store
- * the row index within the
- * shape_values, shape_gradients,
- * and shape_hessians tables (the
- * column index is the quadrature
- * point index). If the shape
- * function is primitive, then we
- * can get this information from
- * the shape_function_to_row_table
- * of the FEValues object;
- * otherwise, we have to work a bit
- * harder to compute this
+ * For each pair (shape function, component within vector), store the
+ * row index within the shape_values, shape_gradients, and
+ * shape_hessians tables (the column index is the quadrature point
+ * index). If the shape function is primitive, then we can get this
+ * information from the shape_function_to_row_table of the FEValues
+ * object; otherwise, we have to work a bit harder to compute this
* information.
*/
unsigned int row_index[value_type::n_independent_components];
/**
- * For each shape function say the
- * following: if only a single
- * entry in
- * is_nonzero_shape_function_component
- * for this shape function is
- * nonzero, then store the
- * corresponding value of row_index
- * and
- * single_nonzero_component_index
- * represents the index between 0
- * and (dim^2 + dim)/2 for which it is
- * attained. If multiple components
- * are nonzero, then store -1. If
- * no components are nonzero then
- * store -2.
+ * For each shape function say the following: if only a single entry in
+ * is_nonzero_shape_function_component for this shape function is
+ * nonzero, then store the corresponding value of row_index and
+ * single_nonzero_component_index represents the index between 0 and
+ * (dim^2 + dim)/2 for which it is attained. If multiple components are
+ * nonzero, then store -1. If no components are nonzero then store -2.
*/
int single_nonzero_component;
unsigned int single_nonzero_component_index;
};
/**
- * Default constructor. Creates an
- * invalid object.
+ * Default constructor. Creates an invalid object.
*/
SymmetricTensor();
/**
- * Constructor for an object that
- * represents (dim*dim + dim)/2
- * components of a
- * FEValuesBase object (or of one of
- * the classes derived from
- * FEValuesBase), representing the unique
- * components comprising a symmetric second-
- * order tensor valued variable.
+ * Constructor for an object that represents (dim*dim +
+ * dim)/2
components of a FEValuesBase object (or of one of the
+ * classes derived from FEValuesBase), representing the unique components
+ * comprising a symmetric second- order tensor valued variable.
*
- * The second argument denotes the
- * index of the first component of the
+ * The second argument denotes the index of the first component of the
* selected symmetric second order tensor.
*/
SymmetricTensor(const FEValuesBase &fe_values_base,
const unsigned int first_tensor_component);
/**
- * Copy operator. This is not a
- * lightweight object so we don't allow
- * copying and generate an exception if
- * this function is called.
+ * Copy operator. This is not a lightweight object so we don't allow
+ * copying and generate an exception if this function is called.
*/
SymmetricTensor &operator=(const SymmetricTensor<2, dim, spacedim> &);
/**
- * Return the value of the vector
- * components selected by this view,
- * for the shape function and
- * quadrature point selected by the
- * arguments. Here, since the view
- * represents a vector-valued part of
- * the FEValues object with
- * (dim*dim + dim)/2
components
- * (the unique components of a symmetric second-order tensor),
- * the return type is a symmetric tensor of rank 2.
+ * Return the value of the vector components selected by this view, for
+ * the shape function and quadrature point selected by the
+ * arguments. Here, since the view represents a vector-valued part of the
+ * FEValues object with (dim*dim + dim)/2
components (the
+ * unique components of a symmetric second-order tensor), the return type
+ * is a symmetric tensor of rank 2.
*
- * @param shape_function Number
- * of the shape function to be
- * evaluated. Note that this
- * number runs from zero to
- * dofs_per_cell, even in the
- * case of an FEFaceValues or
- * FESubfaceValues object.
+ * @param shape_function Number of the shape function to be
+ * evaluated. Note that this number runs from zero to dofs_per_cell, even
+ * in the case of an FEFaceValues or FESubfaceValues object.
*
- * @param q_point Number of
- * the quadrature point at which
- * function is to be evaluated
+ * @param q_point Number of the quadrature point at which function is to
+ * be evaluated
*/
value_type
value (const unsigned int shape_function,
@@ -1134,19 +817,14 @@ namespace FEValuesViews
/**
- * Return the vector divergence of
- * the vector components selected by
- * this view, for the shape function
- * and quadrature point selected by the
+ * Return the vector divergence of the vector components selected by this
+ * view, for the shape function and quadrature point selected by the
* arguments.
*
- * See the general discussion
- * of this class for a
- * definition of the
+ * See the general discussion of this class for a definition of the
* divergence.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
divergence_type
@@ -1154,19 +832,13 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the values of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the values of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_values
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_values function but it only works on the
* selected vector components.
*/
template
@@ -1174,26 +846,17 @@ namespace FEValuesViews
std::vector &values) const;
/**
- * Return the divergence of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the divergence of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * There is no equivalent function such
- * as
- * FEValuesBase::get_function_divergences
- * in the FEValues classes but the
- * information can be obtained from
- * FEValuesBase::get_function_gradients,
+ * There is no equivalent function such as
+ * FEValuesBase::get_function_divergences in the FEValues classes but the
+ * information can be obtained from FEValuesBase::get_function_gradients,
* of course.
*
- * See the general discussion
- * of this class for a
- * definition of the
+ * See the general discussion of this class for a definition of the
* divergence.
*/
template
@@ -1202,21 +865,18 @@ namespace FEValuesViews
private:
/**
- * A reference to the FEValuesBase object
- * we operate on.
+ * A reference to the FEValuesBase object we operate on.
*/
const FEValuesBase &fe_values;
/**
- * The first component of the vector
- * this view represents of the
+ * The first component of the vector this view represents of the
* FEValuesBase object.
*/
const unsigned int first_tensor_component;
/**
- * Store the data about shape
- * functions.
+ * Store the data about shape functions.
*/
std::vector shape_function_data;
};
@@ -1226,29 +886,17 @@ namespace FEValuesViews
class Tensor;
/**
- * A class representing a view to a set of
- * dim*dim
components forming a
- * second-order tensor from a
- * vector-valued finite
- * element. Views are discussed in the
- * @ref vector_valued module.
+ * A class representing a view to a set of dim*dim
components
+ * forming a second-order tensor from a vector-valued finite element. Views
+ * are discussed in the @ref vector_valued module.
*
- * This class allows to query the
- * value and divergence of
- * (components of) shape functions
- * and solutions representing
- * tensors. The
- * divergence of a tensor
- * $T_{ij}, 0\le i,j<\text{dim}$ is
- * defined as
- * $d_i = \sum_j \frac{\partial T_{ji}}{\partial x_j},
- * 0\le i<\text{dim}$.
+ * This class allows to query the value and divergence of (components of)
+ * shape functions and solutions representing tensors. The divergence of a
+ * tensor $T_{ij}, 0\le i,j<\text{dim}$ is defined as $d_i = \sum_j
+ * \frac{\partial T_{ji}}{\partial x_j}, 0\le i<\text{dim}$.
*
- * You get an object of this type if you
- * apply a
- * FEValuesExtractors::Tensor to
- * an FEValues, FEFaceValues or
- * FESubfaceValues object.
+ * You get an object of this type if you apply a FEValuesExtractors::Tensor
+ * to an FEValues, FEFaceValues or FESubfaceValues object.
*
* @ingroup feaccess vector_valued
*
@@ -1260,8 +908,8 @@ namespace FEValuesViews
public:
/**
- * Data type for what you get when you apply an extractor
- * of this kind to a vector-valued finite element.
+ * Data type for what you get when you apply an extractor of this kind to
+ * a vector-valued finite element.
*/
typedef dealii::Tensor<2, spacedim> value_type;
@@ -1271,88 +919,57 @@ namespace FEValuesViews
typedef dealii::Tensor<1, spacedim> divergence_type;
/**
- * A structure where for each shape
- * function we pre-compute a bunch of
- * data that will make later accesses
- * much cheaper.
+ * A structure where for each shape function we pre-compute a bunch of
+ * data that will make later accesses much cheaper.
*/
struct ShapeFunctionData
{
/**
- * For each pair (shape
- * function,component within
- * vector), store whether the
- * selected vector component may be
- * nonzero. For primitive shape
- * functions we know for sure
- * whether a certain scalar
- * component of a given shape
- * function is nonzero, whereas for
- * non-primitive shape functions
- * this may not be entirely clear
- * (e.g. for RT elements it depends
- * on the shape of a cell).
+ * For each pair (shape function,component within vector), store whether
+ * the selected vector component may be nonzero. For primitive shape
+ * functions we know for sure whether a certain scalar component of a
+ * given shape function is nonzero, whereas for non-primitive shape
+ * functions this may not be entirely clear (e.g. for RT elements it
+ * depends on the shape of a cell).
*/
bool is_nonzero_shape_function_component[value_type::n_independent_components];
/**
- * For each pair (shape function,
- * component within vector), store
- * the row index within the
- * shape_values, shape_gradients,
- * and shape_hessians tables (the
- * column index is the quadrature
- * point index). If the shape
- * function is primitive, then we
- * can get this information from
- * the shape_function_to_row_table
- * of the FEValues object;
- * otherwise, we have to work a bit
- * harder to compute this
+ * For each pair (shape function, component within vector), store the
+ * row index within the shape_values, shape_gradients, and
+ * shape_hessians tables (the column index is the quadrature point
+ * index). If the shape function is primitive, then we can get this
+ * information from the shape_function_to_row_table of the FEValues
+ * object; otherwise, we have to work a bit harder to compute this
* information.
*/
unsigned int row_index[value_type::n_independent_components];
/**
- * For each shape function say the
- * following: if only a single
- * entry in
- * is_nonzero_shape_function_component
- * for this shape function is
- * nonzero, then store the
- * corresponding value of row_index
- * and
- * single_nonzero_component_index
- * represents the index between 0
- * and (dim^2) for which it is
- * attained. If multiple components
- * are nonzero, then store -1. If
- * no components are nonzero then
- * store -2.
+ * For each shape function say the following: if only a single entry in
+ * is_nonzero_shape_function_component for this shape function is
+ * nonzero, then store the corresponding value of row_index and
+ * single_nonzero_component_index represents the index between 0 and
+ * (dim^2) for which it is attained. If multiple components are nonzero,
+ * then store -1. If no components are nonzero then store -2.
*/
int single_nonzero_component;
unsigned int single_nonzero_component_index;
};
/**
- * Default constructor. Creates an
- * invalid object.
+ * Default constructor. Creates an invalid object.
*/
Tensor();
/**
- * Constructor for an object that
- * represents (dim*dim)
- * components of a
- * FEValuesBase object (or of one of
- * the classes derived from
- * FEValuesBase), representing the unique
- * components comprising a second-order
- * tensor valued variable.
+ * Constructor for an object that represents (dim*dim)
+ * components of a FEValuesBase object (or of one of the classes derived
+ * from FEValuesBase), representing the unique components comprising a
+ * second-order tensor valued variable.
*
- * The second argument denotes the
- * index of the first component of the
+ * The second argument denotes the index of the first component of the
* selected symmetric second order tensor.
*/
Tensor(const FEValuesBase &fe_values_base,
@@ -1360,55 +977,39 @@ namespace FEValuesViews
/**
- * Copy operator. This is not a
- * lightweight object so we don't allow
- * copying and generate an exception if
- * this function is called.
+ * Copy operator. This is not a lightweight object so we don't allow
+ * copying and generate an exception if this function is called.
*/
Tensor &operator=(const Tensor<2, dim, spacedim> &);
/**
- * Return the value of the vector
- * components selected by this view,
- * for the shape function and
- * quadrature point selected by the
- * arguments. Here, since the view
- * represents a vector-valued part of
- * the FEValues object with
- * (dim*dim)
components
- * (the unique components of a second-order tensor),
- * the return type is a tensor of rank 2.
+ * Return the value of the vector components selected by this view, for
+ * the shape function and quadrature point selected by the
+ * arguments. Here, since the view represents a vector-valued part of the
+ * FEValues object with (dim*dim)
components (the unique
+ * components of a second-order tensor), the return type is a tensor of
+ * rank 2.
*
- * @param shape_function Number
- * of the shape function to be
- * evaluated. Note that this
- * number runs from zero to
- * dofs_per_cell, even in the
- * case of an FEFaceValues or
- * FESubfaceValues object.
+ * @param shape_function Number of the shape function to be
+ * evaluated. Note that this number runs from zero to dofs_per_cell, even
+ * in the case of an FEFaceValues or FESubfaceValues object.
*
- * @param q_point Number of
- * the quadrature point at which
- * function is to be evaluated
+ * @param q_point Number of the quadrature point at which function is to
+ * be evaluated
*/
value_type
value (const unsigned int shape_function,
const unsigned int q_point) const;
/**
- * Return the vector divergence of
- * the vector components selected by
- * this view, for the shape function
- * and quadrature point selected by the
+ * Return the vector divergence of the vector components selected by this
+ * view, for the shape function and quadrature point selected by the
* arguments.
*
- * See the general discussion
- * of this class for a
- * definition of the
+ * See the general discussion of this class for a definition of the
* divergence.
*
- * @note The meaning of the arguments
- * is as documented for the value()
+ * @note The meaning of the arguments is as documented for the value()
* function.
*/
divergence_type
@@ -1416,19 +1017,13 @@ namespace FEValuesViews
const unsigned int q_point) const;
/**
- * Return the values of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the values of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * This function is the equivalent of
- * the
- * FEValuesBase::get_function_values
- * function but it only works on the
+ * This function is the equivalent of the
+ * FEValuesBase::get_function_values function but it only works on the
* selected vector components.
*/
template
@@ -1437,26 +1032,17 @@ namespace FEValuesViews
/**
- * Return the divergence of the selected
- * vector components of the finite
- * element function characterized by
- * fe_function at the
- * quadrature points of the cell, face
- * or subface selected the last time
- * the reinit function of the
- * FEValues object was called.
+ * Return the divergence of the selected vector components of the finite
+ * element function characterized by fe_function at the
+ * quadrature points of the cell, face or subface selected the last time
+ * the reinit function of the FEValues object was called.
*
- * There is no equivalent function such
- * as
- * FEValuesBase::get_function_divergences
- * in the FEValues classes but the
- * information can be obtained from
- * FEValuesBase::get_function_gradients,
+ * There is no equivalent function such as
+ * FEValuesBase::get_function_divergences in the FEValues classes but the
+ * information can be obtained from FEValuesBase::get_function_gradients,
* of course.
*
- * See the general discussion
- * of this class for a
- * definition of the
+ * See the general discussion of this class for a definition of the
* divergence.
*/
template
@@ -1465,21 +1051,18 @@ namespace FEValuesViews
private:
/**
- * A reference to the FEValuesBase object
- * we operate on.
+ * A reference to the FEValuesBase object we operate on.
*/
const FEValuesBase &fe_values;
/**
- * The first component of the vector
- * this view represents of the
+ * The first component of the vector this view represents of the
* FEValuesBase object.
*/
const unsigned int first_tensor_component;
/**
- * Store the data about shape
- * functions.
+ * Store the data about shape functions.
*/
std::vector shape_function_data;
};
@@ -1492,24 +1075,18 @@ namespace internal
namespace FEValuesViews
{
/**
- * A class objects of which store a
- * collection of FEValuesViews::Scalar,
- * FEValuesViews::Vector, etc object. The
- * FEValuesBase class uses it to generate
- * all possible Views classes upon
- * construction time; we do this at
- * construction time since the Views
- * classes cache some information and are
- * therefore relatively expensive to
- * create.
+ * A class objects of which store a collection of FEValuesViews::Scalar,
+ * FEValuesViews::Vector, etc object. The FEValuesBase class uses it to
+ * generate all possible Views classes upon construction time; we do this
+ * at construction time since the Views classes cache some information and
+ * are therefore relatively expensive to create.
*/
template
struct Cache
{
/**
- * Caches for scalar and
- * vector, and symmetric second-order
- * tensor valued views.
+ * Caches for scalar and vector, and symmetric second-order tensor
+ * valued views.
*/
std::vector > scalars;
std::vector > vectors;
@@ -1532,16 +1109,15 @@ namespace internal
//TODO: Several FEValuesBase of a system should share Mapping
/**
- * Contains all data vectors for FEValues.
- * This class has been extracted from FEValuesBase to be handed
- * over to the fill functions of Mapping and
+ * Contains all data vectors for FEValues. This class has been extracted from
+ * FEValuesBase to be handed over to the fill functions of Mapping and
* FiniteElement.
*
- * @note All data fields are public, but this is not
- * critical, because access to this object is private in FEValues.
+ * @note All data fields are public, but this is not critical, because access
+ * to this object is private in FEValues.
*
- * The purpose of this class is discussed
- * on the page on @ref UpdateFlagsEssay.
+ * The purpose of this class is discussed on the page on @ref
+ * UpdateFlagsEssay.
*
* @ingroup feaccess
* @author Guido Kanschat
@@ -1552,179 +1128,118 @@ class FEValuesData
{
public:
/**
- * Initialize all vectors to
- * correct size.
+ * Initialize all vectors to correct size.
*/
void initialize (const unsigned int n_quadrature_points,
const FiniteElement &fe,
const UpdateFlags flags);
/**
- * Storage type for shape
- * values. Each row in the matrix
- * denotes the values of a single
- * shape function at the
- * different points, columns are
- * for a single point with the
- * different shape functions.
+ * Storage type for shape values. Each row in the matrix denotes the values
+ * of a single shape function at the different points, columns are for a
+ * single point with the different shape functions.
*
- * If a shape function has more
- * than one non-zero component
- * (in deal.II diction: it is
- * non-primitive), then we
- * allocate one row per non-zero
- * component, and shift
- * subsequent rows backward.
- * Lookup of the correct row for
- * a shape function is thus
- * simple in case the entire
- * finite element is primitive
- * (i.e. all shape functions are
- * primitive), since then the
- * shape function number equals
- * the row number. Otherwise, use
- * the
- * #shape_function_to_row_table
- * array to get at the first row
- * that belongs to this
- * particular shape function, and
- * navigate among all the rows
- * for this shape function using
- * the
- * FiniteElement::get_nonzero_components()
- * function which tells us which
- * components are non-zero and
- * thus have a row in the array
- * presently under discussion.
+ * If a shape function has more than one non-zero component (in deal.II
+ * diction: it is non-primitive), then we allocate one row per non-zero
+ * component, and shift subsequent rows backward. Lookup of the correct row
+ * for a shape function is thus simple in case the entire finite element is
+ * primitive (i.e. all shape functions are primitive), since then the shape
+ * function number equals the row number. Otherwise, use the
+ * #shape_function_to_row_table array to get at the first row that belongs
+ * to this particular shape function, and navigate among all the rows for
+ * this shape function using the FiniteElement::get_nonzero_components()
+ * function which tells us which components are non-zero and thus have a row
+ * in the array presently under discussion.
*/
typedef Table<2,double> ShapeVector;
/**
- * Storage type for
- * gradients. The layout of data
- * is the same as for the
+ * Storage type for gradients. The layout of data is the same as for the
* #ShapeVector data type.
*/
typedef std::vector > > GradientVector;
/**
- * Likewise for second order
- * derivatives.
+ * Likewise for second order derivatives.
*/
typedef std::vector > > HessianVector;
/**
- * Store the values of the shape
- * functions at the quadrature
- * points. See the description of
- * the data type for the layout
- * of the data in this field.
+ * Store the values of the shape functions at the quadrature points. See the
+ * description of the data type for the layout of the data in this field.
*/
ShapeVector shape_values;
/**
- * Store the gradients of the
- * shape functions at the
- * quadrature points. See the
- * description of the data type
- * for the layout of the data in
- * this field.
+ * Store the gradients of the shape functions at the quadrature points. See
+ * the description of the data type for the layout of the data in this
+ * field.
*/
GradientVector shape_gradients;
/**
- * Store the 2nd derivatives of
- * the shape functions at the
- * quadrature points. See the
- * description of the data type
- * for the layout of the data in
- * this field.
+ * Store the 2nd derivatives of the shape functions at the quadrature
+ * points. See the description of the data type for the layout of the data
+ * in this field.
*/
HessianVector shape_hessians;
/**
- * Store an array of weights
- * times the Jacobi determinant
- * at the quadrature points. This
- * function is reset each time
- * reinit() is called. The
- * Jacobi determinant is actually
- * the reciprocal value of the
- * Jacobi matrices stored in this
- * class, see the general
- * documentation of this class
- * for more information.
+ * Store an array of weights times the Jacobi determinant at the quadrature
+ * points. This function is reset each time reinit() is called. The Jacobi
+ * determinant is actually the reciprocal value of the Jacobi matrices
+ * stored in this class, see the general documentation of this class for
+ * more information.
*
- * However, if this object refers
- * to an FEFaceValues or
- * FESubfaceValues object, then
- * the JxW_values correspond to
- * the Jacobian of the
- * transformation of the face,
- * not the cell, i.e. the
- * dimensionality is that of a
- * surface measure, not of a
- * volume measure. In this case,
- * it is computed from the
- * boundary forms, rather than
- * the Jacobian matrix.
+ * However, if this object refers to an FEFaceValues or FESubfaceValues
+ * object, then the JxW_values correspond to the Jacobian of the
+ * transformation of the face, not the cell, i.e. the dimensionality is that
+ * of a surface measure, not of a volume measure. In this case, it is
+ * computed from the boundary forms, rather than the Jacobian matrix.
*/
std::vector JxW_values;
/**
- * Array of the Jacobian matrices at the
- * quadrature points.
+ * Array of the Jacobian matrices at the quadrature points.
*/
std::vector< DerivativeForm<1,dim,spacedim> > jacobians;
/**
- * Array of the derivatives of the Jacobian
- * matrices at the quadrature points.
+ * Array of the derivatives of the Jacobian matrices at the quadrature
+ * points.
*/
std::vector > jacobian_grads;
/**
- * Array of the inverse Jacobian matrices
- * at the quadrature points.
+ * Array of the inverse Jacobian matrices at the quadrature points.
*/
std::vector > inverse_jacobians;
/**
- * Array of quadrature points. This array
- * is set up upon calling reinit() and
- * contains the quadrature points on the
- * real element, rather than on the
- * reference element.
+ * Array of quadrature points. This array is set up upon calling reinit()
+ * and contains the quadrature points on the real element, rather than on
+ * the reference element.
*/
std::vector > quadrature_points;
/**
- * List of outward normal vectors at the
- * quadrature points. This field is filled
- * in by the finite element class.
+ * List of outward normal vectors at the quadrature points. This field is
+ * filled in by the finite element class.
*/
std::vector > normal_vectors;
/**
- * List of boundary forms at the
- * quadrature points. This field is filled
- * in by the finite element class.
+ * List of boundary forms at the quadrature points. This field is filled in
+ * by the finite element class.
*/
std::vector > boundary_forms;
/**
- * When asked for the value (or
- * gradient, or Hessian) of shape
- * function i's c-th vector
- * component, we need to look it
- * up in the #shape_values,
- * #shape_gradients and
- * #shape_hessians arrays. The
- * question is where in this
- * array does the data for shape
- * function i, component c
- * reside. This is what this
- * table answers.
+ * When asked for the value (or gradient, or Hessian) of shape function i's
+ * c-th vector component, we need to look it up in the #shape_values,
+ * #shape_gradients and #shape_hessians arrays. The question is where in
+ * this array does the data for shape function i, component c reside. This is
+ * what this table answers.
*
* The format of the table is as
* follows:
@@ -1740,43 +1255,24 @@ public:
* corresponding datum is stored
* for all the quadrature points.
*
- * In the general, vector-valued
- * context, the number of
- * components is larger than one,
- * but for a given shape
- * function, not all vector
- * components may be nonzero
- * (e.g., if a shape function is
- * primitive, then exactly one
- * vector component is non-zero,
- * while the others are all
- * zero). For such zero
- * components, #shape_values and
- * friends do not have a
- * row. Consequently, for vector
- * components for which shape
- * function i is zero, the entry
- * in the current table is
- * numbers::invalid_unsigned_int.
+ * In the general, vector-valued context, the number of components is larger
+ * than one, but for a given shape function, not all vector components may be
+ * nonzero (e.g., if a shape function is primitive, then exactly one vector
+ * component is non-zero, while the others are all zero). For such zero
+ * components, #shape_values and friends do not have a row. Consequently, for
+ * vector components for which shape function i is zero, the entry in the
+ * current table is numbers::invalid_unsigned_int.
*
- * On the other hand, the table
- * is guaranteed to have at least
- * one valid index for each shape
- * function. In particular, for a
- * primitive finite element, each
- * shape function has exactly one
- * nonzero component and so for
- * each i, there is exactly one
- * valid index within the range
- * [i*n_components,
- * (i+1)*n_components)
.
+ * On the other hand, the table is guaranteed to have at least one valid
+ * index for each shape function. In particular, for a primitive finite
+ * element, each shape function has exactly one nonzero component and so for
+ * each i, there is exactly one valid index within the range
+ * [i*n_components, (i+1)*n_components)
.
*/
std::vector shape_function_to_row_table;
/**
- * Original update flags handed
- * to the constructor of
- * FEValues.
+ * Original update flags handed to the constructor of FEValues.
*/
UpdateFlags update_flags;
};
@@ -1878,19 +1374,18 @@ public:
*
* UpdateFlags
*
- * The UpdateFlags object handed to the constructor is used to
- * determine which of the data fields to compute. This way, it is
- * possible to avoid expensive computations of useless derivatives.
- * In the beginning, these flags are processed through the functions
- * Mapping::update_once(), Mapping::update_each(),
- * FiniteElement::update_once() FiniteElement::update_each(). All the
- * results are bit-wise or'd and determine the fields actually
- * computed. This enables Mapping and FiniteElement to schedule
- * auxiliary data fields for updating. Still, it is recommended to
- * give all needed update flags to FEValues.
+ * The UpdateFlags object handed to the constructor is used to determine which
+ * of the data fields to compute. This way, it is possible to avoid expensive
+ * computations of useless derivatives. In the beginning, these flags are
+ * processed through the functions Mapping::update_once(),
+ * Mapping::update_each(), FiniteElement::update_once()
+ * FiniteElement::update_each(). All the results are bit-wise or'd and
+ * determine the fields actually computed. This enables Mapping and
+ * FiniteElement to schedule auxiliary data fields for updating. Still, it is
+ * recommended to give all needed update flags to FEValues.
*
- * The mechanisms by which this class works is also discussed
- * on the page on @ref UpdateFlagsEssay.
+ * The mechanisms by which this class works is also discussed on the page on
+ * @ref UpdateFlagsEssay.
*
* @ingroup feaccess
* @author Wolfgang Bangerth, 1998, 2003, Guido Kanschat, 2001
@@ -1901,14 +1396,12 @@ class FEValuesBase : protected FEValuesData,
{
public:
/**
- * Dimension in which this object
- * operates.
+ * Dimension in which this object operates.
*/
static const unsigned int dimension = dim;
/**
- * Dimension of the space in
- * which this object operates.
+ * Dimension of the space in which this object operates.
*/
static const unsigned int space_dimension = spacedim;
@@ -1918,30 +1411,19 @@ public:
const unsigned int n_quadrature_points;
/**
- * Number of shape functions per
- * cell. If we use this base
- * class to evaluate a finite
- * element on faces of cells,
- * this is still the number of
- * degrees of freedom per cell,
- * not per face.
+ * Number of shape functions per cell. If we use this base class to evaluate
+ * a finite element on faces of cells, this is still the number of degrees
+ * of freedom per cell, not per face.
*/
const unsigned int dofs_per_cell;
/**
- * Constructor. Set up the array
- * sizes with n_q_points
- * quadrature points, dofs_per_cell
- * trial functions per cell and
- * with the given pattern to
- * update the fields when the
- * reinit function of the
- * derived classes is called. The
- * fields themselves are not set
- * up, this must happen in the
- * constructor of the derived
- * class.
+ * Constructor. Set up the array sizes with n_q_points quadrature
+ * points, dofs_per_cell trial functions per cell and with the
+ * given pattern to update the fields when the reinit function of
+ * the derived classes is called. The fields themselves are not set up, this
+ * must happen in the constructor of the derived class.
*/
FEValuesBase (const unsigned int n_q_points,
const unsigned int dofs_per_cell,
@@ -1958,71 +1440,42 @@ public:
//@{
/**
- * Value of a shape function at a
- * quadrature point on the cell,
- * face or subface selected the
- * last time the reinit
- * function of the derived class
- * was called.
+ * Value of a shape function at a quadrature point on the cell, face or
+ * subface selected the last time the reinit function of the
+ * derived class was called.
*
- * If the shape function is
- * vector-valued, then this
- * returns the only non-zero
- * component. If the shape
- * function has more than one
- * non-zero component (i.e. it is
- * not primitive), then throw an
- * exception of type
- * ExcShapeFunctionNotPrimitive. In
- * that case, use the
- * shape_value_component()
- * function.
+ * If the shape function is vector-valued, then this returns the only
+ * non-zero component. If the shape function has more than one non-zero
+ * component (i.e. it is not primitive), then throw an exception of type
+ * ExcShapeFunctionNotPrimitive. In that case, use the
+ * shape_value_component() function.
*
- * @param function_no Number
- * of the shape function to be
- * evaluated. Note that this
- * number runs from zero to
- * dofs_per_cell, even in the
- * case of an FEFaceValues or
- * FESubfaceValues object.
+ * @param function_no Number of the shape function to be evaluated. Note
+ * that this number runs from zero to dofs_per_cell, even in the case of an
+ * FEFaceValues or FESubfaceValues object.
*
- * @param point_no Number of
- * the quadrature point at which
- * function is to be evaluated
+ * @param point_no Number of the quadrature point at which function is to be
+ * evaluated
*/
const double &shape_value (const unsigned int function_no,
const unsigned int point_no) const;
/**
- * Compute one vector component of
- * the value of a shape function
- * at a quadrature point. If the
- * finite element is scalar, then
- * only component zero is allowed
- * and the return value equals
- * that of the shape_value()
- * function. If the finite
- * element is vector valued but
- * all shape functions are
- * primitive (i.e. they are
- * non-zero in only one
- * component), then the value
- * returned by shape_value()
- * equals that of this function
- * for exactly one
- * component. This function is
- * therefore only of greater
- * interest if the shape function
- * is not primitive, but then it
- * is necessary since the other
+ * Compute one vector component of the value of a shape function at a
+ * quadrature point. If the finite element is scalar, then only component
+ * zero is allowed and the return value equals that of the shape_value()
+ * function. If the finite element is vector valued but all shape functions
+ * are primitive (i.e. they are non-zero in only one component), then the
+ * value returned by shape_value() equals that of this function for exactly
+ * one component. This function is therefore only of greater interest if the
+ * shape function is not primitive, but then it is necessary since the other
* function cannot be used.
*
- * @param function_no Number
- * of the shape function to be
+ * @param function_no Number of the shape function to be evaluated
+ *
+ * @param point_no Number of the quadrature point at which function is to be
* evaluated
- * @param point_no Number of
- * the quadrature point at which
- * function is to be evaluated
+ *
* @param component vector component to be evaluated
*/
double shape_value_component (const unsigned int function_no,
@@ -2030,68 +1483,39 @@ public:
const unsigned int component) const;
/**
- * Compute the gradient of the
- * ith shape function at the
- * jth quadrature point with
- * respect to real cell
- * coordinates. If you want to
- * get the derivative in one of
- * the coordinate directions, use
- * the appropriate function of
- * the Tensor class to
- * extract one component. Since
- * only a reference to the
- * gradient's value is returned,
- * there should be no major
+ * Compute the gradient of the function_noth shape function at the
+ * quadrature_pointth quadrature point with respect to real cell
+ * coordinates. If you want to get the derivative in one of the coordinate
+ * directions, use the appropriate function of the Tensor class to extract
+ * one component of the Tensor returned by this function. Since only a
+ * reference to the gradient's value is returned, there should be no major
* performance drawback.
*
- * If the shape function is
- * vector-valued, then this
- * returns the only non-zero
- * component. If the shape
- * function has more than one
- * non-zero component (i.e. it is
- * not primitive), then throw an
- * exception of type
- * ExcShapeFunctionNotPrimitive. In
- * that case, use the
- * shape_grad_component()
- * function.
+ * If the shape function is vector-valued, then this returns the only
+ * non-zero component. If the shape function has more than one non-zero
+ * component (i.e. it is not primitive), then it will throw an exception of
+ * type ExcShapeFunctionNotPrimitive. In that case, use the
+ * shape_grad_component() function.
*
- * The same holds for the arguments
- * of this function as for the
+ * The same holds for the arguments of this function as for the
* shape_value() function.
*/
const Tensor<1,spacedim> &
- shape_grad (const unsigned int function,
+ shape_grad (const unsigned int function_no,
const unsigned int quadrature_point) const;
/**
- * Return one vector component of
- * the gradient of a shape function
- * at a quadrature point. If the
- * finite element is scalar, then
- * only component zero is allowed
- * and the return value equals
- * that of the shape_grad()
- * function. If the finite
- * element is vector valued but
- * all shape functions are
- * primitive (i.e. they are
- * non-zero in only one
- * component), then the value
- * returned by shape_grad()
- * equals that of this function
- * for exactly one
- * component. This function is
- * therefore only of greater
- * interest if the shape function
- * is not primitive, but then it
- * is necessary since the other
+ * Return one vector component of the gradient of a shape function at a
+ * quadrature point. If the finite element is scalar, then only component
+ * zero is allowed and the return value equals that of the shape_grad()
+ * function. If the finite element is vector valued but all shape functions
+ * are primitive (i.e. they are non-zero in only one component), then the
+ * value returned by shape_grad() equals that of this function for exactly
+ * one component. This function is therefore only of greater interest if the
+ * shape function is not primitive, but then it is necessary since the other
* function cannot be used.
*
- * The same holds for the arguments
- * of this function as for the
+ * The same holds for the arguments of this function as for the
* shape_value_component() function.
*/
Tensor<1,spacedim>
@@ -2100,36 +1524,20 @@ public:
const unsigned int component) const;
/**
- * Second derivatives of
- * the function_noth shape function at
- * the point_noth quadrature point
- * with respect to real cell
- * coordinates. If you want to
- * get the derivatives in one of
- * the coordinate directions, use
- * the appropriate function of
- * the Tensor class to
- * extract one component. Since
- * only a reference to the
- * derivative values is returned,
- * there should be no major
- * performance drawback.
+ * Second derivatives of the function_noth shape function at the
+ * point_noth quadrature point with respect to real cell
+ * coordinates. If you want to get the derivatives in one of the coordinate
+ * directions, use the appropriate function of the Tensor class to extract
+ * one component. Since only a reference to the derivative values is
+ * returned, there should be no major performance drawback.
*
- * If the shape function is
- * vector-valued, then this
- * returns the only non-zero
- * component. If the shape
- * function has more than one
- * non-zero component (i.e. it is
- * not primitive), then throw an
- * exception of type
- * ExcShapeFunctionNotPrimitive. In
- * that case, use the
- * shape_grad_grad_component()
- * function.
+ * If the shape function is vector-valued, then this returns the only
+ * non-zero component. If the shape function has more than one non-zero
+ * component (i.e. it is not primitive), then throw an exception of type
+ * ExcShapeFunctionNotPrimitive. In that case, use the
+ * shape_grad_grad_component() function.
*
- * The same holds for the arguments
- * of this function as for the
+ * The same holds for the arguments of this function as for the
* shape_value() function.
*/
const Tensor<2,spacedim> &
@@ -2145,33 +1553,17 @@ public:
/**
- * Return one vector component of
- * the gradient of a shape
- * function at a quadrature
- * point. If the finite element
- * is scalar, then only component
- * zero is allowed and the return
- * value equals that of the
- * shape_hessian()
- * function. If the finite
- * element is vector valued but
- * all shape functions are
- * primitive (i.e. they are
- * non-zero in only one
- * component), then the value
- * returned by
- * shape_hessian()
- * equals that of this function
- * for exactly one
- * component. This function is
- * therefore only of greater
- * interest if the shape function
- * is not primitive, but then it
- * is necessary since the other
- * function cannot be used.
+ * Return one vector component of the gradient of a shape function at a
+ * quadrature point. If the finite element is scalar, then only component
+ * zero is allowed and the return value equals that of the shape_hessian()
+ * function. If the finite element is vector valued but all shape functions
+ * are primitive (i.e. they are non-zero in only one component), then the
+ * value returned by shape_hessian() equals that of this function for
+ * exactly one component. This function is therefore only of greater
+ * interest if the shape function is not primitive, but then it is necessary
+ * since the other function cannot be used.
*
- * The same holds for the arguments
- * of this function as for the
+ * The same holds for the arguments of this function as for the
* shape_value_component() function.
*/
Tensor<2,spacedim>
@@ -2193,131 +1585,71 @@ public:
//@{
/**
- * Returns the values of a finite
- * element function restricted to
- * the current cell, face or
- * subface selected the last time
- * the reinit function
- * of the derived class was
- * called, at the quadrature
- * points.
+ * Returns the values of a finite element function restricted to the current
+ * cell, face or subface selected the last time the reinit function
+ * of the derived class was called, at the quadrature points.
*
- * If the present cell is not
- * active then values are
- * interpolated to the current
- * cell and point values are
- * computed from that.
+ * If the present cell is not active then values are interpolated to the
+ * current cell and point values are computed from that.
*
- * This function may only be used
- * if the finite element in use
- * is a scalar one, i.e. has only
- * one vector component. To get
- * values of multi-component
- * elements, there is another
- * get_function_values() below,
- * returning a vector of vectors
- * of results.
+ * This function may only be used if the finite element in use is a scalar
+ * one, i.e. has only one vector component. To get values of
+ * multi-component elements, there is another get_function_values() below,
+ * returning a vector of vectors of results.
*
- * @param[in] fe_function A
- * vector of values that
- * describes (globally) the
- * finite element function that
- * this function should evaluate
- * at the quadrature points of
- * the current cell.
+ * @param[in] fe_function A vector of values that describes (globally) the
+ * finite element function that this function should evaluate at the
+ * quadrature points of the current cell.
*
- * @param[out] values The values
- * of the function specified by
- * fe_function at the quadrature
- * points of the current cell.
- * The object is assume to
+ * @param[out] values The values of the function specified by fe_function at
+ * the quadrature points of the current cell. The object is assume to
* already have the correct size.
*
- * @post values[q]
- * will contain the value of the
- * field described by fe_function
- * at the $q$th quadrature point.
+ * @post values[q]
will contain the value of the field
+ * described by fe_function at the $q$th quadrature point.
*
- * @note The actual data type of the
- * input vector may be either a
- * Vector<T>,
- * BlockVector<T>, or one
- * of the sequential PETSc or
- * Trilinos vector wrapper
- * classes. It represents a
- * global vector of DoF values
- * associated with the DofHandler
- * object with which this
- * FEValues object was last
- * initialized. Alternatively,
- * if the vector argument is of
- * type IndexSet, then the function
- * is represented as one that
- * is either zero or one, depending
- * on whether a DoF index is in
- * the set or not.
+ * @note The actual data type of the input vector may be either a
+ * Vector<T>, BlockVector<T>, or one of the sequential PETSc or
+ * Trilinos vector wrapper classes. It represents a global vector of DoF
+ * values associated with the DofHandler object with which this FEValues
+ * object was last initialized. Alternatively, if the vector argument is of
+ * type IndexSet, then the function is represented as one that is either
+ * zero or one, depending on whether a DoF index is in the set or not.
*/
template
void get_function_values (const InputVector &fe_function,
std::vector &values) const;
/**
- * This function does the same as
- * the other
- * get_function_values(), but
- * applied to multi-component
- * (vector-valued) elements. The
- * meaning of the arguments is as
- * explained there.
+ * This function does the same as the other get_function_values(), but
+ * applied to multi-component (vector-valued) elements. The meaning of the
+ * arguments is as explained there.
*
- * @post values[q]
- * is a vector of values of the
- * field described by fe_function
- * at the $q$th quadrature
- * point. The size of the vector
- * accessed by
- * values[q]
equals
- * the number of components of
- * the finite element,
- * i.e. values[q](c)
- * returns the value of the $c$th
- * vector component at the $q$th
- * quadrature point.
+ * @post values[q]
is a vector of values of the field described
+ * by fe_function at the $q$th quadrature point. The size of the vector
+ * accessed by values[q]
equals the number of components of the
+ * finite element, i.e. values[q](c)
returns the value of the
+ * $c$th vector component at the $q$th quadrature point.
*/
template
void get_function_values (const InputVector &fe_function,
std::vector > &values) const;
/**
- * Generate function values from
- * an arbitrary vector.
+ * Generate function values from an arbitrary vector.
*
- * This function offers the
- * possibility to extract
- * function values in quadrature
- * points from vectors not
- * corresponding to a whole
+ * This function offers the possibility to extract function values in
+ * quadrature points from vectors not corresponding to a whole
* discretization.
*
- * The vector indices
- * corresponds to the degrees of
- * freedom on a single cell. Its
- * length may even be a multiple
- * of the number of dofs per
- * cell. Then, the vectors in
- * value should allow
- * for the same multiple of the
- * components of the finite
- * element.
+ * The vector indices corresponds to the degrees of freedom on a
+ * single cell. Its length may even be a multiple of the number of dofs per
+ * cell. Then, the vectors in value should allow for the same
+ * multiple of the components of the finite element.
*
- * You may want to use this
- * function, if you want to
- * access just a single block
- * from a BlockVector, if you
- * have a multi-level vector or
- * if you already have a local
- * representation of your finite
- * element data.
+ * You may want to use this function, if you want to access just a single
+ * block from a BlockVector, if you have a multi-level vector or if you
+ * already have a local representation of your finite element data.
*/
template
void get_function_values (const InputVector &fe_function,
@@ -2325,42 +1657,23 @@ public:
std::vector &values) const;
/**
- * Generate vector function
- * values from an arbitrary
- * vector.
+ * Generate vector function values from an arbitrary vector.
*
- * This function offers the
- * possibility to extract
- * function values in quadrature
- * points from vectors not
- * corresponding to a whole
+ * This function offers the possibility to extract function values in
+ * quadrature points from vectors not corresponding to a whole
* discretization.
*
- * The vector indices
- * corresponds to the degrees of
- * freedom on a single cell. Its
- * length may even be a multiple
- * of the number of dofs per
- * cell. Then, the vectors in
- * value should allow
- * for the same multiple of the
- * components of the finite
- * element.
+ * The vector indices corresponds to the degrees of freedom on a
+ * single cell. Its length may even be a multiple of the number of dofs per
+ * cell. Then, the vectors in value should allow for the same
+ * multiple of the components of the finite element.
*
- * You may want to use this
- * function, if you want to
- * access just a single block
- * from a BlockVector, if you
- * have a multi-level vector or
- * if you already have a local
- * representation of your finite
- * element data.
+ * You may want to use this function, if you want to access just a single
+ * block from a BlockVector, if you have a multi-level vector or if you
+ * already have a local representation of your finite element data.
*
- * Since this function allows for
- * fairly general combinations of
- * argument sizes, be aware that
- * the checks on the arguments
- * may not detect errors.
+ * Since this function allows for fairly general combinations of argument
+ * sizes, be aware that the checks on the arguments may not detect errors.
*/
template
void get_function_values (const InputVector &fe_function,
@@ -2369,62 +1682,32 @@ public:
/**
- * Generate vector function
- * values from an arbitrary
- * vector.
+ * Generate vector function values from an arbitrary vector.
*
- * This function offers the
- * possibility to extract
- * function values in quadrature
- * points from vectors not
- * corresponding to a whole
+ * This function offers the possibility to extract function values in
+ * quadrature points from vectors not corresponding to a whole
* discretization.
*
- * The vector indices
- * corresponds to the degrees of
- * freedom on a single cell. Its
- * length may even be a multiple
- * of the number of dofs per
- * cell. Then, the vectors in
- * value should allow
- * for the same multiple of the
- * components of the finite
- * element.
+ * The vector indices corresponds to the degrees of freedom on a
+ * single cell. Its length may even be a multiple of the number of dofs per
+ * cell. Then, the vectors in value should allow for the same
+ * multiple of the components of the finite element.
*
- * Depending on the value of the last
- * argument, the outer vector of
- * values has either the
- * length of the quadrature rule
- * (quadrature_points_fastest
- * == false) or the length
- * of components to be filled
- * quadrature_points_fastest
- * == true. If p is
- * the current quadrature point
- * number and i is the
- * vector component of the
- * solution desired, the access
- * to values is
- * values[p][i] if
- * quadrature_points_fastest
- * == false, and
- * values[i][p]
- * otherwise.
+ * Depending on the value of the last argument, the outer vector of
+ * values has either the length of the quadrature rule
+ * (quadrature_points_fastest == false) or the length of components
+ * to be filled quadrature_points_fastest == true. If p is
+ * the current quadrature point number and i is the vector
+ * component of the solution desired, the access to values is
+ * values[p][i] if quadrature_points_fastest == false, and
+ * values[i][p] otherwise.
*
- * You may want to use this
- * function, if you want to
- * access just a single block
- * from a BlockVector, if you
- * have a multi-level vector or
- * if you already have a local
- * representation of your finite
- * element data.
+ * You may want to use this function, if you want to access just a single
+ * block from a BlockVector, if you have a multi-level vector or if you
+ * already have a local representation of your finite element data.
*
- * Since this function allows for
- * fairly general combinations of
- * argument sizes, be aware that
- * the checks on the arguments
- * may not detect errors.
+ * Since this function allows for fairly general combinations of argument
+ * sizes, be aware that the checks on the arguments may not detect errors.
*/
template
void get_function_values (const InputVector &fe_function,
@@ -2437,118 +1720,62 @@ public:
//@{
/**
- * Compute the gradients of a
- * finite element at the
- * quadrature points of a
- * cell. This function is the
- * equivalent of the
- * corresponding
- * get_function_values() function
- * (see there for more
- * information) but evaluates the
- * finite element field's
- * gradient instead of its value.
+ * Compute the gradients of a finite element at the quadrature points of a
+ * cell. This function is the equivalent of the corresponding
+ * get_function_values() function (see there for more information) but
+ * evaluates the finite element field's gradient instead of its value.
*
- * This function may only be used
- * if the finite element in use
- * is a scalar one, i.e. has only
- * one vector component. There is
- * a corresponding function of
- * the same name for
- * vector-valued finite elements.
+ * This function may only be used if the finite element in use is a scalar
+ * one, i.e. has only one vector component. There is a corresponding
+ * function of the same name for vector-valued finite elements.
*
- * @param[in] fe_function A
- * vector of values that
- * describes (globally) the
- * finite element function that
- * this function should evaluate
- * at the quadrature points of
- * the current cell.
+ * @param[in] fe_function A vector of values that describes (globally) the
+ * finite element function that this function should evaluate at the
+ * quadrature points of the current cell.
*
- * @param[out] gradients The gradients
- * of the function specified by
- * fe_function at the quadrature
- * points of the current cell.
- * The gradients are computed
- * in real space (as opposed to
- * on the unit cell).
- * The object is assume to
- * already have the correct size.
+ * @param[out] gradients The gradients of the function specified by
+ * fe_function at the quadrature points of the current cell. The gradients
+ * are computed in real space (as opposed to on the unit cell). The object
+ * is assume to already have the correct size.
*
- * @post
- * gradients[q]
will
- * contain the gradient of the
- * field described by fe_function
- * at the $q$th quadrature
- * point. gradients[q][d]
- * represents the derivative in
- * coordinate direction $d$ at
- * quadrature point $q$.
+ * @post gradients[q]
will contain the gradient of the field
+ * described by fe_function at the $q$th quadrature
+ * point. gradients[q][d]
represents the derivative in
+ * coordinate direction $d$ at quadrature point $q$.
*
- * @note The actual data type of the
- * input vector may be either a
- * Vector<T>,
- * BlockVector<T>, or one
- * of the sequential PETSc or
- * Trilinos vector wrapper
- * classes. It represents a
- * global vector of DoF values
- * associated with the DofHandler
- * object with which this
- * FEValues object was last
- * initialized. Alternatively,
- * if the vector argument is of
- * type IndexSet, then the function
- * is represented as one that
- * is either zero or one, depending
- * on whether a DoF index is in
- * the set or not.
+ * @note The actual data type of the input vector may be either a
+ * Vector<T>, BlockVector<T>, or one of the sequential PETSc or
+ * Trilinos vector wrapper classes. It represents a global vector of DoF
+ * values associated with the DofHandler object with which this FEValues
+ * object was last initialized. Alternatively, if the vector argument is of
+ * type IndexSet, then the function is represented as one that is either
+ * zero or one, depending on whether a DoF index is in the set or not.
*/
template
void get_function_gradients (const InputVector &fe_function,
std::vector > &gradients) const;
/**
- * This function does the same as
- * the other
- * get_function_gradients(), but
- * applied to multi-component
- * (vector-valued) elements. The
- * meaning of the arguments is as
- * explained there.
+ * This function does the same as the other get_function_gradients(), but
+ * applied to multi-component (vector-valued) elements. The meaning of the
+ * arguments is as explained there.
*
- * @post
- * gradients[q]
is a
- * vector of gradients of the
- * field described by fe_function
- * at the $q$th quadrature
- * point. The size of the vector
- * accessed by
- * gradients[q]
- * equals the number of
- * components of the finite
- * element,
- * i.e. gradients[q][c]
- * returns the gradient of the
- * $c$th vector component at the
- * $q$th quadrature
- * point. Consequently,
- * gradients[q][c][d]
- * is the derivative in
- * coordinate direction $d$ of
- * the $c$th vector component of
- * the vector field at quadrature
- * point $q$ of the current cell.
+ * @post gradients[q]
is a vector of gradients of the field
+ * described by fe_function at the $q$th quadrature point. The size of the
+ * vector accessed by gradients[q]
equals the number of
+ * components of the finite element, i.e. gradients[q][c]
+ * returns the gradient of the $c$th vector component at the $q$th
+ * quadrature point. Consequently, gradients[q][c][d]
is the
+ * derivative in coordinate direction $d$ of the $c$th vector component of
+ * the vector field at quadrature point $q$ of the current cell.
*/
template
void get_function_gradients (const InputVector &fe_function,
std::vector > > &gradients) const;
/**
- * Function gradient access with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Function gradient access with more flexibility. see get_function_values()
+ * with corresponding arguments.
*/
template
void get_function_gradients (const InputVector &fe_function,
@@ -2556,10 +1783,8 @@ public:
std::vector > &gradients) const;
/**
- * Function gradient access with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Function gradient access with more flexibility. see get_function_values()
+ * with corresponding arguments.
*/
template
void get_function_gradients (const InputVector &fe_function,
@@ -2568,24 +1793,21 @@ public:
bool quadrature_points_fastest = false) const;
/**
- * @deprecated Use
- * get_function_gradients() instead.
+ * @deprecated Use get_function_gradients() instead.
*/
template
void get_function_grads (const InputVector &fe_function,
std::vector > &gradients) const DEAL_II_DEPRECATED;
/**
- * @deprecated Use
- * get_function_gradients() instead.
+ * @deprecated Use get_function_gradients() instead.
*/
template
void get_function_grads (const InputVector &fe_function,
std::vector > > &gradients) const DEAL_II_DEPRECATED;
/**
- * @deprecated Use
- * get_function_gradients() instead.
+ * @deprecated Use get_function_gradients() instead.
*/
template
void get_function_grads (const InputVector &fe_function,
@@ -2593,8 +1815,7 @@ public:
std::vector > &gradients) const DEAL_II_DEPRECATED;
/**
- * @deprecated Use
- * get_function_gradients() instead.
+ * @deprecated Use get_function_gradients() instead.
*/
template
void get_function_grads (const InputVector &fe_function,
@@ -2607,74 +1828,37 @@ public:
//@{
/**
- * Compute the tensor of second
- * derivatives of a finite
- * element at the quadrature
- * points of a cell. This
- * function is the equivalent of
- * the corresponding
- * get_function_values() function
- * (see there for more
- * information) but evaluates the
- * finite element field's second
- * derivatives instead of its
- * value.
+ * Compute the tensor of second derivatives of a finite element at the
+ * quadrature points of a cell. This function is the equivalent of the
+ * corresponding get_function_values() function (see there for more
+ * information) but evaluates the finite element field's second derivatives
+ * instead of its value.
*
- * This function may only be used
- * if the finite element in use
- * is a scalar one, i.e. has only
- * one vector component. There is
- * a corresponding function of
- * the same name for
- * vector-valued finite elements.
+ * This function may only be used if the finite element in use is a scalar
+ * one, i.e. has only one vector component. There is a corresponding
+ * function of the same name for vector-valued finite elements.
*
- * @param[in] fe_function A
- * vector of values that
- * describes (globally) the
- * finite element function that
- * this function should evaluate
- * at the quadrature points of
- * the current cell.
+ * @param[in] fe_function A vector of values that describes (globally) the
+ * finite element function that this function should evaluate at the
+ * quadrature points of the current cell.
*
- * @param[out] hessians The Hessians
- * of the function specified by
- * fe_function at the quadrature
- * points of the current cell.
- * The Hessians are computed
- * in real space (as opposed to
- * on the unit cell).
- * The object is assume to
- * already have the correct size.
+ * @param[out] hessians The Hessians of the function specified by
+ * fe_function at the quadrature points of the current cell. The Hessians
+ * are computed in real space (as opposed to on the unit cell). The object
+ * is assume to already have the correct size.
*
- * @post hessians[q]
- * will contain the Hessian of
- * the field described by
- * fe_function at the $q$th
- * quadrature
- * point. gradients[q][i][j]
- * represents the $(i,j)$th
- * component of the matrix of
- * second derivatives at
- * quadrature point $q$.
+ * @post hessians[q]
will contain the Hessian of the field
+ * described by fe_function at the $q$th quadrature
+ * point. gradients[q][i][j]
represents the $(i,j)$th component
+ * of the matrix of second derivatives at quadrature point $q$.
*
- * @note The actual data type of the
- * input vector may be either a
- * Vector<T>,
- * BlockVector<T>, or one
- * of the sequential PETSc or
- * Trilinos vector wrapper
- * classes. It represents a
- * global vector of DoF values
- * associated with the DofHandler
- * object with which this
- * FEValues object was last
- * initialized. Alternatively,
- * if the vector argument is of
- * type IndexSet, then the function
- * is represented as one that
- * is either zero or one, depending
- * on whether a DoF index is in
- * the set or not.
+ * @note The actual data type of the input vector may be either a
+ * Vector<T>, BlockVector<T>, or one of the sequential PETSc or
+ * Trilinos vector wrapper classes. It represents a global vector of DoF
+ * values associated with the DofHandler object with which this FEValues
+ * object was last initialized. Alternatively, if the vector argument is of
+ * type IndexSet, then the function is represented as one that is either
+ * zero or one, depending on whether a DoF index is in the set or not.
*/
template
void
@@ -2682,36 +1866,19 @@ public:
std::vector > &hessians) const;
/**
- * This function does the same as
- * the other
- * get_function_hessians(), but
- * applied to multi-component
- * (vector-valued) elements. The
- * meaning of the arguments is as
- * explained there.
+ * This function does the same as the other get_function_hessians(), but
+ * applied to multi-component (vector-valued) elements. The meaning of the
+ * arguments is as explained there.
*
- * @post hessians[q]
- * is a vector of Hessians of the
- * field described by fe_function
- * at the $q$th quadrature
- * point. The size of the vector
- * accessed by
- * hessians[q]
- * equals the number of
- * components of the finite
- * element,
- * i.e. hessians[q][c]
- * returns the Hessian of the
- * $c$th vector component at the
- * $q$th quadrature
- * point. Consequently,
- * values[q][c][i][j]
- * is the $(i,j)$th component of
- * the matrix of second
- * derivatives of the $c$th
- * vector component of the vector
- * field at quadrature point $q$
- * of the current cell.
+ * @post hessians[q]
is a vector of Hessians of the field
+ * described by fe_function at the $q$th quadrature point. The size of the
+ * vector accessed by hessians[q]
equals the number of
+ * components of the finite element, i.e. hessians[q][c]
+ * returns the Hessian of the $c$th vector component at the $q$th quadrature
+ * point. Consequently, values[q][c][i][j]
is the $(i,j)$th
+ * component of the matrix of second derivatives of the $c$th vector
+ * component of the vector field at quadrature point $q$ of the current
+ * cell.
*/
template
void
@@ -2720,11 +1887,8 @@ public:
bool quadrature_points_fastest = false) const;
/**
- * Access to the second
- * derivatives of a function with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Access to the second derivatives of a function with more flexibility. see
+ * get_function_values() with corresponding arguments.
*/
template
void get_function_hessians (
@@ -2733,11 +1897,8 @@ public:
std::vector > &hessians) const;
/**
- * Access to the second
- * derivatives of a function with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Access to the second derivatives of a function with more flexibility. see
+ * get_function_values() with corresponding arguments.
*/
template
void get_function_hessians (
@@ -2765,81 +1926,40 @@ public:
/**
* Compute the (scalar) Laplacian (i.e. the trace of the tensor of second
- * derivatives) of a finite
- * element at the quadrature
- * points of a cell. This
- * function is the equivalent of
- * the corresponding
- * get_function_values() function
- * (see there for more
- * information) but evaluates the
- * finite element field's second
- * derivatives instead of its
- * value.
+ * derivatives) of a finite element at the quadrature points of a cell. This
+ * function is the equivalent of the corresponding get_function_values()
+ * function (see there for more information) but evaluates the finite
+ * element field's second derivatives instead of its value.
*
- * This function may only be used
- * if the finite element in use
- * is a scalar one, i.e. has only
- * one vector component. There is
- * a corresponding function of
- * the same name for
- * vector-valued finite elements.
+ * This function may only be used if the finite element in use is a scalar
+ * one, i.e. has only one vector component. There is a corresponding
+ * function of the same name for vector-valued finite elements.
*
- * @param[in] fe_function A
- * vector of values that
- * describes (globally) the
- * finite element function that
- * this function should evaluate
- * at the quadrature points of
- * the current cell.
+ * @param[in] fe_function A vector of values that describes (globally) the
+ * finite element function that this function should evaluate at the
+ * quadrature points of the current cell.
*
- * @param[out] laplacians The Laplacians
- * of the function specified by
- * fe_function at the quadrature
- * points of the current cell.
- * The Laplacians are computed
- * in real space (as opposed to
- * on the unit cell).
- * The object is assume to
- * already have the correct size.
+ * @param[out] laplacians The Laplacians of the function specified by
+ * fe_function at the quadrature points of the current cell. The Laplacians
+ * are computed in real space (as opposed to on the unit cell). The object
+ * is assume to already have the correct size.
*
- * @post laplacians[q]
- * will contain the Laplacian of
- * the field described by
- * fe_function at the $q$th
- * quadrature
- * point. gradients[q][i][j]
- * represents the $(i,j)$th
- * component of the matrix of
- * second derivatives at
- * quadrature point $q$.
+ * @post laplacians[q]
will contain the Laplacian of the field
+ * described by fe_function at the $q$th quadrature
+ * point. gradients[q][i][j]
represents the $(i,j)$th component
+ * of the matrix of second derivatives at quadrature point $q$.
*
- * @post For each component of
- * the output vector, there holds
- * laplacians[q]=trace(hessians[q])
,
- * where hessians would
- * be the output of the
- * get_function_hessians()
- * function.
+ * @post For each component of the output vector, there holds
+ * laplacians[q]=trace(hessians[q])
, where hessians
+ * would be the output of the get_function_hessians() function.
*
- * @note The actual data type of the
- * input vector may be either a
- * Vector<T>,
- * BlockVector<T>, or one
- * of the sequential PETSc or
- * Trilinos vector wrapper
- * classes. It represents a
- * global vector of DoF values
- * associated with the DofHandler
- * object with which this
- * FEValues object was last
- * initialized. Alternatively,
- * if the vector argument is of
- * type IndexSet, then the function
- * is represented as one that
- * is either zero or one, depending
- * on whether a DoF index is in
- * the set or not.
+ * @note The actual data type of the input vector may be either a
+ * Vector<T>, BlockVector<T>, or one of the sequential PETSc or
+ * Trilinos vector wrapper classes. It represents a global vector of DoF
+ * values associated with the DofHandler object with which this FEValues
+ * object was last initialized. Alternatively, if the vector argument is of
+ * type IndexSet, then the function is represented as one that is either
+ * zero or one, depending on whether a DoF index is in the set or not.
*/
template
void
@@ -2847,36 +1967,20 @@ public:
std::vector &laplacians) const;
/**
- * This function does the same as
- * the other
- * get_function_laplacians(), but
- * applied to multi-component
- * (vector-valued) elements. The
- * meaning of the arguments is as
- * explained there.
+ * This function does the same as the other get_function_laplacians(), but
+ * applied to multi-component (vector-valued) elements. The meaning of the
+ * arguments is as explained there.
*
- * @post laplacians[q]
- * is a vector of Laplacians of the
- * field described by fe_function
- * at the $q$th quadrature
- * point. The size of the vector
- * accessed by
- * laplacians[q]
- * equals the number of
- * components of the finite
- * element,
- * i.e. laplacians[q][c]
- * returns the Laplacian of the
- * $c$th vector component at the
- * $q$th quadrature
- * point.
+ * @post laplacians[q]
is a vector of Laplacians of the field
+ * described by fe_function at the $q$th quadrature point. The size of the
+ * vector accessed by laplacians[q]
equals the number of
+ * components of the finite element, i.e. laplacians[q][c]
+ * returns the Laplacian of the $c$th vector component at the $q$th
+ * quadrature point.
*
- * @post For each component of
- * the output vector, there holds
- * laplacians[q][c]=trace(hessians[q][c])
,
- * where hessians would
- * be the output of the
- * get_function_hessians()
+ * @post For each component of the output vector, there holds
+ * laplacians[q][c]=trace(hessians[q][c])
, where
+ * hessians would be the output of the get_function_hessians()
* function.
*/
template
@@ -2885,11 +1989,8 @@ public:
std::vector > &laplacians) const;
/**
- * Access to the second
- * derivatives of a function with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Access to the second derivatives of a function with more flexibility. see
+ * get_function_values() with corresponding arguments.
*/
template
void get_function_laplacians (
@@ -2898,11 +1999,8 @@ public:
std::vector &laplacians) const;
/**
- * Access to the second
- * derivatives of a function with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Access to the second derivatives of a function with more flexibility. see
+ * get_function_values() with corresponding arguments.
*/
template
void get_function_laplacians (
@@ -2911,11 +2009,8 @@ public:
std::vector > &laplacians) const;
/**
- * Access to the second
- * derivatives of a function with
- * more flexibility. see
- * get_function_values() with
- * corresponding arguments.
+ * Access to the second derivatives of a function with more flexibility. see
+ * get_function_values() with corresponding arguments.
*/
template
void get_function_laplacians (
@@ -2929,149 +2024,106 @@ public:
//@{
/**
- * Position of the ith
- * quadrature point in real space.
+ * Position of the ith quadrature point in real space.
*/
const Point &quadrature_point (const unsigned int i) const;
/**
- * Return a pointer to the vector of
- * quadrature points in real space.
+ * Return a pointer to the vector of quadrature points in real space.
*/
const std::vector > &get_quadrature_points () const;
/**
- * Mapped quadrature weight. If
- * this object refers to a volume
- * evaluation (i.e. the derived
- * class is of type FEValues),
- * then this is the Jacobi
- * determinant times the weight
- * of the *ith unit
- * quadrature point.
+ * Mapped quadrature weight. If this object refers to a volume evaluation
+ * (i.e. the derived class is of type FEValues), then this is the Jacobi
+ * determinant times the weight of the *ith unit quadrature point.
*
- * For surface evaluations
- * (i.e. classes FEFaceValues or
- * FESubfaceValues), it is the
- * mapped surface element times
- * the weight of the quadrature
+ * For surface evaluations (i.e. classes FEFaceValues or FESubfaceValues),
+ * it is the mapped surface element times the weight of the quadrature
* point.
*
- * You can think of the quantity returned
- * by this function as the volume or
- * surface element $dx, ds$ in the
- * integral that we implement here by
+ * You can think of the quantity returned by this function as the volume or
+ * surface element $dx, ds$ in the integral that we implement here by
* quadrature.
*/
double JxW (const unsigned int quadrature_point) const;
/**
- * Pointer to the array holding
- * the values returned by JxW().
+ * Pointer to the array holding the values returned by JxW().
*/
const std::vector &get_JxW_values () const;
/**
- * Return the Jacobian of the
- * transformation at the specified
- * quadrature point, i.e.
- * $J_{ij}=dx_i/d\hat x_j$
+ * Return the Jacobian of the transformation at the specified quadrature
+ * point, i.e. $J_{ij}=dx_i/d\hat x_j$
*/
const DerivativeForm<1,dim,spacedim> &jacobian (const unsigned int quadrature_point) const;
/**
- * Pointer to the array holding
- * the values returned by jacobian().
+ * Pointer to the array holding the values returned by jacobian().
*/
const std::vector > &get_jacobians () const;
/**
- * Return the second derivative of the
- * transformation from unit to real cell,
- * i.e. the first derivative of the
- * Jacobian, at the specified quadrature
- * point, i.e. $G_{ijk}=dJ_{jk}/d\hat x_i$.
+ * Return the second derivative of the transformation from unit to real
+ * cell, i.e. the first derivative of the Jacobian, at the specified
+ * quadrature point, i.e. $G_{ijk}=dJ_{jk}/d\hat x_i$.
*/
const DerivativeForm<2,dim,spacedim> &jacobian_grad (const unsigned int quadrature_point) const;
/**
- * Pointer to the array holding
- * the values returned by
- * jacobian_grads().
+ * Pointer to the array holding the values returned by jacobian_grads().
*/
const std::vector > &get_jacobian_grads () const;
/**
- * Return the inverse Jacobian of the
- * transformation at the specified
- * quadrature point, i.e.
- * $J_{ij}=d\hat x_i/dx_j$
+ * Return the inverse Jacobian of the transformation at the specified
+ * quadrature point, i.e. $J_{ij}=d\hat x_i/dx_j$
*/
const DerivativeForm<1,spacedim,dim> &inverse_jacobian (const unsigned int quadrature_point) const;
/**
- * Pointer to the array holding
- * the values returned by
- * inverse_jacobian().
+ * Pointer to the array holding the values returned by inverse_jacobian().
*/
const std::vector > &get_inverse_jacobians () const;
/**
- * For a face, return the outward
- * normal vector to the cell at
- * the ith quadrature
- * point.
+ * For a face, return the outward normal vector to the cell at the
+ * ith quadrature point.
*
- * For a cell of codimension one,
- * return the normal vector, as
- * it is specified by the
- * numbering of the vertices.
+ * For a cell of codimension one, return the normal vector, as it is
+ * specified by the numbering of the vertices.
*
- * The length of the vector
- * is normalized to one.
+ * The length of the vector is normalized to one.
*/
const Point &normal_vector (const unsigned int i) const;
/**
- * Return the normal vectors at
- * the quadrature points. For a
- * face, these are the outward
- * normal vectors to the
- * cell. For a cell of
- * codimension one, the
- * orientation is given by the
- * numbering of vertices.
+ * Return the normal vectors at the quadrature points. For a face, these are
+ * the outward normal vectors to the cell. For a cell of codimension one,
+ * the orientation is given by the numbering of vertices.
*/
const std::vector > &get_normal_vectors () const;
/**
- * Transform a set of vectors,
- * one for each quadrature
- * point. The mapping
- * can be any of the ones defined
- * in MappingType.
+ * Transform a set of vectors, one for each quadrature point. The
+ * mapping can be any of the ones defined in MappingType.
*/
void transform (std::vector > &transformed,
const std::vector > &original,
MappingType mapping) const;
/**
- * @deprecated Use
- * normal_vector() instead.
+ * @deprecated Use normal_vector() instead.
*
- * Return the outward normal vector to
- * the cell at the ith quadrature
- * point. The length of the vector
- * is normalized to one.
+ * Return the outward normal vector to the cell at the ith
+ * quadrature point. The length of the vector is normalized to one.
*/
const Point &cell_normal_vector (const unsigned int i) const DEAL_II_DEPRECATED;
/**
- * @deprecated Use
- * get_normal_vectors() instead.
+ * @deprecated Use get_normal_vectors() instead.
*
- * Returns the vectors normal to
- * the cell in each of the
- * quadrature points.
+ * Returns the vectors normal to the cell in each of the quadrature points.
*/
const std::vector > &get_cell_normal_vectors () const DEAL_II_DEPRECATED;
@@ -3081,56 +2133,41 @@ public:
//@{
/**
- * Create a view of the current FEValues
- * object that represents a particular
- * scalar component of the possibly
- * vector-valued finite element. The
- * concept of views is explained in the
- * documentation of the namespace
- * FEValuesViews and in particular
- * in the @ref vector_valued module.
+ * Create a view of the current FEValues object that represents a particular
+ * scalar component of the possibly vector-valued finite element. The
+ * concept of views is explained in the documentation of the namespace
+ * FEValuesViews and in particular in the @ref vector_valued module.
*/
const FEValuesViews::Scalar &
operator[] (const FEValuesExtractors::Scalar &scalar) const;
/**
- * Create a view of the current FEValues
- * object that represents a set of
- * dim
scalar components
- * (i.e. a vector) of the vector-valued
- * finite element. The concept of views
- * is explained in the documentation of
- * the namespace FEValuesViews and in particular
- * in the @ref vector_valued module.
+ * Create a view of the current FEValues object that represents a set of
+ * dim
scalar components (i.e. a vector) of the vector-valued
+ * finite element. The concept of views is explained in the documentation of
+ * the namespace FEValuesViews and in particular in the @ref vector_valued
+ * module.
*/
const FEValuesViews::Vector &
operator[] (const FEValuesExtractors::Vector &vector) const;
/**
- * Create a view of the current FEValues
- * object that represents a set of
- * (dim*dim + dim)/2
scalar components
- * (i.e. a symmetric 2nd order tensor)
- * of the vector-valued
- * finite element. The concept of views
- * is explained in the documentation of
- * the namespace FEValuesViews and in particular
- * in the @ref vector_valued module.
+ * Create a view of the current FEValues object that represents a set of
+ * (dim*dim + dim)/2
scalar components (i.e. a symmetric 2nd
+ * order tensor) of the vector-valued finite element. The concept of views
+ * is explained in the documentation of the namespace FEValuesViews and in
+ * particular in the @ref vector_valued module.
*/
const FEValuesViews::SymmetricTensor<2,dim,spacedim> &
operator[] (const FEValuesExtractors::SymmetricTensor<2> &tensor) const;
/**
- * Create a view of the current FEValues
- * object that represents a set of
- * (dim*dim)
scalar components
- * (i.e. a 2nd order tensor)
- * of the vector-valued
- * finite element. The concept of views
- * is explained in the documentation of
- * the namespace FEValuesViews and in particular
- * in the @ref vector_valued module.
+ * Create a view of the current FEValues object that represents a set of
+ * (dim*dim)
scalar components (i.e. a 2nd order tensor) of the
+ * vector-valued finite element. The concept of views is explained in the
+ * documentation of the namespace FEValuesViews and in particular in the
+ * @ref vector_valued module.
*/
const FEValuesViews::Tensor<2,dim,spacedim> &
operator[] (const FEValuesExtractors::Tensor<2> &tensor) const;
@@ -3141,57 +2178,43 @@ public:
//@{
/**
- * Constant reference to the
- * selected mapping object.
+ * Constant reference to the selected mapping object.
*/
const Mapping &get_mapping () const;
/**
- * Constant reference to the
- * selected finite element
- * object.
+ * Constant reference to the selected finite element object.
*/
const FiniteElement &get_fe () const;
/**
- * Return the update flags set
- * for this object.
+ * Return the update flags set for this object.
*/
UpdateFlags get_update_flags () const;
/**
- * Return a triangulation
- * iterator to the current cell.
+ * Return a triangulation iterator to the current cell.
*/
const typename Triangulation::cell_iterator get_cell () const;
/**
- * Return the relation of the current
- * cell to the previous cell. This
- * allows re-use of some cell data
- * (like local matrices for equations
- * with constant coefficients) if the
- * result is
- * CellSimilarity::translation.
+ * Return the relation of the current cell to the previous cell. This allows
+ * re-use of some cell data (like local matrices for equations with constant
+ * coefficients) if the result is CellSimilarity::translation.
*/
CellSimilarity::Similarity get_cell_similarity () const;
/**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
+ * Determine an estimate for the memory consumption (in bytes) of this
+ * object.
*/
std::size_t memory_consumption () const;
//@}
/**
- * This exception is thrown if
- * FEValuesBase is asked to
- * return the value of a field
- * which was not required by the
- * UpdateFlags for this
- * FEValuesBase.
+ * This exception is thrown if FEValuesBase is asked to return the value of
+ * a field which was not required by the UpdateFlags for this FEValuesBase.
*
* @ingroup Exceptions
*/
@@ -3236,110 +2259,73 @@ public:
protected:
/**
- * Objects of the FEValues
- * class need to store a pointer
- * (i.e. an iterator) to the
- * present cell in order to be
- * able to extract the values of
- * the degrees of freedom on this
- * cell in the
- * get_function_values() and
- * assorted functions. On the
- * other hand, this class should
- * also work for different
- * iterators, as long as they
- * have the same interface to
- * extract the DoF values (i.e.,
- * for example, they need to have
- * a @p get_interpolated_dof_values
- * function).
+ * Objects of the FEValues class need to store a pointer (i.e. an iterator)
+ * to the present cell in order to be able to extract the values of the
+ * degrees of freedom on this cell in the get_function_values() and assorted
+ * functions. On the other hand, this class should also work for different
+ * iterators, as long as they have the same interface to extract the DoF
+ * values (i.e., for example, they need to have a @p
+ * get_interpolated_dof_values function).
*
- * This calls for a common base
- * class of iterator classes, and
- * making the functions we need
- * here @p virtual. On the other
- * hand, this is the only place
- * in the library where we need
- * this, and introducing a base
- * class of iterators and making
- * a function virtual penalizes
- * all users of the
- * iterators, which are basically
- * intended as very fast accessor
- * functions. So we do not want
- * to do this. Rather, what we do
- * here is making the functions
- * we need virtual only for use
- * with this class. The idea
- * is the following: have a
- * common base class which
- * declares some pure virtual
- * functions, and for each
- * possible iterator type, we
- * have a derived class which
- * stores the iterator to the
- * cell and implements these
- * functions. Since the iterator
- * classes have the same
- * interface, we can make the
- * derived classes a template,
- * templatized on the iterator
- * type.
+ * This calls for a common base class of iterator classes, and making the
+ * functions we need here @p virtual. On the other hand, this is the only
+ * place in the library where we need this, and introducing a base class of
+ * iterators and making a function virtual penalizes all users of
+ * the iterators, which are basically intended as very fast accessor
+ * functions. So we do not want to do this. Rather, what we do here is
+ * making the functions we need virtual only for use with this
+ * class. The idea is the following: have a common base class which
+ * declares some pure virtual functions, and for each possible iterator
+ * type, we have a derived class which stores the iterator to the cell and
+ * implements these functions. Since the iterator classes have the same
+ * interface, we can make the derived classes a template, templatized on the
+ * iterator type.
*
- * This way, the use of virtual
- * functions is restricted to
- * only this class, and other
- * users of iterators do not have
- * to bear the negative effects.
+ * This way, the use of virtual functions is restricted to only this class,
+ * and other users of iterators do not have to bear the negative effects.
*
* @author Wolfgang Bangerth, 2003
*/
class CellIteratorBase;
/**
- * Forward declaration of classes derived
- * from CellIteratorBase. Their
- * definition and implementation is given
- * in the .cc file.
+ * Forward declaration of classes derived from CellIteratorBase. Their
+ * definition and implementation is given in the .cc file.
*/
template class CellIterator;
class TriaCellIterator;
/**
- * Store the cell selected last time the
- * reinit() function was called. This is
- * necessary for the
- * get_function_* functions as
- * well as the functions of same name in
- * the extractor classes.
+ * Store the cell selected last time the reinit() function was called. This
+ * is necessary for the get_function_* functions as well as the
+ * functions of same name in the extractor classes.
*/
std::auto_ptr present_cell;
/**
* A signal connection we use to ensure we get informed whenever the
- * triangulation changes. We need to know about that because it
- * invalidates all cell iterators and, as part of that, the
- * 'present_cell' iterator we keep around between subsequent
- * calls to reinit() in order to compute the cell similarity.
+ * triangulation changes. We need to know about that because it invalidates
+ * all cell iterators and, as part of that, the 'present_cell' iterator we
+ * keep around between subsequent calls to reinit() in order to compute the
+ * cell similarity.
*/
boost::signals2::connection tria_listener;
/**
- * A function that is connected to the triangulation in
- * order to reset the stored 'present_cell' iterator to an invalid
- * one whenever the triangulation is changed and the iterator consequently
- * becomes invalid.
+ * A function that is connected to the triangulation in order to reset the
+ * stored 'present_cell' iterator to an invalid one whenever the
+ * triangulation is changed and the iterator consequently becomes invalid.
*/
void invalidate_present_cell ();
/**
* This function is called by the various reinit() functions in derived
- * classes. Given the cell indicated by the argument, test whether
- * we have to throw away the previously stored present_cell argument
- * because it would require us to compare cells from different
- * triangulations. In checking all this, also make sure that we have
- * tria_listener connected to the triangulation to which we will set
- * present_cell right after calling this function.
+ * classes. Given the cell indicated by the argument, test whether we have
+ * to throw away the previously stored present_cell argument because it
+ * would require us to compare cells from different triangulations. In
+ * checking all this, also make sure that we have tria_listener connected to
+ * the triangulation to which we will set present_cell right after calling
+ * this function.
*/
void
maybe_invalidate_previous_present_cell (const typename Triangulation::cell_iterator &cell);
@@ -3366,72 +2352,50 @@ protected:
SmartPointer::InternalDataBase,FEValuesBase > fe_data;
/**
- * Initialize some update
- * flags. Called from the
- * @p initialize functions of
- * derived classes, which are in
- * turn called from their
- * constructors.
+ * Initialize some update flags. Called from the @p initialize functions of
+ * derived classes, which are in turn called from their constructors.
*
- * Basically, this function finds
- * out using the finite element
- * and mapping object already
- * stored which flags need to be
- * set to compute everything the
- * user wants, as expressed
- * through the flags passed as
- * argument.
+ * Basically, this function finds out using the finite element and mapping
+ * object already stored which flags need to be set to compute everything
+ * the user wants, as expressed through the flags passed as argument.
*/
UpdateFlags compute_update_flags (const UpdateFlags update_flags) const;
/**
- * An enum variable that can store
- * different states of the current cell
- * in comparison to the previously
- * visited cell. If wanted, additional
- * states can be checked here and used
- * in one of the methods used during
- * reinit.
+ * An enum variable that can store different states of the current cell in
+ * comparison to the previously visited cell. If wanted, additional states
+ * can be checked here and used in one of the methods used during reinit.
*/
CellSimilarity::Similarity cell_similarity;
/**
- * A function that checks whether the
- * new cell is similar to the one
- * previously used. Then, a significant
- * amount of the data can be reused,
- * e.g. the derivatives of the basis
- * functions in real space, shape_grad.
+ * A function that checks whether the new cell is similar to the one
+ * previously used. Then, a significant amount of the data can be reused,
+ * e.g. the derivatives of the basis functions in real space, shape_grad.
*/
void
check_cell_similarity (const typename Triangulation::cell_iterator &cell);
private:
/**
- * Copy constructor. Since
- * objects of this class are not
- * copyable, we make it private,
- * and also do not implement it.
+ * Copy constructor. Since objects of this class are not copyable, we make
+ * it private, and also do not implement it.
*/
FEValuesBase (const FEValuesBase &);
/**
- * Copy operator. Since
- * objects of this class are not
- * copyable, we make it private,
- * and also do not implement it.
+ * Copy operator. Since objects of this class are not copyable, we make it
+ * private, and also do not implement it.
*/
FEValuesBase &operator= (const FEValuesBase &);
/**
- * A cache for all possible FEValuesViews
- * objects.
+ * A cache for all possible FEValuesViews objects.
*/
dealii::internal::FEValuesViews::Cache fe_values_views_cache;
/**
- * Make the view classes friends of this
- * class, since they access internal
+ * Make the view classes friends of this class, since they access internal
* data.
*/
template friend class FEValuesViews::Scalar;
@@ -3445,9 +2409,9 @@ private:
/**
* Finite element evaluated in quadrature points of a cell.
*
- * This function implements the initialization routines for
- * FEValuesBase, if values in quadrature points of a cell are
- * needed. For further documentation see this class.
+ * This function implements the initialization routines for FEValuesBase, if
+ * values in quadrature points of a cell are needed. For further documentation
+ * see this class.
*
* @ingroup feaccess
* @author Wolfgang Bangerth, 1998, Guido Kanschat, 2001
@@ -3457,19 +2421,14 @@ class FEValues : public FEValuesBase
{
public:
/**
- * Dimension of the object over
- * which we integrate. For the
- * present class, this is equal
- * to dim
.
+ * Dimension of the object over which we integrate. For the present class,
+ * this is equal to dim
.
*/
static const unsigned int integral_dimension = dim;
/**
- * Constructor. Gets cell
- * independent data from mapping
- * and finite element objects,
- * matching the quadrature rule
- * and update flags.
+ * Constructor. Gets cell independent data from mapping and finite element
+ * objects, matching the quadrature rule and update flags.
*/
FEValues (const Mapping &mapping,
const FiniteElement &fe,
@@ -3477,129 +2436,87 @@ public:
const UpdateFlags update_flags);
/**
- * Constructor. Uses MappingQ1
- * implicitly.
+ * Constructor. Uses MappingQ1 implicitly.
*/
FEValues (const FiniteElement &fe,
const Quadrature &quadrature,
const UpdateFlags update_flags);
/**
- * Reinitialize the gradients,
- * Jacobi determinants, etc for
- * the given cell of type
- * "iterator into a DoFHandler
- * object", and the finite
- * element associated with this
- * object. It is assumed that the
- * finite element used by the
- * given cell is also the one
- * used by this FEValues
- * object.
+ * Reinitialize the gradients, Jacobi determinants, etc for the given cell
+ * of type "iterator into a DoFHandler object", and the finite element
+ * associated with this object. It is assumed that the finite element used
+ * by the given cell is also the one used by this FEValues object.
*/
template
void reinit (const TriaIterator > cell);
/**
- * Reinitialize the gradients,
- * Jacobi determinants, etc for
- * the given cell of type
- * "iterator into a Triangulation
- * object", and the given finite
- * element. Since iterators into
- * triangulation alone only
- * convey information about the
- * geometry of a cell, but not
- * about degrees of freedom
- * possibly associated with this
- * cell, you will not be able to
- * call some functions of this
- * class if they need information
- * about degrees of
- * freedom. These functions are,
- * above all, the
- * get_function_value/gradients/hessians/laplacians
- * functions. If you want to call
- * these functions, you have to
- * call the @p reinit variants
- * that take iterators into
- * DoFHandler or other DoF
- * handler type objects.
+ * Reinitialize the gradients, Jacobi determinants, etc for the given cell
+ * of type "iterator into a Triangulation object", and the given finite
+ * element. Since iterators into triangulation alone only convey information
+ * about the geometry of a cell, but not about degrees of freedom possibly
+ * associated with this cell, you will not be able to call some functions of
+ * this class if they need information about degrees of freedom. These
+ * functions are, above all, the
+ * get_function_value/gradients/hessians/laplacians functions. If
+ * you want to call these functions, you have to call the @p reinit variants
+ * that take iterators into DoFHandler or other DoF handler type objects.
*/
void reinit (const typename Triangulation::cell_iterator &cell);
/**
- * Return a reference to the copy
- * of the quadrature formula
- * stored by this object.
+ * Return a reference to the copy of the quadrature formula stored by this
+ * object.
*/
const Quadrature &get_quadrature () const;
/**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
+ * Determine an estimate for the memory consumption (in bytes) of this
+ * object.
*/
std::size_t memory_consumption () const;
/**
- * Return a reference to this
- * very object.
+ * Return a reference to this very object.
*
- * Though it seems that it is not very
- * useful, this function is there to
- * provide capability to the hpFEValues
- * class, in which case it provides the
- * FEValues object for the present cell
- * (remember that for hp finite elements,
- * the actual FE object used may change
- * from cell to cell, so we also need
- * different FEValues objects for
- * different cells; once you reinitialize
- * the hpFEValues object for a specific
- * cell, it retrieves the FEValues object
- * for the FE on that cell and returns it
- * through a function of the same name as
- * this one; this function here therefore
- * only provides the same interface so
- * that one can templatize on
- * FEValues/hpFEValues).
+ * Though it seems that it is not very useful, this function is there to
+ * provide capability to the hpFEValues class, in which case it provides the
+ * FEValues object for the present cell (remember that for hp finite
+ * elements, the actual FE object used may change from cell to cell, so we
+ * also need different FEValues objects for different cells; once you
+ * reinitialize the hpFEValues object for a specific cell, it retrieves the
+ * FEValues object for the FE on that cell and returns it through a function
+ * of the same name as this one; this function here therefore only provides
+ * the same interface so that one can templatize on FEValues/hpFEValues).
*/
const FEValues &get_present_fe_values () const;
private:
/**
- * Store a copy of the quadrature
- * formula here.
+ * Store a copy of the quadrature formula here.
*/
const Quadrature quadrature;
/**
- * Do work common to the two
- * constructors.
+ * Do work common to the two constructors.
*/
void initialize (const UpdateFlags update_flags);
/**
- * The reinit() functions do
- * only that part of the work
- * that requires knowledge of the
- * type of iterator. After
- * setting present_cell(),
- * they pass on to this function,
- * which does the real work, and
- * which is independent of the
- * actual type of the cell
- * iterator.
+ * The reinit() functions do only that part of the work that requires
+ * knowledge of the type of iterator. After setting present_cell(), they
+ * pass on to this function, which does the real work, and which is
+ * independent of the actual type of the cell iterator.
*/
void do_reinit ();
};
/**
- * Extend the interface of FEValuesBase to values that only make sense
- * when evaluating something on the surface of a cell. All the data
- * that is available in the interior of cells is also available here.
+ * Extend the interface of FEValuesBase to values that only make sense when
+ * evaluating something on the surface of a cell. All the data that is
+ * available in the interior of cells is also available here.
*
* See FEValuesBase
*
@@ -3611,30 +2528,21 @@ class FEFaceValuesBase : public FEValuesBase
{
public:
/**
- * Dimension of the object over
- * which we integrate. For the
- * present class, this is equal
- * to dim-1
.
+ * Dimension of the object over which we integrate. For the present class,
+ * this is equal to dim-1
.
*/
static const unsigned int integral_dimension = dim-1;
/**
- * Constructor. Call the constructor of
- * the base class and set up the arrays
- * of this class with the right sizes.
- * Actually filling these arrays is a
- * duty of the derived class's
- * constructors.
+ * Constructor. Call the constructor of the base class and set up the arrays
+ * of this class with the right sizes. Actually filling these arrays is a
+ * duty of the derived class's constructors.
*
- * @p n_faces_or_subfaces is the number
- * of faces or subfaces that this object
- * is to store. The actual number depends
- * on the derived class, for
- * FEFaceValues it is 2*dim, while for
- * the FESubfaceValues class it is
- * 2*dim*(1<<(dim-1)), i.e. the number
- * of faces times the number of subfaces
- * per face.
+ * @p n_faces_or_subfaces is the number of faces or subfaces that this
+ * object is to store. The actual number depends on the derived class, for
+ * FEFaceValues it is 2*dim, while for the FESubfaceValues class it
+ * is 2*dim*(1<<(dim-1)), i.e. the number of faces times the number
+ * of subfaces per face.
*/
FEFaceValuesBase (const unsigned int n_q_points,
const unsigned int dofs_per_cell,
@@ -3644,54 +2552,45 @@ public:
const Quadrature& quadrature);
/**
- * Boundary form of the
- * transformation of the cell at
- * the ith quadrature point.
- * See @ref GlossBoundaryForm .
+ * Boundary form of the transformation of the cell at the ith
+ * quadrature point. See @ref GlossBoundaryForm .
*/
const Tensor<1,spacedim> &boundary_form (const unsigned int i) const;
/**
- * Return the list of outward
- * normal vectors times the
- * Jacobian of the surface
- * mapping.
+ * Return the list of outward normal vectors times the Jacobian of the
+ * surface mapping.
*/
const std::vector > &get_boundary_forms () const;
/**
- * Return the index of the face
- * selected the last time the
- * reinit() function was called.
+ * Return the index of the face selected the last time the reinit() function
+ * was called.
*/
unsigned int get_face_index() const;
/**
- * Return a reference to the copy
- * of the quadrature formula
- * stored by this object.
+ * Return a reference to the copy of the quadrature formula stored by this
+ * object.
*/
const Quadrature & get_quadrature () const;
/**
- * Determine an estimate for the
- * memory consumption (in bytes)
- * of this object.
+ * Determine an estimate for the memory consumption (in bytes) of this
+ * object.
*/
std::size_t memory_consumption () const;
protected:
/**
- * Index of the face selected the
- * last time the reinit()
- * function was called.
+ * Index of the face selected the last time the reinit() function was
+ * called.
*/
unsigned int present_face_index;
/**
- * Store a copy of the quadrature
- * formula here.
+ * Store a copy of the quadrature formula here.
*/
const Quadrature quadrature;
};
@@ -3701,13 +2600,13 @@ protected:
/**
* Finite element evaluated in quadrature points on a face.
*
- * This class adds the functionality of FEFaceValuesBase to
- * FEValues; see there for more documentation.
+ * This class adds the functionality of FEFaceValuesBase to FEValues; see
+ * there for more documentation.
*
- * Since finite element functions and their derivatives may be
- * discontinuous at cell boundaries, there is no restriction of this
- * function to a mesh face. But, there are limits of these values
- * approaching the face from either of the neighboring cells.
+ * Since finite element functions and their derivatives may be discontinuous
+ * at cell boundaries, there is no restriction of this function to a mesh
+ * face. But, there are limits of these values approaching the face from
+ * either of the neighboring cells.
*
* @ingroup feaccess
* @author Wolfgang Bangerth, 1998, Guido Kanschat, 2000, 2001
@@ -3717,8 +2616,7 @@ class FEFaceValues : public FEFaceValuesBase
{
public:
/**
- * Dimension in which this object
- * operates.
+ * Dimension in which this object operates.
*/
static const unsigned int dimension = dim;
@@ -3726,19 +2624,14 @@ public:
static const unsigned int space_dimension = spacedim;
/**
- * Dimension of the object over
- * which we integrate. For the
- * present class, this is equal
- * to dim-1
.
+ * Dimension of the object over which we integrate. For the present class,
+ * this is equal to dim-1
.
*/
static const unsigned int integral_dimension = dim-1;
/**
- * Constructor. Gets cell
- * independent data from mapping
- * and finite element objects,
- * matching the quadrature rule
- * and update flags.
+ * Constructor. Gets cell independent data from mapping and finite element
+ * objects, matching the quadrature rule and update flags.
*/
FEFaceValues (const Mapping &mapping,
const FiniteElement &fe,
@@ -3746,95 +2639,61 @@ public:
const UpdateFlags update_flags);
/**
- * Constructor. Uses MappingQ1
- * implicitly.
+ * Constructor. Uses MappingQ1 implicitly.
*/
FEFaceValues (const FiniteElement &fe,
const Quadrature &quadrature,
const UpdateFlags update_flags);
/**
- * Reinitialize the gradients, Jacobi
- * determinants, etc for the face with
- * number @p face_no of @p cell
- * and the given finite element.
+ * Reinitialize the gradients, Jacobi determinants, etc for the face with
+ * number @p face_no of @p cell and the given finite element.
*/
template
void reinit (const TriaIterator > cell,
const unsigned int face_no);
/**
- * Reinitialize the gradients,
- * Jacobi determinants, etc for
- * the given face on given cell
- * of type "iterator into a
- * Triangulation object", and the
- * given finite element. Since
- * iterators into triangulation
- * alone only convey information
- * about the geometry of a cell,
- * but not about degrees of
- * freedom possibly associated
- * with this cell, you will not
- * be able to call some functions
- * of this class if they need
- * information about degrees of
- * freedom. These functions are,
- * above all, the
- * get_function_value/gradients/hessians
- * functions. If you want to call
- * these functions, you have to
- * call the @p reinit variants
- * that take iterators into
- * DoFHandler or other DoF
- * handler type objects.
+ * Reinitialize the gradients, Jacobi determinants, etc for the given face
+ * on given cell of type "iterator into a Triangulation object", and the
+ * given finite element. Since iterators into triangulation alone only
+ * convey information about the geometry of a cell, but not about degrees of
+ * freedom possibly associated with this cell, you will not be able to call
+ * some functions of this class if they need information about degrees of
+ * freedom. These functions are, above all, the
+ * get_function_value/gradients/hessians functions. If you want to
+ * call these functions, you have to call the @p reinit variants that take
+ * iterators into DoFHandler or other DoF handler type objects.
*/
void reinit (const typename Triangulation::cell_iterator &cell,
const unsigned int face_no);
/**
- * Return a reference to this
- * very object.
+ * Return a reference to this very object.
*
- * Though it seems that it is not very
- * useful, this function is there to
- * provide capability to the hpFEValues
- * class, in which case it provides the
- * FEValues object for the present cell
- * (remember that for hp finite elements,
- * the actual FE object used may change
- * from cell to cell, so we also need
- * different FEValues objects for
- * different cells; once you reinitialize
- * the hpFEValues object for a specific
- * cell, it retrieves the FEValues object
- * for the FE on that cell and returns it
- * through a function of the same name as
- * this one; this function here therefore
- * only provides the same interface so
- * that one can templatize on
- * FEValues/hpFEValues).
+ * Though it seems that it is not very useful, this function is there to
+ * provide capability to the hpFEValues class, in which case it provides the
+ * FEValues object for the present cell (remember that for hp finite
+ * elements, the actual FE object used may change from cell to cell, so we
+ * also need different FEValues objects for different cells; once you
+ * reinitialize the hpFEValues object for a specific cell, it retrieves the
+ * FEValues object for the FE on that cell and returns it through a function
+ * of the same name as this one; this function here therefore only provides
+ * the same interface so that one can templatize on FEValues/hpFEValues).
*/
const FEFaceValues &get_present_fe_values () const;
private:
/**
- * Do work common to the two
- * constructors.
+ * Do work common to the two constructors.
*/
void initialize (const UpdateFlags update_flags);
/**
- * The reinit() functions do
- * only that part of the work
- * that requires knowledge of the
- * type of iterator. After
- * setting present_cell(),
- * they pass on to this function,
- * which does the real work, and
- * which is independent of the
- * actual type of the cell
- * iterator.
+ * The reinit() functions do only that part of the work that requires
+ * knowledge of the type of iterator. After setting present_cell(), they
+ * pass on to this function, which does the real work, and which is
+ * independent of the actual type of the cell iterator.
*/
void do_reinit (const unsigned int face_no);
};
@@ -3843,17 +2702,16 @@ private:
/**
* Finite element evaluated in quadrature points on a face.
*
- * This class adds the functionality of FEFaceValuesBase to
- * FEValues; see there for more documentation.
+ * This class adds the functionality of FEFaceValuesBase to FEValues; see
+ * there for more documentation.
*
- * This class is used for faces lying on a refinement edge. In this
- * case, the neighboring cell is refined. To be able to compute
- * differences between interior and exterior function values, the
- * refinement of the neighboring cell must be simulated on this
- * cell. This is achieved by applying a quadrature rule that simulates
- * the refinement. The resulting data fields are split up to reflect
- * the refinement structure of the neighbor: a subface number
- * corresponds to the number of the child of the neighboring face.
+ * This class is used for faces lying on a refinement edge. In this case, the
+ * neighboring cell is refined. To be able to compute differences between
+ * interior and exterior function values, the refinement of the neighboring
+ * cell must be simulated on this cell. This is achieved by applying a
+ * quadrature rule that simulates the refinement. The resulting data fields
+ * are split up to reflect the refinement structure of the neighbor: a subface
+ * number corresponds to the number of the child of the neighboring face.
*
* @ingroup feaccess
* @author Wolfgang Bangerth, 1998, Guido Kanschat, 2000, 2001
@@ -3863,31 +2721,24 @@ class FESubfaceValues : public FEFaceValuesBase
{
public:
/**
- * Dimension in which this object
- * operates.
+ * Dimension in which this object operates.
*/
static const unsigned int dimension = dim;
/**
- * Dimension of the space in
- * which this object operates.
+ * Dimension of the space in which this object operates.
*/
static const unsigned int space_dimension = spacedim;
/**
- * Dimension of the object over
- * which we integrate. For the
- * present class, this is equal
- * to dim-1
.
+ * Dimension of the object over which we integrate. For the present class,
+ * this is equal to dim-1
.
*/
static const unsigned int integral_dimension = dim-1;
/**
- * Constructor. Gets cell
- * independent data from mapping
- * and finite element objects,
- * matching the quadrature rule
- * and update flags.
+ * Constructor. Gets cell independent data from mapping and finite element
+ * objects, matching the quadrature rule and update flags.
*/
FESubfaceValues (const Mapping &mapping,
const FiniteElement &fe,
@@ -3895,25 +2746,17 @@ public:
const UpdateFlags update_flags);
/**
- * Constructor. Uses MappingQ1
- * implicitly.
+ * Constructor. Uses MappingQ1 implicitly.
*/
FESubfaceValues (const FiniteElement &fe,
const Quadrature &face_quadrature,
const UpdateFlags update_flags);
/**
- * Reinitialize the gradients,
- * Jacobi determinants, etc for
- * the given cell of type
- * "iterator into a DoFHandler
- * object", and the finite
- * element associated with this
- * object. It is assumed that the
- * finite element used by the
- * given cell is also the one
- * used by this
- * FESubfaceValues object.
+ * Reinitialize the gradients, Jacobi determinants, etc for the given cell
+ * of type "iterator into a DoFHandler object", and the finite element
+ * associated with this object. It is assumed that the finite element used
+ * by the given cell is also the one used by this FESubfaceValues object.
*/
template
void reinit (const TriaIterator > cell,
@@ -3921,57 +2764,33 @@ public:
const unsigned int subface_no);
/**
- * Reinitialize the gradients,
- * Jacobi determinants, etc for
- * the given subface on given
- * cell of type "iterator into a
- * Triangulation object", and the
- * given finite element. Since
- * iterators into triangulation
- * alone only convey information
- * about the geometry of a cell,
- * but not about degrees of
- * freedom possibly associated
- * with this cell, you will not
- * be able to call some functions
- * of this class if they need
- * information about degrees of
- * freedom. These functions are,
- * above all, the
- * get_function_value/gradients/hessians
- * functions. If you want to call
- * these functions, you have to
- * call the @p reinit variants
- * that take iterators into
- * DoFHandler or other DoF
- * handler type objects.
+ * Reinitialize the gradients, Jacobi determinants, etc for the given
+ * subface on given cell of type "iterator into a Triangulation object", and
+ * the given finite element. Since iterators into triangulation alone only
+ * convey information about the geometry of a cell, but not about degrees of
+ * freedom possibly associated with this cell, you will not be able to call
+ * some functions of this class if they need information about degrees of
+ * freedom. These functions are, above all, the
+ * get_function_value/gradients/hessians functions. If you want to
+ * call these functions, you have to call the @p reinit variants that take
+ * iterators into DoFHandler or other DoF handler type objects.
*/
void reinit (const typename Triangulation::cell_iterator &cell,
const unsigned int face_no,
const unsigned int subface_no);
/**
- * Return a reference to this
- * very object.
+ * Return a reference to this very object.
*
- * Though it seems that it is not very
- * useful, this function is there to
- * provide capability to the hpFEValues
- * class, in which case it provides the
- * FEValues object for the present cell
- * (remember that for hp finite elements,
- * the actual FE object used may change
- * from cell to cell, so we also need
- * different FEValues objects for
- * different cells; once you reinitialize
- * the hpFEValues object for a specific
- * cell, it retrieves the FEValues object
- * for the FE on that cell and returns it
- * through a function of the same name as
- * this one; this function here therefore
- * only provides the same interface so
- * that one can templatize on
- * FEValues/hpFEValues).
+ * Though it seems that it is not very useful, this function is there to
+ * provide capability to the hpFEValues class, in which case it provides the
+ * FEValues object for the present cell (remember that for hp finite
+ * elements, the actual FE object used may change from cell to cell, so we
+ * also need different FEValues objects for different cells; once you
+ * reinitialize the hpFEValues object for a specific cell, it retrieves the
+ * FEValues object for the FE on that cell and returns it through a function
+ * of the same name as this one; this function here therefore only provides
+ * the same interface so that one can templatize on FEValues/hpFEValues).
*/
const FESubfaceValues &get_present_fe_values () const;
@@ -3992,22 +2811,15 @@ public:
private:
/**
- * Do work common to the two
- * constructors.
+ * Do work common to the two constructors.
*/
void initialize (const UpdateFlags update_flags);
/**
- * The reinit() functions do
- * only that part of the work
- * that requires knowledge of the
- * type of iterator. After
- * setting present_cell(),
- * they pass on to this function,
- * which does the real work, and
- * which is independent of the
- * actual type of the cell
- * iterator.
+ * The reinit() functions do only that part of the work that requires
+ * knowledge of the type of iterator. After setting present_cell(), they
+ * pass on to this function, which does the real work, and which is
+ * independent of the actual type of the cell iterator.
*/
void do_reinit (const unsigned int face_no,
const unsigned int subface_no);
@@ -4033,12 +2845,9 @@ namespace FEValuesViews
Assert (fe_values.update_flags & update_values,
typename FVB::ExcAccessToUninitializedField());
- // an adaptation of the
- // FEValuesBase::shape_value_component
- // function except that here we know the
- // component as fixed and we have
- // pre-computed and cached a bunch of
- // information. see the comments there
+ // an adaptation of the FEValuesBase::shape_value_component function
+ // except that here we know the component as fixed and we have
+ // pre-computed and cached a bunch of information. see the comments there
if (shape_function_data[shape_function].is_nonzero_shape_function_component)
return fe_values.shape_values(shape_function_data[shape_function]
.row_index,
diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h
index 2ce90aa9fb..eefb46b6a9 100644
--- a/deal.II/include/deal.II/lac/slepc_solver.h
+++ b/deal.II/include/deal.II/lac/slepc_solver.h
@@ -830,7 +830,7 @@ namespace SLEPcWrappers
// and incompatible eigenvalue/eigenvector sizes
AssertThrow (real_eigenvalues.size() == imag_eigenvalues.size(),
ExcDimensionMismatch(real_eigenvalues.size(), imag_eigenvalues.size()));
- AssertThrow (real_eigenvectors.size() == imag_eigenvectors.n (),
+ AssertThrow (real_eigenvectors.size() == imag_eigenvectors.size (),
ExcDimensionMismatch(real_eigenvectors.size(), imag_eigenvectors.size()));
// Panic if the number of eigenpairs wanted is out of bounds.
diff --git a/deal.II/include/deal.II/lac/solver_control.h b/deal.II/include/deal.II/lac/solver_control.h
index f303cddcf8..80d998fd86 100644
--- a/deal.II/include/deal.II/lac/solver_control.h
+++ b/deal.II/include/deal.II/lac/solver_control.h
@@ -462,6 +462,58 @@ protected:
double reduced_tol;
};
+/**
+ * Specialization of @p SolverControl which returns @p success if a given
+ * number of iteration was performed, irrespective of the actual
+ * residual. This is useful in cases where you don't want to solve exactly,
+ * but rather want to perform a fixed number of iterations, e.g. in an inner
+ * solver. The arguments given to this class are exactly the same as for the
+ * SolverControl class and the solver terminates similarly when one of the
+ * given tolerance or the maximum iteration count were reached. The only
+ * difference to SolverControl is that the solver returns success in the
+ * latter case.
+ *
+ * @author Martin Kronbichler
+ */
+class IterationNumberControl : public SolverControl
+{
+public:
+ /**
+ * Constructor. Provide exactly the same arguments as the constructor of
+ * the SolverControl class.
+ */
+ IterationNumberControl (const unsigned int maxiter = 100,
+ const double tolerance = 1e-12,
+ const bool log_history = false,
+ const bool log_result = true);
+
+ /**
+ * Initialize with a SolverControl object. The result will emulate
+ * SolverControl by setting #reduce to zero.
+ */
+ IterationNumberControl (const SolverControl &c);
+
+ /**
+ * Assign a SolverControl object to ReductionControl. The result of the
+ * assignment will emulate SolverControl by setting #reduce to zero.
+ */
+ IterationNumberControl &operator= (const SolverControl &c);
+
+ /**
+ * Virtual destructor is needed as there are virtual functions in this
+ * class.
+ */
+ virtual ~IterationNumberControl();
+
+ /**
+ * Decide about success or failure of an iteration. This function bases
+ * success solely on the fact if a given number of iterations was reached or
+ * the check value reached exactly zero.
+ */
+ virtual State check (const unsigned int step,
+ const double check_value);
+};
+
/*@}*/
//---------------------------------------------------------------------------
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 93e6847b74..a3748c86b8 100644
--- a/deal.II/include/deal.II/numerics/vector_tools.templates.h
+++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h
@@ -5218,9 +5218,11 @@ namespace VectorTools
case H1_norm:
exponent = 2.;
break;
+
case L1_norm:
exponent = 1.;
break;
+
default:
break;
}
@@ -5233,15 +5235,19 @@ namespace VectorTools
case W1p_seminorm:
case W1infty_seminorm:
update_flags |= UpdateFlags (update_gradients);
- if (spacedim == dim+1) update_flags |= UpdateFlags (update_normal_vectors);
+ if (spacedim == dim+1)
+ update_flags |= UpdateFlags (update_normal_vectors);
break;
+
case H1_norm:
case W1p_norm:
case W1infty_norm:
update_flags |= UpdateFlags (update_gradients);
- if (spacedim == dim+1) update_flags |= UpdateFlags (update_normal_vectors);
+ 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/exceptions.cc b/deal.II/source/base/exceptions.cc
index b71a75d98a..22278be947 100644
--- a/deal.II/source/base/exceptions.cc
+++ b/deal.II/source/base/exceptions.cc
@@ -62,31 +62,28 @@ namespace deal_II_exceptions
ExceptionBase::ExceptionBase ()
:
- std::runtime_error(""),
file(""),
line(0),
function(""),
cond(""),
exc(""),
stacktrace (0),
- n_stacktrace_frames (0)
-{
- // Construct a minimalistic error message:
- generate_message();
-}
+ n_stacktrace_frames (0),
+ what_str(0)
+{}
ExceptionBase::ExceptionBase (const ExceptionBase &exc)
:
- std::runtime_error (exc),
file(exc.file),
line(exc.line),
function(exc.function),
cond(exc.cond),
exc(exc.exc),
stacktrace (0), // don't copy stacktrace to avoid double de-allocation problem
- n_stacktrace_frames (0)
+ n_stacktrace_frames (0),
+ what_str(0) // don't copy the error message, it gets generated dynamically by what()
{}
@@ -98,6 +95,11 @@ ExceptionBase::~ExceptionBase () throw ()
free (stacktrace);
stacktrace = 0;
}
+ if (what_str != 0)
+ {
+ delete[] what_str;
+ what_str = 0;
+ }
}
@@ -115,23 +117,38 @@ 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
+ // order of seconds on some machines.
#ifdef HAVE_GLIBC_STACKTRACE
- void *array[25];
- n_stacktrace_frames = backtrace(array, 25);
- stacktrace = backtrace_symbols(array, n_stacktrace_frames);
+ n_stacktrace_frames = backtrace(raw_stacktrace, 25);
#endif
-
- // And finally populate the underlying std::runtime_error:
- generate_message();
}
+const char* ExceptionBase::what() const throw()
+{
+ // If no error c_string was generated so far, do it now:
+ if (what_str == 0)
+ {
+#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.
+ stacktrace = backtrace_symbols(raw_stacktrace, n_stacktrace_frames);
+#endif
+
+ generate_message();
+ }
+
+ return what_str;
+}
const char *ExceptionBase::get_exc_name () const
@@ -262,35 +279,45 @@ void ExceptionBase::print_stack_trace (std::ostream &out) const
-void ExceptionBase::generate_message ()
+void ExceptionBase::generate_message () const
{
- // build up a string with the error message...
+ // build up a c_string with the error message.
+ // Guard this procedure with a try block, we shall not throw at this
+ // place...
+ try
+ {
+ std::ostringstream converter;
- std::ostringstream converter;
+ converter << std::endl
+ << "--------------------------------------------------------"
+ << std::endl;
- converter << std::endl
- << "--------------------------------------------------------"
- << std::endl;
+ // print out general data
+ print_exc_data (converter);
+ // print out exception specific data
+ print_info (converter);
+ print_stack_trace (converter);
- // print out general data
- print_exc_data (converter);
- // print out exception specific data
- print_info (converter);
- print_stack_trace (converter);
+ if (!deal_II_exceptions::additional_assert_output.empty())
+ {
+ converter << "--------------------------------------------------------"
+ << std::endl
+ << deal_II_exceptions::additional_assert_output
+ << std::endl;
+ }
- if (!deal_II_exceptions::additional_assert_output.empty())
- {
converter << "--------------------------------------------------------"
- << std::endl
- << deal_II_exceptions::additional_assert_output
<< std::endl;
- }
-
- converter << "--------------------------------------------------------"
- << std::endl;
- // ... and set up std::runtime_error with it:
- static_cast(*this) = std::runtime_error(converter.str());
+ 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());
+ }
+ catch (...)
+ {
+ // On error, resume next. There is nothing better we can do...
+ }
}
diff --git a/deal.II/source/dofs/dof_handler.cc b/deal.II/source/dofs/dof_handler.cc
index 6aaaef2dd8..119a9ee2c5 100644
--- a/deal.II/source/dofs/dof_handler.cc
+++ b/deal.II/source/dofs/dof_handler.cc
@@ -65,6 +65,23 @@ namespace internal
namespace internal
{
+ template
+ std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase & policy)
+ {
+ std::string policy_name;
+ if (dynamic_cast*>(&policy))
+ policy_name = "Policy::Sequential<";
+ else
+ if (dynamic_cast*>(&policy))
+ policy_name = "Policy::ParallelDistributed<";
+ else
+ AssertThrow(false, ExcNotImplemented());
+ policy_name += Utilities::int_to_string(dim)+
+ ","+Utilities::int_to_string(spacedim)+">";
+ return policy_name;
+ }
+
+
namespace DoFHandler
{
// access class
diff --git a/deal.II/source/dofs/dof_handler.inst.in b/deal.II/source/dofs/dof_handler.inst.in
index 594bbd4c4a..dbc912bead 100644
--- a/deal.II/source/dofs/dof_handler.inst.in
+++ b/deal.II/source/dofs/dof_handler.inst.in
@@ -21,8 +21,13 @@ for (deal_II_dimension : DIMENSIONS)
namespace internal
\{
template const types::global_dof_index * dummy ();
+ template std::string policy_to_string(const dealii::internal::DoFHandler::Policy::
+ PolicyBase &);
+
#if deal_II_dimension < 3
template const types::global_dof_index * dummy ();
+ template std::string policy_to_string(const dealii::internal::DoFHandler::Policy::
+ PolicyBase &);
#endif
\}
diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc
index 4e8a60fc77..3db4b2104a 100644
--- a/deal.II/source/dofs/dof_handler_policy.cc
+++ b/deal.II/source/dofs/dof_handler_policy.cc
@@ -866,16 +866,8 @@ namespace internal
PolicyBase::~PolicyBase ()
{}
- /* --------------------- class Sequential ---------------- */
-
- template
- std::string
- Sequential::to_string () const
- {
- return "Policy::Sequential<"+Utilities::int_to_string(dim)+
- ","+Utilities::int_to_string(spacedim)+">";
- }
+ /* --------------------- class Sequential ---------------- */
template
@@ -1934,13 +1926,6 @@ namespace internal
#endif // DEAL_II_WITH_P4EST
- template
- std::string
- ParallelDistributed::to_string () const
- {
- return "Policy::ParallelDistributed<"+Utilities::int_to_string(dim)+
- ","+Utilities::int_to_string(spacedim)+">";
- }
template
diff --git a/deal.II/source/dofs/dof_tools_constraints.cc b/deal.II/source/dofs/dof_tools_constraints.cc
index acc7ba92b1..25c01c21cf 100644
--- a/deal.II/source/dofs/dof_tools_constraints.cc
+++ b/deal.II/source/dofs/dof_tools_constraints.cc
@@ -2854,22 +2854,32 @@ namespace DoFTools
Assert (component_mask.n_selected_components(n_components) > 0,
ComponentMask::ExcNoComponentSelected());
- // a field to store the indices
+ // a field to store the indices on the face
std::vector face_dofs;
face_dofs.reserve (max_dofs_per_face(dof));
+ // a field to store the indices on the cell
+ std::vector cell_dofs;
+ cell_dofs.reserve (max_dofs_per_cell(dof));
typename DH::active_cell_iterator
cell = dof.begin_active(),
endc = dof.end();
for (; cell!=endc; ++cell)
- if (!cell->is_artificial())
+ if (!cell->is_artificial()
+ &&
+ cell->at_boundary ())
+ {
+ const FiniteElement &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::faces_per_cell;
++face_no)
{
- const FiniteElement &fe = cell->get_fe();
-
const typename DH::face_iterator face = cell->face(face_no);
-
+
// if face is on the boundary and satisfies the correct
// boundary id property
if (face->at_boundary ()
@@ -2888,8 +2898,13 @@ namespace DoFTools
{
// Find out if a dof has a contribution in this
// component, and if so, add it to the list
+ const std::vector::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(),
+ it_index_on_cell);
const ComponentMask &nonzero_component_array
- = cell->get_fe().get_nonzero_components (i);
+ = cell->get_fe().get_nonzero_components (index_on_cell);
bool nonzero = false;
for (unsigned int c=0; c &,
const unsigned int, const double, const double);
- template
- void
- parallelogram (Triangulation &,
- const Tensor<2,deal_II_dimension> &,
- const bool );
- template
- void
- parallelogram (Triangulation &,
- const Point [deal_II_dimension],
- const bool);
+
template void
subdivided_hyper_rectangle
diff --git a/deal.II/source/lac/solver_control.cc b/deal.II/source/lac/solver_control.cc
index 8f40d154a4..6eab7e4d4f 100644
--- a/deal.II/source/lac/solver_control.cc
+++ b/deal.II/source/lac/solver_control.cc
@@ -303,4 +303,41 @@ ReductionControl::parse_parameters (ParameterHandler ¶m)
set_reduction (param.get_double("Reduction"));
}
+
+/*---------------------- IterationNumberControl -----------------------------*/
+
+
+IterationNumberControl::IterationNumberControl(const unsigned int n,
+ const double tolerance,
+ const bool m_log_history,
+ const bool m_log_result)
+ :
+ SolverControl (n, tolerance, m_log_history, m_log_result){}
+
+
+IterationNumberControl::~IterationNumberControl()
+{}
+
+
+SolverControl::State
+IterationNumberControl::check (const unsigned int step,
+ const double check_value)
+{
+ // check whether the given number of iterations was reached, and return
+ // success in that case. Otherwise, go on to the check of the base class.
+ if (step >= this->maxsteps)
+ {
+ if (m_log_result)
+ deallog << "Convergence step " << step
+ << " value " << check_value << std::endl;
+ lstep = step;
+ lvalue = check_value;
+
+ lcheck = success;
+ return success;
+ }
+ else
+ return SolverControl::check(step, check_value);
+}
+
DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/tests/CMakeLists.txt b/deal.II/tests/CMakeLists.txt
index 74a5cfa2f5..14d41b5410 100644
--- a/deal.II/tests/CMakeLists.txt
+++ b/deal.II/tests/CMakeLists.txt
@@ -14,25 +14,27 @@
##
## ---------------------------------------------------------------------
-#
-# This is a bloody hack to avoid a severe performance penalty when using
-# 12k top level targets with GNU Make that really does not like that...
-#
-# The only choice we have is to set up every test subdirectory as an
-# independent project. Unfortunately this adds quite a significant amount
-# of complexity :-(
-#
+IF(NOT DEFINED DEAL_II_BINARY_DIR)
+ MESSAGE(FATAL_ERROR "\n
+ The testsuite cannot be set up as an independent project.
+ Please configure \"deal.II\" directly instead.\n\n"
+ )
+ENDIF()
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Setup testsuite with TEST_DIR ${TEST_DIR}")
-ADD_SUBDIRECTORY(quick_tests)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+PROJECT(testsuite NONE)
#
-# Custom targets to set and clean up the testsuite:
+# 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)
+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)
@@ -43,46 +45,10 @@ ADD_CUSTOM_TARGET(clean_tests)
# Remove all tests:
ADD_CUSTOM_TARGET(prune_tests)
-#
-# Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR and
-# CMAKE_CURRENT_BINARY_DIR:
-#
-FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
- "SUBDIRS(tests)"
- )
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "")
-
-#
-# Pass all relevant "TEST_" and "_DIR" variables down to the subprojects:
-#
-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
- TEST_TIME_LIMIT
- )
- # always undefine:
- LIST(APPEND _options "-U${_var}")
- IF(DEFINED ${_var})
- LIST(APPEND _options "-D${_var}=${${_var}}")
- ENDIF()
-ENDFOREACH()
-
-# Be as quiet as possible:
-IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
- SET(_shoo)
-ELSE()
- SET(_shoo >/dev/null)
-ENDIF()
-
#
# 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)
@@ -91,75 +57,27 @@ LIST(REMOVE_DUPLICATES _categories)
# Define a subproject for every enabled category:
#
-MESSAGE(STATUS "Regenerating testsuite subprojects")
-
FOREACH(_category ${_categories})
- IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_category}/CMakeLists.txt)
- SET(_category_dir ${CMAKE_CURRENT_SOURCE_DIR}/${_category})
- ELSEIF(EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt)
- SET(_category_dir ${TEST_DIR}/${_category})
- ELSE()
- SET(_category_dir)
- ENDIF()
-
- IF(NOT "${_category_dir}" STREQUAL "")
-
- ADD_CUSTOM_TARGET(setup_tests_${_category}
- COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_CURRENT_BINARY_DIR}/${_category}
- COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/${_category} &&
- ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir}
- ${_shoo}
- DEPENDS ${_category_dir}
- COMMENT "Processing tests/${_category}"
- )
- ADD_DEPENDENCIES(setup_tests setup_tests_${_category})
-
- # depend on a compiled library:
- ADD_DEPENDENCIES(setup_tests_${_category} build_library)
+ IF( EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt OR
+ EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt )
ADD_CUSTOM_TARGET(regen_tests_${_category}
COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
- --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target regenerate
- ${_shoo}
+ --build ${CMAKE_BINARY_DIR}/${_category} --target regenerate
)
ADD_DEPENDENCIES(regen_tests regen_tests_${_category})
ADD_CUSTOM_TARGET(clean_tests_${_category}
COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
- --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target clean
- ${_shoo}
+ --build ${CMAKE_BINARY_DIR}/${_category} --target clean
)
ADD_DEPENDENCIES(clean_tests clean_tests_${_category})
ADD_CUSTOM_TARGET(prune_tests_${_category}
COMMAND ${CMAKE_COMMAND} -E remove_directory
- ${CMAKE_CURRENT_BINARY_DIR}/${_category}
+ ${CMAKE_BINARY_DIR}/${_category}
)
ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
- FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake
- "SUBDIRS(${_category})\n"
- )
-
- #
- # Regenerate subprojects: The "regenerate" target of the subproject
- # depends on "rebuild_cache" so that the subprojects rerun cmake if
- # necessary.
- # (TODO: Unfortunately this is sequential - due to the fact that we
- # cannot call back into the main build system)
- #
-
- IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_category}/CMakeCache.txt)
- EXECUTE_PROCESS(
- COMMAND ${CMAKE_COMMAND}
- --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target regenerate
- OUTPUT_QUIET
- )
- ENDIF()
-
ENDIF()
ENDFOREACH()
-
-MESSAGE(STATUS "Regenerating testsuite subprojects - Done")
-MESSAGE(STATUS "")
diff --git a/deal.II/tests/all-headers/CMakeLists.txt b/deal.II/tests/all-headers/CMakeLists.txt
index f1aa8509a7..175e078ed8 100644
--- a/deal.II/tests/all-headers/CMakeLists.txt
+++ b/deal.II/tests/all-headers/CMakeLists.txt
@@ -15,7 +15,7 @@
## ---------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake)
PROJECT(testsuite CXX)
INCLUDE(${DEAL_II_TARGET_CONFIG})
diff --git a/deal.II/tests/build_tests/CMakeLists.txt b/deal.II/tests/build_tests/CMakeLists.txt
index 8847d559e9..02318b6259 100644
--- a/deal.II/tests/build_tests/CMakeLists.txt
+++ b/deal.II/tests/build_tests/CMakeLists.txt
@@ -15,7 +15,7 @@
## ---------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake)
PROJECT(testsuite CXX)
INCLUDE(${DEAL_II_TARGET_CONFIG})
diff --git a/deal.II/tests/mesh_converter/CMakeLists.txt b/deal.II/tests/mesh_converter/CMakeLists.txt
index 63df321378..0bac004ae8 100644
--- a/deal.II/tests/mesh_converter/CMakeLists.txt
+++ b/deal.II/tests/mesh_converter/CMakeLists.txt
@@ -15,7 +15,7 @@
## ---------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake)
PROJECT(testsuite CXX)
INCLUDE(${DEAL_II_TARGET_CONFIG})
--
2.39.5