ENABLE_LANGUAGE_OPTIONAL(C)
ENABLE_LANGUAGE_OPTIONAL(Fortran)
-INCLUDE(setup_post_project_call)
-
INCLUDE(setup_deal_ii)
+
INCLUDE(setup_compiler_flags)
#
ADD_SUBDIRECTORY(contrib) # has to be included after source
ADD_SUBDIRECTORY(examples)
-IF(DEAL_II_HAVE_TESTS_DIRECTORY)
- ADD_SUBDIRECTORY(${TEST_DIR} ${CMAKE_BINARY_DIR}/tests)
-ENDIF()
+ADD_SUBDIRECTORY(tests)
#
# And finally, print the configuration:
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# Dashboard configuration:
+#
+
+SET(CTEST_PROJECT_NAME "deal.II")
+
+SET(CTEST_DROP_METHOD "http")
+SET(CTEST_DROP_SITE "cdash.kyomu.43-1.org")
+SET(CTEST_DROP_LOCATION "/submit.php?project=deal.II")
+SET(CTEST_DROP_SITE_CDASH TRUE)
+
+SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 100)
+SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300)
+
+# number of lines to submit before an error:
+SET(CTEST_CUSTOM_ERROR_PRE_CONTEXT 5)
+# number of lines to submit after an error:
+SET(CTEST_CUSTOM_ERROR_POST_CONTEXT 20)
+
+#
+# Coverage options:
+#
+
+SET(CTEST_EXTRA_COVERAGE_GLOB
+ # These files should have executable lines and therefore coverage:
+ # source/**/*.cc
+ )
+
+SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
+ "/bundled"
+ "/cmake/scripts/"
+ "/contrib"
+ "/examples"
+ "/tests"
+ )
$ make install (alternatively $ make -j<N> install)
A detailed ReadME can be found at ./doc/readme.html and
- ./doc/development/cmake.html or at http://www.dealii.org/.
+ ./doc/users/cmake.html or at http://www.dealii.org/.
Getting started:
Further information:
- For further information have a look at ./doc/readme.html or at
+ For further information have a look at ./doc/index.html or at
http://www.dealii.org.
ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src)
- IF( DEAL_II_WITH_THREADS AND NOT DEAL_II_CAN_USE_CXX11)
+ IF( DEAL_II_WITH_THREADS AND NOT DEAL_II_USE_CXX11)
#
# If the C++ compiler doesn't completely support the C++11 standard
# (and consequently we can't use std::thread, std::mutex, etc), then
// should only be used by deal.II and dependent projects...
//
// - Maier, 2013
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
template<typename T> struct weak_ptr_traits<std::weak_ptr<T> >
{
typedef std::shared_ptr<T> shared_type;
typedef boost::weak_ptr<T> weak_type;
};
// as above
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
template<typename T> struct shared_ptr_traits<std::shared_ptr<T> >
{
typedef std::weak_ptr<T> weak_type;
DEAL_II_ADD_DEFINITIONS(obj_tbb "DO_ITT_NOTIFY")
ENDIF()
ENDIF()
-
#
# DEAL_II_HAVE_CXX11_FLAG
# DEAL_II_CXX11_FLAG
-# DEAL_II_CAN_USE_CXX11
+# DEAL_II_USE_CXX11
# HAVE_ISNAN
# HAVE_UNDERSCORE_ISNAN
# DEAL_II_HAVE_ISFINITE
MESSAGE(STATUS "Sufficient C++11 support. Enabling ${DEAL_II_CXX11_FLAG}.")
- SET(DEAL_II_CAN_USE_CXX11 TRUE)
+ SET(DEAL_II_USE_CXX11 TRUE)
ADD_FLAGS(CMAKE_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
MESSAGE(STATUS "Insufficient C++11 support. Disabling ${DEAL_II_CXX11_FLAG}.")
ENDIF()
-#
-# Currently unused
-#
-# IF(DEAL_II_CAN_USE_CXX11)
-# #
-# # Also test for a couple of C++11 things that we don't use in the
-# # library but that users may want to use in their applications and that
-# # we might want to test in the testsuite
-# #
-# # TODO: Actually we have to export the test results somehow. :-]
-# #
+ IF(DEAL_II_USE_CXX11)
+ CHECK_CXX_SOURCE_COMPILES(
+ "
+ #include <type_traits>
+ int main(){ std::is_trivially_copyable<int> bob; }
+ "
+ DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
+
+# Currently unused:
#
# CHECK_CXX_SOURCE_COMPILES(
# "
# SET(DEAL_II_CAN_USE_ADDITIONAL_CXX1X_FEATURES)
# ENDIF()
#
-# ENDIF()
+ ENDIF()
POP_TEST_FLAG()
# Shared library handling:
#
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- #
# With MinGW we're lucky:
- #
ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--export-all-symbols")
ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--enable-auto-import")
ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--allow-multiple-definition")
-
- #
- # Workaround for a miscompilation and linkage issue with shared libraries
- # with MinGW. Replacing -O0 with -O1 seems to help..
- #
- REPLACE_FLAG(DEAL_II_CXX_FLAGS_DEBUG "-O0" "-O1")
-
ELSE()
-
- #
# Otherwise disable shared libraries:
- #
MESSAGE(WARNING "\n"
"BUILD_SHARED_LIBS forced to OFF\n\n"
)
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
ENDIF()
- #
- # Disable -ggdb and -g on Windows/MinGW targets for the moment until the
- # compilation issues with too big files are resolved
- #
- # - Matthias Maier, 2012
- #
- STRIP_FLAG(DEAL_II_CXX_FLAGS_DEBUG "-ggdb")
- STRIP_FLAG(DEAL_II_LINKER_FLAGS_DEBUG "-ggdb")
- STRIP_FLAG(DEAL_II_CXX_FLAGS_DEBUG "-g")
- STRIP_FLAG(DEAL_II_LINKER_FLAGS_DEBUG "-g")
ENDIF()
-IF(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
- #
- # Workaround for a miscompilation and linkage issue with shared libraries
- # under Cygwin. Replacing -O0 with -O1 helps.
- #
- # - Matthias Maier, 2013
- #
- REPLACE_FLAG(DEAL_II_CXX_FLAGS_DEBUG "-O0" "-O1")
+IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
+ OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ # TODO: Bailout if current compiler is not gcc-4.8.1 or newer
ENDIF()
)
STRIP_FLAG(CMAKE_CXX_FLAGS "${DEAL_II_CXX11_FLAG}")
SET(DEAL_II_CAN_USE_CXX1X FALSE)
- SET(DEAL_II_CAN_USE_CXX11 FALSE)
+ SET(DEAL_II_USE_CXX11 FALSE)
ENDIF()
+#
+# gcc-4.8.1 has some problems with the constexpr "vertices_per_cell" in the
+# definition of alternating_form_at_vertices.
+#
+# TODO: Write a unit test.
+#
+# For now, just enable the workaround for Windows targets
+#
+# - Matthias Maier, 2013
+#
+
+IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
+ OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ SET(DEAL_II_CONSTEXPR_BUG TRUE)
+ENDIF()
# deal.IIVersionConfig.cmake
#
# and copies it (a) to the build directory and (b) prepares it for later
-# installation (the copy in CMAKE_CURRENT_BINARY_DIR).
+# installation.
#
#
#
# Finally, add a target to create the "binary" file in
-# ${DEAL_II_PROJECT_CONFIG_RELDIR} and add it to the library target:
+# ${DEAL_II_PROJECT_CONFIG_RELDIR} and add it to the "all" target:
#
ADD_CUSTOM_TARGET(setup_build_dir ALL
COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/binary
COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
+ COMMENT "Update build directory"
)
-ADD_DEPENDENCIES(library setup_build_dir)
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ ADD_DEPENDENCIES(setup_build_dir ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
+ENDFOREACH()
#
# And a script to remove it upon installation from the install prefix:
+# This is necessary if somebody wants to install into the build directory
+# (yes this is a valid use case...).
#
INSTALL(CODE
"
#
IF(DEAL_II_BUILD_DIR)
+ SET(DEAL_II_EXECUTABLE_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake")
SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}BuildTargets.cmake")
ELSE()
SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake")
ENDIF()
FIND_PACKAGE(MPI)
- IF(NOT MPI_CXX_FOUND)
+ IF(NOT MPI_CXX_FOUND AND DEAL_II_WITH_MPI)
#
# CMAKE_CXX_COMPILER is apparently not an mpi wrapper.
- # So, let's be a bit more aggressive in finding MPI if DEAL_II_WITH_MPI
- # is set.
+ # So, let's be a bit more aggressive in finding MPI (and if
+ # DEAL_II_WITH_MPI is set).
#
- IF(DEAL_II_WITH_MPI)
- MESSAGE(STATUS
- "MPI not found but DEAL_II_WITH_MPI is set to TRUE."
- " Try again with more aggressive search paths:"
- )
- SET(MPI_FOUND) # clear this value so that FIND_PACKAGE runs again.
- UNSET(MPI_CXX_COMPILER CACHE)
- UNSET(MPI_C_COMPILER CACHE)
- UNSET(MPI_Fortran_COMPILER CACHE)
- FIND_PACKAGE(MPI)
- ENDIF()
+ MESSAGE(STATUS
+ "MPI not found but DEAL_II_WITH_MPI is set to TRUE."
+ " Try again with more aggressive search paths:"
+ )
+ SET(MPI_FOUND) # clear this value so that FIND_PACKAGE runs again.
+ UNSET(MPI_CXX_COMPILER CACHE)
+ UNSET(MPI_C_COMPILER CACHE)
+ UNSET(MPI_Fortran_COMPILER CACHE)
+ FIND_PACKAGE(MPI)
ENDIF()
#
ENDIF()
ENDFOREACH()
- # Hide some variables:
- MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY)
-
IF(MPI_CXX_FOUND)
+ #
+ # Manually assemble some version information:
+ #
+ FIND_FILE(MPI_MPI_H NAMES mpi.h
+ HINTS ${MPI_INCLUDE_PATH}
+ )
+
+ IF(NOT MPI_MPI_H MATCHES "-NOTFOUND" AND NOT DEFINED MPI_VERSION)
+ FILE(STRINGS "${MPI_MPI_H}" MPI_VERSION_MAJOR_STRING
+ REGEX "#define.*MPI_VERSION")
+ STRING(REGEX REPLACE "^.*MPI_VERSION.*([0-9]+).*" "\\1"
+ MPI_VERSION_MAJOR "${MPI_VERSION_MAJOR_STRING}"
+ )
+ FILE(STRINGS ${MPI_MPI_H} MPI_VERSION_MINOR_STRING
+ REGEX "#define.*MPI_SUBVERSION")
+ STRING(REGEX REPLACE "^.*MPI_SUBVERSION.*([0-9]+).*" "\\1"
+ MPI_VERSION_MINOR "${MPI_VERSION_MINOR_STRING}"
+ )
+ SET(MPI_VERSION "${MPI_VERSION_MAJOR}.${MPI_VERSION_MINOR}")
+ IF("${MPI_VERSION}" STREQUAL ".")
+ SET(MPI_VERSION)
+ SET(MPI_VERSION_MAJOR)
+ SET(MPI_VERSION_MINOR)
+ ENDIF()
+
+ # OMPI specific version number:
+ FILE(STRINGS ${MPI_MPI_H} OMPI_VERSION_MAJOR_STRING
+ REGEX "#define.*OMPI_MAJOR_VERSION")
+ STRING(REGEX REPLACE "^.*OMPI_MAJOR_VERSION.*([0-9]+).*" "\\1"
+ OMPI_VERSION_MAJOR "${OMPI_VERSION_MAJOR_STRING}"
+ )
+ FILE(STRINGS ${MPI_MPI_H} OMPI_VERSION_MINOR_STRING
+ REGEX "#define.*OMPI_MINOR_VERSION")
+ STRING(REGEX REPLACE "^.*OMPI_MINOR_VERSION.*([0-9]+).*" "\\1"
+ OMPI_VERSION_MINOR "${OMPI_VERSION_MINOR_STRING}"
+ )
+ FILE(STRINGS ${MPI_MPI_H} OMPI_VERSION_RELEASE_STRING
+ REGEX "#define.*OMPI_RELEASE_VERSION")
+ STRING(REGEX REPLACE "^.*OMPI_RELEASE_VERSION.*([0-9]+).*" "\\1"
+ OMPI_VERSION_SUBMINOR "${OMPI_VERSION_RELEASE_STRING}"
+ )
+ SET(OMPI_VERSION
+ "${OMPI_VERSION_MAJOR}.${OMPI_VERSION_MINOR}.${OMPI_VERSION_SUBMINOR}"
+ )
+ IF("${OMPI_VERSION}" STREQUAL "..")
+ SET(OMPI_VERSION)
+ SET(OMPI_VERSION_MAJOR)
+ SET(OMPI_VERSION_MINOR)
+ SET(OMPI_VERSION_SUBMINOR)
+ ENDIF()
+ ENDIF()
+
SET(${var} TRUE)
ENDIF()
+
+ # Hide some variables:
+ MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY MPI_MPI_H)
+
ENDMACRO()
#
-# Set up genereal threading:
+# Set up general threading:
# The macro will be included in CONFIGURE_FEATURE_THREADS_EXTERNAL/BUNDLED.
#
MACRO(SETUP_THREADING)
ENDIF()
+ #
+ # Workaround for an issue with C++11 mode, non gcc-compilers and missing
+ # template<typename T> std::ist_trivially_copyable<T>
+ #
+ IF( DEAL_II_USE_CXX11 AND
+ NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
+ NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
+ LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
+ LIST(APPEND DEAL_II_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
+ ENDIF()
SETUP_THREADING()
ENDMACRO()
)
ENDIF()
+ #
+ # Workaround for an issue with C++11 mode, non gcc-compilers and missing
+ # template<typename T> std::ist_trivially_copyable<T>
+ #
+ IF( DEAL_II_USE_CXX11 AND
+ NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
+ NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
+ LIST(APPEND DEAL_II_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
+ LIST(APPEND DEAL_II_USER_DEFINITIONS "TBB_IMPLEMENT_CPP0X=1")
+ ENDIF()
+
#
# tbb uses dlopen/dlclose, so link against libdl.so as well:
#
# with the -std=c++0x flag of GCC, see deal.II FAQ.
# Test whether that is indeed the case
#
- IF(DEAL_II_CAN_USE_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11)
+ IF(DEAL_II_USE_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11)
IF(TRILINOS_HAS_C99_TR1_WORKAROUND)
LIST(APPEND DEAL_II_DEFINITIONS "HAS_C99_TR1_CMATH")
FIND_PACKAGE(P4EST)
IF(P4EST_FOUND)
+ SET(${var} TRUE)
+
+ #
+ # We require at least version 0.3.4.1
+ #
+ IF(P4EST_VERSION VERSION_LESS "0.3.4.1")
+ MESSAGE(STATUS "Insufficient p4est installation found: "
+ "At least version 0.3.4.1 is required."
+ )
+ SET(P4EST_ADDITIONAL_ERROR_STRING
+ "Insufficient p4est installation found!\n"
+ "At least version 0.3.4.1 is required.\n"
+ )
+ SET(${var} FALSE)
+ ENDIF()
+
#
# Check whether p4est supports mpi:
#
"p4est has to be configured with MPI enabled."
)
SET(P4EST_ADDITIONAL_ERROR_STRING
+ ${P4EST_ADDITIONAL_ERROR_STRING}
"Insufficient p4est installation found!\n"
"p4est has to be configured with MPI enabled.\n"
)
+ SET(${var} FALSE)
+ ENDIF()
+ #
+ # Reset configuration:
+ #
+ IF(NOT ${var})
UNSET(P4EST_LIBRARY_OPTIMIZED CACHE)
UNSET(P4EST_LIBRARY_DEBUG CACHE)
UNSET(P4EST_INCLUDE_DIR CACHE)
"An optional hint to a p4est installation/directory"
)
MARK_AS_ADVANCED(CLEAR P4EST_DIR)
- ELSE()
- SET(${var} TRUE)
ENDIF()
+
ENDIF()
ENDMACRO()
+
MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL)
INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIRS})
#
CONFIGURE_FEATURE(ZLIB)
+
+# Export ZLIB_VERSION:
+IF(DEFINED ZLIB_VERSION_STRING)
+ SET(ZLIB_VERSION ${ZLIB_VERSION_STRING})
+ENDIF()
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# A Macro to set up tests for the testsuite
+#
+# The following variables must be set:
+#
+# TEST_DIFF
+# - specifying the executable and command line of the diff command to use
+#
+# TEST_TIME_LIMIT
+# - specifying the maximal wall clock time in seconds a test is allowed
+# to run
+#
+#
+# Usage:
+# DEAL_II_ADD_TEST(category test_name comparison_file [ARGN])
+#
+# This macro assumes that a source file "./tests/category/<test_name>.cc"
+# as well as the comparison file "./tests/category/<comparison_file>" is
+# available in the testsuite. The output of compiled source file is
+# compared against the file comparison file.
+#
+# [ARGN] is an optional list of additional output lines passed down to the
+# run_test.cmake script and printed at the beginning of the test output.
+#
+# This macro gets the following options from the comparison file name (have
+# a look at the testsuite documentation for details):
+# - usage of mpirun and number of simultaneous processes
+# - valid build configurations
+# - expected test stage
+#
+
+MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
+
+ IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED)
+ MESSAGE(FATAL_ERROR
+ "\nDEAL_II_ADD_TEST can only be called in external test subprojects after "
+ "the inclusion of deal.IIConfig.cmake. It is not intended for "
+ "internal use.\n\n"
+ )
+ ENDIF()
+
+ GET_FILENAME_COMPONENT(_file ${_comparison_file} NAME)
+
+ #
+ # Determine valid build configurations for this test:
+ #
+
+ SET(_configuration)
+ IF(_file MATCHES "debug")
+ SET(_configuration DEBUG)
+ ELSEIF(_file MATCHES "release")
+ SET(_configuration RELEASE)
+ ENDIF()
+
+ #
+ # Determine whether the test should be run with mpirun:
+ #
+
+ STRING(REGEX MATCH "mpirun=([0-9]*)" _n_cpu ${_file})
+ IF("${_n_cpu}" STREQUAL "")
+ SET(_n_cpu 0) # 0 indicates that no mpirun should be used
+ ELSE()
+ STRING(REGEX REPLACE "^mpirun=([0-9]*)$" "\\1" _n_cpu ${_n_cpu})
+ ENDIF()
+
+ #
+ # Determine the expected build stage of this test:
+ #
+
+ STRING(REGEX MATCH "expect=([a-z]*)" _expect ${_file})
+ IF("${_expect}" STREQUAL "")
+ SET(_expect "PASSED")
+ ELSE()
+ STRING(REGEX REPLACE "^expect=([a-z]*)$" "\\1" _expect ${_expect})
+ STRING(TOUPPER ${_expect} _expect)
+ ENDIF()
+
+
+ FOREACH(_build ${DEAL_II_BUILD_TYPES})
+
+ ITEM_MATCHES(_match "${_build}" ${_configuration})
+ IF(_match OR "${_configuration}" STREQUAL "")
+
+ #
+ # Setup a bunch of variables describing the test:
+ #
+ STRING(TOLOWER ${_build} _build_lowercase)
+ SET(_target ${_test_name}.${_build_lowercase}) # target name
+
+ # If _n_cpu is equal to "0", a normal, sequental test will be run,
+ # otherwise run the test with mpirun:
+ IF("${_n_cpu}" STREQUAL "0")
+
+ SET(_diff_target ${_target}.diff) # diff target name
+ SET(_test_full ${_category}/${_test_name}.${_build_lowercase}) # full test name
+ SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}) # directory to run the test in
+ SET(_run_command ${_target}) # the command to issue
+
+ ELSE()
+
+ SET(_diff_target ${_test_name}.mpirun${_n_cpu}.${_build_lowercase}.diff) # diff target name
+ SET(_test_full ${_category}/${_test_name}.mpirun=${_n_cpu}.${_build_lowercase}) # full test name
+ SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}/mpirun=${_n_cpu}) # directory to run the test in
+ SET(_run_command mpirun -np ${_n_cpu} ${CMAKE_CURRENT_BINARY_DIR}/${_target}/${_target}) # the command to issue
+
+ ENDIF()
+
+ FILE(MAKE_DIRECTORY ${_test_directory})
+
+ #
+ # Add an executable for the current test and set up compile
+ # definitions and the full link interface:
+ #
+ IF(NOT TARGET ${_target})
+ # only add the target once
+
+ ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL ${_test_name}.cc)
+
+ SET_TARGET_PROPERTIES(${_target} PROPERTIES
+ LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
+ COMPILE_DEFINITIONS "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_${_build}}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
+ LINKER_LANGUAGE "CXX"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_target}"
+ )
+ SET_PROPERTY(TARGET ${_target} APPEND PROPERTY
+ INCLUDE_DIRECTORIES "${DEAL_II_INCLUDE_DIRS}"
+ )
+ SET_PROPERTY(TARGET ${_target} APPEND PROPERTY
+ COMPILE_DEFINITIONS
+ SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+ TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET_${_build}})
+ ENDIF()
+
+ #
+ # Add a top level target to run and compare the test:
+ #
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/output
+ COMMAND rm -f ${_test_directory}/failing_output
+ COMMAND touch ${_test_directory}/output
+ COMMAND
+ ${_run_command}
+ || (mv ${_test_directory}/output
+ ${_test_directory}/failing_output
+ && echo "${_test_full}: BUILD successful."
+ && echo "${_test_full}: RUN failed. ------ Result: ${_test_directory}/failing_output"
+ && echo "${_test_full}: RUN failed. ------ Partial output:"
+ && cat ${_test_directory}/failing_output
+ && exit 1)
+ COMMAND
+ ${PERL_EXECUTABLE} -pi ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
+ ${_test_directory}/output
+ WORKING_DIRECTORY
+ ${_test_directory}
+ DEPENDS
+ ${_target}
+ ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
+ )
+ ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff
+ COMMAND rm -f ${_test_directory}/failing_diff
+ COMMAND touch ${_test_directory}/diff
+ COMMAND
+ ${TEST_DIFF}
+ ${_test_directory}/output
+ ${_comparison_file}
+ > ${_test_directory}/diff
+ || (mv ${_test_directory}/diff
+ ${_test_directory}/failing_diff
+ && echo "${_test_full}: BUILD successful."
+ && echo "${_test_full}: RUN successful."
+ && echo "${_test_full}: DIFF failed. ------ Source: ${_comparison_file}"
+ && echo "${_test_full}: DIFF failed. ------ Result: ${_test_directory}/output"
+ && echo "${_test_full}: DIFF failed. ------ Diff: ${_test_directory}/failing_diff"
+ && echo "${_test_full}: DIFF failed. ------ Diffs as follows:"
+ && cat ${_test_directory}/failing_diff
+ && exit 1)
+ WORKING_DIRECTORY
+ ${_test_directory}
+ DEPENDS
+ ${_test_directory}/output
+ ${_comparison_file}
+ )
+
+ ADD_CUSTOM_TARGET(${_diff_target} DEPENDS ${_test_directory}/diff
+ COMMAND
+ echo "${_test_full}: BUILD successful."
+ && echo "${_test_full}: RUN successful."
+ && echo "${_test_full}: DIFF successful."
+ && echo "${_test_full}: PASSED."
+ )
+
+ #
+ # And finally add the test:
+ #
+
+ ADD_TEST(NAME ${_test_full}
+ COMMAND ${CMAKE_COMMAND}
+ -DTRGT=${_diff_target}
+ -DTEST=${_test_full}
+ -DEXPECT=${_expect}
+ -DADDITIONAL_OUTPUT=${ARGN}
+ -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
+ WORKING_DIRECTORY ${_test_directory}
+ )
+ SET_TESTS_PROPERTIES(${_test_full} PROPERTIES
+ LABEL "${_category}"
+ TIMEOUT ${TEST_TIME_LIMIT}
+ )
+
+ #
+ # We have to be careful not to run different mpirun settings for the
+ # same executable in parallel because this triggers a race condition
+ # when compiling the not yet existent executable that is shared
+ # between the different tests.
+ #
+ # Luckily CMake has a mechanism to force a test to be run when
+ # another has finished (and both are scheduled):
+ #
+ IF(NOT "${_n_cpu}" STREQUAL "0")
+ IF(DEFINED TEST_DEPENDENCIES_${_target})
+ SET_TESTS_PROPERTIES(${_test_full} PROPERTIES
+ DEPENDS ${TEST_DEPENDENCIES_${_target}}
+ )
+ ENDIF()
+ SET(TEST_DEPENDENCIES_${_target} ${_test_full})
+ ENDIF()
+
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO()
--- /dev/null
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2012 - 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# This file provides an insource version of the DEAL_II_SETUP_TARGET macro.
+#
+# Usage:
+# DEAL_II_INSOURCE_SETUP_TARGET(target build)
+#
+# This appends necessary include directories, linker flags, compile
+# definitions and the deal.II library link interface to the given target.
+#
+#
+
+MACRO(DEAL_II_INSOURCE_SETUP_TARGET _target _build)
+
+ SET_TARGET_PROPERTIES(${_target} PROPERTIES
+ LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}"
+ LINKER_LANGUAGE "CXX"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_test_short}"
+ )
+ SET_PROPERTY(TARGET ${_target} APPEND PROPERTY
+ INCLUDE_DIRECTORIES
+ "${CMAKE_BINARY_DIR}/include"
+ "${CMAKE_SOURCE_DIR}/include"
+ "${CMAKE_SOURCE_DIR}/include/deal.II/"
+ )
+
+GET_PROPERTY(_type TARGET ${_target} PROPERTY TYPE)
+IF(NOT "${_type}" STREQUAL "OBJECT_LIBRARY")
+ TARGET_LINK_LIBRARIES(${_target}
+ ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}
+ )
+ENDIF()
+
+ENDMACRO()
#
# Set up the link interface:
#
- TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET})
+ GET_PROPERTY(_type TARGET ${_target} PROPERTY TYPE)
+ IF(NOT "${_type}" STREQUAL "OBJECT_LIBRARY")
+ TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET})
+ ENDIF()
#
# If DEAL_II_STATIC_EXECUTABLE is set, switch the final link type to
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# A macro to pick up all tests in a test subdirectory
+#
+# If TEST_PICKUP_REGEX is set, only tests matching the regex will be
+# processed.
+#
+# If TEST_OVERRIDE_LOCATION is set, a comparison file category/test.output
+# will be substituted by ${TEST_OVERRIDE_LOCATION}/category/test.output if
+# the latter exists.
+#
+# Usage:
+# DEAL_II_PICKUP_TESTS()
+#
+
+MACRO(DEAL_II_PICKUP_TESTS)
+ SET_IF_EMPTY(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}")
+
+ GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+
+ SET(DEAL_II_SOURCE_DIR) # avoid a bogus warning
+
+ FILE(GLOB _tests "*.output")
+ FOREACH(_test ${_tests})
+ SET(_comparison ${_test})
+ GET_FILENAME_COMPONENT(_test ${_test} NAME)
+
+ #
+ # Respect TEST_PICKUP_REGEX:
+ #
+
+ IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR
+ "${_category}/${_test}" MATCHES "${TEST_PICKUP_REGEX}" )
+ SET(_define_test TRUE)
+ ELSE()
+ SET(_define_test FALSE)
+ ENDIF()
+
+ #
+ # Query configuration and check whether we support it. Otherwise
+ # set _define_test to FALSE:
+ #
+
+ STRING(REGEX MATCHALL
+ "with_([0-9]|[a-z]|_)*=(on|off|yes|no|true|false)" _matches ${_test}
+ )
+ FOREACH(_match ${_matches})
+ STRING(REGEX REPLACE
+ "^(with_([0-9]|[a-z]|_)*)=(on|off|yes|no|true|false)$" "\\1"
+ _feature ${_match}
+ )
+ STRING(TOUPPER ${_feature} _feature)
+ STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
+
+ IF( (DEAL_II_${_feature} AND NOT ${_boolean}) OR
+ (NOT DEAL_II_${_feature} AND ${_boolean}) )
+ SET(_define_test FALSE)
+ ENDIF()
+ ENDFOREACH()
+
+ #
+ # Respect TEST_OVERRIDE_LOCATION:
+ #
+
+ SET(_add_output)
+ IF(EXISTS ${TEST_OVERRIDE_LOCATION}/${_category}/${_test})
+ SET(_add_output
+ "!!NOTE!! Comparison file overriden by ${TEST_OVERRIDE_LOCATION}/${_category}/${_test}"
+ )
+ SET(_comparison "${TEST_OVERRIDE_LOCATION}/${_category}/${_test}")
+ ENDIF()
+
+ IF(_define_test)
+ STRING(REGEX REPLACE "\\..*" "" _test ${_test})
+ DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_add_output})
+ ENDIF()
+
+ ENDFOREACH()
+ENDMACRO()
#
# If 'variable' is empty it will be set to 'value'
#
-MACRO(SET_IF_EMPTY _variable _value)
+MACRO(SET_IF_EMPTY _variable)
IF("${${_variable}}" STREQUAL "")
- SET(${_variable} ${_value})
+ SET(${_variable} ${ARGN})
ENDIF()
ENDMACRO()
# Well, in case of static archives we have to manually pick up the
# complete link interface. *sigh*
#
- # Do this unconditionally for the most common case:
- # TODO: Non-GNU setups...
+ # If CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES is not available, do it
+ # unconditionally for the most common case (gfortran).
#
# Switch the library preference back to prefer dynamic libraries if
# DEAL_II_PREFER_STATIC_LIBS=TRUE but DEAL_II_STATIC_EXECUTABLE=FALSE. In
# this case system libraries should be linked dynamically.
#
+ SET(_fortran_libs ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
+ SET_IF_EMPTY(_fortran_libs gfortran m quadmath c)
+
SWITCH_LIBRARY_PREFERENCE()
- FOREACH(_lib gfortran m quadmath)
+ FOREACH(_lib ${_fortran_libs})
FIND_LIBRARY(${_lib}_LIBRARY
NAMES ${_lib}
- HINTS ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
+ HINTS
+ ${CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES}
+ ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
MARK_AS_ADVANCED(${_lib}_LIBRARY)
IF(NOT ${_lib}_LIBRARY MATCHES "-NOTFOUND")
IF(METIS_FOUND)
- IF(NOT PARMETIS_LIBRARY MATCHES "-NOTFOUND")
+ #
+ # Sanity check: Only include parmetis library if it is in the same
+ # directory as the metis library...
+ #
+ GET_FILENAME_COMPONENT(_path1 "${PARMETIS_LIBRARY}" PATH)
+ GET_FILENAME_COMPONENT(_path2 "${ETIS_LIBRARY}" PATH)
+ IF( NOT PARMETIS_LIBRARY MATCHES "-NOTFOUND"
+ AND "${_path1}" STREQUAL "${_path2}" )
SET(METIS_LIBRARIES ${PARMETIS_LIBRARY})
ENDIF()
# MUMPS_INCLUDE_DIRS
# MUMPS_LIBRARIES
# MUMPS_LINKER_FLAGS
+# MUMPS_VERSION
+# MUMPS_VERSION_MAJOR
+# MUMPS_VERSION_MINOR
+# MUMPS_VERSION_SUBMINOR
#
SET_IF_EMPTY(MUMPS_DIR "$ENV{MUMPS_DIR}")
UNSET(PORD_LIBRARY CACHE)
ENDIF()
+IF(EXISTS ${MUMPS_INCLUDE_DIR}/dmumps_c.h)
+ FILE(STRINGS "${MUMPS_INCLUDE_DIR}/dmumps_c.h" MUMPS_VERSION_STRING
+ REGEX "#define.*MUMPS_VERSION")
+ STRING(REGEX REPLACE "^.*MUMPS_VERSION.*\"(.+)\".*" "\\1"
+ MUMPS_VERSION "${MUMPS_VERSION_STRING}"
+ )
+ STRING(REGEX REPLACE
+ "([0-9]+)\\..*" "\\1" MUMPS_VERSION_MAJOR "${MUMPS_VERSION}"
+ )
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.([0-9]+).*" "\\1" MUMPS_VERSION_MINOR "${MUMPS_VERSION}"
+ )
+ STRING(REGEX REPLACE
+ "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" MUMPS_VERSION_SUBMINOR "${MUMPS_VERSION}"
+ )
+ENDIF()
+
SET(_output ${DMUMPS_LIBRARY} ${MUMPS_COMMON_LIBRARY} ${PORD_LIBRARY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUMPS DEFAULT_MSG
_output # Cosmetic: Gives nice output
# TBB_LIBRARIES
# TBB_INCLUDE_DIRS
# TBB_WITH_DEBUGLIB
+# TBB_VERSION
+# TBB_VERSION_MAJOR
+# TBB_VERSION_MINOR
#
INCLUDE(FindPackageHandleStandardArgs)
SET_IF_EMPTY(TBB_DIR "$ENV{TBB_DIR}")
-FIND_PATH(TBB_INCLUDE_DIR tbb/parallel_reduce.h
+FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h
HINTS
${TBB_DIR}
PATH_SUFFIXES include include/tbb tbb
TBB_INCLUDE_DIR
)
+IF(NOT TBB_INCLUDE_DIR MATCHES "-NOTFOUND")
+ FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MAJOR_STRING
+ REGEX "#define.*TBB_VERSION_MAJOR")
+ STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR.*([0-9]+).*" "\\1"
+ TBB_VERSION_MAJOR "${TBB_VERSION_MAJOR_STRING}"
+ )
+
+ FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MINOR_STRING
+ REGEX "#define.*TBB_VERSION_MINOR")
+ STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR.*([0-9]+).*" "\\1"
+ TBB_VERSION_MINOR "${TBB_VERSION_MINOR_STRING}"
+ )
+
+ SET(TBB_VERSION
+ "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}"
+ )
+ENDIF()
+
MARK_AS_ADVANCED(
TBB_LIBRARY
TBB_DEBUG_LIBRARY
# UMFPACK_LIBRARIES
# UMFPACK_INCLUDE_DIRS
# UMFPACK_LINKER_FLAGS
+# UMFPACK_VERSION
+# UMFPACK_VERSION_MAJOR
+# UMFPACK_VERSION_MINOR
+# UMFPACK_VERSION_SUBMINOR
#
INCLUDE(FindPackageHandleStandardArgs)
FIND_UMFPACK_LIBRARY(CAMD camd)
FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig)
+IF(EXISTS ${UMFPACK_INCLUDE_DIR}/umfpack.h)
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MAJOR_STRING
+ REGEX "#define.*UMFPACK_MAIN_VERSION")
+ STRING(REGEX REPLACE "^.*UMFPACK_MAIN_VERSION.*([0-9]+).*" "\\1"
+ UMFPACK_VERSION_MAJOR "${UMFPACK_VERSION_MAJOR_STRING}"
+ )
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MINOR_STRING
+ REGEX "#define.*UMFPACK_SUB_VERSION")
+ STRING(REGEX REPLACE "^.*UMFPACK_SUB_VERSION.*([0-9]+).*" "\\1"
+ UMFPACK_VERSION_MINOR "${UMFPACK_VERSION_MINOR_STRING}"
+ )
+ FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_SUBMINOR_STRING
+ REGEX "#define.*UMFPACK_SUBSUB_VERSION")
+ STRING(REGEX REPLACE "^.*UMFPACK_SUBSUB_VERSION.*([0-9]+).*" "\\1"
+ UMFPACK_VERSION_SUBMINOR "${UMFPACK_VERSION_SUBMINOR_STRING}"
+ )
+ SET(UMFPACK_VERSION
+ "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUBMINOR}"
+ )
+ENDIF()
+
SET(_output ${UMFPACK_LIBRARY} ${CHOLMOD_LIBRARY} ${CCOLAMD_LIBRARY} ${COLAMD_LIBRARY} ${CAMD_LIBRARY} ${AMD_LIBRARY} ${SuiteSparse_config_LIBRARY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
_output # Cosmetic: Gives nice output
IF(DEAL_II_COMPONENT_COMPAT_FILES)
SET_TARGET_PROPERTIES(expand_instantiations
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/common/scripts
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/scripts
)
INSTALL(TARGETS expand_instantiations
- EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
COMPONENT compat_files
)
ENDIF()
EXPORT(TARGETS expand_instantiations
- FILE ${CMAKE_BINARY_DIR}/importExecutables.cmake
+ FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake
)
ENDIF()
ENDIF()
SET_TARGET_PROPERTIES(make_dependencies report_features
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/common/scripts
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/scripts
)
INSTALL(TARGETS make_dependencies report_features
- EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
DESTINATION ${DEAL_II_COMMON_RELDIR}/scripts
COMPONENT compat_files
)
+ EXPORT(TARGETS make_dependencies report_features
+ FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake
+ APPEND
+ )
ENDIF()
--- /dev/null
+######################################################################
+# $Id$
+#
+# Copyright (C) 2001, 2003, 2005, 2010, 2011, 2012, 2013, the deal.II authors
+#
+# Remove insignificant volatile data from output files of tests
+#
+# Data affected:
+# JobID line (containing date)
+# line number of exceptions
+# start and final residual in iterations
+# small doubles
+######################################################################
+
+# Remove JobID
+
+s/JobId.*//;
+
+# Remove Input File Name:
+
+s/# Input file name:.*//;
+
+# Several date and time strings
+
+s/%%Creation Date:.*//;
+s/\"created\".*//;
+s/# Time =.*//;
+s/# Date =.*//;
+s/^\s+Time =.*//;
+s/^\s+Date =.*//;
+s/Time tag:.*//g;
+s/by the deal.II library on.*//;
+
+# Exceptions
+
+s/line <\d+> of file <.*\//file </;
+
+# See if we have a -0.0... (not followed by any other digit) and replace it
+# by the same number without the negative sign
+s/-0\.(0+)(?!\d)/0.\1/g;
+
+# remove deal.II debug output
+s/^DEAL.*::_.*\n//g;
+
+# Normalize version string by replacing (for example) 'written by
+# deal.II 8.1.pre' by written by 'written by deal.II x.y.z'
+s/written by deal\.II \d+\.\d+\.(pre|\d+)/written by deal.II x.y.z/;
--- /dev/null
+SET(TRACK "Build Tests")
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake)
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# This is a small worker to run a single test in the testsuite
+#
+# The following variables must be set:
+#
+# TRGT - the name of the target that should be invoked
+# TEST - the test name (used for status messages)
+# DEAL_II_BINARY_DIR - the build directory that contains the target
+#
+# Optional options:
+# EXPECT - the stage this test must reach to be considered successful
+# (return value 0)
+# Possible values are CONFIGURE, BUILD, RUN, DIFF, PASSED
+#
+# ADDITIONAL_OUTPUT - A list of additional output lines that should be printed
+#
+
+IF("${EXPECT}" STREQUAL "")
+ SET(EXPECT "PASSED")
+ENDIF()
+
+EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
+ --build ${DEAL_II_BINARY_DIR} --target ${TRGT}
+ RESULT_VARIABLE _result_code # ignored ;-)
+ OUTPUT_VARIABLE _output
+ )
+
+#
+# Determine the last succesful stage of the test:
+# (Possible values are CONFIGURE, BUILD, RUN, DIFF, PASSED)
+#
+
+STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex ${_output})
+STRING(REGEX MATCH "${TEST}: BUILD failed\\." _build_regex ${_output})
+STRING(REGEX MATCH "${TEST}: RUN failed\\." _run_regex ${_output})
+STRING(REGEX MATCH "${TEST}: DIFF failed\\." _diff_regex ${_output})
+STRING(REGEX MATCH "${TEST}: PASSED\\." _passed_regex ${_output})
+
+IF(NOT "${_passed_regex}" STREQUAL "")
+ SET(_stage PASSED)
+ELSEIF(NOT "${_diff_regex}" STREQUAL "")
+ SET(_stage DIFF)
+ELSEIF(NOT "${_run_regex}" STREQUAL "")
+ SET(_stage RUN)
+ELSEIF(NOT "${_configure_regex}" STREQUAL "")
+ SET(_stage CONFIGURE)
+ELSE() # unconditionally, because "BUILD failed." doesn't have to be printed...
+ SET(_stage BUILD)
+ENDIF()
+
+#
+# Print out the test result:
+#
+
+MESSAGE("Test ${TEST}: ${_stage}")
+
+FOREACH(_line ${ADDITIONAL_OUTPUT})
+ MESSAGE("Test ${TEST}: ${_line}")
+ENDFOREACH()
+
+MESSAGE("=============================== OUTPUT BEGIN ===============================")
+
+IF("${_stage}" STREQUAL "PASSED")
+ MESSAGE("${TEST}: PASSED.")
+
+ELSE()
+
+ IF( "${_stage}" STREQUAL "BUILD" AND "${_build_regex}" STREQUAL "" )
+ # Some special output in case the BUILD stage failed in a regression test:
+ MESSAGE("${TEST}: BUILD failed. Output:")
+ ENDIF()
+ MESSAGE(${_output})
+ MESSAGE("")
+ MESSAGE("${TEST}: ****** ${_stage} failed *******")
+ MESSAGE("")
+ENDIF()
+
+MESSAGE("=============================== OUTPUT END ===============================")
+
+#
+# Bail out:
+#
+
+IF(NOT "${_stage}" STREQUAL "${EXPECT}")
+ MESSAGE("Excpected stage ${EXPECT} - aborting")
+ MESSAGE(FATAL_ERROR "*** abort")
+ELSEIF(NOT "${_stage}" STREQUAL "PASSED")
+ MESSAGE("Excpected stage ${EXPECT} - test considered successful.")
+ENDIF()
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+
+########################################################################
+# #
+# Test setup: #
+# #
+########################################################################
+
+#
+# This is the ctest script for running and submitting build and regression
+# tests.
+#
+# Invoke it in a _build directory_ (or designated build directory) via:
+#
+# ctest -S <...>/run_testsuite.cmake
+#
+# The following configuration variables can be overwritten with
+#
+# ctest -D<variable>=<value> [...]
+#
+#
+# CTEST_SOURCE_DIRECTORY
+# - The source directory of deal.II (usually ending in "[...]/deal.II"
+# (equivalent to https://svn.dealii.org/trunk/deal.II)
+# Note: This is _not_ the test directory ending in "[...]/tests"
+# - If unspecified, "../deal.II" relative to the location of this
+# script is used. If this is not a source directory, an error is
+# thrown.
+#
+# CTEST_BINARY_DIRECTORY
+# - The designated build directory (already configured, empty, or non
+# existent - see the information about TRACKs what will happen)
+# - If unspecified the current directory is used. If the current
+# directory is equal to CTEST_SOURCE_DIRECTORY or the "tests"
+# directory, an error is thrown.
+#
+# CTEST_CMAKE_GENERATOR
+# - The CMake Generator to use (e.g. "Unix Makefiles", or "Ninja", see
+# $ man cmake)
+# - If unspecified the generator of a configured build directory will
+# be used, otherwise "Unix Makefiles".
+#
+# TRACK
+# - The track the test should be submitted to. Defaults to
+# "Experimental". Possible values are:
+#
+# "Experimental" - all tests that are not specifically "build" or
+# "regression" tests should go into this track
+#
+# "Build Tests" - Build tests that configure and build in a
+# clean directory and run the build tests
+# "build_tests/*"
+#
+# "Nightly" - Reserved for nightly regression tests for
+# build bots on various architectures
+#
+# "Regression Tests" - Reserved for the regression tester
+#
+# CONFIG_FILE
+# - A configuration file (see ../deal.II/docs/development/Config.sample)
+# that will be used during the configuration stage (invokes
+# # cmake -C ${CONFIG_FILE}). This only has an effect if
+# CTEST_BINARY_DIRECTORY is empty.
+#
+# COVERAGE
+# - If set to TRUE deal.II will be configured with
+# DEAL_II_SETUP_COVERAGE=TRUE, CMAKE_BUILD_TYPE=Debug and the
+# CTEST_COVERAGE() stage will be run. Test results must go into the
+# "Experimental" section.
+#
+# Furthermore, the following variables controlling the testsuite can be set
+# and will be automatically handed down to cmake:
+#
+# TEST_DIFF
+# TEST_TIME_LIMIT
+# TEST_PICKUP_REGEX
+# TEST_OVERRIDE_LOCATION
+# NUMDIFF_DIR
+#
+# For details, consult the ./README file.
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+MESSAGE("-- This is CTest ${CMAKE_VERSION}")
+
+#
+# TRACK: Default to Experimental:
+#
+
+IF("${TRACK}" STREQUAL "")
+ SET(TRACK "Experimental")
+ENDIF()
+
+IF( NOT "${TRACK}" STREQUAL "Experimental"
+ AND NOT "${TRACK}" STREQUAL "Build Tests"
+ AND NOT "${TRACK}" STREQUAL "Nightly"
+ AND NOT "${TRACK}" STREQUAL "Regression Tests" )
+ MESSAGE(FATAL_ERROR "
+Unknown TRACK \"${TRACK}\" - see the manual for valid values.
+"
+ )
+ENDIF()
+
+MESSAGE("-- TRACK: ${TRACK}")
+
+#
+# CTEST_SOURCE_DIRECTORY:
+#
+
+IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "")
+ #
+ # If CTEST_SOURCE_DIRECTORY is not set we just assume that this script
+ # was called residing under cmake/scipts in the source directory
+ #
+ GET_FILENAME_COMPONENT(_path "${CMAKE_CURRENT_LIST_DIR}" PATH)
+ GET_FILENAME_COMPONENT(CTEST_SOURCE_DIRECTORY "${_path}" PATH)
+
+ IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt)
+ MESSAGE(FATAL_ERROR "
+Could not find a suitable source directory. There is no source directory
+\"../deal.II\" or \"../../\" relative to the location of this script.
+Please, set CTEST_SOURCE_DIRECTORY manually to the appropriate source
+directory.
+"
+ )
+ ENDIF()
+ENDIF()
+
+MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}")
+
+#
+# Read in custom config files:
+#
+
+CTEST_READ_CUSTOM_FILES(${CTEST_SOURCE_DIRECTORY})
+
+#
+# CTEST_BINARY_DIRECTORY:
+#
+
+IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "")
+ #
+ # If CTEST_BINARY_DIRECTORY is not set we just use the current directory
+ # except if it is equal to CTEST_SOURCE_DIRECTORY in which case we fail.
+ #
+ SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+
+ IF( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIRECTORY}")
+ 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.
+"
+ )
+ ENDIF()
+ENDIF()
+
+#
+# Read in custom config files:
+#
+
+CTEST_READ_CUSTOM_FILES(${CTEST_BINARY_DIRECTORY})
+
+# Make sure that for a build test the directory is empty:
+FILE(GLOB _test ${CTEST_BINARY_DIRECTORY}/*)
+IF( "${TRACK}" STREQUAL "Build Tests"
+ AND NOT "${_test}" STREQUAL "" )
+ MESSAGE(FATAL_ERROR "
+TRACK was set to \"Build Tests\" which require an empty build directory.
+But files were found in \"${CTEST_BINARY_DIRECTORY}\"
+"
+ )
+ENDIF()
+
+MESSAGE("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}")
+
+#
+# CTEST_CMAKE_GENERATOR:
+#
+
+# Query Generator from build directory (if possible):
+IF(EXISTS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt)
+ FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt _generator
+ REGEX "^CMAKE_GENERATOR:"
+ )
+ STRING(REGEX REPLACE "^.*=" "" _generator ${_generator})
+ENDIF()
+
+IF("${CTEST_CMAKE_GENERATOR}" STREQUAL "")
+ IF(NOT "${_generator}" STREQUAL "")
+ SET(CTEST_CMAKE_GENERATOR ${_generator})
+ ELSE()
+ # default to "Unix Makefiles"
+ SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+ ENDIF()
+ELSE()
+ # ensure that CTEST_CMAKE_GENERATOR (that was apparantly set) is
+ # compatible with the build directory:
+ IF( NOT "${CTEST_CMAKE_GENERATOR}" STREQUAL "${_generator}"
+ AND NOT "${_generator}" STREQUAL "" )
+ MESSAGE(FATAL_ERROR "
+The build directory is already set up with Generator \"${_generator}\", but
+CTEST_CMAKE_GENERATOR was set to a different Generator \"${CTEST_CMAKE_GENERATOR}\".
+"
+ )
+ ENDIF()
+ENDIF()
+
+MESSAGE("-- CTEST_CMAKE_GENERATOR: ${CTEST_CMAKE_GENERATOR}")
+
+#
+# CTEST_SITE:
+#
+
+FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname)
+EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname)
+SET(CTEST_SITE "${_hostname}")
+
+MESSAGE("-- CTEST_SITE: ${CTEST_SITE}")
+
+IF( "${TRACK}" STREQUAL "Regression Tests"
+ AND NOT CTEST_SITE MATCHES "c0541" )
+ MESSAGE(FATAL_ERROR "
+I'm sorry ${CTEST_SITE}, I'm afraid I can't do that.
+The TRACK \"Regression Tests\" is not for you.
+"
+ )
+ENDIF()
+
+#
+# Assemble configuration options, we need it now:
+#
+
+IF(NOT "${CONFIG_FILE}" STREQUAL "")
+ SET(_options "-C${CONFIG_FILE}")
+ENDIF()
+
+IF("${TRACK}" STREQUAL "Build Tests")
+ SET(TEST_PICKUP_REGEX "^build_tests")
+ENDIF()
+
+# Pass all relevant "TEST_" variables down to configure:
+GET_CMAKE_PROPERTY(_variables VARIABLES)
+FOREACH(_var ${_variables})
+ IF(_var MATCHES
+ "^(TEST_DIFF|TEST_TIME_LIMIT|TEST_PICKUP_REGEX|TEST_OVERRIDE_LOCATION|NUMDIFF_DIR)$"
+ )
+ LIST(APPEND _options "-D${_var}=${${_var}}")
+ ENDIF()
+ENDFOREACH()
+
+IF(COVERAGE)
+ LIST(APPEND _options "-DDEAL_II_SETUP_COVERAGE=TRUE")
+ LIST(APPEND _options "-DCMAKE_BUILD_TYPE=Debug")
+ENDIF()
+
+#
+# CTEST_BUILD_NAME:
+#
+
+# Append compiler information to CTEST_BUILD_NAME:
+IF(NOT EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log)
+ # Apparently, ${CTEST_BINARY_DIRECTORY} is not a configured build
+ # directory. In this case we need a trick: set up a dummy project and
+ # query it for the compiler information.
+ FILE(WRITE ${CTEST_BINARY_DIRECTORY}/query_for_compiler/CMakeLists.txt "
+FILE(WRITE ${CTEST_BINARY_DIRECTORY}/detailed.log
+ \"# CMAKE_CXX_COMPILER: \${CMAKE_CXX_COMPILER_ID} \${CMAKE_CXX_COMPILER_VERSION} on platform \${CMAKE_SYSTEM_NAME} \${CMAKE_SYSTEM_PROCESSOR}\"
+ )"
+ )
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND} ${_options} "-G${CTEST_CMAKE_GENERATOR}" .
+ OUTPUT_QUIET ERROR_QUIET
+ WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}/query_for_compiler
+ )
+ FILE(REMOVE_RECURSE ${CTEST_BINARY_DIRECTORY}/query_for_compiler)
+ENDIF()
+
+IF(EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log)
+ FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/detailed.log _compiler_id
+ REGEX "CMAKE_CXX_COMPILER:"
+ )
+ STRING(REGEX REPLACE
+ "^.*CMAKE_CXX_COMPILER: \(.*\) on platform.*$" "\\1"
+ _compiler_id ${_compiler_id}
+ )
+ STRING(REGEX REPLACE "^\(.*\) .*$" "\\1" _compiler_name ${_compiler_id})
+ STRING(REGEX REPLACE "^.* " "" _compiler_version ${_compiler_id})
+ STRING(REGEX REPLACE " " "-" _compiler_id ${_compiler_id})
+ IF( NOT "${_compiler_id}" STREQUAL "" OR
+ _compiler_id MATCHES "CMAKE_CXX_COMPILER" )
+ SET(CTEST_BUILD_NAME "${_compiler_id}")
+ ENDIF()
+ENDIF()
+
+#
+# Append subversion branch to CTEST_BUILD_NAME:
+#
+FIND_PACKAGE(Subversion QUIET)
+EXECUTE_PROCESS(
+ COMMAND ${Subversion_SVN_EXECUTABLE} info ${CTEST_SOURCE_DIRECTORY}
+ OUTPUT_QUIET ERROR_QUIET
+ RESULT_VARIABLE _result
+ )
+IF(${_result} EQUAL 0)
+ Subversion_WC_INFO(${CTEST_SOURCE_DIRECTORY} _svn)
+ STRING(REGEX REPLACE "^${_svn_WC_ROOT}/" "" _branch ${_svn_WC_URL})
+ STRING(REGEX REPLACE "^branches/" "" _branch ${_branch})
+ STRING(REGEX REPLACE "/deal.II$" "" _branch ${_branch})
+ SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}")
+ENDIF()
+
+#
+# Append config file name to CTEST_BUILD_NAME:
+#
+
+IF(NOT "${CONFIG_FILE}" STREQUAL "")
+ GET_FILENAME_COMPONENT(_conf ${CONFIG_FILE} NAME_WE)
+ STRING(REGEX REPLACE "#.*$" "" _conf ${_conf})
+ SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}")
+ENDIF()
+
+MESSAGE("-- CTEST_BUILD_NAME: ${CTEST_BUILD_NAME}")
+
+#
+# We require valid svn information for build tests:
+#
+
+IF( "${TRACK}" STREQUAL "Build Tests"
+ AND NOT DEFINED _svn_WC_REVISION )
+ MESSAGE(FATAL_ERROR "
+TRACK was set to \"Build Tests\" which requires the source directory to be
+under Subversion version control.
+"
+ )
+ENDIF()
+
+#
+# Write revision log:
+#
+
+IF(DEFINED _svn_WC_REVISION)
+ FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
+"###
+#
+# SVN information:
+# SVN_WC_URL: ${_svn_WC_URL}
+# SVN_WC_REVISION: ${_svn_WC_REVISION}
+# SVN_WC_LAST_CHANGED_DATE: ${_svn_WC_LAST_CHANGED_DATE}
+#
+###"
+ )
+ELSE()
+ FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
+"###
+#
+# No SVN information available.
+#
+###"
+ )
+ENDIF()
+
+#
+# Declare files that should be submitted as notes:
+#
+
+SET(CTEST_NOTES_FILES
+ ${CTEST_BINARY_DIRECTORY}/revision.log
+ ${CTEST_BINARY_DIRECTORY}/summary.log
+ ${CTEST_BINARY_DIRECTORY}/detailed.log
+ ${CTEST_BINARY_DIRECTORY}/include/deal.II/base/config.h
+ )
+
+#
+# Setup coverage:
+#
+IF(COVERAGE)
+ IF(NOT TRACK MATCHES "Experimental")
+ MESSAGE(FATAL_ERROR "
+TRACK must be set to \"Experimental\" if Coverage is enabled via
+COVERAGE=TRUE.
+"
+ )
+ ENDIF()
+
+ FIND_PROGRAM(GCOV_COMMAND NAMES gcov)
+
+ IF(GCOV_COMMAND MATCHES "-NOTFOUND")
+ MESSAGE(FATAL_ERROR "
+Coverage enabled but could not find the gcov executable. Please install
+gcov, which is part of the GNU Compiler Collection.
+"
+ )
+ ENDIF()
+
+ SET(CTEST_COVERAGE_COMMAND "${GCOV_COMMAND}")
+ENDIF()
+
+MESSAGE("-- COVERAGE: ${COVERAGE}")
+
+
+MACRO(CREATE_TARGETDIRECTORIES_TXT)
+ #
+ # It gets tricky: Fake a TargetDirectories.txt containing _all_ target
+ # directories (of the main project and all subprojects) so that the
+ # CTEST_COVERAGE() actually picks everything up...
+ #
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
+ ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt
+ ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt.bck
+ )
+ FILE(GLOB _subprojects ${CTEST_BINARY_DIRECTORY}/tests/*)
+ FOREACH(_subproject ${_subprojects})
+ IF(EXISTS ${_subproject}/CMakeFiles/TargetDirectories.txt)
+ FILE(READ ${_subproject}/CMakeFiles/TargetDirectories.txt _var)
+ FILE(APPEND ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt ${_var})
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO()
+
+MACRO(CLEAR_TARGETDIRECTORIES_TXT)
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E rename
+ ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt.bck
+ ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt
+ )
+ENDMACRO()
+
+
+########################################################################
+# #
+# Run the testsuite: #
+# #
+########################################################################
+
+IF(NOT "${_branch}" STREQUAL "")
+ SET_PROPERTY(GLOBAL PROPERTY SubProject ${_branch})
+ENDIF()
+
+CTEST_START(Experimental TRACK ${TRACK})
+
+MESSAGE("-- Running CTEST_CONFIGURE()")
+CTEST_CONFIGURE(OPTIONS "${_options}" RETURN_VALUE _res)
+
+IF("${_res}" STREQUAL "0")
+ # Only run the build stage if configure was successful:
+
+ MESSAGE("-- Running CTEST_BUILD()")
+ CTEST_BUILD(TARGET NUMBER_ERRORS _res)
+
+ IF("${_res}" STREQUAL "0")
+ # Only run tests if the build was successful:
+
+ MESSAGE("-- Running make setup_tests")
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
+ --build ${CTEST_BINARY_DIRECTORY} --target setup_tests
+ OUTPUT_QUIET RESULT_VARIABLE _res
+ )
+ IF(NOT "${_res}" STREQUAL "0")
+ MESSAGE(FATAL_ERROR "
+\"setup_tests\" target exited with an error. Bailing out.
+"
+ )
+ ENDIF()
+
+ MESSAGE("-- Running CTEST_TESTS()")
+ CTEST_TEST()
+
+ IF(COVERAGE)
+ CREATE_TARGETDIRECTORIES_TXT()
+ MESSAGE("-- Running CTEST_COVERAGE()")
+ CTEST_COVERAGE()
+ CLEAR_TARGETDIRECTORIES_TXT()
+ ENDIF(COVERAGE)
+
+ ENDIF()
+ENDIF()
+
+#
+# Inject compiler information and svn revision into xml files:
+#
+
+FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag LIMIT_COUNT 1)
+SET(_path "${CTEST_BINARY_DIRECTORY}/Testing/${_tag}")
+IF(NOT EXISTS ${_path})
+ MESSAGE(FATAL_ERROR "
+Unable to determine test submission files from TAG. Bailing out.
+"
+ )
+ENDIF()
+FILE(GLOB _xml_files ${_path}/*.xml)
+EXECUTE_PROCESS(COMMAND sed -i -e
+ s/CompilerName=\"\"/CompilerName=\"${_compiler_name}\"\\n\\tCompilerVersion=\"${_compiler_version}\"/g
+ ${_xml_files}
+ OUTPUT_QUIET RESULT_VARIABLE _res
+ )
+IF(NOT "${_res}" STREQUAL "0")
+ MESSAGE(FATAL_ERROR "
+\"sed\" failed. Bailing out.
+"
+ )
+ENDIF()
+
+IF(NOT "${_svn_WC_REVISION}" STREQUAL "")
+ FILE(WRITE ${_path}/Update.xml
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<Update mode=\"Client\" Generator=\"ctest-${CTEST_VERSION}\">
+ <Site>${CTEST_SITE}</Site>
+ <BuildName>${CTEST_BUILD_NAME}</BuildName>
+ <BuildStamp>${_tag}-${TRACK}</BuildStamp>
+ <UpdateType>SVN</UpdateType>
+ <Revision>${_svn_WC_REVISION}</Revision>
+ <Path>${_branch}</Path>
+</Update>"
+ )
+ENDIF()
+
+#
+# And finally submit:
+#
+
+MESSAGE("-- Running CTEST_SUBMIT()")
+CTEST_SUBMIT(RETURN_VALUE _res)
+
+IF("${_res}" STREQUAL "0")
+ MESSAGE("-- Submission successful. Goodbye!")
+ENDIF()
+
+# .oO( This script is freaky 541 lines long... )
# CMAKE_BUILD_TYPE
# DEAL_II_ALLOW_PLATFORM_INTROSPECTION
# DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
+# DEAL_II_SETUP_COVERAGE
# BUILD_SHARED_LIBS
# DEAL_II_PREFER_STATIC_LIBS
# DEAL_II_STATIC_EXECUTABLE
)
MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+OPTION(DEAL_II_SETUP_COVERAGE
+ "Setup debug compiler flags to provide additional test coverage information. Currently only gprof is supported."
+ OFF
+ )
+MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+
SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
"Build a shared library"
)
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-all-loops")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fstrict-aliasing")
- ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-felide-constructors")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-Wno-unused")
ENDIF()
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-g")
ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-g")
ENDIF()
+
+ IF(DEAL_II_SETUP_COVERAGE)
+ #
+ # Enable test coverage
+ #
+ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fno-elide-constructors")
+ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs")
+ ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs")
+ ENDIF()
+
ENDIF()
ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static-intel")
ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static-gcc")
ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-pthread")
+ELSE()
+ #
+ # Explicitly link intel support libraries dynamically:
+ #
+ ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-shared-intel")
ENDIF()
# General optimization flags:
#
- IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13.0" )
- ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2")
- ELSE()
+ IF(CMAKE_CXX_COMPILER_VERSION MATCHES "^13\\.")
#
# Disable aggressive optimization for intel-13* compilers, until we
# resolve a lot of funny miscompilations...
# - Maier, 2013
#
ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O1")
+ ELSE()
+ ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2")
ENDIF()
+ # equivalent to -fno-strict-aliasing:
+ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-ansi-alias")
+
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-ip")
ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops")
- # equivalent to -fno-strict-aliasing:
- ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-ansi-alias")
ENDIF()
#
# Add convenience targets that build and install only a specific component:
#
+# library
+# compat_files
+# documentation
+# examples
+# mesh_converter
+# parameter_gui
+#
-FOREACH(_component library)
- ADD_CUSTOM_TARGET(${_component}
- COMMAND ${CMAKE_COMMAND}
- -DCOMPONENT="${_component}" -P cmake_install.cmake
- COMMENT "Build and install component \"${_component}\"."
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- )
-ENDFOREACH()
+# The library can always be installed ;-)
+ADD_CUSTOM_TARGET(library
+ COMMAND ${CMAKE_COMMAND}
+ -DCOMPONENT="library" -P cmake_install.cmake
+ COMMENT "Build and install component \"library\"."
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ )
FOREACH(_component compat_files documentation examples mesh_converter parameter_gui)
STRING(TOUPPER "${_component}" _component_uppercase)
IF(DEAL_II_COMPONENT_${_component_uppercase})
-
ADD_CUSTOM_TARGET(${_component}
COMMAND ${CMAKE_COMMAND}
-DCOMPONENT="${_component}" -P cmake_install.cmake
COMMENT "Build and install component \"${_component}\"."
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
-
ELSE()
-
STRING(TOUPPER ${_component} _componentuppercase)
ADD_CUSTOM_TARGET(${_component}
COMMAND
&& ${CMAKE_COMMAND} -E echo ''
&& false
)
-
ENDIF()
ENDFOREACH()
+#
+# Provide an "info" target to print a help message:
+#
+
+FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
+"MESSAGE(
+\"###
+#
+# The following targets are available (invoke by $ make <target>):
+#
+# all - compiles the library and all enabled components
+# clean - removes all generated files
+# install - installs into CMAKE_INSTALL_PREFIX
+# help - prints a list of valid top level targets
+# info - prints this help message
+#
+# edit_cache - runs ccmake for changing (cached) configuration variables
+# and reruns the configure and generate phases of CMake
+# rebuild_cache - reruns the configure and generate phases of CMake
+#
+# compat_files - builds and installs the 'compat_files' component
+# documentation - builds and installs the 'documentation' component
+# examples - builds and installs the 'examples' component
+# library - builds and installs the 'library' component
+# mesh_converter - builds and installs the 'mesh_converter' component
+# parameter_gui - builds and installs the 'parameter_gui' component
+#
+# test - runs a minimal set of tests
+#
+# setup_tests - sets up the testsuite subprojects
+# clean_tests - runs the 'clean' target in every testsuite subproject
+# prune_tests - removes all testsuite subprojects
+#
+###\")"
+ )
+ADD_CUSTOM_TARGET(info
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
+ )
# Set up deal.II specific definitions
#
# This file defines a long list of uncached variables, used throughout the
-# configuration to determine paths, locations and names.
+# configuration to determine paths, locations and names. Some linkage and
+# crosscompilation setup happens also in here.
#
# Definitions marked with *) can be overriden by defining them to cache
# prior to the call of this file. This is done with the help of the
SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}")
ENDIF()
-
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
LIST(APPEND DEAL_II_BUILD_TYPES "DEBUG")
ENDIF()
LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE")
ENDIF()
+
+########################################################################
+# #
+# Setup static linkage and crosscompilation: #
+# #
+########################################################################
+
+#
+# Library search order:
+#
+IF(DEAL_II_PREFER_STATIC_LIBS)
+ # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
+ # is set. This will prefer static archives instead of shared libraries:
+ LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
+ENDIF()
+
+#
+# Cross compilation stuff:
+#
+IF(CMAKE_CROSSCOMPILING)
+ # Disable platform introspection when cross compiling
+ SET(DEAL_II_ALLOW_PLATFORM_INTROSPECTION OFF CACHE BOOL "" FORCE)
+
+ # Import native expand_instantiations for use in cross compilation:
+ SET(DEAL_II_NATIVE "DEAL_II_NATIVE-NOTFOUND" CACHE FILEPATH
+ "A pointer to a native deal.Ii build directory"
+ )
+ IF(DEAL_II_NATIVE MATCHES "-NOTFOUND")
+ MESSAGE(FATAL_ERROR
+ "Please set the CMake variable DEAL_II_NATIVE to a valid path that points to a native deal.II build directory"
+ )
+ ENDIF()
+ INCLUDE(${DEAL_II_NATIVE}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake)
+ENDIF()
# CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}
# CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}
# ${CMAKE_CXX_COMPILER}
+"
+ )
+_detailed(
+"# CMAKE_GENERATOR: ${CMAKE_GENERATOR}
"
)
IF(CMAKE_CROSSCOMPILING)
#
IF(DEFINED ${_feature}_VERSION)
_detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n")
+ ELSEIF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION)
+ _detailed("# TBB_VERSION = ${TBB_VERSION}\n")
+ ENDIF()
+
+ IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION)
+ _detailed("# OMPI_VERSION = ${OMPI_VERSION}\n")
ENDIF()
#
IF( # MPI:
_var2 MATCHES "^${_feature}_CXX_(COMPILER|COMPILE_FLAGS|LINK_FLAGS|LIBRARIES|INCLUDE_PATH)$" OR
# Boost:
- ( _feature MATCHES "BOOST" AND _var2 MATCHES "^Boost(_LIBRARIES|_INCLUDE_DIRS)$" ) OR
+ ( _feature MATCHES "BOOST" AND _var2 MATCHES "^Boost_(LIBRARIES|INCLUDE_DIRS)$" ) OR
# TBB:
- ( _feature MATCHES "THREADS" AND _var2 MATCHES "^TBB(_LIBRARIES|_INCLUDE_DIRS)$" ) OR
+ ( _feature MATCHES "THREADS" AND _var2 MATCHES "^TBB_(LIBRARIES|INCLUDE_DIRS)$" ) OR
# Generic:
( (NOT _var2 MATCHES "^(MPI|Boost)") AND
_var2 MATCHES "^${_feature}_(INCLUDE_DIRS|LIBRARIES|LINKER_FLAGS)$" )
ENDFOREACH()
_summary(
- "#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log\n"
+"#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log
+#\n# Run $ make info to print a help message with a list of top level targets\n"
)
_both("#\n###")
+++ /dev/null
-## ---------------------------------------------------------------------
-## $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 that has to happen after the call to PROJECT(): #
-# #
-########################################################################
-
-#
-# Library search order:
-#
-IF(DEAL_II_PREFER_STATIC_LIBS)
- #
- # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
- # is set. This will prefer static archives instead of shared libraries:
- #
- # TODO: Does this work on a Windows or CYGWIN target?
- LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
-ENDIF()
-
-
-#
-# Cross compilation stuff:
-#
-IF(CMAKE_CROSSCOMPILING)
- #
- # Disable platform introspection when cross compiling
- #
- SET(DEAL_II_ALLOW_PLATFORM_INTROSPECTION OFF CACHE BOOL "" FORCE)
-
- #
- # Import native expand_instantiations for use in cross compilation:
- #
- SET(DEAL_II_NATIVE "DEAL_II_NATIVE-NOTFOUND" CACHE FILEPATH
- "A pointer to a native deal.Ii build directory"
- )
- IF(DEAL_II_NATIVE MATCHES "-NOTFOUND")
- MESSAGE(FATAL_ERROR
- "Please set the CMake variable DEAL_II_NATIVE to a valid path that points to a native deal.II build directory"
- )
- ENDIF()
- INCLUDE(${DEAL_II_NATIVE}/importExecutables.cmake)
-ENDIF()
--- /dev/null
+## ---------------------------------------------------------------------
+## $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:
+#
+SET_IF_EMPTY(DEAL_II_BINARY_DIR $ENV{DEAL_II_BINARY_DIR})
+SET_IF_EMPTY(DEAL_II_BINARY_DIR $ENV{DEAL_II_DIR})
+SET_IF_EMPTY(DEAL_II_SOURCE_DIR $ENV{DEAL_II_SOURCE_DIR})
+SET_IF_EMPTY(TEST_DIFF $ENV{TEST_DIFF})
+SET_IF_EMPTY(TEST_TIME_LIMIT $ENV{TEST_TIME_LIMIT})
+SET_IF_EMPTY(TEST_PICKUP_REGEX $ENV{TEST_PICKUP_REGEX})
+SET_IF_EMPTY(TEST_OVERRIDE_LOCATION $ENV{TEST_OVERRIDE_LOCATION})
+
+#
+# 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
+ )
+
+FIND_PROGRAM(NUMDIFF_EXECUTABLE
+ NAMES numdiff
+ HINTS ${NUMDIFF_DIR}
+ PATH_SUFFIXES bin
+ )
+
+MARK_AS_ADVANCED(DIFF_EXECUTABLE NUMDIFF_EXECUTABLE)
+
+IF( NUMDIFF_EXECUTABLE MATCHES "-NOTFOUND"
+ AND DIFF_EXECUTABLE MATCHES "-NOTFOUND" )
+ MESSAGE(FATAL_ERROR
+ "Could not find diff or numdiff. One of those are required for running the testsuite."
+ )
+ENDIF()
+
+IF("${TEST_DIFF}" STREQUAL "")
+ IF(NOT NUMDIFF_EXECUTABLE MATCHES "-NOTFOUND")
+ SET(TEST_DIFF ${NUMDIFF_EXECUTABLE} -a 1e-6 -s ' \\t\\n:')
+ ELSE()
+ SET(TEST_DIFF ${DIFF_EXECUTABLE})
+ ENDIF()
+ELSE()
+ # TODO: I have no idea how to prepare a custom string comming possibly
+ # through two layers of command line into a list...
+ SEPARATE_ARGUMENTS(TEST_DIFF ${TEST_DIFF})
+ENDIF()
+
+#
+# Set a default time limit of 600 seconds:
+#
+SET_IF_EMPTY(TEST_TIME_LIMIT 600)
+
+#
+# And finally, enable testing:
+#
+ENABLE_TESTING()
ENDIF()
INSTALL(TARGETS mesh_converter_exe
- RUNTIME
- DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
+ RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
COMPONENT mesh_converter
)
+EXPORT(TARGETS mesh_converter_exe
+ FILE
+ ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake
+ APPEND
+ )
RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
COMPONENT parameter_gui
)
+EXPORT(TARGETS parameter_gui_exe
+ FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Executables.cmake
+ APPEND
+ )
+++ /dev/null
-## ---------------------------------------------------------------------
-## $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.
-##
-## ---------------------------------------------------------------------
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-INCLUDE_DIRECTORIES(
- BEFORE
- ${CMAKE_SOURCE_DIR}/include/
- ${CMAKE_BINARY_DIR}/include/
- )
-
-ADD_EXECUTABLE(test_affinity
- test_affinity.cc
- )
-
-IF(CMAKE_BUILD_TYPE MATCHES "Debug")
- SET(_build "DEBUG")
-ELSE()
- SET(_build "RELEASE")
-ENDIF()
-
-SET_TARGET_PROPERTIES(test_affinity PROPERTIES
- LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
- COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
- COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}"
- LINKER_LANGUAGE "CXX"
- )
-
-TARGET_LINK_LIBRARIES(test_affinity ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
-
-IF(NOT CMAKE_CROSSCOMPILING)
- ADD_CUSTOM_TARGET(run_test_affinity COMMAND test_affinity)
-ENDIF()
#
SOURCEDIR=$(CURDIR)
LOGDIR=$(PWD)
-TMPDIR=/tmp
+TMPDIR?=/tmp
CMAKE=cmake
SVN=svn info $(SOURCEDIR)
<li><a href="#projectconfig"><code>./cmake/config/CMakeLists.txt</code></a></li>
</ol>
</li>
+ </ol>
</div>
<a name="codingstyle"></a>
<h1>The deal.II Testsuite</h1>
- <p>The deal.II testsuite consists of two parts, the
- <a href="#build_tests">build tests</a> and the
- <a href="#regression_tests">regression tests</a>. While the build tests
- just check if the
- library can be compiled on different systems and with different (versions
- of) compilers, the regression tests are actually run and their output
- compared with previously stored. These two testsuites are
- described below.</p>
-
- <a name="build_tests"></a>
- <h2>The build tests</h2>
+ <p>
+ The deal.II testsuite consists of two parts:
+ <i>build tests</i> and the
+ <i>regression testsuite</i>. While the build tests
+ are used to check that the
+ library can be compiled on different systems and with different (versions
+ of) compilers, the regression tests are actually run and their output
+ compared with previously stored output files to verify that what
+ worked yesterday still works today. These two testsuites are
+ described below.
+ </p>
<p>
- With our build tests, we check if deal.II can be compiled on
- different systems and with different compilers as well as
- different configuration options. Results are collected in a
- database and can be accessed <a
- href="http://www.dealii.org/testsuite.html">online</a>.<p>
+ deal.II has a testsuite that has, at the time this article is written
+ (mid-2013), some 2,900 small programs (growing by roughly one per day)
+ that we run every time we make a change to make sure that no existing
+ functionality is broken. The expected output for every test is stored in
+ our subversion archive, and when you run a test you are notified if a
+ test produces different output. These days, every time we add a
+ significant piece of functionality, we add at least one new test to the
+ testsuite, and we also do so if we fix a bug, in both cases to make sure
+ that future changes do not break what we have just checked in. Machines
+ running tests send results
+ back home and these are then converted into
+ <a href="http://dealii.mathsim.eu/cgi-bin/regression_quick.pl"
+ target="body">a webpage showing the status of our regression tests</a>.
+ </p>
- <p>Running the build test suite is simple and we encourage deal.II
- users with configurations not found on the <a
- href="http://www.dealii.org/testsuite.html">test suite page</a> to
- participate. Assuming you checked out deal.II into the directory
- <code>dealtest</code>, running it is as simple as:
+ <div class="toc">
+ <ol>
+ <li><a href="#quick">Quick instructions</a></li>
+ <li><a href="#setup">Setting up the testsuite</a></li>
+ <ol>
+ <li><a href="#setupdownload">Downloading the testsuite</a></li>
+ <li><a href="#setupconfigure">Preparing the testsuite</a></li>
+ </ol>
+ <li><a href="#run">Running the testsuite</a></li>
+ <ol>
+ <li><a href="#runoutput">How to interpret the output</a></li>
+ </ol>
+ <li><a href="#layout">Testsuite development</a></li>
+ <ol>
+ <li><a href="#layoutgeneral">General layout</a></li>
+ <li><a href="#restrictbuild">Restricting tests for build configurations</a></li>
+ <li><a href="#restrictfeature">Restricting tests for feature configurations</a></li>
+ <li><a href="#mpi">Running tests with MPI</a></li>
+ <li><a href="#expect">Changing condition for success</a></li>
+ <li><a href="#layoutaddtests">Adding new tests</a></li>
+ </ol>
+ <li><a href="#submit">Submitting test results</a></li>
+ <li><a href="#build_tests">Build tests</a></li>
+ <ol>
+ <li><a href="#dedicatedbuilds">Dedicated build tests</a></li>
+ </ol>
+ </ol>
+ </div>
+
+ <a name="quick"></a>
+ <h2>Quick instructions</h2>
+
+ <p>
+ If you're impatient, use the following commands:
<pre>
- cd dealtest
- svn update
- ./contrib/utilities/build_test
- mail build-tests@dealii.org < *.log
- ( rm *.log )
+ $ mkdir new_directory
+ $ cd new_directory
+ $ svn checkout https://svn.dealii.org/trunk .
+ $ mkdir build
+ $ cd build
+ $ cmake ../deal.II
+ $ make -j16
+ $ make -j16 setup_tests
+ $ ctest -j16
</pre>
+ The exact meaning of all of these commands will be explained in much
+ greater detail below.
+ </p>
+
+ <a name="setup"></a>
+ <h2>Setting up the testsuite</h2>
+
+ <p> In order to run it, you need to download and set up the testsuite
+ first. The following paragraphs detail how to do that.
</p>
+ <a name="setupdownload"></a>
+ <h3>Downloading the testsuite</h3>
+
<p>
- The <code>build_test</code> script supports the following options:
+ To download the testsuite, check it out from the subversion repository,
+ along with deal.II. To this end, go to an empty directory where you
+ want to test deal.II and do this:
<pre>
- SOURCEDIR - the source directory to use (otherwise the current directory is used)
- CONFIGFILE - A cmake configuration file for the build test
- LOGDIR - directory for the log file
- LOGFILE - the logfile to use, defaults to
- $LOGDIR/$BRANCH.$CONFIGFILE.<unix time>.log
-
- CMAKE - the cmake executable to use
- SVN - svn info command to use, defaults to
- svn info $(SOURCEDIR)
- TMPDIR - defaults to "/tmp"
- CLEAN_TMPDIR - defaults to "true"
- RUN_EXAMPLES - defaults to "true"
+ $ svn checkout https://svn.dealii.org/trunk .
</pre>
- An example configuration file can be found <a
- href="../users/Config.sample">here</a>. Options can be passed either via
- environment
+ (The period at the end puts everything from under <code>trunk/</code>
+ into the current directory, rather than creating a
+ new <code>trunk/</code> directory.) You will then have
+ two folders:
<pre>
- export CONFIGFILE=MyConfiguration.conf
- ./contrib/utilities/build_test
+ ./deal.II
+ ./tests
</pre>
- or directly on the command line:
+ </p>
+
+ <p>
+ <b>Note:</b> CMake will pick up any testsuite that is located in a
+ <code>tests</code> folder next to the source directory
+ (<code>../tests</code>). If your test directory is at a different
+ location you have to hint during configuration by specifying
+ <code>TEST_DIR</code>:
<pre>
- ./contrib/utilities/build_test CONFIGFILE=myConfiguration.conf
+ $ cmake -DTEST_DIR=<...>
</pre>
</p>
+ <a name="setupconfigure"></a>
+ <h3>Preparing the testsuite</h3>
+
<p>
- A status indicator should appear on the build test website after some
- time (results are collected and processed by a program that is run
- periodically, but not immediately after a mail has been received).
- </p>
+ To enable the testsuite, configure and build deal.II in a build
+ directory as normal (installation is not necessary). After that you
+ can setup the testsuite via the "setup_tests" target:s
+ <pre>
+ $ make setup_tests
+ </pre>
+ This will set up all tests supported by the current configuration.
+ The testsuite can now be run in the current <i>build directory</i> as
+ described below.
+ </p>
- <h3>Dedicated build tests</h3>
+ <p>
+ Setup can be fine-tuned using the following commands:
+ <pre>
- There is a detailed example for dedicated build tests on the <a
- href="https://code.google.com/p/dealii/wiki/BuildTests">wiki</a>.
+ $ make clean_tests - runs the 'clean' target in every testsuite subproject
- <a name="regression_tests"></a>
- <h2>The regression tests</h2>
+ $ make prune_tests - removes all testsuite subprojects
+ </pre>
<p>
- deal.II has a testsuite that, at the time this article is written (mid-2013),
- has some 2,900 small programs (growing by roughly one per day) that we run
- every time we make a
- change to make sure that no existing functionality is broken. The
- expected output is also stored in our subversion archive, and when you
- run a test you are notified if a test fails. These days, every
- time we add a significant piece of functionality, we add at least
- one new test to the testsuite, and we also do so if we fix a bug,
- in both cases to make sure that future changes do not break what
- we have just checked in. In addition, some machines run the tests
- every night and send the results back home; this is then converted
- into <a href="http://dealii.mathsim.eu/cgi-bin/regression_quick.pl"
- target="body">a webpage showing the status of our regression
- tests</a>.
+ In addition, when setting up the testsuite, the following environment
+ variables can be used to override default behavior when
+ calling <code>make setup_tests</code>:
+ <pre>
+
+ TEST_DIFF
+ - The diff tool and command line to use for comparison. If numdiff is
+ available it defaults to "numdiff -a 1e-6 -q", otherwise plain diff
+ is used.
+
+ TEST_TIME_LIMIT
+ - The time limit (in seconds) a single test is allowed to take. Defaults
+ to 180 seconds
+
+ TEST_PICKUP_REGEX
+ - A regular expression to select only a subset of tests during setup.
+ An empty string is interpreted as a catchall (this is the default).
+
+ TEST_OVERRIDE_LOCATION
+ - If TEST_OVERRIDE_LOCATION is set, a comparison file category/test.output
+ will be substituted by ${TEST_OVERRIDE_LOCATION}/category/test.output if
+ the latter exists.
+ </pre>
</p>
<p>
- If you develop parts of deal.II, want to add something, or fix a
- bug in it, we encourage you to use our testsuite. This page
- documents some aspects of it.
+ <b>Note:</b> Specifying these options via environment variables is
+ volatile, i.e. if <code>make setup_tests</code> is invoked a second
+ time without the variables set in environment, the option will be
+ reset to the default value. If you want to set these options
+ permanently, set them via cmake as CMake variable in the build
+ directory:
+ <pre>
+
+ $ cmake -DTEST_PICKUP_REGEX="<regular expression>" .
+ </pre>
+ A variable set via cmake always <i>overrides</i> one
+ set via environment.
</p>
+ <a name="run"></a>
+ <h2>Running the testsuite</h2>
+
+ <p>
+ The testsuite can now be run in the <i>build directory</i> via
+ <pre>
- <h3>Running it</h3>
+ $ ctest [-j N]
+ </pre>
+ Here, <code>N</code> is the number of concurrent tests that should be
+ run, in the same way as you can say <code>make -jN</code>. The testsuite
+ is huge and will need around 12h on current computers
+ running single threaded.
+ </p>
<p>
- To run the testsuite, go to the directory where you want to test deal.II
- and do this:
- <pre>
+ If you only want to run a subset of tests
+ matching a regular expression, or if you want to exclude tests matching
+ a regular expression, you can use
+ <pre>
- svn checkout https://svn.dealii.org/trunk/tests
- cd tests
- DEAL_II_DIR=/a/b/c ./configure
- </pre>
- where <code>/a/b/c</code> is the installation directory you have told
- CMake to install deal.II into previously.
+ $ ctest [-j N] -R '<positive regular expression>'
+ $ ctest [-j N] -E '<negative regular expression>'
+ </pre>
+ </p>
+
+ <p>
+ <b>Note:</b>
+ Not all tests succeed on every machine even if all computations are
+ correct, because your machine generates slightly different floating
+ point outputs. To increase the number of tests that work correctly,
+ install the
+ <a href="http://www.nongnu.org/numdiff/">numdiff</a> tool that compares
+ stored and newly created output files based on floating point
+ tolerances. To use it, simply export where the <code>numdiff</code>
+ executable can be found via the <code>PATH</code>
+ environment variable so that it can be found during
+ <code>make setup_tests</code>.
</p>
+ <a name="runoutput"></a>
+ <h3>How to interpret the output</h3>
+
<p>
- Not all tests succeed on every machine even if all computations are
- correct, because you might not have configured with all the required
- packages (for example PETSc or Trilinos), or because your machine
- generates slightly different floating point outputs. To increase the
- number of tests that work correctly, install the
- <a href="http://www.nongnu.org/numdiff/">numdiff</a> toold that compares
- stored and newly created output files based on floating point
- tolerances. To use it, simply export the environment variable
- <code>export DEAL_II_DIFF="numdiff -a 1e-6 -q"</code>
- before running the testsuite.
+ A typical output of a <code>ctest</code> invocation looks like:
+ <pre>
+
+ $ ctest -j4 -R "base/thread_validity"
+ Test project /tmp/trunk/build
+ Start 747: base/thread_validity_01.debug
+ Start 748: base/thread_validity_01.release
+ Start 775: base/thread_validity_05.debug
+ Start 776: base/thread_validity_05.release
+ 1/24 Test #776: base/thread_validity_05.release ... Passed 1.89 sec
+ 2/24 Test #748: base/thread_validity_01.release ... Passed 1.89 sec
+ Start 839: base/thread_validity_03.debug
+ Start 840: base/thread_validity_03.release
+ 3/24 Test #747: base/thread_validity_01.debug ..... Passed 2.68 sec
+ [...]
+ Start 1077: base/thread_validity_08.debug
+ Start 1078: base/thread_validity_08.release
+ 16/24 Test #1078: base/thread_validity_08.release ...***Failed 2.86 sec
+ 18/24 Test #1077: base/thread_validity_08.debug .....***Failed 3.97 sec
+ [...]
+
+ 92% tests passed, 2 tests failed out of 24
+
+ Total Test time (real) = 20.43 sec
+
+ The following tests FAILED:
+ 1077 - base/thread_validity_08.debug (Failed)
+ 1078 - base/thread_validity_08.release (Failed)
+ Errors while running CTest
+ </pre>
+ If a test failed (like <code>base/thread_validity_08.debug</code> in above
+ example output), you might want to find out what exactly went wrong. To
+ this end, you can search
+ through <code>Testing/Temporary/LastTest.log</code> for the exact output
+ of the test, or you can rerun this one test, specifying <code>-V</code>
+ to select verbose output of tests:
+ <pre>
+
+ $ ctest -V -R "base/thread_validity_08.debug"
+ [...]
+ test 1077
+ Start 1077: base/thread_validity_08.debug
+
+ 1077: Test command: [...]
+ 1077: Test timeout computed to be: 600
+ 1077: Test base/thread_validity_08.debug: RUN
+ 1077: =============================== OUTPUT BEGIN ===============================
+ 1077: Built target thread_validity_08.debug
+ 1077: Generating thread_validity_08.debug/output
+ 1077: terminate called without an active exception
+ 1077: /bin/sh: line 1: 18030 Aborted [...]/thread_validity_08.debug
+ 1077: base/thread_validity_08.debug: BUILD successful.
+ 1077: base/thread_validity_08.debug: RUN failed. Output:
+ 1077: DEAL::OK.
+ 1077: gmake[3]: *** [thread_validity_08.debug/output] Error 1
+ 1077: gmake[2]: *** [CMakeFiles/thread_validity_08.debug.diff.dir/all] Error 2
+ 1077: gmake[1]: *** [CMakeFiles/thread_validity_08.debug.diff.dir/rule] Error 2
+ 1077: gmake: *** [thread_validity_08.debug.diff] Error 2
+ 1077:
+ 1077:
+ 1077: base/thread_validity_08.debug: ****** RUN failed *******
+ 1077:
+ 1077: =============================== OUTPUT END ===============================
+ </pre>
+ So this specific test aborted in the <code>RUN</code> stage.
</p>
<p>
- Once you have done this, you may simply type
- <code>make</code>. This runs all the tests there are, but stops at
- the first one that fails to either execute properly or for which
- the output does not match the expected output found in the subversion
- archive. This is helpful if you want to figure out if any test is
- failing at all. Typical output looks like this:
- <pre>
+ The general output for a successful test <code><test></code> in
+ category <code><category></code> for build type
+ <code><build></code> is
+ <pre>
- deal.II/tests> make
- cd base ; make
- make[1]: Entering directory `/ices/bangerth/p/deal.II/1/deal.II/tests/base'
- =====linking======= logtest.exe
- =====Running======= logtest.exe
- =====Checking====== logtest.output
- =====OK============ logtest.OK
- =====linking======= reference.exe
- =====Running======= reference.exe
- =====Checking====== reference.output
- =====OK============ reference.OK
- =====linking======= quadrature_test.exe
- ...
- </pre>
- Be aware that because of the number of tests we have, running the entire
- testsuite takes approximately 10 hours (as of early 2013), even on a fast
- system. (On the other hand, of couse only a large testsuite can offer
- comprehensive coverage of a software as big as deal.II.) This time can be
- reduced, however, on multicore machines if you use the command
- <code>make -jN</code> where <code>N</code> is an integer equal to or
- slightly larger than the number of processor cores you have, as this
- instructs <code>make</code> to run several tests at the same time.
- </p>
-
- <p>
- Sometimes, you know that for whatever reason one test
- always fails on your system, or has already failed before you made
- any changes to the library that could have caused tests to
- fail. We also sometimes check in tests that we know presently
- fail, just to remind us that we need to work on a fix, if we don't
- have the time to debug the problem properly right away. In this
- case, you will not want the testsuite to stop at the first test
- that fails, but will want to run all tests first and then inspect
- the output to find any fails. There are make targets for this
- as well. The usual way we use the testsuite is to run all tests
- like this
- (the same applies as above: <code>make -jN</code> can be used on multicore
- machines):
- <pre>
+ xx: Test <category>/<test>.<build>: PASSED
+ xx: =============================== OUTPUT BEGIN ===============================
+ xx: [...]
+ xx: <category>/<test>.<build>: PASSED.
+ xx: =============================== OUTPUT END ===============================
+ </pre>
+ And for a test that fails in stage <code><stage></code>:
+ <pre>
- deal.II/tests> make report | tee report
- </pre>
- which produces the file report ( here in the test directory <tt>a-framework</tt>)
- <pre>
+ xx: Test <category>/<test>.<build>: <stage>
+ xx: =============================== OUTPUT BEGIN ===============================
+ xx: [...]
+ xx: <category>/<test>.<build>: <stage> failed. [...]
+ xx:
+ xx: <category>/<test>.<build>: ****** <stage> failed *******
+ xx: =============================== OUTPUT END ===============================
+ </pre>
+ Hereby, <code><stage></code> indicates the stage in which the
+ test failed:
+ <ul>
+ <li>
+ <code>CONFIGURE</code>: only for test in the "build_tests"
+ category: The test project failed in the configuration stage
+ </li>
+ <li>
+ <code>BUILD</code>: compilation error occured
+ </li>
+ <li>
+ <code>RUN</code>: the test executable could not be run / aborted
+ </li>
+ <li>
+ <code>DIFF</code>: the test output differs from the reference output
+ </li>
+ <li>
+ <code>PASSED</code>: the test run successful
+ </li>
+ </ul>
+ Typically, tests fail because the output has changed, and you will see
+ this in the DIFF phase of the test.
+ </p>
- =====Checking====== miscompare/output
- +++++Error+++++++++ miscompare/OK (miscompare/cmp/generic) Use make verbose=on for the diffs
- =====linking======= compile/exe
- =====Running======= link/exe
- =====debug========= fail.cc
- make[1]: Leaving directory `/home/kanschat/deal/tests/a-framework'
- Revision: 21455
- Date: 2010 187 2010-07-06 27-2
- Id: kanschat@odin
- 2010-07-06 16:39 1 a-framework/compile
- 2010-07-06 16:39 0 a-framework/fail
- 2010-07-06 16:39 2 a-framework/link
- 2010-07-06 16:39 3 a-framework/miscompare
- 2010-07-06 16:39 + a-framework/run
- </pre>
- The last lines are the ones we are looking for: they show the time at which
- the tests was run, an indicator of success, and the name of a
- test. The indicator is either a plus, which means that the test
- compiled and linked successfully and that the output compared
- successfully against the stored results. Otherwise, it is any of the
- numbers 0 to 3, indicating failure at different levels:
- <ul>
- <li> 0: compiling failed
- <li> 1: linking failed
- <li> 2: the program crashed
- <li> 3: output differs from stored result
- <li> +: test succeeded
- </ul>
- If you only want to see the tests that failed, after the previous command,
- issue
- <pre>
- grep -v + report
- </pre>
+ <a name="layout"></a>
+ <h2>Testsuite development</h2>
+
+ <p>
+ The following outlines what you need to know if you want to understand
+ how the testsuite actually works, for example because you may want to
+ add tests along with the functionality you are currently developing.
</p>
+
+
+ <a name="layoutgeneral"></a>
+ <h3>General layout</h3>
+
<p>
- If you want to do a little more than just that, you should
- consider running
- <pre>
+ A test usually consists of a source file and an output file for
+ comparison (under the testsuite directory <code>tests</code>):
+ <pre>
- make report+mail | tee report
- </pre>
- instead. This does all the same stuff, but also mails the test
- result to our central mail result server which will in regular
- intervals (at least once a day) munge these mails and present them
- on our <a href="http://www.dealii.org/~archiver/cgi-bin/regression_quick.pl"
- target="body">test site</a>. This way, people can
- get an overview of what tests fail. You may even consider running
- tests nightly through a cron-job with this command, to have
- regular test runs.
+ category/test.cc
+ category/test.output
+ </pre>
+ <code>category</code> will be one of the existing subdirectory
+ under <code>tests/</code>, e.g., <code>lac/</code>, <code>base/</code>,
+ or <code>mpi/</code>. Historically, we have grouped tests into the
+ directories <code>base/, lac/, deal.II/</code> depending on their
+ functionality, and <code>bits/</code> if they were small unit tests, but
+ in practice we have not always followed this rigidly. There are also
+ more specialized directories <code>trilinos/, petsc/,
+ serialization/, mpi/</code> etc, whose meaning is more obvious.
+ <code>test.cc</code> must be a regular executable (i.e. having an
+ <code>int main()</code> routine). It will be compiled, linked and
+ run. The executable should not output anything to <code>cout</code>
+ (at least under normal circumstances, i.e. no error condition),
+ instead the executable should output to a file <code>output</code>
+ in the current working directory. In practice, we rarely write the
+ source files completely from scratch, but we find an existing test that
+ already does something similar and copy/modify it to fit our needs.
</p>
+ <p>
+ For a normal test, <code>ctest</code> will typically run the following 3
+ stages:
+ <ul>
+ <li>
+ <code>BUILD</code>: The build stage generates an executable in
+ <code>BUILD_DIR/tests/<category>/<test></code>.
+ </li>
+ <li>
+ <code>RUN</code>: The run stage then invokes the executable in the
+ directory where it is located. By convention, each test puts its
+ output into a file simply called <code>output</code>, which will
+ then be located in
+ <code>BUILD_DIR/tests/<category>/<test>/output</code>.
+ If the run fails (e.g. because the program aborts with an error
+ code) the file <code>output</code> is renamed to
+ <code>failing_output</code>.
+ </li>
+ <li>
+ <code>DIFF</code>: As a last stage the generated output file will
+ be compared to
+ <code>SOURCE_DIR/tests/<category>/<test>[...].output</code>.
+ and stored in
+ <code>BUILD_DIR/tests/<category>/<test>/diff</code>.
+ If the diff fails the file <code>diff</code> is renamed to
+ <code>failing_diff</code>.
+ </li>
+ </ul>
+ </p>
+
+
+ <a name="restrictbuild"></a>
+ <h3>Restricting tests for build configurations</h3>
<p>
- To get a quick overview you can run
- <pre>
+ Comparison file can actually be named in a more complex way than
+ just <code>category/test.output</code>:
+ <pre>
- make report+summary
- </pre>
- instead. This runs all the tests and outputs a table in the following format
- at the end:
- <pre>
+ category/test.[with_<feature>=<on|off>.]*[mpirun=<x>.][expect=<y>.][<debug|release>.]output
+ </pre>
+ Normally, a test will be set up so that it runs twice, once in debug and
+ once in release configuration.
+ If a specific test can only be run in debug or release configurations but
+ not in both it is possible to restrict the setup by prepeding
+ <code>.debug</code> or <code>.release</code> directly before
+ <code>.output</code>, e.g.:
+ <pre>
- Compiling Linking Running Check OK all
- a-framework 1 1 1 1 1 5
- base 0 0 0 2 185 187
- lac 0 0 0 0 117 117
- fe 0 0 0 4 114 118
- deal.II 0 0 0 2 291 293
- integrators 0 0 0 0 15 15
- multigrid 0 0 0 0 35 35
- ...
- </pre>
+ category/test.debug.output
+ </pre>
+ This way, the test will only be set up to build and run against the debug
+ library. If a test should run in both configurations but, for some
+ reason, produces different output (e.g., because it triggers an
+ assertion in debug mode), then you can just provide two different output
+ files:
+ <pre>
+
+ category/test.debug.output
+ category/test.release.output
+ </pre>
</p>
+
+ <a name="restrictfeature"></a>
+ <h3>Restricting tests for feature configurations</h3>
<p>
- If a test failed, you have to find out what exactly went
- wrong. For this, you will want to go into the directory of that
- test, and figure out in more detail what went wrong. For example,
- if above test <code>hierarchical</code> would have failed, you
- would want to go into the <code>base</code> directory (this is
- given in the line with the equals signs; there are tests in other
- directories as well) and then type
- <pre>
+ In a similar vain as for build configurations, it is possible to restrict
+ tests to specific feature configurations, e.g.:
+ <pre>
- make hierarchical/exe
- </pre>
- to compile and link the executable. (For each test there is a not
- only a file with suffic <code>.cc</code> but also a subdirectory with the
- same name, in which we store among other things the executable for that
- test, under the name <code>exe</code>.) If this fails, i.e. if
- you can't compile or link, then you probably already know where
- the problem is, and how to fix it. If you could compile and link
- the test, you will want to make sure that it executes correctly
- and produces an output file:
- <pre>
+ category/test.with_umfpack=on.output, or
+ category/test.with_zlib=off.output
+ </pre>
+ These tests will only be set up if the specified feature was configured.
+ It is possible to provide different output files for disabled/enabled
+ features, e.g.
+ <pre>
- make hierarchical/output
- </pre>
- (As you see, the output file is also stored in the subdirectory with the
- test's name.) If this produces errors or triggers assertions, then you will
- want to use a debugger on the executable to figure out what happens. On
- the other hand, if you are sure that this also worked, you will
- want to compare the output with the stored output from subversion:
- <pre>
+ category/test.with_64bit_indices=on.output
+ category/test.with_64bit_indices=off.output
+ </pre>
+ It is also possible to declare multiple constraints subsequently, e.g.
+ <pre>
- make hierarchical/OK
- </pre>
- If the output isn't equal, then you'll see something like
- this:
- <pre>
+ category/test.with_umfpack=on.with_zlib=on.output
+ </pre>
+ </p>
+ <p>
+ <b>Note:</b> The tests in some subdirectories of <code>tests/</code> are
+ automatically run only if some feature is enabled. In this case a
+ feature constraint encoded in the output file name is
+ redundant and should be avoided. In particular, this holds for
+ subdirectories
+ <code>distributed_grids</code>, <code>lapack</code>,
+ <code>metis</code>, <code>petsc</code>, <code>slepc</code>,
+ <code>trilinos</code>, <code>umfpack</code>, <code>gla</code>, and
+ <code>mpi</code>
+ </p>
- =====Checking====== hierarchical/output
- +++++Error+++++++++ hierarchical/OK. Use make verbose=on for the diffs
- </pre>
- Because the diffs between the output we get and the output we
- expected can sometimes be very large, you don't get to see it by
- default. However, following the suggestion printed, if you type
- <pre>
- make hierarchical/OK verbose=on
- </pre>
- you get to see it all:
- <pre>
+ <a name="mpi"></a>
+ <h3>Running tests with MPI</h3>
+ <p>
+ If a test should be run with MPI in parallel, the number of MPI
+ processes <code>N</code> with which a program needs to be run for
+ comparison with a given output file is specified as follows:
+ <pre>
- =====Checking====== hierarchical/output
- 12c12
- < DEAL::0.333 1.667 0.333 -0.889 0.296 -0.988 0.329 -0.999 0.333 -1.000 0.333 -1.000
- ---
- > DEAL::0.333 0.667 0.333 -0.889 0.296 -0.988 0.329 -0.999 0.333 -1.000 0.333 -1.000
- +++++Error+++++++++ hierarchical/OK
- </pre>
- In this case, the second number on line 12 is off by one. To find
- the reason for this, you again should use a debugger or other
- suitable means, but that of course depends on what changes you
- have made last and that could have caused this discrepancy.
+ category/test.mpirun=N.output
+ </pre>
+ It is quite typical for an MPI-enabled test to have multiple output
+ files for different numbers of MPI processes.
+ </p>
+
+ <a name="expect"></a>
+ <h3>Changing condition for success</h3>
+ <p>
+ Normally a test is considered to be successful if all test stages
+ could be run and the test reached the <code>PASSED</code> stage (see
+ the <a href="#runoutput">output description</a> section for details).
+ If (for some reason) the test should succeed ending at a specific
+ test stage different than <code>PASSED</code> you can specify it via
+ <code>expect=<stage></code>, e.g.:
+ <pre>
+
+ category/test.expect=run.output
+ </pre>
</p>
+ <a name="layoutaddtests"></a>
<h3>Adding new tests</h3>
<p>
- As mentioned above, we add a new test every
- time we add new functionality to the library or fix a bug. If you
- want to contribute code to the library, you should do this
- as well. Here's how: you need a testcase,
- a subdirectory with the same name as the test, and a file with the
- expected output.
+ We typically add one or more new tests every
+ time we add new functionality to the library or fix a bug. If you
+ want to contribute code to the library, you should do this
+ as well. Here's how: you need a testcase and a file with the
+ expected output.
</p>
<h4>The testcase</h4>
<p>
- For the testcase, we usually start from a template like this:
+ For the testcase, we usually start from one of the existing tests, copy
+ and modify it to where it does what we'd like to test. Alternatively,
+ you can also start from a template like this:
<pre>
// ---------------------------------------------------------------------
// a short (a few lines) description of what the program does
#include "../tests.h"
-#include <iostream>
-#include <fstream>
+#include <iostream>
+#include <fstream>
// all include files you need here
int main ()
{
- std::ofstream logfile("my_new_test/output");
+ std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
}
</pre>
- <p>You open an output file in a directory with the same
- name as your test, and then write
- all output you generate to it,
- through the <code>deallog</code> stream. The <code>deallog</code>
- stream works like any
- other <code>std::ostream</code> except that it does a few more
- things behind the scenes that are helpful in this context. In
- above case, we only write a zero to the output
- file. Most tests actually write computed data to the output file
- to make sure that whatever we compute is what we got when the
- test was first written.
+ <p>This code opens an output file <code>output</code> in the current working
+ directory and then writes all output you generate to it, through the
+ <code>deallog</code> stream. The <code>deallog</code> stream works like
+ any other <code>std::ostream</code> except that it does a few more
+ things behind the scenes that are helpful in this context. In above
+ case, we only write a zero to the output file. Most tests of course
+ write computed data to the output file to make sure that whatever we
+ compute is what we got when the test was first written.
</p>
<p>
have traditionally been into the <code>base/</code>,
<code>lac/</code>, <code>deal.II/</code>, <code>fe/</code>,
<code>hp/</code>, or <code>multigrid/</code> directories, depending on
- where the classes that are tested are located.
+ where the classes that are tested are located. More atomic tests often go
+ into <code>bits/</code>. There are also
+ directories for PETSc and Trilinos wrapper functionality.
</p>
+ <h4>An expected output</h4>
+
<p>
- We have started to create more atomic tests which
- are usually very small and test only a single aspect of the
- library, often only a single function. These tests go into the
- <code>bits/</code> directory and often have names that are
- composed of the name of the class being tested and a two-digit
- number, e.g., <code>dof_tools_11</code>. There are
- directories for PETSc and Trilinos wrapper functionality.
- </p>
+ In order to run your new test, copy it to an appropriate category and
+ create an empty comparison file for it:
+ <pre>
- <h4>A directory with the same name as the test</h4>
+ category/my_new_test.cc
+ category/my_new_test.output
+ </pre>
+ Now, rerun
+ <pre>
- <p> You have to create a subdirectory
- with the same name as your test to hold the output from the test.
+ $ make setup_tests
+ </pre>
+ so that your new test is picked up. After that it is possible to
+ invoke it with
+ <pre>
- <p> One convenient way to create this subdirectory with the correct
- properties is to use svn copy.
- <pre>
+ $ ctest -V -R "category/my_new_test"
+ </pre>
+ </p>
- svn copy existing_test_directory my_new_test
- </pre>
+ <p>
+ If you run your new test executable this way, the test should compile
+ and run successfully but fail in the diff stage (because of the empty
+ comparison file). You will get an output file
+ <code>BUILD_DIR/category/my_new_test/output</code>. Take a look at it to
+ make sure that the output is what you had expected. (For complex tests,
+ it may sometimes be impossible to say whether the output is correct, and
+ in this case we sometimes just take it to make
+ sure that future invokations of the test yield the same results.)
+ </p>
<p>
- Once you have done this, you can try to run
- <pre>
+ The next step is to copy and rename this output file to the source
+ directory and replace the original comparison file with it:
+ <pre>
- make my_new_test/output
- </pre>
- This should compile, link, and run your test. Running your test
- should generate the desired output file.
- </p>
+ category/my_new_test.output
+ </pre>
+ At this point running the test again should be successful:
+ <pre>
+ $ ctest -V -R "category/my_new_test"
+ </pre>
+ </p>
- <h4>An expected output</h4>
+ <h4>Checking in</h4>
<p>
- If you run your new test executable, you will get an output file
- <code>mytestname/output</code> that should be used to compare all future
- runs with. If the test
- is relatively simple, it is often a good idea to look at the
- output and make sure that the output is actually what you had
- expected. However, if you do complex operations, this may
- sometimes be impossible, and in this case we are quite happy with
- any reasonable output file just to make sure that future
- invokations of the test yield the same results.
- </p>
+ Tests are a way to make sure everything keeps working. If they
+ aren't automated, they are no good. We are therefore very
+ interested in getting new tests. If you have subversion write access
+ already, you can add the new test and the expected output
+ file:
+ <pre>
- <p>
- The next step is to copy this output file to the place where the
- scripts can find it when they compare with newer runs. For this, you first
- have to understand how correct results are verified. It works in the
- following way: for each test, we have subdirectories
- <code>testname/cmp</code> where we store the expected results in a file
- <code>testname/cmp/generic</code>. If you create a new test, you should
- therefore create this directory, and copy the output of your program,
- <code>testname/output</code> to <code>testname/cmp/generic</code>.
+ svn add category/my_new_test.cc
+ svn add category/my_new_test.output
+ svn commit -m "New test"
+ </pre>
+ If you don't have subversion write access, talk to us in the
+ discussion group; writing testcases is a worthy and laudable task,
+ and we would like to encourage it by giving people the opportunity to
+ contribute!
</p>
- <p>
- Why <code>generic</code>? The reason is that sometimes test results
- differ slightly from platform to platform, for example because numerical
- roundoff is different due to different floating point implementations on
- different CPUs. What this means is that sometimes a single stored output is
- not enough to verify that a test functioned properly: if you happen to be
- on a platform different from the one on which the generic output was
- created, your test will always fail even though it produces almost exactly
- the same output.
- </p>
+
+
+ <a name="submit"></a>
+ <h2>Submitting test results</h2>
<p>
- To avoid this, what the makefiles do is to first check whether an output
- file is stored for this test and your particular configuration (platform
- and compiler). If this isn't the case, it goes through a hierarchy of files
- with related configurations, and only if none of them does it take the
- generic output file. It then compares the output of your test run with the
- first file it found in this process. To make things a bit clearer, if you
- are, for example, on a <code>i686-pc-linux-gnu</code> box and use
- <code>gcc4.0</code> as your compiler, then the following files will be
- sought (in this order):
- <pre>
+ To submit test results to our <a
+ href="http://cdash.kyomu.43-1.org/index.php?project=deal.II">CDash</a>
+ instance just invoke ctest within a build directory (or designated
+ build directory) with the <code>-S</code> option pointing to the
+ <code>run_testsuite.cmake</code> script: <pre>
-testname/cmp/i686-pc-linux-gnu+gcc4.0
-testname/cmp/i686-pc-linux-gnu+gcc3.4
-testname/cmp/i686-pc-linux-gnu+gcc3.3
-testname/cmp/generic
- </pre>
- (This list is generated by the <code>tests/hierarchy.pl</code> script.)
- Your output will then be compared with the first one that is actually
- found. The virtue of this is that we don't have to store the output files
- from all possible platforms (this would amount to gigabytes of data), but
- that we only have store an output file for gcc4.0 if it differs from that
- of gcc3.4, and for gcc3.4 if it differs from gcc3.3. If all of them are the
- same, we would only have the generic output file.
+ $ ctest [...] -V -S ../tests/run_testsuite.cmake
+ </pre>
+ The script will run configure, build and ctest and submit the results
+ to the CDash server. It does not matter whether the configure, build
+ or ctest stages were run before that. Also in script mode, you can
+ specify the same options for <code>ctest</code> as explained above.
</p>
<p>
- Most of the time, you will be able to generate output files only
- for your own platform and compiler, and that's alright: someone
- else will create the output files for other platforms
- eventually. You only have to copy your output file to
- <code>testname/cmp/generic</code>.
+ <b>Note:</b> The default output in script mode is very minimal.
+ Therefore, it is recommended to specify <code>-V</code> which will
+ give the same level of verbosity as the non-script mode.
</p>
<p>
- At this point you can run
- <pre>
+ <b>Note:</b> The following variables can be set to via
+ <pre>
- make my_new_test/OK
- </pre>
- which should compare the present output with what you have just
- copied into the compare directory. This should, of course,
- succeed, since the two files should be identical.
+ ctest -D<variable>=<value> [...]
+ </pre>
+ to control the behaviour of the <code>run_testsuite.cmake</code>
+ script:
+ <pre>
+
+ CTEST_SOURCE_DIRECTORY
+ - The source directory of deal.II (usually ending in "[...]/deal.II"
+ (equivalent to https://svn.dealii.org/trunk/deal.II)
+ Note: This is _not_ the test directory ending in "[...]/tests"
+ - If unspecified, "../deal.II" and "../../$ relative to the location
+ of this script is used. If this is not a source directory, an error
+ thrown.
+
+ CTEST_BINARY_DIRECTORY
+ - The designated build directory (already configured, empty, or non
+ existent - see the information about TRACKs what will happen)
+ - If unspecified the current directory is used. If the current
+ directory is equal to CTEST_SOURCE_DIRECTORY or the "tests"
+ directory, an error is thrown.
+
+ CTEST_CMAKE_GENERATOR
+ - The CMake Generator to use (e.g. "Unix Makefiles", or "Ninja", see
+ $ man cmake)
+ - If unspecified the current generator of a configured build directory
+ will be used, otherwise "Unix Makefiles".
+
+ TRACK
+ - The track the test should be submitted to. Defaults to "Experimental".
+ Possible values are:
+
+ "Experimental" - all tests that are not specifically "build" or
+ "regression" tests should go into this track
+
+ "Build Tests" - Build tests that configure and build in a
+ clean directory and run the build tests
+ "build_tests/*"
+
+ "Nightly" - Reserved for nightly regression tests for
+ build bots on various architectures
+
+ "Regression Tests" - Reserved for the regression tester
+
+ CONFIG_FILE
+ - A configuration file (see docs/development/Config.sample)
+ that will be used during the configuration stage (invokes
+ $ cmake -C ${CONFIG_FILE}). This only has an effect if
+ CTEST_BINARY_DIRECTORY is empty.
+ </pre>
+ Furthermore, the variables described <a href="#setupconfigure">above</a> can also be
+ set and will be handed automatically down to <code>cmake</code>.
</p>
- <p>
- On the other hand, if you realize that an existing test fails on your
- system, but that the differences (as shown when running with
- <code>verbose=on</code>, see above) are only marginal and around the 6th or
- 8th digit, then you should check in your output file for the platform you
- work on. For this, you could copy <code>testname/output</code> to
- <code>testname/cmp/myplatform+compiler</code>, but your life can be easier
- if you simply type
- <pre>
- make my_new_test/ref
- </pre>
- which takes your output and copies it to the right place automatically.
- </p>
+ <a name="build_tests"></a>
+ <h2>Build tests</h2>
+ <p>
+ Build tests are used to check that deal.II can be compiled on
+ different systems and with different compilers as well as
+ different configuration options. Results are collected in the "Build
+ Tests" track in <a
+ href="http://cdash.kyomu.43-1.org/index.php?project=deal.II">CDash</a>.<p>
+ <p>Running the build test suite is simple and we encourage deal.II
+ users with configurations not found on the <a
+ href="http://www.dealii.org/testsuite.html">test suite page</a> to
+ participate. Assuming you checked out deal.II into the directory
+ <code>deal.II</code>, running it is as simple as:
+ <pre>
- <h4>Checking in</h4>
+ cd deal.II
+ mkdir build
+ cd build
+ ctest -j4 -S ../cmake/scripts/run_buildtest.cmake
+ </pre>
+ </p>
<p>
- Tests are a way to make sure everything keeps working. If they
- aren't automated, they are no good. We are therefore very
- interested in getting new tests. If you have subversion write access
- already, you can add the new test and the expected output
- file:
- <pre>
+ What this does is to compile and build deal.II in the directory
+ <code>build</code>, try to configure, build (and run a subset) of all
+ tutorial programs supported by the current configuration and send the
+ results to the CDash instance.
+ </p>
- svn add bits/my_new_test.cc
- svn add bits/my_new_test
- svn add bits/my_new_test/cmp
- svn add bits/my_new_test/cmp/generic
- svn commit -m "New test" bits/my_new_test*
- </pre>
- In addition, you should do the following in order to avoid that the files
- generated while running the testsuite show up in the output of <code>svn
- status</code> commands:
- <pre>
+ <p>
+ <b>Note:</b> Build tests require the designated build directory to be
+ completely empty and the source directory to be under subversion
+ version control. If you want to specify a build configuration for
+ cmake use a <a href="../users/Config.sample">configuration file</a>
+ to preseed the cache as explained <a href="#submit">above</a>:
+ <pre>
- svn propset svn:ignore "obj.*
- exe
- output
- status
- OK" bits/my_new_test
- svn commit -m "Ignore generated files." bits/my_new_test
- </pre>
- Note that the list of files given in quotes to the propset command extends
- over several lines.
+ $ ctest -DCONFIG_FILE="[...]/Config.sample" [...]
+ </pre>
</p>
+
+
+ <a name="dedicatedbuilds"></a>
+ <h3>Dedicated build tests</h3>
+
<p>
- If you don't have subversion write access, talk to us in the discussion group;
- writing testcases is a worthy and laudable task, and we would
- like to encourage it by giving people the opportunity to
- contribute!
+ Build tests work best if they run automatically and periodically.
+ There is a detailed example for such dedicated build tests on the <a
+ href="https://code.google.com/p/dealii/wiki/BuildTests">wiki</a>.
</p>
+
<hr />
<address>
<a href="../authors.html" target="body">The deal.II Authors</a>
<p>
The <acronym>deal.II</acronym> library has been placed under an Open
Source license, in the sense advocated by the <a
- href="http://www.opensource.org" target="_top">Open Source
+ href="http://opensource.org" target="_top">Open Source
Initiative</a>. You are thus free to copy and use it, and you have
free access to all source code.
</p>
</p>
<ol>
+ <li>
+ Changed: The ghost handling of the parallel::distributed::Vector class has
+ been reworked: The vector now carries a global state that stores whether
+ ghost elements have been updated or not. If a vector has ghost elements, it
+ does not allow calls to compress() any more. Instead, a compress operation
+ can now only be done when the ghost entries have been cleared before by
+ calling zero_out_ghosts() or operator=0. The state can be queried by the new
+ method has_ghost_elements(). This change avoids spurious entries to be
+ inserted with compress(), but requires some change in user codes. The
+ behavior of a ghosted vector is now very similar to ghosted PETSc and
+ Trilinos vectors. The only difference is that the <i>same</i> vector can
+ also be used as a non-ghosted vector which is designed for use in assembly
+ routines.
+ <br>
+ (Martin Kronbichler, 2013/10/18)
+ </li>
+
<li>
Removed: GridTools::collect_periodic_face_pairs. This function is superseded
by GridTools::collect_periodic_faces which exports an
<ol>
+ <li> New: The testsuite is now ported to <a href="http://www.cmake.org/">
+ CMake</a> and uses CTest as test driver.
+ <br>
+ (Wolfgang Bangerth, Timo Heister, Matthias Maier, Bruno Turcksin, 2013/10/20)
+ </li>
+
<li>
Changed: multithreadinfo::n_default_threads is now deprecated. Use the
new n_threads() function instead, which works correctly with TBB.
<h3>Specific improvements</h3>
<ol>
+ <li>
+ ~Subscriptor and ~GrowingVectorMemory no longer throw an exception (the
+ former if disable_abort_on_exception was called) to be compatible with the
+ C++11 standard which otherwise requires the program to immediately call
+ std::terminate. This was done with a new macro "AssertNothrow".
+ <br>
+ (Wolfgang Bangerth, Matthias Maier, Bruno Turcksin 2013/10/22)
+ </li>
+
+ <li>
+ dealii::SolverControl::NoConvergence now inherits dealii::ExceptionBase and
+ is thrown via AssertThrow(false, ... ).
+ <br>
+ (Matthias Maier, 2013/10/20)
+ </li>
+
+ <li>
+ New: parallel::distributed::BlockVector has now methods update_ghost_values,
+ compress, set_out_ghosts, and has_ghost_elements that do the respective
+ operation on each block of parallel::distributed::Vector.
+ <br>
+ (Martin Kronbichler, 2013/10/18)
+ </li>
+
<li>
Fixed: When deriving from DataOut to filter the cells where output is generated, there were two different bugs that result in segmentation faults or wrong cells written (example, step-18).
<br>
<dd>
The principal authors of <acronym>deal.II</acronym>—Wolfgang
Bangerth, Ralf Hartmann and Guido Kanscht—have received the <a
- href="http://www-fp.mcs.anl.gov/wilkinson/award/">J. H. Wilkinson
+ href="http://www.mcs.anl.gov/WilkinsonPrize/">J. H. Wilkinson
Prize for Numerical Software</a> for their creation of and work on
the deal.II library. The prize committee particularly noted the
reliability and usability of the software and the quality of the
Library (HSL)</strong>
</dt>
<dd>
- The <a href="http://www.cse.clrc.ac.uk/Activity/HSL"
+ The <a href="http://www.hsl.rl.ac.uk/"
target="_top">Harwell Subroutine Library (HSL)</a> is a
library that, among much other functionality, offers some
sparse direct solvers. We have added support for an
</li>
<li> <a href="http://www.math.tamu.edu/~bangerth"
target="_top">W. Bangerth</a>,
- <a href="http://www.math.tamu.edu/~heister"
+ <a href="http://www.clemson.edu/~heister"
target="_top">T. Heister</a>
and
<a href="http://www.math.tamu.edu/~kanschat"
<strong>A finite basis grid analysis of the Hartree-Fock wavefunction method for one- and two-electron atoms
</strong>
<br>
- AIP Conf. Proc., Accepted, 2013.
+ AIP Conf. Proc., vol. 1558, pp. 1524, 2013.
</li>
<li> <a href="http://www.ippt.gov.pl/~tyoung"
<ol>
<li> M. Anderson, <a href="http://www.math.tamu.edu/~bangerth"
- target="_top">W. Bangerth</a>, <a
- href="http://www.cfdlab.ae.utexas.edu/labstaff/carey.php"
- target="_top">G. Carey</a>
+ target="_top">W. Bangerth</a>, G. Carey
<br>
<strong>Analysis of parameter sensitivity and experimental
design for a class of nonlinear partial differential
J. Sci. Comput., vol. 24, pp. 321-341, 2005
<br>
(This paper uses <a
- href="http://circus.math.pku.edu.cn/AFEPack/"
+ href="http://dsec.pku.edu.cn/~rli/software_e.php"
target="_top">AFEPack</a> which in turn uses deal.II's linear
algebra library.)
</li>
Ph.D. thesis, University of Twente, The Netherlands, 2005
</li>
- <li> <a href="http://www.dkfz-heidelberg.de/en/medphysrad/ect/team/rschulz.html"
- target="_top">R. B. Schulz</a>, G. Echner, H. Ruehle,
+ <li> R. B. Schulz, G. Echner, H. Ruehle,
W. Stroh, J. Vierling, T. Vogt, J. Peter, W. Semmler
<br>
<strong>Development of a fully rotational non-contact fluorescence tomographer
</li>
- <li> <a href="http://www.dkfz-heidelberg.de/en/medphysrad/ect/team/rschulz.html" target="_top">R. B. Schulz</a>, J. Peter, W. Semmler, C. D'andrea, G. Valentini, R. Cubeddu
+ <li> R. B. Schulz, J. Peter, W. Semmler, C. D'andrea, G. Valentini, R. Cubeddu
<br>
<strong>Quantifiability and Image Quality in Noncontact Fluorescence Tomography
</strong>
</li>
- <li> <a href="http://www.cfdlab.ae.utexas.edu/labstaff/carey.php"
- target="_top">G. Carey</a>, M. Anderson, B. Carnes, B. Kirk
+ <li> G. Carey, M. Anderson, B. Carnes, B. Kirk
<br>
<strong>Some aspects of adaptive grid technology related to
boundary and interior layers
pp. 55-86, 2004
</li>
- <li> <a href="http://www.cfdlab.ae.utexas.edu/labstaff/carey.php"
- target="_top">G. Carey</a>, W. Barth, J. A. Woods, B. Kirk,
+ <li> G. Carey, W. Barth, J. A. Woods, B. Kirk,
M. Anderson, S. Chow, <a href="http://www.math.tamu.edu/~bangerth"
target="_top">W. Bangerth</a>
<br>
Modelling Simul. Mater. Sci. Eng., vol. 12, pp. 1293-1306, 2004
</li>
- <li> <a
- href="http://www.dkfz-heidelberg.de/en/medphysrad/ect/team/rschulz.html"
- target="_top">R. B.
- Schulz</a>, <a href="http://www.math.tamu.edu/~bangerth"
+ <li> R. B.
+ Schulz, <a href="http://www.math.tamu.edu/~bangerth"
target="_top">W. Bangerth</a>, J. Peter, W. Semmler
<br>
<strong>Independent modeling of
<hr />
<address>
- <a href="authors.html" target="body">The deal.II Authors</a>
+ <a href="../authors.html" target="body">The deal.II Authors</a>
</address>
<div class="right">
<a href="http://validator.w3.org/check?uri=referer" target="_top">
platforms:
</p>
<ul>
- <li>GNU/Linux: GCC version 4.0 or later;
- Clang version 3.0 or later; ICC version 12 or later</li>
- <li>Mac OS X: GCC version 4.0 or later; Clang version 3.0 or later
- (Please see the <a href="https://code.google.com/p/dealii/w/list"
- target="_top">deal.II Wiki</a> for installation issues)</li>
- <li>Windows: <a href="http://www.cygwin.com"
- target="_top">Cygwin</a> with recent GCC or Clang versions.
- Native Windows support with recent
- <a href="http://www.mingw.org/">MinGW</a> compiler.
- For <a href="https://code.google.com/p/dealii/wiki/Windows"
- target="_top">installing on Windows</a>, please refer to
- additional information on the <a href="https://code.google.com/p/dealii/w/list"
- target="_top">deal.II Wiki</a> and have a look at the <a
- href="https://code.google.com/p/dealii/issues/list">bug
- tracker</a>!</li>
+ <li>GNU/Linux: GCC version 4.1 or later; Clang version 3.0 or later;
+ ICC versions 12* or 14* (version 13 is not supported)</li>
+ <li>Mac OS X: GCC version 4.1 or later; Clang version 3.0 or later.
+ Please see the <a href="https://code.google.com/p/dealii/wiki/MacOSX"
+ target="_top">deal.II Wiki</a> for installation instructions.</li>
+ <li>Windows: Currently unsupported.
+ Please see the <a href="https://code.google.com/p/dealii/wiki/Windows"
+ target="_top">deal.II Wiki</a> for installation instructions.</li>
+ </li>
</ul>
+
<p>
Most other combinations of POSIX-style operating systems and C++
Standard compliant compilers should also work. <i>If they don't,
<li> <p>
The library generates output in formats readable by
- <a href="http://www.ucc.ie/gnuplot/gnuplot-faq.html" target="_top">GNUPLOT</a>,
- <a href="http://www-xdiv.lanl.gov/XCM/gmv/" target="_top">GMV
+ <a href="http://www.gnuplot.info/" target="_top">GNUPLOT</a>,
+ <a href="http://www.generalmeshviewer.com/" target="_top">GMV
(general mesh viewer)</a>,
- <a href="http://www.amtec.com" target="_top">Tecplot</a> (ASCII and binary),
- <a href="http://public.kitware.com/VTK/"
+ <a href="http://www.tecplot.com/" target="_top">Tecplot</a> (ASCII and binary),
+ <a href="http://www.vtk.org/"
target="_top">Visualization Toolkit (Vtk)</a>,
<a href="http://www.avs.com" target="_top">AVS Explorer</a>,
<a href="http://www.opendx.org" target="_top">Open DX</a>,
of excellent programs that can read <code>vtk</code> and
<code>vtu</code>, such as
<a href="http://www.llnl.gov/visit/" target="_top">Visit</a>,
- <a href="http://www.paraview.org/HTML/Index.html" target="_top">ParaView</a>,
+ <a href="http://www.paraview.org/" target="_top">ParaView</a>,
as well as others. Povray is freely available for almost all
platforms. AVS is a commercial program available for most Unix
flavors. Tecplot is a commercial program available for Windows
possibly with different arguments.
However, this sometimes leads to surprising results and you may
not get exactly what you were hoping for. For more information,
- see <a href="development/cmake.html">here</a>.
+ see <a href="users/cmake.html">here</a>.
</li>
</ul>
border-bottom: 1px solid #aaaaaa;
}
-h1 {
- font-size: 175%;
- counter-reset: section;
-}
+h1 { font-size: 175%;
+ counter-reset: section; }
-h2 {
- font-size: 150%;
- counter-reset: subsection;
-}
+h2 { font-size: 150%;
+ padding-top: 1.5em;
+ counter-reset: subsection; }
h3 { font-size: 140%;
- padding-top: 1.5em;
+ padding-top: 0.5em;
padding-bottom: 0.17em;
border-bottom: 1px dashed #aaaaaa; }
-h4 { font-size: 110%;
+h4 { font-size: 110%;
border-bottom: none;
font-weight: bold;
}
-h5 { font-size: 100%;
+h5 { font-size: 100%;
border-bottom: none;
font-weight: bold;
}
-h6 { font-size: 80%;
+h6 { font-size: 80%;
border-bottom: none;
font-weight: bold;
}
## ##
-# Example configuration file #
+# Example configuration file #
# #
-# See doc/readme.html and doc/development/cmake.html for further #
-# details on how to use the cmake build system of deal.II. #
+# See doc/readme.html and doc/users/cmake.html for further #
+# details on how to use the cmake build system of deal.II. #
## ##
# "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
# )
#
+# SET(DEAL_II_SETUP_COVERAGE OFF CACHE BOOL
+# "Setup debug compiler flags to provide additional test coverage information. Currently only gprof is supported."
+# )
+#
# SET(CMAKE_CXX_COMPILER "" CACHE STRING
# "CXX Compiler."
# )
# SET(MPI_CXX_INCLUDE_PATH "include directory for mpi" CACHE STRING "")
# SET(MPI_CXX_COMPILE_FLAGS "..." CACHE STRING "")
# SET(MPI_CXX_LINK_FLAGS "..." CACHE STRING "")
+# SET(MPI_VERSION "x.y" CACHE STRING "")
+# SET(MPI_VERSION_MAJOR "x" CACHE STRING "")
+# SET(MPI_VERSION_MINOR "y" CACHE STRING "")
#
# Additionally:
#
# SET(MUMPS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(MUMPS_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
# SET(MUMPS_LINKER_FLAGS "..." CACHE STRING "")
+# SET(MUMPS_VERSION "x.y.z" CACHE STRING "")
+# SET(MUMPS_VERSION_MAJOR "x" CACHE STRING "")
+# SET(MUMPS_VERSION_MINOR "y" CACHE STRING "")
+# SET(MUMPS_VERSION_SUBMINOR "z" CACHE STRING "")
#
# SET(PETSC_FOUND TRUE CACHE BOOL "")
# SET(PETSC_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(PETSC_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
-# SET(PETSC_VERSION "x.y.z." CACHE STRING "")
+# SET(PETSC_VERSION "x.y.z.p" CACHE STRING "")
# SET(PETSC_VERSION_MAJOR "x" CACHE STRING "")
# SET(PETSC_VERSION_MINOR "y" CACHE STRING "")
# SET(PETSC_VERSION_SUBMINOR "z" CACHE STRING "")
-# SET(PETSC_VERSION_PATCH "" CACHE STRING "")
+# SET(PETSC_VERSION_PATCH "p" CACHE STRING "")
# SET(PETSC_WITH_MPI_UNI FALSE CACHE BOOL "")
#
# SET(SLEPC_FOUND TRUE CACHE BOOL "")
# SET(SLEPC_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(SLEPC_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
-# SET(SLEPC_VERSION "x.y.z." CACHE STRING "")
+# SET(SLEPC_VERSION "x.y.z.p" CACHE STRING "")
# SET(SLEPC_VERSION_MAJOR "x" CACHE STRING "")
# SET(SLEPC_VERSION_MINOR "y" CACHE STRING "")
# SET(SLEPC_VERSION_SUBMINOR "z" CACHE STRING "")
-# SET(SLEPC_VERSION_PATCH "" CACHE STRING "")
+# SET(SLEPC_VERSION_PATCH "p" CACHE STRING "")
# SET(SLEPC_WITH_MPI_UNI FALSE CACHE BOOL "")
#
# SET(TBB_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(TBB_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
# SET(TBB_WITH_DEBUGLIB TRUE CACHE BOOL "")
+# SET(TBB_VERSION "x.y" CACHE STRING "")
+# SET(TBB_VERSION_MAJOR "x" CACHE STRING "")
+# SET(TBB_VERSION_MINOR "y" CACHE STRING "")
#
# SET(TRILINOS_FOUND TRUE CACHE BOOL "")
# SET(TRILINOS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(TRILINOS_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
+# SET(TRILINOS_VERSION "x.y.z" CACHE STRING "")
# SET(TRILINOS_VERSION_MAJOR "x" CACHE STRING "")
# SET(TRILINOS_VERSION_MINOR "y" CACHE STRING "")
# SET(TRILINOS_VERSION_SUBMINOR "z" CACHE STRING "")
# SET(UMFPACK_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(UMFPACK_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
# SET(UMFPACK_LINKER_FLAGS "..." CACHE STRING "")
+# SET(UMFPACK_VERSION "x.y.z" CACHE STRING "")
+# SET(UMFPACK_VERSION_MAJOR "x" CACHE STRING "")
+# SET(UMFPACK_VERSION_MINOR "y" CACHE STRING "")
+# SET(UMFPACK_VERSION_SUBMINOR "z" CACHE STRING "")
#
#
-# Obnoxiously adavanced configuration about paths, install locations and
+# Obnoxiously advanced configuration about paths, install locations and
# names:
#
# SET(DEAL_II_PACKAGE_NAME "deal.II" CACHE STRING
<li><a href="#operatingshortcuts">Shortcuts</a></li>
</ol>
</li>
+ <li><a href="#build">Configuring and Building deal.II</a>
+ <ol>
+ <li><a href="#buildtargets">Primary build targets</a></li>
+ <li><a href="#buildinformation">Information about current configuration</a></li>
+ <li><a href="#buildinsource">Out-of-source versus in-source builds</a></li>
+ <li><a href="#buildgenerator">CMake Generators</a></li>
+ <li><a href="#buildinstall">Installation</a></li>
+ </ol>
+ </li>
<li><a href="#configure">Configuration options</a>
<ol>
<li><a href="#configurefeature">Feature configuration</a></li>
<li><a href="#compiling">Compiling only certain parts</a></li>
</ol>
</div>
-
+
<a name="operating"></a>
<h2>Operating cmake</h2>
will be expanded to the full <code>DEAL_II_COMPONENT_*</code> variable name).
</p>
+
+
+ <a name="build"></a>
+ <h2>Configuring and Building deal.II</h2>
+
+ <p>
+ This section provides some further details and advanced topics with
+ respect to configuration and building that is not covered in the <a
+ href="../readme.html" target="body">README</a>.
+ </p>
+
+ <a name="buildtargets"></a>
+ <h3>Primary build targets</h3>
+
+ <p> The current list of primary build targets can be queried via
+ <code>make info</code>:
+ <pre>
+
+ ###
+ #
+ # The following targets are available (invoke via $ make <target>):
+ #
+ # all - compiles the library and all enabled components
+ # clean - removes all generated files
+ # install - installs into CMAKE_INSTALL_PREFIX
+ # help - prints a list of valid top level targets
+ # info - prints this help message
+ #
+ # edit_cache - runs ccmake for changing (cached) configuration variables
+ # and reruns the configure and generate phases of CMake
+ # rebuild_cache - reruns the configure and generate phases of CMake
+ #
+ # compat_files - builds and installs the 'compat_files' component
+ # documentation - builds and installs the 'documentation' component
+ # examples - builds and installs the 'examples' component
+ # library - builds and installs the 'library' component
+ # mesh_converter - builds and installs the 'mesh_converter' component
+ # parameter_gui - builds and installs the 'parameter_gui' component
+ #
+ # test - runs a minimal set of tests
+ #
+ # setup_test - sets up the testsuite subprojects
+ # clean_test - runs the 'clean' target in every testsuite subproject
+ # prune_test - removes all testsuite subprojects
+ #
+ ###
+ </pre>
+
+
+ <a name="buildinformation"></a>
+ <h3>Information about current configuration</h3>
+
+ <p>
+ A configuration run of <code>cmake</code> (or <code>ccmake</code>)
+ writes a short summary of the current configuration into
+ <code>CMAKE_BUILD_DIR/summary.log</code>:
+ <pre>
+
+ ###
+ #
+ # deal.II configuration:
+ # CMAKE_BUILD_TYPE: DebugRelease
+ # BUILD_SHARED_LIBS: ON
+ # CMAKE_INSTALL_PREFIX: /tmp/deal.II/install
+ # CMAKE_SOURCE_DIR: /tmp/deal.II/deal.II (Version 8.1.pre)
+ # CMAKE_BINARY_DIR: /tmp/deal.II/build
+ # CMAKE_CXX_COMPILER: GNU 4.7.3 on platform Linux x86_64
+ # /usr/bin/c++
+ #
+ # Configured Features (DEAL_II_ALLOW_BUNDLED = ON, DEAL_II_ALLOW_AUTODETECTION = ON):
+ # ( DEAL_II_WITH_64BIT_INDICES = OFF )
+ # DEAL_II_WITH_ARPACK set up with external dependencies
+ # DEAL_II_WITH_BOOST set up with external dependencies
+ # [...]
+ #
+ # Component configuration:
+ # DEAL_II_COMPONENT_COMPAT_FILES
+ # ( DEAL_II_COMPONENT_DOCUMENTATION = OFF )
+ # DEAL_II_COMPONENT_EXAMPLES
+ # DEAL_II_COMPONENT_MESH_CONVERTER
+ # ( DEAL_II_COMPONENT_PARAMETER_GUI = OFF )
+ #
+ # Detailed information (compiler flags, feature configuration) can be found in detailed.log
+ #
+ # Run $ make info to print a help message with a list of top level targets
+ #
+ ###
+ </pre>
+ This summary is also printed at the end of the configuration phase.
+ It tells you about build and install directory locations, feature
+ configuration (whether a feature is enabled with external/internal
+ dependencies, disabled or forced) and component configuration.
+ A more detailed version can be found in
+ <code>CMAKE_BUILD_DIR/detailed.log</code> that also includes detailed
+ information about feature configuration, e.g.
+ <pre>
+
+ # DEAL_II_WITH_BOOST set up with external dependencies
+ # BOOST_VERSION = 1.52.0
+ # BOOST_DIR =
+ # Boost_INCLUDE_DIRS = /usr/include
+ # Boost_LIBRARIES = /usr/lib64/libboost_serialization-mt.so;/usr/lib64/libboost_system-mt.so;
+ # [...]
+ </pre>
+ If this information is not sufficient, you might want to have a look
+ at the following files in <code>CMAKE_BUILD_DIR</code>
+ <ul>
+ <li><code>CMakeCache.txt</code>: The file CMake stores its cached
+ variables in. Do not change directly.
+ <li><code>include/deal.II/base/config.h</code>: The generated
+ config.h file
+ <li><code>lib/cmake/deal.II/deal.IIConfig.cmake</code>: The project
+ configuration file for external projects.
+ </ul>
+ </p>
+
+
+
+ <a name="buildinsource"></a>
+ <h3>Out-of-source versus in-source builds</h3>
+
+ <p>
+ A so called out-of-source build is a setup where the build directory
+ (the directory containing intermediate and generated files) is
+ different from the source directory (the directory containing the
+ source code). With CMake an out-of-source build is set up by invoking
+ <code>cmake</code> (or <code>ccmake</code>) from the designated build
+ directory, so for example (a build directory under the source
+ directory):
+ <pre>
+
+ $ mkdir build
+ $ cd build
+ $ cmake ..
+ </pre>
+ The big advantage is that source files and intermediate files are
+ strictly separated (highly desired for version control) and that you
+ can have multiple build directories (with different configuration) at
+ the same time.
+ </p>
+
+ <p>
+ <b>Note:</b> However, under rare occasions an in-source build might be
+ useful or needed , so it is supported
+ <pre>
+
+ $ cmake .
+ </pre>
+ But we highly discourage it!
+ </p>
+
+ <a name="buildgenerator"></a>
+ <h3>CMake Generators</h3>
+
+ <p>
+ Cmake is a <i>Makefile Generator</i>. This allows to switch the
+ generator that is used to something different. If you for example want
+ to automatically generate an Eclipse project of deal.II, you can run
+ <pre>
+
+ $ cmake -G"Eclipse CDT4 - Unix Makefiles" [...]
+ </pre>
+ and load up the build directory as a project directly into Eclipse.
+ Have a look at the <a href="https://code.google.com/p/dealii/w/list"
+ target="_top">Wiki</a> for more information.
+ </p>
+
+ <p>
+ An interesting alternative to (GNU) Make might also be <a
+ href="http://martine.github.io/ninja/">Ninja</a>. Configure via
+ <pre>
+
+ $ cmake -GNinja [...]
+ </pre>
+ and run <code>ninja</code> instead of <code>make</code>.
+ </p>
+
+
+ <a name="buildinstall"></a>
+ <h3>Installation</h3>
+
+ <p>
+ It is not necessary to install the library in order to use deal.II.
+ Invoking the <code>all</code> or <code>library</code> target will
+ compile the library and set up all necessary configuration in the
+ build directory so that external projects can directly use it.
+ However, we strongly recommend to proceed in the way explained in the
+ <a href="../readme.html" target="body">README</a> and install the
+ library to a designated install directory (different from source and
+ build directory).
+ </p>
+
+ <p>
+ For installing the library it is necessary to set the CMake variable
+ <code>CMAKE_INSTALL_PREFIX</code> to the designated install
+ directory. You can do this by invoking <code>cmake</code> together
+ with <code>-DCMAKE_INSTALL_PREFIX=<...></code> or by invoking
+ <code>ccmake</code>.
+ </p>
+
+ <p>
+ <b>Note:</b> When you don't install deal.II to an install directory
+ and use it directly from a build directory,
+ both, the build <i>and</i> source directories have to be kept.
+ </p>
+
+ <p>
+ <b>Note:</b> It is not necessary for the source, build and or install
+ directory to be different. All combinations are supported.
+ </p>
+
+
+ <h4>Install a single component</h4>
+
+ <p>
+ If you want to only generate, compile and install a specific
+ component (most notably the documentation) you can use one of the
+ following top level targets:
+ <pre>
+
+ compat_files - builds and installs the 'compat_files' component
+ documentation - builds and installs the 'documentation' component
+ examples - builds and installs the 'examples' component
+ library - builds and installs the 'library' component
+ mesh_converter - builds and installs the 'mesh_converter' component
+ parameter_gui - builds and installs the 'parameter_gui' component
+ </pre>
+
+
<a name="configure"></a>
<h2>Configuration options</h2>
</p>
+
<a name="configurefeature"></a>
<h3>Feature configuration</h3>
<code>DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS</code> to
<code>OFF</code>. Beware of the fact that certain features
may still pull in necessary compiler flags.
+
+ <li>
+ You can setup additional debug compiler flags to provide test
+ coverage information by setting
+ <code>DEAL_II_SETUP_COVERAGE</code> to <code>ON</code>.
</ol>
</p>
<h3> Installation </h3>
<p>
- the location,
- where the <acronym>deal.II</acronym> library will be
- installed to is set with the help of
+ the location, where the <acronym>deal.II</acronym> library will be
+ installed when invoking <code>make install</code> to is set with the
+ help of
<pre>
CMAKE_INSTALL_PREFIX
Please note that depending on whether
<code>DEAL_II_COMPONENT_COMPAT_FILES</code> is set, there will be
- different directory structures:
+ a different default directory structure:
<ul>
<li>
With <code>DEAL_II_COMPONENT_COMPAT_FILES=ON</code>:
</p>
<p>
- The individual target directories can be overwritten by setting the
+ The default directory structure can be changed by by setting the
following variables:
<pre>
library. Rather, <code>make install</code> will still want to have both
libraries up to date and will therefore invoke <code>make all</code>
automatically. To restrict builds in such a way that only one library
- will be installed, see <a href="#configurebuild">this section</a>.
+ will be installed, see <a href="#configurebuild">configuration</a>
+ and <a href="#buildinstall">installation</a> sections.
</p>
<hr />
#include <deal.II/base/function.h>
#include <deal.II/base/logstream.h>
#include <deal.II/base/table_handler.h>
-#include <deal.II/base/thread_management.h>
+#include <deal.II/base/work_stream.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/sparse_matrix.h>
#include <list>
#include <sstream>
+#ifdef DEAL_II_WITH_THREADS
+# include <tbb/task.h>
+# include <tbb/task_scheduler_init.h>
+#endif
+
// The last step is as in all previous programs:
namespace Step13
{
using namespace dealii;
+ namespace Assembler
+ {
+ // Dummy structure
+ struct Scratch
+ {
+ Scratch() {}
+ };
+
+ struct CopyData
+ {
+ CopyData() {}
+
+ unsigned int dofs_per_cell;
+ FullMatrix<double> cell_matrix;
+ std::vector<types::global_dof_index> local_dof_indices;
+ };
+ }
+
// @sect3{Evaluation of the solution}
// As for the program itself, we first define classes that evaluate the
// various subobjects, and there is a function that implements a
// conjugate gradient method as solver.
private:
- struct LinearSystem
+ struct LinearSystem
{
LinearSystem (const DoFHandler<dim> &dof_handler);
Vector<double> rhs;
};
+#ifdef DEAL_II_WITH_THREADS
+
+ // Tasks in TBB must be derived from tbb::task and override tbb::task*
+ // execute.
+ // The purpose of HangingNodeTask is to apply execute DoFTools::make_hanging_node_constraints.
+ struct HangingNodeTask : public tbb::task
+ {
+ HangingNodeTask (const DoFHandler<dim> &dof_handler,ConstraintMatrix &hanging_node_constraints) :
+ dof_handler(&dof_handler),
+ hanging_node_constraints(& hanging_node_constraints) {}
+
+ tbb::task* execute()
+ {
+ DoFTools::make_hanging_node_constraints(*dof_handler,*hanging_node_constraints);
+
+ return NULL;
+ }
+
+ const DoFHandler<dim>* dof_handler;
+ ConstraintMatrix* hanging_node_constraints;
+ };
+
+
+
+ // The purpose of SparsityPatternTask is to create the sparsity pattern.
+ struct SparsityPatternTask : public tbb::task
+ {
+ SparsityPatternTask (const DoFHandler<dim> &dof_handler,SparsityPattern &sparsity_pattern) :
+ dof_handler(&dof_handler),
+ sparsity_pattern(&sparsity_pattern) {}
+
+ tbb::task* execute()
+ {
+ sparsity_pattern->reinit (dof_handler->n_dofs(),
+ dof_handler->n_dofs(),
+ dof_handler->max_couplings_between_dofs());
+ DoFTools::make_sparsity_pattern (*dof_handler, *sparsity_pattern);
+
+ return NULL;
+ }
+
+ const DoFHandler<dim>* dof_handler;
+ SparsityPattern* sparsity_pattern;
+ };
+
+#endif
+
// Finally, there is a pair of functions which will be used to assemble
// the actual system matrix. It calls the virtual function assembling
// the right hand side, and installs a number threads each running the
assemble_linear_system (LinearSystem &linear_system);
void
- assemble_matrix (LinearSystem &linear_system,
- const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
- const typename DoFHandler<dim>::active_cell_iterator &end_cell,
- Threads::Mutex &mutex) const;
+ assemble_matrix (const typename DoFHandler<dim>::active_cell_iterator &cell,
+ Assembler::Scratch &scratch,
+ Assembler::CopyData ©_data) const;
+
+
+ void
+ copy_local_to_global(Assembler::CopyData const ©_data,
+ LinearSystem &linear_system) const;
};
// of equal size. The number of blocks is set to the default number of
// threads to be used, which by default is set to the number of
// processors found in your computer at startup of the program:
- const unsigned int n_threads = multithread_info.n_threads();
- std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
- thread_ranges
- = Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
- dof_handler.end (),
- n_threads);
// These ranges are then assigned to a number of threads which we create
// next. Each will assemble the local cell matrices on the assigned
// cells, and fill the matrix object with it. Since there is need for
// synchronization when filling the same matrix from different threads,
// we need a mutex here:
- Threads::Mutex mutex;
- Threads::ThreadGroup<> threads;
- for (unsigned int thread=0; thread<n_threads; ++thread)
- threads += Threads::new_thread (&Solver<dim>::assemble_matrix,
- *this,
- linear_system,
- thread_ranges[thread].first,
- thread_ranges[thread].second,
- mutex);
+
+ Assembler::Scratch scratch;
+ Assembler::CopyData copy_data;
+ WorkStream::run(dof_handler.begin_active(),dof_handler.end(),
+ std_cxx1x::bind(&Solver<dim>::assemble_matrix,this,std_cxx1x::_1,std_cxx1x::_2,std_cxx1x::_3),
+ std_cxx1x::bind(&Solver<dim>::copy_local_to_global,this,std_cxx1x::_1,std_cxx1x::ref(linear_system)),
+ scratch,copy_data);
// While the new threads assemble the system matrix, we can already
// compute the right hand side vector in the main thread, and condense
// If this is done, wait for the matrix assembling threads, and condense
// the constraints in the matrix as well:
- threads.join_all ();
linear_system.hanging_node_constraints.condense (linear_system.matrix);
// Now that we have the linear system, we can also treat boundary
// on it any more, except for one point below.
template <int dim>
void
- Solver<dim>::assemble_matrix (LinearSystem &linear_system,
- const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
- const typename DoFHandler<dim>::active_cell_iterator &end_cell,
- Threads::Mutex &mutex) const
+ Solver<dim>::assemble_matrix (const typename DoFHandler<dim>::active_cell_iterator &cell,
+ Assembler::Scratch &scratch,
+ Assembler::CopyData ©_data) const
{
FEValues<dim> fe_values (*fe, *quadrature,
update_gradients | update_JxW_values);
- const unsigned int dofs_per_cell = fe->dofs_per_cell;
+ copy_data.dofs_per_cell = fe->dofs_per_cell;
const unsigned int n_q_points = quadrature->size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ copy_data.cell_matrix = FullMatrix<double> (copy_data.dofs_per_cell, copy_data.dofs_per_cell);
- std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+ copy_data.local_dof_indices.resize(copy_data.dofs_per_cell);
- for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
- cell!=end_cell; ++cell)
- {
- cell_matrix = 0;
+ fe_values.reinit (cell);
- fe_values.reinit (cell);
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ for (unsigned int i=0; i<copy_data.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<copy_data.dofs_per_cell; ++j)
+ copy_data.cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
- fe_values.shape_grad(j,q_point) *
- fe_values.JxW(q_point));
+ cell->get_dof_indices (copy_data.local_dof_indices);
+ }
- cell->get_dof_indices (local_dof_indices);
+ template <int dim>
+ void
+ Solver<dim>::copy_local_to_global(Assembler::CopyData const ©_data,
+ LinearSystem &linear_system) const
+ {
// In the step-9 program, we have shown that you have to use the
// mutex to lock the matrix when copying the elements from the local
// to the global matrix. This was necessary to avoid that two
// whether the operation completed successfully or not, whether the
// exit path was something we implemented willfully or whether the
// function was exited by an exception that we did not foresee.
- //
- // deal.II implements the scoped locking pattern in the
- // Treads::Mutex::ScopedLock class: it takes the mutex in the
- // constructor and locks it; in its destructor, it unlocks it
- // again. So here is how it is used:
- Threads::Mutex::ScopedLock lock (mutex);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- linear_system.matrix.add (local_dof_indices[i],
- local_dof_indices[j],
- cell_matrix(i,j));
- // Here, at the brace, the current scope ends, so the
- // <code>lock</code> variable goes out of existence and its
- // destructor the mutex is unlocked.
- };
+ for (unsigned int i=0; i<copy_data.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<copy_data.dofs_per_cell; ++j)
+ linear_system.matrix.add (copy_data.local_dof_indices[i],
+ copy_data.local_dof_indices[j],
+ copy_data.cell_matrix(i,j));
}
{
hanging_node_constraints.clear ();
- void (*mhnc_p) (const DoFHandler<dim> &,
- ConstraintMatrix &)
- = &DoFTools::make_hanging_node_constraints;
-
- Threads::Thread<>
- mhnc_thread = Threads::new_thread (mhnc_p,
- dof_handler,
- hanging_node_constraints);
+#ifdef DEAL_II_WITH_THREADS
+ tbb::task_scheduler_init init;
+ // Create an empty task to be the parent of the two tasks that we need.
+ tbb::empty_task* empty_task = new (tbb::task::allocate_root()) tbb::empty_task;
+ // Set the reference count to 3 (number of children+1 because
+ // wati_for_all returns when ref_count is one).
+ empty_task->set_ref_count(3);
+
+ HangingNodeTask* hanging_node_task =
+ new (empty_task->allocate_child()) HangingNodeTask(dof_handler,hanging_node_constraints);
+ SparsityPatternTask* sparsity_pattern_task =
+ new (empty_task->allocate_child()) SparsityPatternTask(dof_handler,sparsity_pattern);
+
+ // Spawn the two tasks
+ empty_task->spawn(*hanging_node_task);
+ empty_task->spawn(*sparsity_pattern_task);
+
+ // Wait for children to finish
+ empty_task->wait_for_all();
+ // empty_task must be destroy manually because it does not return.
+ empty_task->destroy(*empty_task);
+#else
+ DoFTools::make_hanging_node_constraints(dof_handler,hanging_node_constraints);
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
dof_handler.max_couplings_between_dofs());
DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
+#endif
- // Wait until the <code>hanging_node_constraints</code> object is fully
- // set up, then close it and use it to condense the sparsity pattern:
- mhnc_thread.join ();
hanging_node_constraints.close ();
hanging_node_constraints.condense (sparsity_pattern);
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/function.h>
#include <deal.II/base/logstream.h>
-#include <deal.II/base/thread_management.h>
+#include <deal.II/base/work_stream.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/sparse_matrix.h>
#include <numeric>
#include <sstream>
+#ifdef DEAL_II_WITH_THREADS
+# include <tbb/task.h>
+# include <tbb/task_scheduler_init.h>
+#endif
+
// The last step is as in all previous programs:
namespace Step14
{
using namespace dealii;
+ namespace Assembler
+ {
+ struct Scratch
+ {
+ Scratch() {}
+ };
+
+ struct CopyData
+ {
+ CopyData() {}
+
+ unsigned int dofs_per_cell;
+ FullMatrix<double> cell_matrix;
+ std::vector<types::global_dof_index> local_dof_indices;
+ };
+ }
+
// @sect3{Evaluating the solution}
// As mentioned in the introduction, significant parts of the program have
Vector<double> rhs;
};
+#ifdef DEAL_II_WITH_THREADS
+
+ struct HangingNodeTask : public tbb::task
+ {
+ HangingNodeTask (const DoFHandler<dim> &dof_handler,ConstraintMatrix &hanging_node_constraints) :
+ dof_handler(&dof_handler),
+ hanging_node_constraints(& hanging_node_constraints) {}
+
+ tbb::task* execute()
+ {
+ DoFTools::make_hanging_node_constraints(*dof_handler,*hanging_node_constraints);
+
+ return NULL;
+ }
+
+ const DoFHandler<dim>* dof_handler;
+ ConstraintMatrix* hanging_node_constraints;
+ };
+
+ struct SparsityPatternTask : public tbb::task
+ {
+ SparsityPatternTask (const DoFHandler<dim> &dof_handler,SparsityPattern &sparsity_pattern) :
+ dof_handler(&dof_handler),
+ sparsity_pattern(&sparsity_pattern) {}
+
+ tbb::task* execute()
+ {
+ sparsity_pattern->reinit (dof_handler->n_dofs(),
+ dof_handler->n_dofs(),
+ dof_handler->max_couplings_between_dofs());
+ DoFTools::make_sparsity_pattern (*dof_handler, *sparsity_pattern);
+
+ return NULL;
+ }
+
+ const DoFHandler<dim>* dof_handler;
+ SparsityPattern* sparsity_pattern;
+ };
+
+#endif
+
void
assemble_linear_system (LinearSystem &linear_system);
void
- assemble_matrix (LinearSystem &linear_system,
- const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
- const typename DoFHandler<dim>::active_cell_iterator &end_cell,
- Threads::Mutex &mutex) const;
+ assemble_matrix (const typename DoFHandler<dim>::active_cell_iterator &cell,
+ Assembler::Scratch &scratch,
+ Assembler::CopyData ©_data) const;
+
+
+ void
+ copy_local_to_global(Assembler::CopyData const ©_data,
+ LinearSystem &linear_system) const;
};
dof_handler.end (),
n_threads);
- Threads::Mutex mutex;
- Threads::ThreadGroup<> threads;
- for (unsigned int thread=0; thread<n_threads; ++thread)
- threads += Threads::new_thread (&Solver<dim>::assemble_matrix,
- *this,
- linear_system,
- thread_ranges[thread].first,
- thread_ranges[thread].second,
- mutex);
+ Assembler::Scratch scratch;
+ Assembler::CopyData copy_data;
+ WorkStream::run(dof_handler.begin_active(),dof_handler.end(),
+ std_cxx1x::bind(&Solver<dim>::assemble_matrix,this,std_cxx1x::_1,std_cxx1x::_2,std_cxx1x::_3),
+ std_cxx1x::bind(&Solver<dim>::copy_local_to_global,this,std_cxx1x::_1,std_cxx1x::ref(linear_system)),
+ scratch,copy_data);
+
assemble_rhs (linear_system.rhs);
linear_system.hanging_node_constraints.condense (linear_system.rhs);
*boundary_values,
boundary_value_map);
- threads.join_all ();
linear_system.hanging_node_constraints.condense (linear_system.matrix);
MatrixTools::apply_boundary_values (boundary_value_map,
template <int dim>
void
- Solver<dim>::assemble_matrix (LinearSystem &linear_system,
- const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
- const typename DoFHandler<dim>::active_cell_iterator &end_cell,
- Threads::Mutex &mutex) const
+ Solver<dim>::assemble_matrix (const typename DoFHandler<dim>::active_cell_iterator &cell,
+ Assembler::Scratch &scratch,
+ Assembler::CopyData ©_data) const
{
FEValues<dim> fe_values (*fe, *quadrature,
update_gradients | update_JxW_values);
- const unsigned int dofs_per_cell = fe->dofs_per_cell;
+ copy_data.dofs_per_cell = fe->dofs_per_cell;
const unsigned int n_q_points = quadrature->size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ copy_data.cell_matrix = FullMatrix<double> (copy_data.dofs_per_cell, copy_data.dofs_per_cell);
- std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+ copy_data.local_dof_indices.resize(copy_data.dofs_per_cell);
- for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
- cell!=end_cell; ++cell)
- {
- cell_matrix = 0;
+ fe_values.reinit (cell);
- fe_values.reinit (cell);
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ for (unsigned int i=0; i<copy_data.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<copy_data.dofs_per_cell; ++j)
+ copy_data.cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
- fe_values.shape_grad(j,q_point) *
- fe_values.JxW(q_point));
+ cell->get_dof_indices (copy_data.local_dof_indices);
+ }
- cell->get_dof_indices (local_dof_indices);
- Threads::Mutex::ScopedLock lock (mutex);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- linear_system.matrix.add (local_dof_indices[i],
- local_dof_indices[j],
- cell_matrix(i,j));
- }
+
+ template <int dim>
+ void
+ Solver<dim>::copy_local_to_global(Assembler::CopyData const ©_data,
+ LinearSystem &linear_system) const
+ {
+ for (unsigned int i=0; i<copy_data.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<copy_data.dofs_per_cell; ++j)
+ linear_system.matrix.add (copy_data.local_dof_indices[i],
+ copy_data.local_dof_indices[j],
+ copy_data.cell_matrix(i,j));
}
+ // Now for the functions that implement actions in the linear system
+ // class. First, the constructor initializes all data elements to their
+ // correct sizes, and sets up a number of additional data structures, such
+ // as constraints due to hanging nodes. Since setting up the hanging nodes
+ // and finding out about the nonzero elements of the matrix is
+ // independent, we do that in parallel (if the library was configured to
+ // use concurrency, at least; otherwise, the actions are performed
+ // sequentially). Note that we start only one thread, and do the second
+ // action in the main thread. Since only one thread is generated, we don't
+ // use the <code>Threads::ThreadGroup</code> class here, but rather use
+ // the one created thread object directly to wait for this particular
+ // thread's exit.
+ //
+ // Note that taking up the address of the
+ // <code>DoFTools::make_hanging_node_constraints</code> function is a
+ // little tricky, since there are actually three of them, one for each
+ // supported space dimension. Taking addresses of overloaded functions is
+ // somewhat complicated in C++, since the address-of operator
+ // <code>&</code> in that case returns more like a set of values (the
+ // addresses of all functions with that name), and selecting the right one
+ // is then the next step. If the context dictates which one to take (for
+ // example by assigning to a function pointer of known type), then the
+ // compiler can do that by itself, but if this set of pointers shall be
+ // given as the argument to a function that takes a template, the compiler
+ // could choose all without having a preference for one. We therefore have
+ // to make it clear to the compiler which one we would like to have; for
+ // this, we could use a cast, but for more clarity, we assign it to a
+ // temporary <code>mhnc_p</code> (short for <code>pointer to
+ // make_hanging_node_constraints</code>) with the right type, and using
+ // this pointer instead.
template <int dim>
Solver<dim>::LinearSystem::
LinearSystem (const DoFHandler<dim> &dof_handler)
{
hanging_node_constraints.clear ();
- void (*mhnc_p) (const DoFHandler<dim> &,
- ConstraintMatrix &)
- = &DoFTools::make_hanging_node_constraints;
-
- Threads::Thread<>
- mhnc_thread = Threads::new_thread (mhnc_p,
- dof_handler,
- hanging_node_constraints);
+#ifdef DEAL_II_WITH_THREADS
+ tbb::task_scheduler_init init;
+ // Create an empty task to be the parent of the two tasks that we need.
+ tbb::empty_task* empty_task = new (tbb::task::allocate_root()) tbb::empty_task;
+ // Set the reference count to 3 (number of children+1)
+ empty_task->set_ref_count(3);
+
+ HangingNodeTask* hanging_node_task =
+ new (empty_task->allocate_child()) HangingNodeTask(dof_handler,hanging_node_constraints);
+ SparsityPatternTask* sparsity_pattern_task =
+ new (empty_task->allocate_child()) SparsityPatternTask(dof_handler,sparsity_pattern);
+
+ empty_task->spawn(*hanging_node_task);
+ empty_task->spawn(*sparsity_pattern_task);
+
+ // Wait for children to finish
+ empty_task->wait_for_all();
+ empty_task->destroy(*empty_task);
+#else
+ DoFTools::make_hanging_node_constraints(dof_handler,hanging_node_constraints);
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
dof_handler.max_couplings_between_dofs());
DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
+#endif
- mhnc_thread.join ();
hanging_node_constraints.close ();
hanging_node_constraints.condense (sparsity_pattern);
}
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (control.last_step(),
- control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (control.last_step(),
+ control.last_value()));
// otherwise exit as normal
}
}
* to allow using the standard library classes instead of the corresponding
* BOOST classes.
*/
-#cmakedefine DEAL_II_CAN_USE_CXX11
-#ifdef DEAL_II_CAN_USE_CXX11
+#cmakedefine DEAL_II_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
+# define DEAL_II_CAN_USE_CXX11
# define DEAL_II_CAN_USE_CXX1X
#endif
+/* Defined if C++11 is enabled and the standard library supports
+ * template<typename T> std::is_trivially_copyable<T>
+ */
+#cmakedefine DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
+
/* Defined if isnan is available */
#cmakedefine HAVE_ISNAN
/****************************************
- * Configured in check_2_compiler_bugs: *
+ * Configured in check_3_compiler_bugs: *
****************************************/
/* Defined if we have to work around a bug with some compilers that will not
*/
#cmakedefine DEAL_II_BOOST_BIND_COMPILER_BUG
+/* Defined if the compiler incorrectly deduces a constexpr as not being a
+ * constant integral expression under certain optimization (notably
+ * gcc-4.8.1 on Windows and Mac)
+ */
+#cmakedefine DEAL_II_CONSTEXPR_BUG
+
/*****************************************
* Configured in configure_arpack.cmake: *
{
/**
- * Conditionally abort the program. Depending on whether
- * disable_abort_on_exception was called, this function either aborts
- * the program flow by printing the error message provided by @p exc
- * and calling <tt>std::abort()</tt>, or throws @p exc instead.
+ * Conditionally abort the program.
+ *
+ * Depending on whether disable_abort_on_exception was called, this
+ * function either aborts the program flow by printing the error
+ * message provided by @p exc and calling <tt>std::abort()</tt>, or
+ * throws @p exc instead (if @p nothrow is set to <tt>false</tt>).
+ *
+ * If the boolean @p nothrow is set to true and
+ * disable_abort_on_exception was called, the exception type is just
+ * printed to deallog and program flow continues. This is useful if
+ * throwing an exception is prohibited (e.g. in a destructor with
+ * <tt>noexcept(true)</tt> or <tt>throw()</tt>).
*/
- void abort (const ExceptionBase &exc);
+ void abort (const ExceptionBase &exc, bool nothrow = false);
/**
- * This routine does the main work for the exception generation
- * mechanism used in the <tt>Assert</tt> macro.
- *
- * @ref ExceptionBase
+ * An enum describing how to treat an exception in issue_error
*/
- template <class exc>
- void issue_error_abort (const char *file,
- int line,
- const char *function,
- const char *cond,
- const char *exc_name,
- exc e)
+ enum ExceptionHandling
{
- // Fill the fields of the exception object
- e.set_fields (file, line, function, cond, exc_name);
-
- dealii::deal_II_exceptions::internals::abort(e);
- }
+ abort_on_exception,
+ throw_on_exception,
+ abort_nothrow_on_exception
+ };
/**
* This routine does the main work for the exception generation
- * mechanism used in the <tt>AssertThrow</tt> macro.
+ * mechanism used in the <tt>Assert</tt> macro.
*
* @ref ExceptionBase
*/
template <class exc>
- void issue_error (const char *file,
+ void issue_error (ExceptionHandling handling,
+ const char *file,
int line,
const char *function,
const char *cond,
{
// Fill the fields of the exception object
e.set_fields (file, line, function, cond, exc_name);
- throw e;
+
+ switch(handling)
+ {
+ case abort_on_exception:
+ dealii::deal_II_exceptions::internals::abort(e);
+ break;
+ case abort_nothrow_on_exception:
+ dealii::deal_II_exceptions::internals::abort(e, /*nothrow =*/ true);
+ break;
+ case throw_on_exception:
+ throw e;
+ }
}
} /*namespace internals*/
* @author Wolfgang Bangerth, 1997, 1998, Matthias Maier, 2013
*/
#ifdef DEBUG
-#define Assert(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error_abort (__FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+#define Assert(cond, exc) \
+{ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals:: \
+ issue_error(::dealii::deal_II_exceptions::internals::abort_on_exception,\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
+#else
+#define Assert(cond, exc) \
+{}
+#endif
+
+
+/**
+ * A variant of the <tt>Assert</tt> macro above that exhibits the same
+ * runtime behaviour as long as disable_abort_on_exception was not called.
+ *
+ * However, if disable_abort_on_exception was called, this macro merely
+ * prints the exception that would be thrown to deallog and continues
+ * normally without throwing an exception.
+ *
+ * See the <tt>ExceptionBase</tt> class for more information.
+ *
+ * @ingroup Exceptions
+ * @author Wolfgang Bangerth, 1997, 1998, Matthias Maier, 2013
+ */
+#ifdef DEBUG
+#define AssertNothrow(cond, exc) \
+{ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals:: \
+ issue_error( \
+ ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
#else
-#define Assert(cond, exc) \
- { }
+#define AssertNothrow(cond, exc) \
+{}
#endif
* @author Wolfgang Bangerth, 1997, 1998, Matthias Maier, 2013
*/
#ifdef HAVE_BUILTIN_EXPECT
-#define AssertThrow(cond, exc) \
- { \
- if (__builtin_expect(!(cond), false)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error (__FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
-
+#define AssertThrow(cond, exc) \
+{ \
+ if (__builtin_expect(!(cond), false)) \
+ ::dealii::deal_II_exceptions::internals:: \
+ issue_error(::dealii::deal_II_exceptions::internals::throw_on_exception,\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
#else /*ifdef HAVE_BUILTIN_EXPECT*/
-#define AssertThrow(cond, exc) \
- { \
- if (!(cond)) \
- ::dealii::deal_II_exceptions::internals:: \
- issue_error (__FILE__, \
- __LINE__, \
- __PRETTY_FUNCTION__, #cond, #exc, exc); \
- }
+#define AssertThrow(cond, exc) \
+{ \
+ if (!(cond)) \
+ ::dealii::deal_II_exceptions::internals:: \
+ issue_error(::dealii::deal_II_exceptions::internals::throw_on_exception,\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \
+}
#endif /*ifdef HAVE_BUILTIN_EXPECT*/
* in the glossary).
*/
template <int spacedim>
- static
- void
+ static void
alternating_form_at_vertices
- (const Point<spacedim> (&vertices)[vertices_per_cell],
- Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell]);
+#ifndef DEAL_II_CONSTEXPR_BUG
+ (const Point<spacedim> (&vertices)[vertices_per_cell],
+ Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell]);
+#else
+ (const Point<spacedim> *vertices,
+ Tensor<spacedim-dim,spacedim> *forms);
+#endif
/**
* For each face of the reference
std::ios::fmtflags flags(const std::ios::fmtflags f);
- /**
- * Output a constant something through this stream.
- */
- template <typename T>
- LogStream &operator << (const T &t);
-
-
/**
* Output double precision numbers through this stream.
*
* for every thread that sends log messages.
*/
Threads::ThreadLocalStorage<std_cxx1x::shared_ptr<std::ostringstream> > outstreams;
+
+ template <typename T> friend LogStream &operator << (LogStream & log, const T &t);
};
/* ----------------------------- Inline functions and templates ---------------- */
+/**
+ * Output a constant something through LogStream:
+ *
+ * @note We declare this operator as a non-member function so that it is
+ * possible to overload it with more specialized templated versions under
+ * C++11 overload resolution rules
+ */
+template <typename T>
+inline
+LogStream & operator<< (LogStream &log, const T &t)
+{
+ // print to the internal stringstream
+ log.get_stream() << t;
+ return log;
+}
+
+
inline
std::ostringstream &
LogStream::get_stream()
}
-template <class T>
-inline
-LogStream &
-LogStream::operator<< (const T &t)
-{
- // print to the internal stringstream
- get_stream() << t;
-
- return *this;
-}
-
inline
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <array>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <functional>
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <condition_variable>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <functional>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <mutex>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <memory>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <thread>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <tuple>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#ifdef DEAL_II_CAN_USE_CXX11
+#ifdef DEAL_II_USE_CXX11
# include <type_traits>
DEAL_II_NAMESPACE_OPEN
#include <vector>
-
DEAL_II_NAMESPACE_OPEN
/**
void *&
TriaObjects<G>::user_pointer (const unsigned int i)
{
-#ifdef DEBUG
Assert(user_data_type == data_unknown || user_data_type == data_pointer,
ExcPointerIndexClash());
user_data_type = data_pointer;
-#endif
+
Assert(i<user_data.size(), ExcIndexRange(i,0,user_data.size()));
return user_data[i].p;
}
const void *
TriaObjects<G>::user_pointer (const unsigned int i) const
{
-#ifdef DEBUG
Assert(user_data_type == data_unknown || user_data_type == data_pointer,
ExcPointerIndexClash());
user_data_type = data_pointer;
-#endif
+
Assert(i<user_data.size(), ExcIndexRange(i,0,user_data.size()));
return user_data[i].p;
}
unsigned int &
TriaObjects<G>::user_index (const unsigned int i)
{
-#ifdef DEBUG
Assert(user_data_type == data_unknown || user_data_type == data_index,
ExcPointerIndexClash());
user_data_type = data_index;
-#endif
+
Assert(i<user_data.size(), ExcIndexRange(i,0,user_data.size()));
return user_data[i].i;
}
inline
unsigned int TriaObjects<G>::user_index (const unsigned int i) const
{
-#ifdef DEBUG
Assert(user_data_type == data_unknown || user_data_type == data_index,
ExcPointerIndexClash());
user_data_type = data_index;
-#endif
+
Assert(i<user_data.size(), ExcIndexRange(i,0,user_data.size()));
return user_data[i].i;
}
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
*/
void update_ghost_values () const;
+ /**
+ * This method zeros the entries on ghost dofs, but does not touch
+ * locally owned DoFs.
+ *
+ * After calling this method, read access to ghost elements of the
+ * vector is forbidden and an exception is thrown. Only write access to
+ * ghost elements is allowed in this state.
+ */
+ void zero_out_ghosts ();
+
+ /**
+ * Returns if this Vector contains ghost elements.
+ */
+ bool has_ghost_elements() const;
+
/**
* Return whether the vector contains only elements with value
* zero. This function is mainly for internal consistency checks and
void
BlockVector<Number>::compress (::dealii::VectorOperation::values operation)
{
+ // start all requests for all blocks before finishing the transfers as
+ // this saves repeated synchronizations
for (unsigned int block=0; block<this->n_blocks(); ++block)
- this->block(block).compress(operation);
+ this->block(block).compress_start(block*10 + 8273, operation);
+ for (unsigned int block=0; block<this->n_blocks(); ++block)
+ this->block(block).compress_finish(operation);
}
BlockVector<Number>::update_ghost_values () const
{
for (unsigned int block=0; block<this->n_blocks(); ++block)
- this->block(block).update_ghost_values();
+ this->block(block).update_ghost_values_start(block*10 + 9923);
+ for (unsigned int block=0; block<this->n_blocks(); ++block)
+ this->block(block).update_ghost_values_finish();
+ }
+
+
+
+ template <typename Number>
+ inline
+ void
+ BlockVector<Number>::zero_out_ghosts ()
+ {
+ for (unsigned int block=0; block<this->n_blocks(); ++block)
+ this->block(block).zero_out_ghosts();
+ }
+
+
+
+ template <typename Number>
+ inline
+ bool
+ BlockVector<Number>::has_ghost_elements () const
+ {
+ bool has_ghost_elements = false;
+ for (unsigned int block=0; block<this->n_blocks(); ++block)
+ if (this->block(block).has_ghost_elements() == true)
+ has_ghost_elements = true;
+ return has_ghost_elements;
}
* - Of course, reduction operations (like norms) make use of collective
* all-to-all MPI communications.
*
+ * This vector can take two different states with respect to ghost
+ * elements:
+ * - After creation and whenever zero_out_ghosts() is called (or
+ * <code>operator = (0.)</code>), the vector does only allow writing
+ * into ghost elements but not reading from ghost elements.
+ * - After a call to update_ghost_values(), the vector does not allow
+ * writing into ghost elements but only reading from them. This is in
+ * order to avoid undesired ghost data artifacts when calling compress()
+ * after modifying some vector entries.
+ * The current statues of the ghost entries (read mode or write mode) can
+ * be queried by the method has_ghost_elements(), which returns
+ * <code>true</code> exactly when ghost elements have been updated and
+ * <code>false</code> otherwise, irrespective of the actual number of
+ * ghost entries in the vector layout (for that information, use
+ * n_ghost_entries() instead).
+ *
* @author Katharina Kormann, Martin Kronbichler, 2010, 2011
*/
template <typename Number>
* ghost data is changed. This is needed to allow functions with a @p
* const vector to perform the data exchange without creating
* temporaries.
+ *
+ * After calling this method, write access to ghost elements of the
+ * vector is forbidden and an exception is thrown. Only read access to
+ * ghost elements is allowed in this state. Note that all subsequent
+ * operations on this vector, like global vector addition, etc., will
+ * also update the ghost values by a call to this method after the
+ * operation. However, global reduction operations like norms or the
+ * inner product will always ignore ghost elements in order to avoid
+ * counting the ghost data more than once. To allow writing to ghost
+ * elements again, call zero_out_ghosts().
*/
void update_ghost_values () const;
* the communication to finish. Once it is finished, add or set the data
* (depending on the flag operation) to the respective positions in the
* owning processor, and clear the contents in the ghost data
- * fields. The meaning of this argument is the same as in compress().
+ * fields. The meaning of this argument is the same as in
+ * compress().
+ *
+ * This function should be called exactly once per vector after calling
+ * compress_start, otherwise the result is undefined. In particular, it
+ * is not well-defined to call compress_start on the same vector again
+ * before compress_finished has been called. However, there is no
+ * warning to prevent this situation.
*
* Must follow a call to the @p compress_start function.
*/
/**
* This method zeros the entries on ghost dofs, but does not touch
* locally owned DoFs.
+ *
+ * After calling this method, read access to ghost elements of the
+ * vector is forbidden and an exception is thrown. Only write access to
+ * ghost elements is allowed in this state.
*/
void zero_out_ghosts ();
+ /**
+ * Returns whether the vector currently is in a state where ghost values
+ * can be read or not. This is the same functionality as other parallel
+ * vectors have. If this method returns false, this only means that
+ * read-access to ghost elements is prohibited whereas write access is
+ * still possible (to those entries specified as ghosts during
+ * initialization), not that there are no ghost elements at all.
+ */
+ bool has_ghost_elements() const;
+
/**
* Return whether the vector contains only elements with value
* zero. This function is mainly for internal consistency checks and
*/
mutable Number *import_data;
+ /**
+ * Stores whether the vector currently allows for reading ghost elements
+ * or not. Note that this is to ensure consistent ghost data and does
+ * not indicate whether the vector actually can store ghost elements. In
+ * particular, when assembling a vector we do not allow reading
+ * elements, only writing them.
+ */
+ mutable bool vector_is_ghosted;
+
/**
* Provide this class with all functionality of ::dealii::Vector by
* creating a VectorView object.
allocated_size (0),
val (0),
import_data (0),
+ vector_is_ghosted (false),
vector_view (0, static_cast<Number *>(0))
{}
allocated_size (0),
val (0),
import_data (0),
+ vector_is_ghosted (false),
vector_view (0, static_cast<Number *>(0))
{
reinit (v, true);
allocated_size (0),
val (0),
import_data (0),
+ vector_is_ghosted (false),
vector_view (0, static_cast<Number *>(0))
{
reinit (local_range, ghost_indices, communicator);
template <typename Number>
inline
Vector<Number>::Vector (const IndexSet &local_range,
- const MPI_Comm communicator)
+ const MPI_Comm communicator)
:
allocated_size (0),
val (0),
import_data (0),
+ vector_is_ghosted (false),
vector_view (0, static_cast<Number *>(0))
{
IndexSet ghost_indices(local_range.size());
allocated_size (0),
val (0),
import_data (0),
+ vector_is_ghosted (false),
vector_view (0, static_cast<Number *>(0))
{
reinit (size, false);
allocated_size (0),
val (0),
import_data (0),
+ vector_is_ghosted (false),
vector_view (0, static_cast<Number *>(0))
{
reinit (partitioner);
{
Assert (c.partitioner.get() != 0, ExcNotInitialized());
- // check whether the two vectors use the same
- // parallel partitioner. if not, check if all
- // local ranges are the same (that way, we can
- // exchange data between different parallel
- // layouts)
+ // we update ghost values whenever one of the input or output vector
+ // already held ghost values or when we import data from a vector with
+ // the same local range but different ghost layout
+ bool must_update_ghost_values = true;
+
+ // check whether the two vectors use the same parallel partitioner. if
+ // not, check if all local ranges are the same (that way, we can
+ // exchange data between different parallel layouts)
if (partitioner.get() == 0)
reinit (c, true);
else if (partitioner.get() != c.partitioner.get())
local_ranges_different_loc)
reinit (c, true);
}
+ else
+ must_update_ghost_values = vector_is_ghosted || c.vector_is_ghosted;
+
vector_view = c.vector_view;
- update_ghost_values();
+ if (must_update_ghost_values)
+ update_ghost_values();
return *this;
}
reinit (c, true);
}
vector_view.reinit (partitioner->local_size(), val);
- if (partitioner->local_size() > 0)
+
+ if (partitioner->local_size())
vector_view.equ (1., c.vector_view);
+
+ if (vector_is_ghosted || c.vector_is_ghosted)
+ update_ghost_values();
return *this;
}
std::fill_n (&val[partitioner->local_size()],
partitioner->n_ghost_indices(),
Number());
+ vector_is_ghosted = false;
+ }
+
+
+
+ template <typename Number>
+ inline
+ bool
+ Vector<Number>::has_ghost_elements () const
+ {
+ return vector_is_ghosted;
}
Vector<Number>::mean_value_local () const
{
Assert (partitioner->size()!=0, ExcEmptyObject());
- return (partitioner->local_size()>0 ?
+ return (partitioner->local_size() ?
vector_view.mean_value()
: Number());
}
typename Vector<Number>::real_type
Vector<Number>::l1_norm_local () const
{
- return partitioner->local_size()>0 ? vector_view.l1_norm() : real_type();
+ return partitioner->local_size() ? vector_view.l1_norm() : real_type();
}
typename Vector<Number>::real_type
Vector<Number>::lp_norm_local (const real_type p) const
{
- return partitioner->local_size()>0 ? vector_view.lp_norm(p) : real_type();
+ return partitioner->local_size() ? vector_view.lp_norm(p) : real_type();
}
typename Vector<Number>::real_type
Vector<Number>::linfty_norm_local () const
{
- return partitioner->local_size()>0 ? vector_view.linfty_norm() : real_type();
+ return partitioner->local_size() ? vector_view.linfty_norm() : real_type();
}
{
IndexSet is (size());
- const std::pair<types::global_dof_index,types::global_dof_index> x = local_range();
- is.add_range (x.first, x.second);
+ is.add_range (local_range().first, local_range().second);
return is;
}
Number
Vector<Number>::operator() (const size_type global_index) const
{
+ // do not allow reading a vector which is not in ghost mode
+ Assert (in_local_range (global_index) || vector_is_ghosted == true,
+ ExcMessage("You tried to read a ghost element of this vector, "
+ "but it has not imported its ghost values."));
return val[partitioner->global_to_local(global_index)];
}
Number &
Vector<Number>::operator() (const size_type global_index)
{
+ // we would like to prevent reading ghosts from a vector that does not
+ // have them imported, but this is not possible because we might be in a
+ // part of the code where the vector has enabled ghosts but is non-const
+ // (then, the compiler picks this method according to the C++ rule book
+ // even if a human would pick the const method when this subsequent use
+ // is just a read)
return val[partitioner->global_to_local (global_index)];
}
const ForwardIterator indices_end,
OutputIterator values_begin) const
{
- while (indices_begin != indices_end) {
- *values_begin = operator()(*indices_begin);
- indices_begin++; values_begin++;
- }
+ while (indices_begin != indices_end)
+ {
+ *values_begin = operator()(*indices_begin);
+ indices_begin++; values_begin++;
+ }
}
AssertIndexRange (local_index,
partitioner->local_size()+
partitioner->n_ghost_indices());
+ // do not allow reading a vector which is not in ghost mode
+ Assert (local_index < local_size() || vector_is_ghosted == true,
+ ExcMessage("You tried to read a ghost element of this vector, "
+ "but it has not imported its ghost values."));
return val[local_index];
}
Vector<Number> &
Vector<Number>::operator = (const Number s)
{
- // if we call Vector::operator=0, we want to
- // zero out all the entries plus ghosts.
+ // if we call Vector::operator=0, we want to zero out all the entries
+ // plus ghosts.
if (partitioner->local_size() > 0)
vector_view.dealii::template Vector<Number>::operator= (s);
if (s==Number())
Vector<Number>::operator += (const Vector<Number> &v)
{
AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
+
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
if (local_size()>0)
vector_view += v.vector_view;
+
+ if (vector_is_ghosted)
+ update_ghost_values();
+
return *this;
}
Vector<Number>::operator -= (const Vector<Number> &v)
{
AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
+
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
if (local_size()>0)
vector_view -= v.vector_view;
+
+ if (vector_is_ghosted)
+ update_ghost_values();
+
return *this;
}
void
Vector<Number>::add (const size_type n_indices,
const size_type *indices,
- const OtherNumber *values)
+ const OtherNumber *values)
{
for (size_type i=0; i<n_indices; ++i)
{
void
Vector<Number>::add (const Number a)
{
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.add (a);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
void
Vector<Number>::add (const Vector<Number> &v)
{
- AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.add (v.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
Vector<Number>::add (const Number a,
const Vector<Number> &v)
{
- AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.add (a, v.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
const Number b,
const Vector<Number> &w)
{
- AssertDimension (local_size(), v.local_size());
- AssertDimension (local_size(), w.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.add (a, v.vector_view, b, w.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
Vector<Number>::sadd (const Number x,
const Vector<Number> &v)
{
- AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.sadd (x, v.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
const Number a,
const Vector<Number> &v)
{
- AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.sadd (x, a, v.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
const Number b,
const Vector<Number> &w)
{
- AssertDimension (local_size(), v.local_size());
- AssertDimension (local_size(), w.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.sadd (x, a, v.vector_view, b, w.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
const Number c,
const Vector<Number> &x)
{
- AssertDimension (local_size(), v.local_size());
- AssertDimension (local_size(), w.local_size());
- AssertDimension (local_size(), x.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.sadd (s, a, v.vector_view, b, w.vector_view,
c, x.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
void
Vector<Number>::scale (const Number factor)
{
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
- vector_view *= factor;
+ operator *=(factor);
}
Vector<Number> &
Vector<Number>::operator *= (const Number factor)
{
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
- vector_view.operator *= (factor);
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
+ vector_view *= factor;
+
+ if (vector_is_ghosted)
+ update_ghost_values();
+
return *this;
}
Vector<Number> &
Vector<Number>::operator /= (const Number factor)
{
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
- vector_view.operator /= (factor);
+ operator *= (1./factor);
return *this;
}
void
Vector<Number>::scale (const Vector<Number> &scaling_factors)
{
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.scale (scaling_factors.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
void
Vector<Number>::scale (const Vector<Number2> &scaling_factors)
{
- vector_view.template scale<Number2> (scaling_factors.vector_view);
+ if (local_size())
+ vector_view.template scale<Number2> (scaling_factors.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
Vector<Number>::equ (const Number a,
const Vector<Number> &v)
{
- AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.equ (a, v.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
Vector<Number>::equ (const Number a,
const Vector<Number2> &v)
{
- AssertDimension (local_size(), v.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.equ (a, v.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
const Number b,
const Vector<Number> &w)
{
- AssertDimension (local_size(), v.local_size());
- AssertDimension (local_size(), w.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.equ (a, v.vector_view, b, w.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
const Number c,
const Vector<Number> &x)
{
- AssertDimension (local_size(), v.local_size());
- AssertDimension (local_size(), w.local_size());
- AssertDimension (local_size(), w.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.equ (a, v.vector_view, b, w.vector_view,
c, x.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
Vector<Number>::ratio (const Vector<Number> &a,
const Vector<Number> &b)
{
- AssertDimension (local_size(), a.local_size());
- AssertDimension (local_size(), b.local_size());
- // dealii::Vector does not allow empty fields
- // but this might happen on some processors
- // for parallel implementation
- if (local_size()>0)
+ // dealii::Vector does not allow empty fields but this might happen on
+ // some processors for parallel implementation
+ if (local_size())
vector_view.ratio (a.vector_view, b.vector_view);
+
+ if (vector_is_ghosted)
+ update_ghost_values();
}
// set entries to zero if so requested
if (fast == false)
this->operator = (Number());
+
+ vector_is_ghosted = false;
}
// call these methods and hence do not need to have the storage.
import_data = 0;
}
+
+ vector_is_ghosted = false;
}
// call these methods and hence do not need to have the storage.
import_data = 0;
}
+
+ vector_is_ghosted = false;
}
vector_view = c.vector_view;
if (call_update_ghost_values == true)
update_ghost_values();
+ else
+ vector_is_ghosted = false;
}
Vector<Number>::compress_start (const unsigned int counter,
::dealii::VectorOperation::values operation)
{
-#ifdef DEAL_II_WITH_MPI
+ Assert (vector_is_ghosted == false,
+ ExcMessage ("Cannot call compress() on a ghosted vector"));
+#ifdef DEAL_II_WITH_MPI
// nothing to do for insert (only need to zero ghost entries in
- // compress_finish(). in debug mode we still want to check consistency
+ // compress_finish()). in debug mode we want to check consistency
// of the inserted data, therefore the communication is still
// initialized. Having different code in debug and optimized mode is
// somewhat dangerous, but it really saves communication so it seems
const size_type n_import_targets = part.import_targets().size();
const size_type n_ghost_targets = part.ghost_targets().size();
- // Need to send and receive the data. Use
- // non-blocking communication, where it is
- // generally less overhead to first initiate
- // the receive and then actually send the data
+ // Need to send and receive the data. Use non-blocking communication,
+ // where it is generally less overhead to first initiate the receive and
+ // then actually send the data
if (compress_requests.size() == 0)
{
- // set channels in different range from
- // update_ghost_values channels
+ // set channels in different range from update_ghost_values channels
const unsigned int channel = counter + 400;
unsigned int current_index_start = 0;
compress_requests.resize (n_import_targets + n_ghost_targets);
- // allocate import_data in case it is not set
- // up yet
+ // allocate import_data in case it is not set up yet
if (import_data == 0)
import_data = new Number[part.n_import_indices()];
for (size_type i=0; i<n_import_targets; i++)
compress_requests.size());
if (compress_requests.size() > 0)
{
- int ierr;
- ierr = MPI_Startall(compress_requests.size(),&compress_requests[0]);
+ int ierr = MPI_Startall(compress_requests.size(),&compress_requests[0]);
Assert (ierr == MPI_SUCCESS, ExcInternalError());
}
(void)counter;
(void)operation;
#endif
-
}
const Utilities::MPI::Partitioner &part = *partitioner;
- // nothing to do when we neither have import
- // nor ghost indices.
+ // nothing to do when we neither have import nor ghost indices.
if (part.n_ghost_indices()==0 && part.n_import_indices()==0)
return;
// first wait for the receive to complete
if (compress_requests.size() > 0 && n_import_targets > 0)
{
- int ierr;
- ierr = MPI_Waitall (n_import_targets, &compress_requests[0],
- MPI_STATUSES_IGNORE);
+ int ierr = MPI_Waitall (n_import_targets, &compress_requests[0],
+ MPI_STATUSES_IGNORE);
Assert (ierr == MPI_SUCCESS, ExcInternalError());
Number *read_position = import_data;
if (compress_requests.size() > 0 && n_ghost_targets > 0)
{
- int ierr;
- ierr = MPI_Waitall (n_ghost_targets,
- &compress_requests[n_import_targets],
- MPI_STATUSES_IGNORE);
+ int ierr = MPI_Waitall (n_ghost_targets,
+ &compress_requests[n_import_targets],
+ MPI_STATUSES_IGNORE);
Assert (ierr == MPI_SUCCESS, ExcInternalError());
}
else
#ifdef DEAL_II_WITH_MPI
const Utilities::MPI::Partitioner &part = *partitioner;
- // nothing to do when we neither have import
- // nor ghost indices.
+ // nothing to do when we neither have import nor ghost indices.
if (part.n_ghost_indices()==0 && part.n_import_indices()==0)
return;
const size_type n_import_targets = part.import_targets().size();
const size_type n_ghost_targets = part.ghost_targets().size();
- // Need to send and receive the data. Use
- // non-blocking communication, where it is
- // generally less overhead to first initiate
- // the receive and then actually send the data
+ // Need to send and receive the data. Use non-blocking communication,
+ // where it is generally less overhead to first initiate the receive and
+ // then actually send the data
if (update_ghost_values_requests.size() == 0)
{
Assert (part.local_size() == vector_view.size(),
update_ghost_values_requests.resize (n_import_targets+n_ghost_targets);
for (size_type i=0; i<n_ghost_targets; i++)
{
- // allow writing into ghost indices even
- // though we are in a const function
+ // allow writing into ghost indices even though we are in a
+ // const function
MPI_Recv_init (const_cast<Number *>(&val[current_index_start]),
part.ghost_targets()[i].second*sizeof(Number),
MPI_BYTE,
AssertDimension (current_index_start,
part.local_size()+part.n_ghost_indices());
- // allocate import_data in case it is not set
- // up yet
+ // allocate import_data in case it is not set up yet
if (import_data == 0 && part.n_import_indices() > 0)
import_data = new Number[part.n_import_indices()];
current_index_start = 0;
AssertDimension (current_index_start, part.n_import_indices());
}
- // copy the data that is actually to be send
- // to the import_data field
+ // copy the data that is actually to be send to the import_data field
if (part.n_import_indices() > 0)
{
Assert (import_data != 0, ExcInternalError());
update_ghost_values_requests.size());
if (update_ghost_values_requests.size() > 0)
{
- int ierr;
- ierr = MPI_Startall(update_ghost_values_requests.size(),
- &update_ghost_values_requests[0]);
+ int ierr = MPI_Startall(update_ghost_values_requests.size(),
+ &update_ghost_values_requests[0]);
Assert (ierr == MPI_SUCCESS, ExcInternalError());
}
#else
Vector<Number>::update_ghost_values_finish () const
{
#ifdef DEAL_II_WITH_MPI
- // wait for both sends and receives to
- // complete, even though only receives are
- // really necessary. this gives (much) better
- // performance
+ // wait for both sends and receives to complete, even though only
+ // receives are really necessary. this gives (much) better performance
AssertDimension (partitioner->ghost_targets().size() +
partitioner->import_targets().size(),
update_ghost_values_requests.size());
// make this function thread safe
Threads::Mutex::ScopedLock lock (mutex);
- int ierr;
- ierr = MPI_Waitall (update_ghost_values_requests.size(),
- &update_ghost_values_requests[0],
- MPI_STATUSES_IGNORE);
+ int ierr = MPI_Waitall (update_ghost_values_requests.size(),
+ &update_ghost_values_requests[0],
+ MPI_STATUSES_IGNORE);
Assert (ierr == MPI_SUCCESS, ExcInternalError());
}
#endif
+ vector_is_ghosted = true;
}
Vector<Number>::swap (Vector<Number> &v)
{
#ifdef DEAL_II_WITH_MPI
- // introduce a Barrier over all MPI processes
- // to make sure that the compress request are
- // no longer used before changing the owner
- if (v.partitioner->n_mpi_processes() > 1)
- MPI_Barrier (v.partitioner->get_communicator());
- if (partitioner->n_mpi_processes() > 1 &&
- v.partitioner->n_mpi_processes() !=
- partitioner->n_mpi_processes())
- MPI_Barrier (partitioner->get_communicator());
+
+#ifdef DEBUG
+ // make sure that there are not outstanding requests from updating ghost
+ // values or compress
+ int flag = 1;
+ int ierr = MPI_Testall (update_ghost_values_requests.size(),
+ &update_ghost_values_requests[0],
+ &flag, MPI_STATUSES_IGNORE);
+ Assert (ierr == MPI_SUCCESS, ExcInternalError());
+ Assert (flag == 1,
+ ExcMessage("MPI found unfinished update_ghost_values() requests"
+ "when calling swap, which is not allowed"));
+ ierr = MPI_Testall (compress_requests.size(), &compress_requests[0],
+ &flag, MPI_STATUSES_IGNORE);
+ Assert (ierr == MPI_SUCCESS, ExcInternalError());
+ Assert (flag == 1,
+ ExcMessage("MPI found unfinished compress() requests "
+ "when calling swap, which is not allowed"));
+#endif
std::swap (compress_requests, v.compress_requests);
std::swap (update_ghost_values_requests, v.update_ghost_values_requests);
#endif
- std::swap (partitioner, v.partitioner);
- std::swap (allocated_size, v.allocated_size);
- std::swap (val, v.val);
- std::swap (import_data, v.import_data);
+ std::swap (partitioner, v.partitioner);
+ std::swap (allocated_size, v.allocated_size);
+ std::swap (val, v.val);
+ std::swap (import_data, v.import_data);
+ std::swap (vector_is_ghosted, v.vector_is_ghosted);
- // vector view cannot be swapped so reset it
- // manually (without touching the vector
- // elements)
+ // vector view cannot be swapped so reset it manually (without touching
+ // the vector elements)
vector_view.reinit (partitioner->local_size(), val);
v.vector_view.reinit (v.partitioner->local_size(), v.val);
}
std::size_t memory = sizeof(*this);
memory += sizeof (Number) * static_cast<std::size_t>(allocated_size);
- // if the partitioner is shared between more
- // processors, just count a fraction of that
- // memory, since we're not actually using more
- // memory for it.
+ // if the partitioner is shared between more processors, just count a
+ // fraction of that memory, since we're not actually using more memory
+ // for it.
if (partitioner.use_count() > 0)
memory += partitioner->memory_consumption()/partitioner.use_count()+1;
if (import_data != 0)
else
out.setf (std::ios::fixed, std::ios::floatfield);
- // to make the vector write out all the
- // information in order, use as many barriers
- // as there are processors and start writing
- // when it's our turn
+ // to make the vector write out all the information in order, use as
+ // many barriers as there are processors and start writing when it's our
+ // turn
#ifdef DEAL_II_WITH_MPI
if (partitioner->n_mpi_processes() > 1)
for (unsigned int i=0; i<partitioner->this_mpi_process(); i++)
for (size_type i=0; i<partitioner->local_size(); ++i)
out << local_element(i) << std::endl;
out << std::endl;
- out << "Ghost entries (global index / value):" << std::endl;
- if (across)
- for (size_type i=0; i<partitioner->n_ghost_indices(); ++i)
- out << '(' << partitioner->ghost_indices().nth_index_in_set(i)
- << '/' << local_element(partitioner->local_size()+i) << ") ";
- else
- for (size_type i=0; i<partitioner->n_ghost_indices(); ++i)
- out << '(' << partitioner->ghost_indices().nth_index_in_set(i)
- << '/' << local_element(partitioner->local_size()+i) << ")"
- << std::endl;
- out << std::endl << std::flush;
+
+ if (vector_is_ghosted)
+ {
+ out << "Ghost entries (global index / value):" << std::endl;
+ if (across)
+ for (size_type i=0; i<partitioner->n_ghost_indices(); ++i)
+ out << '(' << partitioner->ghost_indices().nth_index_in_set(i)
+ << '/' << local_element(partitioner->local_size()+i) << ") ";
+ else
+ for (size_type i=0; i<partitioner->n_ghost_indices(); ++i)
+ out << '(' << partitioner->ghost_indices().nth_index_in_set(i)
+ << '/' << local_element(partitioner->local_size()+i) << ")"
+ << std::endl;
+ out << std::endl;
+ }
+ out << std::flush;
#ifdef DEAL_II_WITH_MPI
if (partitioner->n_mpi_processes() > 1)
void
SolverBase::solve (const PETScWrappers::MatrixBase &A,
const PETScWrappers::MatrixBase &B,
- std::vector<double> &eigenvalues,
+ std::vector<PetscScalar> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
const unsigned int n_eigenpairs)
{ ... }
template <typename OutputVector>
void
solve (const PETScWrappers::MatrixBase &A,
- std::vector<double> &eigenvalues,
+ std::vector<PetscScalar> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
const unsigned int n_eigenpairs = 1);
void
solve (const PETScWrappers::MatrixBase &A,
const PETScWrappers::MatrixBase &B,
- std::vector<double> &eigenvalues,
+ std::vector<PetscScalar> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
const unsigned int n_eigenpairs = 1);
* default, no target is set.
*/
void
- set_target_eigenvalue (const double &this_target);
+ set_target_eigenvalue (const PetscScalar &this_target);
/**
* Indicate which part of the spectrum is to be computed. By
template <typename OutputVector>
void
SolverBase::solve (const PETScWrappers::MatrixBase &A,
- std::vector<double> &eigenvalues,
+ std::vector<PetscScalar> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
const unsigned int n_eigenpairs)
{
void
SolverBase::solve (const PETScWrappers::MatrixBase &A,
const PETScWrappers::MatrixBase &B,
- std::vector<double> &eigenvalues,
+ std::vector<PetscScalar> &eigenvalues,
std::vector<OutputVector> &eigenvectors,
const unsigned int n_eigenpairs)
{
// in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
// Deallocate Memory
cleanup();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
public:
/**
- * Enum denoting the different
- * states a solver can be in. See
- * the general documentation of
- * this class for more
- * information.
+ * Enum denoting the different states a solver can be in. See the general
+ * documentation of this class for more information.
*/
enum State
{
failure
};
+
+
/**
- * Class to be thrown upon
- * failing convergence of an
- * iterative solver, when either
- * the number of iterations
- * exceeds the limit or the
- * residual fails to reach the
- * desired limit, e.g. in the
- * case of a break-down.
+ * Class to be thrown upon failing convergence of an iterative solver,
+ * when either the number of iterations exceeds the limit or the residual
+ * fails to reach the desired limit, e.g. in the case of a break-down.
*
- * The residual in the last
- * iteration, as well as the
- * iteration number of the last
- * step are stored in this object
- * and can be recovered upon
- * catching an exception of this
- * class.
+ * The residual in the last iteration, as well as the iteration number of
+ * the last step are stored in this object and can be recovered upon
+ * catching an exception of this class.
*/
- class NoConvergence : public std::exception
+
+ class NoConvergence : public dealii::ExceptionBase
{
public:
- /**
- * Constructor.
- */
NoConvergence (const unsigned int last_step,
- const double last_residual);
+ const double last_residual)
+ : last_step (last_step), last_residual(last_residual)
+ {}
- /**
- * Standardized output for
- * catch handlers.
- */
- virtual const char *what () const throw ();
+ virtual ~NoConvergence () throw () {}
+
+ virtual void print_info (std::ostream &out) const
+ {
+ out << "Iterative method reported convergence failure in step "
+ << last_step << " with residual " << last_residual << std::endl;
+ }
/**
- * Iteration number of the
- * last step.
+ * Iteration number of the last step.
*/
const unsigned int last_step;
};
+
/**
- * Constructor. The parameters
- * @p n and @p tol are the
- * maximum number of iteration
- * steps before failure and the
- * tolerance to determine success
+ * Constructor. The parameters @p n and @p tol are the maximum number of
+ * iteration steps before failure and the tolerance to determine success
* of the iteration.
*
- * @p log_history specifies
- * whether the history (i.e. the
- * value to be checked and the
- * number of the iteration step)
- * shall be printed to
- * @p deallog stream. Default
- * is: do not print. Similarly,
- * @p log_result specifies the
- * whether the final result is
- * logged to @p deallog. Default
- * is yes.
+ * @p log_history specifies whether the history (i.e. the value to be
+ * checked and the number of the iteration step) shall be printed to @p
+ * deallog stream. Default is: do not print. Similarly, @p log_result
+ * specifies the whether the final result is logged to @p deallog.
+ * Default is yes.
*/
SolverControl (const unsigned int n = 100,
const double tol = 1.e-10,
const bool log_result = true);
/**
- * Virtual destructor is needed
- * as there are virtual functions
- * in this class.
+ * Virtual destructor is needed as there are virtual functions in this
+ * class.
*/
virtual ~SolverControl();
void parse_parameters (ParameterHandler ¶m);
/**
- * Decide about success or failure
- * of an iteration. This function
- * gets the current iteration step
- * to determine, whether the
- * allowed number of steps has
- * been exceeded and returns
- * @p failure in this case. If
- * @p check_value is below the
- * prescribed tolerance, it
- * returns @p success. In all
- * other cases @p iterate is
- * returned to suggest
- * continuation of the iterative
- * procedure.
+ * Decide about success or failure of an iteration. This function gets
+ * the current iteration step to determine, whether the allowed number of
+ * steps has been exceeded and returns @p failure in this case. If @p
+ * check_value is below the prescribed tolerance, it returns @p success.
+ * In all other cases @p iterate is returned to suggest continuation of
+ * the iterative procedure.
*
- * The iteration is also aborted
- * if the residual becomes a
- * denormalized value
- * (@p NaN). Note, however, that
- * this check is only performed
- * if the @p isnan function is
- * provided by the operating
- * system, which is not always
- * true. The @p configure
- * scripts checks for this and
- * sets the flag @p HAVE_ISNAN
- * in the file
- * <tt>Make.global_options</tt> if
- * this function was found.
+ * The iteration is also aborted if the residual becomes a denormalized
+ * value (@p NaN). Note, however, that this check is only performed if
+ * the @p isnan function is provided by the operating system, which is
+ * not always true. The @p configure scripts checks for this and sets the
+ * flag @p HAVE_ISNAN in the file <tt>Make.global_options</tt> if this
+ * function was found.
*
- * <tt>check()</tt> additionally
- * preserves @p step and
- * @p check_value. These
- * values are accessible by
- * <tt>last_value()</tt> and
+ * <tt>check()</tt> additionally preserves @p step and @p check_value.
+ * These values are accessible by <tt>last_value()</tt> and
* <tt>last_step()</tt>.
*
- * Derived classes may overload
- * this function, e.g. to log the
- * convergence indicators
- * (@p check_value) or to do
- * other computations.
+ * Derived classes may overload this function, e.g. to log the
+ * convergence indicators (@p check_value) or to do other computations.
*/
virtual State check (const unsigned int step,
const double check_value);
State last_check() const;
/**
- * Return the initial convergence
- * criterion.
+ * Return the initial convergence criterion.
*/
double initial_value() const;
/**
- * Return the convergence value of last
- * iteration step for which @p check was
- * called by the solver.
+ * Return the convergence value of last iteration step for which @p check
+ * was called by the solver.
*/
double last_value() const;
unsigned int set_max_steps (const unsigned int);
/**
- * Enables the failure
- * check. Solving is stopped with
- * @p ReturnState @p failure if
- * <tt>residual>failure_residual</tt> with
+ * Enables the failure check. Solving is stopped with @p ReturnState @p
+ * failure if <tt>residual>failure_residual</tt> with
* <tt>failure_residual:=rel_failure_residual*first_residual</tt>.
*/
void set_failure_criterion (const double rel_failure_residual);
/**
- * Disables failure check and
- * resets
- * @p relative_failure_residual
- * and @p failure_residual to
- * zero.
+ * Disables failure check and resets @p relative_failure_residual and @p
+ * failure_residual to zero.
*/
void clear_failure_criterion ();
double set_tolerance (const double);
/**
- * Enables writing residuals of
- * each step into a vector for
- * later analysis.
+ * Enables writing residuals of each step into a vector for later
+ * analysis.
*/
void enable_history_data();
/**
- * Average error reduction over
- * all steps.
+ * Average error reduction over all steps.
*
- * Requires
- * enable_history_data()
+ * Requires enable_history_data()
*/
double average_reduction() const;
/**
- * Error reduction of the last
- * step; for stationary
- * iterations, this approximates
- * the norm of the iteration
- * matrix.
+ * Error reduction of the last step; for stationary iterations, this
+ * approximates the norm of the iteration matrix.
*
- * Requires
- * enable_history_data()
+ * Requires enable_history_data()
*/
double final_reduction() const;
/**
- * Error reduction of any
- * iteration step.
+ * Error reduction of any iteration step.
*
- * Requires
- * enable_history_data()
+ * Requires enable_history_data()
*/
double step_reduction(unsigned int step) const;
/**
- * Log each iteration step. Use
- * @p log_frequency for skipping
- * steps.
+ * Log each iteration step. Use @p log_frequency for skipping steps.
*/
void log_history (const bool);
bool log_result () const;
/**
- * This exception is thrown if a
- * function operating on the
- * vector of history data of a
- * SolverControl object id
- * called, but storage of history
- * data was not enabled by
- * enable_history_data().
+ * This exception is thrown if a function operating on the vector of
+ * history data of a SolverControl object id called, but storage of
+ * history data was not enabled by enable_history_data().
*/
DeclException0(ExcHistoryDataRequired);
unsigned int lstep;
/**
- * Is set to @p true by
- * @p set_failure_criterion and
- * enables failure checking.
+ * Is set to @p true by @p set_failure_criterion and enables failure
+ * checking.
*/
bool check_failure;
/**
- * Stores the
- * @p rel_failure_residual set by
- * @p set_failure_criterion
+ * Stores the @p rel_failure_residual set by @p set_failure_criterion
*/
double relative_failure_residual;
/**
- * @p failure_residual equals the
- * first residual multiplied by
- * @p relative_crit set by
- * @p set_failure_criterion (see there).
+ * @p failure_residual equals the first residual multiplied by @p
+ * relative_crit set by @p set_failure_criterion (see there).
*
- * Until the first residual is
- * known it is 0.
+ * Until the first residual is known it is 0.
*/
double failure_residual;
/**
- * Log convergence history to
- * @p deallog.
+ * Log convergence history to @p deallog.
*/
bool m_log_history;
unsigned int m_log_frequency;
/**
- * Log iteration result to
- * @p deallog. If true, after
- * finishing the iteration, a
- * statement about failure or
- * success together with @p lstep
+ * Log iteration result to @p deallog. If true, after finishing the
+ * iteration, a statement about failure or success together with @p lstep
* and @p lvalue are logged.
*/
bool m_log_result;
/**
- * Control over the storage of
- * history data. Set by
+ * Control over the storage of history data. Set by
* enable_history_data().
*/
bool history_data_enabled;
/**
- * Vector storing the result
- * after each iteration step for
- * later statistical analysis.
+ * Vector storing the result after each iteration step for later
+ * statistical analysis.
*
- * Use of this vector is enabled
- * by enable_history_data().
+ * Use of this vector is enabled by enable_history_data().
*/
std::vector<double> history_data;
};
{
public:
/**
- * Constructor. Provide the
- * reduction factor in addition
- * to arguments that have the
- * same meaning as those of the
- * constructor of the
+ * Constructor. Provide the reduction factor in addition to arguments
+ * that have the same meaning as those of the constructor of the
* SolverControl constructor.
*/
ReductionControl (const unsigned int maxiter = 100,
const bool log_result = true);
/**
- * Initialize with a
- * SolverControl object. The
- * result will emulate
- * SolverControl by setting
- * #reduce to zero.
+ * Initialize with a SolverControl object. The result will emulate
+ * SolverControl by setting #reduce to zero.
*/
ReductionControl (const SolverControl &c);
/**
- * Assign a SolverControl object
- * to ReductionControl. The
- * result of the assignment will
- * emulate SolverControl by
- * setting #reduce to zero.
+ * Assign a SolverControl object to ReductionControl. The result of the
+ * assignment will emulate SolverControl by setting #reduce to zero.
*/
ReductionControl &operator= (const SolverControl &c);
/**
- * Virtual destructor is needed
- * as there are virtual functions
- * in this class.
+ * Virtual destructor is needed as there are virtual functions in this
+ * class.
*/
virtual ~ReductionControl();
void parse_parameters (ParameterHandler ¶m);
/**
- * Decide about success or failure
- * of an iteration. This function
- * calls the one in the base
- * class, but sets the tolerance
- * to <tt>reduction * initial value</tt>
- * upon the first iteration.
+ * Decide about success or failure of an iteration. This function calls
+ * the one in the base class, but sets the tolerance to <tt>reduction *
+ * initial value</tt> upon the first iteration.
*/
virtual State check (const unsigned int step,
const double check_value);
double reduce;
/**
- * Reduced tolerance. Stop iterations
- * if either this value is achieved
- * or if the base class indicates
- * success.
+ * Reduced tolerance. Stop iterations if either this value is achieved or
+ * if the base class indicates success.
*/
double reduced_tol;
};
deallog.pop();
// in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
deallog.pop();
// in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
}
#endif // DOXYGEN
// Output
deallog.pop ();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
// Output
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
}
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
this->memory.free(Vd);
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
this->memory.free(Vr);
this->memory.free(Vd);
deallog.pop();
- // in case of failure: throw
- // exception
+ // in case of failure: throw exception
if (this->control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (this->control().last_step(),
- this->control().last_value());
+ AssertThrow(false, SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value()));
// otherwise exit as normal
}
* as there are virtual functions
* in this class.
*/
- virtual ~VectorMemory() {}
+ virtual ~VectorMemory () {}
/**
* Return a pointer to a new
* a warning message, if there
* are allocated vectors left.
*/
- ~GrowingVectorMemory();
+ virtual ~GrowingVectorMemory();
/**
* Return a pointer to a new
void apply_hessians (const VectorizedArray<Number> in [],
VectorizedArray<Number> out []);
+ VectorizedArray<Number> shape_val_evenodd[fe_degree+1][(n_q_points_1d+1)/2];
+ VectorizedArray<Number> shape_gra_evenodd[fe_degree+1][(n_q_points_1d+1)/2];
+ VectorizedArray<Number> shape_hes_evenodd[fe_degree+1][(n_q_points_1d+1)/2];
+
/**
* Friend declarations.
*/
VectorType &vec,
Number &res) const
{
- res = vector_access (vec, index);
+ res = vector_access (const_cast<const VectorType&>(vec), index);
}
void pre_constraints (const Number &,
VectorType &vec,
Number &res) const
{
- res += weight * vector_access (vec, index);
+ res += weight * vector_access (const_cast<const VectorType&>(vec), index);
}
void post_constraints (const Number &sum,
int direction, bool dof_to_quad, bool add>
inline
void
- apply_tensor_product (const VectorizedArray<Number> *shape_data,
- const VectorizedArray<Number> in [],
- VectorizedArray<Number> out [])
+ apply_tensor_product (const Number *shape_data,
+ const Number in [],
+ Number out [])
{
AssertIndexRange (direction, dim);
const int mm = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
{
for (int col=0; col<nn; ++col)
{
- VectorizedArray<Number> val0;
+ Number val0;
if (dof_to_quad == true)
val0 = shape_data[col];
else
val0 = shape_data[col*n_q_points_1d];
- VectorizedArray<Number> res0 = val0 * in[0];
+ Number res0 = val0 * in[0];
for (int ind=1; ind<mm; ++ind)
{
if (dof_to_quad == true)
int direction, bool dof_to_quad, bool add>
inline
void
- apply_tensor_product_values (const VectorizedArray<Number> *shape_values,
- const VectorizedArray<Number> in [],
- VectorizedArray<Number> out [])
+ apply_tensor_product_values (const Number *shape_values,
+ const Number in [],
+ Number out [])
{
AssertIndexRange (direction, dim);
const int mm = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
{
for (int col=0; col<n_cols; ++col)
{
- VectorizedArray<Number> val0, val1, in0, in1, res0, res1;
+ Number val0, val1, in0, in1, res0, res1;
if (dof_to_quad == true)
{
val0 = shape_values[col];
}
}
else
- res0 = res1 = VectorizedArray<Number>();
+ res0 = res1 = Number();
if (dof_to_quad == true)
{
if (mm % 2 == 1)
}
else if (dof_to_quad == true && nn%2==1)
{
- VectorizedArray<Number> res0;
- VectorizedArray<Number> val0 = shape_values[n_cols];
+ Number res0;
+ Number val0 = shape_values[n_cols];
if (mid > 0)
{
res0 = in[0] + in[stride*(mm-1)];
for (int ind=1; ind<mid; ++ind)
{
val0 = shape_values[ind*n_q_points_1d+n_cols];
- VectorizedArray<Number> val1 = in[stride*ind] + in[stride*(mm-1-ind)];
+ Number val1 = in[stride*ind] + in[stride*(mm-1-ind)];
val1 *= val0;
res0 += val1;
}
}
else
- res0 = VectorizedArray<Number>();
+ res0 = Number();
if (add == false)
out[stride*n_cols] = res0;
else
}
else if (dof_to_quad == false && nn%2 == 1)
{
- VectorizedArray<Number> res0;
+ Number res0;
if (mid > 0)
{
- VectorizedArray<Number> val0 = shape_values[n_cols*n_q_points_1d];
+ Number val0 = shape_values[n_cols*n_q_points_1d];
res0 = in[0] + in[stride*(mm-1)];
res0 *= val0;
for (int ind=1; ind<mid; ++ind)
{
val0 = shape_values[n_cols*n_q_points_1d+ind];
- VectorizedArray<Number> val1 = in[stride*ind] + in[stride*(mm-1-ind)];
+ Number val1 = in[stride*ind] + in[stride*(mm-1-ind)];
val1 *= val0;
res0 += val1;
}
int direction, bool dof_to_quad, bool add>
inline
void
- apply_tensor_product_gradients (const VectorizedArray<Number> *shape_gradients,
- const VectorizedArray<Number> in [],
- VectorizedArray<Number> out [])
+ apply_tensor_product_gradients (const Number *shape_gradients,
+ const Number in [],
+ Number out [])
{
AssertIndexRange (direction, dim);
const int mm = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
{
for (int col=0; col<n_cols; ++col)
{
- VectorizedArray<Number> val0, val1, in0, in1, res0, res1;
+ Number val0, val1, in0, in1, res0, res1;
if (dof_to_quad == true)
{
val0 = shape_gradients[col];
}
}
else
- res0 = res1 = VectorizedArray<Number>();
+ res0 = res1 = Number();
if (mm % 2 == 1)
{
if (dof_to_quad == true)
}
if ( nn%2 == 1 )
{
- VectorizedArray<Number> val0, res0;
+ Number val0, res0;
if (dof_to_quad == true)
val0 = shape_gradients[n_cols];
else
val0 = shape_gradients[ind*n_q_points_1d+n_cols];
else
val0 = shape_gradients[n_cols*n_q_points_1d+ind];
- VectorizedArray<Number> val1 = in[stride*ind] - in[stride*(mm-1-ind)];
+ Number val1 = in[stride*ind] - in[stride*(mm-1-ind)];
val1 *= val0;
res0 += val1;
}
int direction, bool dof_to_quad, bool add>
inline
void
- apply_tensor_product_hessians (const VectorizedArray<Number> *shape_hessians,
- const VectorizedArray<Number> in [],
- VectorizedArray<Number> out [])
+ apply_tensor_product_hessians (const Number *shape_hessians,
+ const Number in [],
+ Number out [])
{
AssertIndexRange (direction, dim);
const int mm = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
{
for (int col=0; col<n_cols; ++col)
{
- VectorizedArray<Number> val0, val1, in0, in1, res0, res1;
+ Number val0, val1, in0, in1, res0, res1;
if (dof_to_quad == true)
{
val0 = shape_hessians[col];
}
}
else
- res0 = res1 = VectorizedArray<Number>();
+ res0 = res1 = Number();
if (mm % 2 == 1)
{
if (dof_to_quad == true)
}
if ( nn%2 == 1 )
{
- VectorizedArray<Number> val0, res0;
+ Number val0, res0;
if (dof_to_quad == true)
val0 = shape_hessians[n_cols];
else
val0 = shape_hessians[ind*n_q_points_1d+n_cols];
else
val0 = shape_hessians[n_cols*n_q_points_1d+ind];
- VectorizedArray<Number> val1 = in[stride*ind] + in[stride*(mm-1-ind)];
+ Number val1 = in[stride*ind] + in[stride*(mm-1-ind)];
val1 *= val0;
res0 += val1;
}
}
else
- res0 = VectorizedArray<Number>();
+ res0 = Number();
if (mm % 2 == 1)
{
if (dof_to_quad == true)
+ // This method implements a different approach to the symmetric case for
+ // values, gradients, and Hessians also treated with the above functions: It
+ // is possible to reduce the cost per dimension from N^2 to N^2/2, where N
+ // is the number of 1D dofs (there are only N^2/2 different entries in the
+ // shape matrix, so this is plausible). The approach is based on the idea of
+ // applying the operator on the even and odd part of the input vectors
+ // separately, given that the shape functions evaluated on quadrature points
+ // are symmetric. This method is presented e.g. in the book "Implementing
+ // Spectral Methods for Partial Differential Equations" by David A. Kopriva,
+ // Springer, 2009, section 3.5.3 (Even-Odd-Decomposition). Even though the
+ // experiments in the book say that the method is not efficient for N<20, it
+ // is more efficient in the context where the loop bounds are compile-time
+ // constants (templates).
+ template <int dim, int fe_degree, int n_q_points_1d, typename Number,
+ int direction, bool dof_to_quad, bool add, int type>
+ inline
+ void
+ apply_tensor_product_evenodd (const Number shapes [][(n_q_points_1d+1)/2],
+ const Number in [],
+ Number out [])
+ {
+ AssertIndexRange (type, 3);
+ AssertIndexRange (direction, dim);
+ const int mm = dof_to_quad ? (fe_degree+1) : n_q_points_1d,
+ nn = dof_to_quad ? n_q_points_1d : (fe_degree+1);
+ const int n_cols = nn / 2;
+ const int mid = mm / 2;
+
+ const int n_blocks1 = (dim > 1 ? (direction > 0 ? nn : mm) : 1);
+ const int n_blocks2 = (dim > 2 ? (direction > 1 ? nn : mm) : 1);
+ const int stride = Utilities::fixed_int_power<nn,direction>::value;
+
+ // this code may look very inefficient at first sight due to the many
+ // different cases with if's at the innermost loop part, but all of the
+ // conditionals can be evaluated at compile time because they are
+ // templates, so the compiler should optimize everything away
+ for (int i2=0; i2<n_blocks2; ++i2)
+ {
+ for (int i1=0; i1<n_blocks1; ++i1)
+ {
+ Number xp[mid], xm[mid];
+ for (int i=0; i<mid; ++i)
+ {
+ if (dof_to_quad == true && type == 1)
+ {
+ xp[i] = in[stride*i] - in[stride*(mm-1-i)];
+ xm[i] = in[stride*i] + in[stride*(mm-1-i)];
+ }
+ else
+ {
+ xp[i] = in[stride*i] + in[stride*(mm-1-i)];
+ xm[i] = in[stride*i] - in[stride*(mm-1-i)];
+ }
+ }
+ for (int col=0; col<n_cols; ++col)
+ {
+ Number r0, r1;
+ if (mid > 0)
+ {
+ if (dof_to_quad == true)
+ {
+ r0 = shapes[0][col] * xp[0];
+ r1 = shapes[fe_degree][col] * xm[0];
+ }
+ else
+ {
+ r0 = shapes[col][0] * xp[0];
+ r1 = shapes[fe_degree-col][0] * xm[0];
+ }
+ for (int ind=1; ind<mid; ++ind)
+ {
+ if (dof_to_quad == true)
+ {
+ r0 += shapes[ind][col] * xp[ind];
+ r1 += shapes[fe_degree-ind][col] * xm[ind];
+ }
+ else
+ {
+ r0 += shapes[col][ind] * xp[ind];
+ r1 += shapes[fe_degree-col][ind] * xm[ind];
+ }
+ }
+ }
+ else
+ r0 = r1 = Number();
+ if (mm % 2 == 1 && dof_to_quad == true)
+ {
+ if (type == 1)
+ r1 += shapes[mid][col] * in[stride*mid];
+ else
+ r0 += shapes[mid][col] * in[stride*mid];
+ }
+ else if (mm % 2 == 1 && (nn % 2 == 0 || type > 0))
+ r0 += shapes[col][mid] * in[stride*mid];
+
+ if (add == false)
+ {
+ out[stride*col] = r0 + r1;
+ if (type == 1 && dof_to_quad == false)
+ out[stride*(nn-1-col)] = r1 - r0;
+ else
+ out[stride*(nn-1-col)] = r0 - r1;
+ }
+ else
+ {
+ out[stride*col] += r0 + r1;
+ if (type == 1 && dof_to_quad == false)
+ out[stride*(nn-1-col)] += r1 - r0;
+ else
+ out[stride*(nn-1-col)] += r0 - r1;
+ }
+ }
+ if ( type == 0 && dof_to_quad == true && nn%2==1 && mm%2==1 )
+ {
+ if (add==false)
+ out[stride*n_cols] = in[stride*mid];
+ else
+ out[stride*n_cols] += in[stride*mid];
+ }
+ else if (dof_to_quad == true && nn%2==1)
+ {
+ Number r0;
+ if (mid > 0)
+ {
+ r0 = shapes[0][n_cols] * xp[0];
+ for (int ind=1; ind<mid; ++ind)
+ r0 += shapes[ind][n_cols] * xp[ind];
+ }
+ else
+ r0 = Number();
+ if (type != 1 && mm % 2 == 1)
+ r0 += shapes[mid][n_cols] * in[stride*mid];
+
+ if (add == false)
+ out[stride*n_cols] = r0;
+ else
+ out[stride*n_cols] += r0;
+ }
+ else if (dof_to_quad == false && nn%2 == 1)
+ {
+ Number r0;
+ if (mid > 0)
+ {
+ if (type == 1)
+ {
+ r0 = shapes[n_cols][0] * xm[0];
+ for (int ind=1; ind<mid; ++ind)
+ r0 += shapes[n_cols][ind] * xm[ind];
+ }
+ else
+ {
+ r0 = shapes[n_cols][0] * xp[0];
+ for (int ind=1; ind<mid; ++ind)
+ r0 += shapes[n_cols][ind] * xp[ind];
+ }
+ }
+ else
+ r0 = Number();
+
+ if (type == 0 && mm % 2 == 1)
+ r0 += in[stride*mid];
+ else if (type == 2 && mm % 2 == 1)
+ r0 += shapes[n_cols][mid] * in[stride*mid];
+
+ if (add == false)
+ out[stride*n_cols] = r0;
+ else
+ out[stride*n_cols] += r0;
+ }
+
+ // increment: in regular case, just go to the next point in
+ // x-direction. If we are at the end of one chunk in x-dir, need to
+ // jump over to the next layer in z-direction
+ switch (direction)
+ {
+ case 0:
+ in += mm;
+ out += nn;
+ break;
+ case 1:
+ case 2:
+ ++in;
+ ++out;
+ break;
+ default:
+ Assert (false, ExcNotImplemented());
+ }
+ }
+ if (direction == 1)
+ {
+ in += nn*(mm-1);
+ out += nn*(nn-1);
+ }
+ }
+ }
+
+
+
// evaluates the given shape data in 1d-3d using the tensor product
// form assuming the symmetries of unit cell shape gradients for
// finite elements in FEEvaluationGL
int direction, bool dof_to_quad, bool add>
inline
void
- apply_tensor_product_gradients_gl (const VectorizedArray<Number> *shape_gradients,
- const VectorizedArray<Number> in [],
- VectorizedArray<Number> out [])
+ apply_tensor_product_gradients_gl (const Number *shape_gradients,
+ const Number in [],
+ Number out [])
{
AssertIndexRange (direction, dim);
const int mm = fe_degree+1;
{
for (int col=0; col<n_cols; ++col)
{
- VectorizedArray<Number> val0, val1, in0, in1, res0, res1;
+ Number val0, val1, in0, in1, res0, res1;
if (mid > 0)
{
if (dof_to_quad == true)
}
}
else
- res0 = res1 = VectorizedArray<Number>();
+ res0 = res1 = Number();
if (mm % 2 == 1)
{
if (dof_to_quad == true)
}
if ( nn%2 == 1 )
{
- VectorizedArray<Number> val0, res0;
+ Number val0, res0;
if (dof_to_quad == true)
val0 = shape_gradients[n_cols];
else
val0 = shape_gradients[ind*mm+n_cols];
else
val0 = shape_gradients[n_cols*mm+ind];
- VectorizedArray<Number> val1 = in[stride*ind] - in[stride*(mm-1-ind)];
+ Number val1 = in[stride*ind] - in[stride*(mm-1-ind)];
val1 *= val0;
res0 += val1;
}
}
else
- res0 = VectorizedArray<Number>();
+ res0 = Number();
if (add == false)
out[stride*n_cols] = res0;
else
fe_eval.dof_values_initialized = true;
#endif
}
-}
+
+} // end of namespace internal
::apply_values(const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product<dim,fe_degree,n_q_points_1d,Number,
- direction, dof_to_quad, add>
+ internal::apply_tensor_product<dim,fe_degree,n_q_points_1d,
+ VectorizedArray<Number>, direction, dof_to_quad, add>
(this->data.shape_values.begin(), in, out);
}
::apply_gradients(const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product<dim,fe_degree,n_q_points_1d,Number,
- direction, dof_to_quad, add>
+ internal::apply_tensor_product<dim,fe_degree,n_q_points_1d,
+ VectorizedArray<Number>, direction, dof_to_quad, add>
(this->data.shape_gradients.begin(), in, out);
}
::apply_hessians(const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product<dim,fe_degree,n_q_points_1d,Number,
- direction, dof_to_quad, add>
+ internal::apply_tensor_product<dim,fe_degree,n_q_points_1d,
+ VectorizedArray<Number>, direction, dof_to_quad, add>
(this->data.shape_hessians.begin(), in, out);
}
j-1][0]) < zero_tol,
ExcMessage(error_message));
#endif
+
+ // Compute symmetric and skew-symmetric part of shape values for even-odd
+ // decomposition
+ for (unsigned int i=0; i<(fe_degree+1)/2; ++i)
+ for (unsigned int q=0; q<(n_q_points_1d+1)/2; ++q)
+ {
+ shape_val_evenodd[i][q] =
+ 0.5 * (this->data.shape_values[i*n_q_points_1d+q] +
+ this->data.shape_values[i*n_q_points_1d+n_q_points_1d-1-q]);
+ shape_val_evenodd[fe_degree-i][q] =
+ 0.5 * (this->data.shape_values[i*n_q_points_1d+q] -
+ this->data.shape_values[i*n_q_points_1d+n_q_points_1d-1-q]);
+
+ shape_gra_evenodd[i][q] =
+ 0.5 * (this->data.shape_gradients[i*n_q_points_1d+q] +
+ this->data.shape_gradients[i*n_q_points_1d+n_q_points_1d-1-q]);
+ shape_gra_evenodd[fe_degree-i][q] =
+ 0.5 * (this->data.shape_gradients[i*n_q_points_1d+q] -
+ this->data.shape_gradients[i*n_q_points_1d+n_q_points_1d-1-q]);
+
+ shape_hes_evenodd[i][q] =
+ 0.5 * (this->data.shape_hessians[i*n_q_points_1d+q] +
+ this->data.shape_hessians[i*n_q_points_1d+n_q_points_1d-1-q]);
+ shape_hes_evenodd[fe_degree-i][q] =
+ 0.5 * (this->data.shape_hessians[i*n_q_points_1d+q] -
+ this->data.shape_hessians[i*n_q_points_1d+n_q_points_1d-1-q]);
+ }
+ if (fe_degree % 2 == 0)
+ for (unsigned int q=0; q<(n_q_points_1d+1)/2; ++q)
+ {
+ shape_val_evenodd[fe_degree/2][q] =
+ this->data.shape_values[(fe_degree/2)*n_q_points_1d+q];
+ shape_gra_evenodd[fe_degree/2][q] =
+ this->data.shape_gradients[(fe_degree/2)*n_q_points_1d+q];
+ shape_hes_evenodd[fe_degree/2][q] =
+ this->data.shape_hessians[(fe_degree/2)*n_q_points_1d+q];
+ }
}
::apply_values (const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product_values<dim,fe_degree,n_q_points_1d,Number,
- direction, dof_to_quad, add>
- (this->data.shape_values.begin(), in, out);
+ internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d,
+ VectorizedArray<Number>, direction, dof_to_quad, add, 0>
+ (shape_val_evenodd, in, out);
}
::apply_gradients (const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product_gradients<dim,fe_degree,n_q_points_1d,Number,
- direction, dof_to_quad, add>
- (this->data.shape_gradients.begin(), in, out);
+ internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d,
+ VectorizedArray<Number>, direction, dof_to_quad, add, 1>
+ (shape_gra_evenodd, in, out);
}
::apply_hessians (const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product_hessians<dim,fe_degree,n_q_points_1d,Number,
- direction, dof_to_quad, add>
- (this->data.shape_hessians.begin(), in, out);
+ internal::apply_tensor_product_evenodd<dim,fe_degree,n_q_points_1d,
+ VectorizedArray<Number>, direction, dof_to_quad, add, 2>
+ (shape_hes_evenodd, in, out);
}
::apply_gradients (const VectorizedArray<Number> in [],
VectorizedArray<Number> out [])
{
- internal::apply_tensor_product_gradients_gl<dim,fe_degree,Number,
- direction, dof_to_quad, add>
+ internal::apply_tensor_product_gradients_gl<dim,fe_degree,
+ VectorizedArray<Number>, direction, dof_to_quad, add>
(this->data.shape_gradients.begin(), in, out);
}
// internal helper functions that define how to call MPI data exchange
// functions: for generic vectors, do nothing at all. For distributed vectors,
-// can call update_ghost_values_start function and so on. If we have
-// collections of vectors, just do the individual functions of the
-// components. this is a bit messy for block vectors, which use some
-// additional helper functions to select the blocks
+// call update_ghost_values_start function and so on. If we have collections
+// of vectors, just do the individual functions of the components. In order to
+// keep ghost values consistent (whether we are in read or write mode). the whole situation is a bit complicated by the fact
+// that we need to treat block vectors differently, which use some additional
+// helper functions to select the blocks and template magic.
namespace internal
{
template<typename VectorStruct>
- void update_ghost_values_start_block (const VectorStruct &vec,
+ bool update_ghost_values_start_block (const VectorStruct &vec,
const unsigned int channel,
internal::bool2type<true>);
template<typename VectorStruct>
+ void reset_ghost_values_block (const VectorStruct &vec,
+ const bool zero_out_ghosts,
+ internal::bool2type<true>);
+ template<typename VectorStruct>
void update_ghost_values_finish_block (const VectorStruct &vec,
internal::bool2type<true>);
template<typename VectorStruct>
internal::bool2type<true>);
template<typename VectorStruct>
- void update_ghost_values_start_block (const VectorStruct &,
+ bool update_ghost_values_start_block (const VectorStruct &,
const unsigned int,
internal::bool2type<false>)
+ {
+ return false;
+ }
+ template<typename VectorStruct>
+ void reset_ghost_values_block (const VectorStruct &,
+ const bool,
+ internal::bool2type<false>)
{}
template<typename VectorStruct>
void update_ghost_values_finish_block (const VectorStruct &,
+ // returns true if the vector was in a state without ghost values before,
+ // i.e., we need to zero out ghosts in the very end
template<typename VectorStruct>
inline
- void update_ghost_values_start (const VectorStruct &vec,
+ bool update_ghost_values_start (const VectorStruct &vec,
const unsigned int channel = 0)
{
- update_ghost_values_start_block(vec, channel,
- internal::bool2type<IsBlockVector<VectorStruct>::value>());
+ return
+ update_ghost_values_start_block(vec, channel,
+ internal::bool2type<IsBlockVector<VectorStruct>::value>());
}
template<typename Number>
inline
- void update_ghost_values_start (const parallel::distributed::Vector<Number> &vec,
+ bool update_ghost_values_start (const parallel::distributed::Vector<Number> &vec,
const unsigned int channel = 0)
{
+ bool return_value = !vec.has_ghost_elements();
vec.update_ghost_values_start(channel);
+ return return_value;
}
template <typename VectorStruct>
inline
- void update_ghost_values_start (const std::vector<VectorStruct> &vec)
+ bool update_ghost_values_start (const std::vector<VectorStruct> &vec)
{
+ bool return_value = false;
for (unsigned int comp=0; comp<vec.size(); comp++)
- update_ghost_values_start(vec[comp], comp);
+ return_value = update_ghost_values_start(vec[comp], comp);
+ return return_value;
}
template <typename VectorStruct>
inline
- void update_ghost_values_start (const std::vector<VectorStruct *> &vec)
+ bool update_ghost_values_start (const std::vector<VectorStruct *> &vec)
{
+ bool return_value = false;
for (unsigned int comp=0; comp<vec.size(); comp++)
- update_ghost_values_start(*vec[comp], comp);
+ return_value = update_ghost_values_start(*vec[comp], comp);
+ return return_value;
}
template<typename VectorStruct>
inline
- void update_ghost_values_start_block (const VectorStruct &vec,
+ bool update_ghost_values_start_block (const VectorStruct &vec,
const unsigned int channel,
internal::bool2type<true>)
{
+ bool return_value = false;
for (unsigned int i=0; i<vec.n_blocks(); ++i)
- update_ghost_values_start(vec.block(i), channel+500*i);
+ return_value = update_ghost_values_start(vec.block(i), channel+509*i);
+ return return_value;
+ }
+
+
+
+ // if the input vector did not have ghosts imported, clear them here again
+ // in order to avoid subsequent operations e.g. in linear solvers to work
+ // with ghosts all the time
+ template<typename VectorStruct>
+ inline
+ void reset_ghost_values (const VectorStruct &vec,
+ const bool zero_out_ghosts)
+ {
+ reset_ghost_values_block(vec, zero_out_ghosts,
+ internal::bool2type<IsBlockVector<VectorStruct>::value>());
+ }
+
+
+
+ template<typename Number>
+ inline
+ void reset_ghost_values (const parallel::distributed::Vector<Number> &vec,
+ const bool zero_out_ghosts)
+ {
+ if (zero_out_ghosts)
+ const_cast<parallel::distributed::Vector<Number>&>(vec).zero_out_ghosts();
+ }
+
+
+
+ template <typename VectorStruct>
+ inline
+ void reset_ghost_values (const std::vector<VectorStruct> &vec,
+ const bool zero_out_ghosts)
+ {
+ for (unsigned int comp=0; comp<vec.size(); comp++)
+ reset_ghost_values(vec[comp], zero_out_ghosts);
+ }
+
+
+
+ template <typename VectorStruct>
+ inline
+ void reset_ghost_values (const std::vector<VectorStruct *> &vec,
+ const bool zero_out_ghosts)
+ {
+ for (unsigned int comp=0; comp<vec.size(); comp++)
+ reset_ghost_values(*vec[comp], zero_out_ghosts);
+ }
+
+
+
+ template<typename VectorStruct>
+ inline
+ void reset_ghost_values_block (const VectorStruct &vec,
+ const bool zero_out_ghosts,
+ internal::bool2type<true>)
+ {
+ for (unsigned int i=0; i<vec.n_blocks(); ++i)
+ reset_ghost_values(vec.block(i), zero_out_ghosts);
}
OutVector &dst,
const InVector &src) const
{
+ // in any case, need to start the ghost import at the beginning
+ bool ghosts_were_not_set = internal::update_ghost_values_start (src);
+
#ifdef DEAL_II_WITH_THREADS
// Use multithreading if so requested and if there is enough work to do in
if (task_info.use_partition_partition == true)
{
- internal::update_ghost_values_start(src);
tbb::empty_task *root = new( tbb::task::allocate_root() )
tbb::empty_task;
unsigned int evens = task_info.evens;
internal::MPIComDistribute<InVector> *worker_dist =
new (worker[j]->allocate_child())
internal::MPIComDistribute<InVector>(src);
- if (odds == 0)
- break;
- else
- worker_dist->spawn(*worker_dist);
+ worker_dist->spawn(*worker_dist);
}
if (j<evens-1)
{
root->wait_for_all();
root->destroy(*root);
- internal::compress_finish(dst);
}
else // end of partition-partition, start of partition-color
{
- internal::update_ghost_values_start(src);
unsigned int evens = task_info.evens;
unsigned int odds = task_info.odds;
internal::compress_start(dst);
}
- internal::compress_finish(dst);
}
}
else
{
std::pair<unsigned int,unsigned int> cell_range;
- internal::update_ghost_values_start (src);
-
// First operate on cells where no ghost data is needed (inner cells)
{
cell_range.first = 0;
cell_range.second = size_info.n_macro_cells;
cell_operation (*this, dst, src, cell_range);
}
-
- internal::compress_finish(dst);
}
+
+ // In every case, we need to finish transfers at the very end
+ internal::compress_finish(dst);
+ internal::reset_ghost_values(src, ghosts_were_not_set);
}
COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${build}}"
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}"
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}"
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}"
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}"
)
TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
utilities.cc
)
+SET(_inst
+ data_out_base.inst.in
+ )
+
FILE(GLOB _header
${CMAKE_SOURCE_DIR}/include/deal.II/base/*.h
)
-DEAL_II_ADD_LIBRARY(obj_base OBJECT ${_src} ${_header}
+DEAL_II_ADD_LIBRARY(obj_base OBJECT ${_src} ${_header} ${_inst}
${CMAKE_BINARY_DIR}/include/deal.II/base/config.h
)
+EXPAND_INSTANTIATIONS(obj_base "${_inst}")
{
r = filtered_points[i];
if (d < dimension) data_sets.back()[r*new_dim+d] = data_vectors(set_num+d, i);
- else data_sets.back()[r] = 0;
+ else data_sets.back()[r*new_dim+d] = 0;
}
}
}
//----------------------------------------------------------------------//
//For a given patch, compute the node interpolating the corner nodes
//linearly at the point (xstep, ystep, zstep)*1./n_subdivisions.
-//If the popints are saved in the patch->data member, return the
+//If the points are saved in the patch->data member, return the
//saved point instead
+
+//TODO: Make this function return its value, rather than using a reference
+// as first argument; take a reference for 'patch', not a pointer
template <int dim, int spacedim>
inline
void
// explicit instantiations
-#define INSTANTIATE(dim,spacedim) \
- template class DataOutInterface<dim,spacedim>; \
- template class DataOutReader<dim,spacedim>; \
- template struct DataOutBase::Patch<dim,spacedim>; \
- template \
- std::ostream & \
- operator << (std::ostream &out, \
- const DataOutBase::Patch<dim,spacedim> &patch); \
- template \
- std::istream & \
- operator >> (std::istream &in, \
- DataOutBase::Patch<dim,spacedim> &patch)
-
-INSTANTIATE(1,1);
-INSTANTIATE(2,2);
-INSTANTIATE(3,3);
-INSTANTIATE(4,4);
-INSTANTIATE(1,2);
-INSTANTIATE(1,3);
-INSTANTIATE(2,3);
-INSTANTIATE(3,4);
-
-#undef INSTANTIATE
+#include "data_out_base.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+// ---------------------------------------------------------------------
+// $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.
+//
+// ---------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+{
+#if deal_II_dimension <= deal_II_space_dimension
+ template class DataOutInterface<deal_II_dimension, deal_II_space_dimension>;
+ template class DataOutReader<deal_II_dimension, deal_II_space_dimension>;
+ template struct DataOutBase::Patch<deal_II_dimension, deal_II_space_dimension>;
+
+ template
+ std::ostream &
+ operator << (std::ostream &out,
+ const DataOutBase::Patch<deal_II_dimension, deal_II_space_dimension> &patch);
+
+ template
+ std::istream &
+ operator >> (std::istream &in,
+ DataOutBase::Patch<deal_II_dimension, deal_II_space_dimension> &patch);
+
+ template
+ void
+ DataOutBase::write_vtk (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const VtkFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_vtu (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const VtkFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_ucd (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const UcdFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_dx (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const DXFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_gnuplot (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const GnuplotFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_povray (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const PovrayFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_eps (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const EpsFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_gmv (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const GmvFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_tecplot (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const TecplotFlags &flags,
+ std::ostream &out);
+
+ template
+ void
+ DataOutBase::write_tecplot_binary (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const TecplotFlags &flags,
+ std::ostream &out);
+ template
+ void
+ DataOutBase::write_svg (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const SvgFlags &flags,
+ std::ostream &out);
+ template
+ void
+ DataOutBase::write_deal_II_intermediate (const std::vector<Patch<deal_II_dimension,deal_II_space_dimension> > &patches,
+ const std::vector<std::string> &data_names,
+ const std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > &vector_data_ranges,
+ const Deal_II_IntermediateFlags &flags,
+ std::ostream &out);
+#endif
+}
namespace internals
{
- void abort (const ExceptionBase &exc)
+ void abort (const ExceptionBase &exc, bool nothrow /*= false*/)
{
if (dealii::deal_II_exceptions::abort_on_exception)
{
- //* Print the error message and bail out:
+ // Print the error message and bail out:
std::cerr << exc.what() << std::endl;
std::abort();
}
+ else if (nothrow)
+ {
+ // We are not allowed to throw, and not allowed to abort.
+ // Just print the exception name to deallog and continue
+ // normally:
+ deallog << "Exception: " << exc.get_exc_name() << std::endl;
+ }
else
{
+ // We are not allowed to abort, so just throw the error so just
+ // throw the error so just throw the error so just throw the
+ // error:
throw exc;
}
}
const double co = (r==0.) ? 0. : (p(0)-center(0))/r;
const double si = (r==0.) ? 0. : (p(1)-center(1))/r;
+#ifdef HAVE_JN
const double dJn = (order==0)
? (-jn(1, r*wave_number))
: (.5*(jn(order-1, wave_number*r) -jn(order+1, wave_number*r)));
Tensor<1,dim> result;
result[0] = wave_number * co * dJn;
result[1] = wave_number * si * dJn;
-#ifdef HAVE_JN
return result;
#else
Assert(false, ExcMessage("Bessel function jn was not found by configure"));
void
GeometryInfo<dim>::
alternating_form_at_vertices
-(const Point<spacedim> (&vertices)[vertices_per_cell],
- Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell])
+#ifndef DEAL_II_CONSTEXPR_BUG
+ (const Point<spacedim> (&vertices)[vertices_per_cell],
+ Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell])
+#else
+ (const Point<spacedim> *vertices,
+ Tensor<spacedim-dim,spacedim> *forms)
+#endif
{
// for each of the vertices,
// compute the alternating form
void
GeometryInfo<1>::
alternating_form_at_vertices
-(const Point<1> (&vertices)[vertices_per_cell],
- Tensor<1-1,1> (&forms)[vertices_per_cell])
+#ifndef DEAL_II_CONSTEXPR_BUG
+(const Point<1> (&)[vertices_per_cell],
+ Tensor<1-1,1> (&)[vertices_per_cell])
+#else
+(const Point<1> *, Tensor<1-1,1> *)
+#endif
;
template
void
GeometryInfo<1>::
alternating_form_at_vertices
-(const Point<2> (&vertices)[vertices_per_cell],
- Tensor<2-1,2> (&forms)[vertices_per_cell])
+#ifndef DEAL_II_CONSTEXPR_BUG
+(const Point<2> (&)[vertices_per_cell],
+ Tensor<2-1,2> (&)[vertices_per_cell])
+#else
+(const Point<2> *, Tensor<2-1,2> *)
+#endif
;
template
void
GeometryInfo<2>::
alternating_form_at_vertices
+#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<2> (&vertices)[vertices_per_cell],
Tensor<2-2,2> (&forms)[vertices_per_cell])
+#else
+(const Point<2> *, Tensor<2-2,2> *)
+#endif
;
template
void
GeometryInfo<2>::
alternating_form_at_vertices
+#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<3> (&vertices)[vertices_per_cell],
Tensor<3-2,3> (&forms)[vertices_per_cell])
+#else
+(const Point<3> *, Tensor<3-2,3> *)
+#endif
;
void
GeometryInfo<3>::
alternating_form_at_vertices
+#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<3> (&vertices)[vertices_per_cell],
Tensor<3-3,3> (&forms)[vertices_per_cell])
+#else
+(const Point<3> *, Tensor<3-3,3> *)
+#endif
;
char *endptr;
double d = std::strtod (s.c_str(), &endptr);
// assert there was no error
- AssertThrow ((s.c_str()!='\0') || (*endptr == '\0'),
+ AssertThrow ((*s.c_str() != '\0') || (*endptr == '\0'),
ExcConversionError(s));
return d;
if (infostring == "")
infostring = "<none>";
- Assert (counter == 0,
- ExcInUse (counter, object_info->name(), infostring));
+ AssertNothrow (counter == 0,
+ ExcInUse (counter, object_info->name(), infostring));
}
else
{
void ChunkSparsityPattern::copy_from<double> (const FullMatrix<double> &,
const size_type ,
const bool);
+template
+void ChunkSparsityPattern::copy_from<float> (const FullMatrix<float> &,
+ const size_type);
+template
+void ChunkSparsityPattern::copy_from<double> (const FullMatrix<double> &,
+ const size_type);
DEAL_II_NAMESPACE_CLOSE
// in case of failure: throw
// exception
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
// otherwise exit as normal
}
* throw exception
*/
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ {
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
+ }
else
{
/**
}
void
- SolverBase::set_target_eigenvalue (const double &this_target)
+ SolverBase::set_target_eigenvalue (const PetscScalar &this_target)
{
target_eigenvalue = this_target;
}
// and in case of failure: throw exception
if (solver_control.last_check () != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step (),
- solver_control.last_value ());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
}
/*----------------------- SolverControl ---------------------------------*/
-SolverControl::NoConvergence::NoConvergence (const unsigned int last_step,
- const double last_residual)
- :
- last_step (last_step),
- last_residual (last_residual)
-{}
-
-
-const char *
-SolverControl::NoConvergence::what () const throw ()
-{
- // have a place where to store the
- // description of the exception as a char *
- //
- // this thing obviously is not multi-threading
- // safe, but we don't care about that for now
- //
- // we need to make this object static, since
- // we want to return the data stored in it
- // and therefore need a lifetime which is
- // longer than the execution time of this
- // function
- static std::string description;
- // convert the messages printed by the
- // exceptions into a std::string
- std::ostringstream out;
- out << "Iterative method reported convergence failure in step "
- << last_step << " with residual " << last_residual;
-
- description = out.str();
- return description.c_str();
-}
-
-
-
SolverControl::SolverControl (const unsigned int maxiter,
const double tolerance,
const bool m_log_history,
solver_control.check (solver.NumIters(), solver.TrueResidual());
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
solver_control.check (0, 0);
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
solver_control.check (0, 0);
if (solver_control.last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (solver_control.last_step(),
- solver_control.last_value());
+ AssertThrow(false, SolverControl::NoConvergence (solver_control.last_step(),
+ solver_control.last_value()));
}
inline
GrowingVectorMemory<VECTOR>::~GrowingVectorMemory()
{
- AssertThrow(current_alloc == 0,
- StandardExceptions::ExcMemoryLeak(current_alloc));
+ AssertNothrow(current_alloc == 0,
+ StandardExceptions::ExcMemoryLeak(current_alloc));
if (log_statistics)
{
deallog << "GrowingVectorMemory:Overall allocated vectors: "
// things for DataOutRotation
+#if deal_II_dimension < 3
template void
DataOut_DoFData<DH<deal_II_dimension,deal_II_dimension>,deal_II_dimension+1,deal_II_dimension+1>::
add_data_vector<VEC> (const VEC &,
add_data_vector<VEC> (const DH<deal_II_dimension,deal_II_dimension> &,
const VEC &,
const DataPostprocessor<DH<deal_II_dimension,deal_II_dimension>::space_dimension> &);
-
+#endif
// codim 1
- #if deal_II_dimension < 3
+#if deal_II_dimension < 3
template void
DataOut_DoFData<DH<deal_II_dimension,deal_II_dimension+1>,deal_II_dimension,deal_II_dimension+1>::
add_data_vector<VEC> (const VEC &,
add_data_vector<VEC> (const DH<deal_II_dimension,deal_II_dimension+1> &,
const VEC &,
const DataPostprocessor<DH<deal_II_dimension,deal_II_dimension+1>::space_dimension> &);
- #endif
+#endif
// things for DataOutRotation
+#if deal_II_dimension < 3
template void
DataOut_DoFData<DH<deal_II_dimension,deal_II_dimension>,deal_II_dimension+1,deal_II_dimension+1>::
add_data_vector<IndexSet> (const IndexSet &,
const IndexSet &,
const std::vector<std::string> &,
const std::vector<DataComponentInterpretation::DataComponentInterpretation> &);
+#endif
// codim 1
- #if deal_II_dimension < 3
+#if deal_II_dimension < 3
template void
DataOut_DoFData<DH<deal_II_dimension,deal_II_dimension+1>,deal_II_dimension,deal_II_dimension+1>::
add_data_vector<IndexSet> (const IndexSet &,
DataOut_DoFData<DH<deal_II_dimension,deal_II_dimension+1>,deal_II_dimension,deal_II_dimension+1>::
add_data_vector<IndexSet> (const IndexSet &,
const DataPostprocessor<DH<deal_II_dimension,deal_II_dimension+1>::space_dimension> &);
- #endif
+#endif
}
for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
{
template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension>;
- template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension+1>;
- #if deal_II_dimension < 3
+#if deal_II_dimension < 3
+ template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension+1>;
template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension,deal_II_dimension+1>;
template class DataOut_DoFData<DH<deal_II_dimension,deal_II_dimension+1>,deal_II_dimension,deal_II_dimension+1>;
- #endif
+#endif
- #if deal_II_dimension >= 2
+#if deal_II_dimension >= 2
template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension>;
- #endif
+#endif
- #if deal_II_dimension == 3
+#if deal_II_dimension == 3
template class DataOut_DoFData<DH<1>,1,3>;
template class DataOut_DoFData<DH<1,3>,1,3>;
- #endif
+#endif
}
namespace DataOut \{
#if deal_II_dimension <= deal_II_space_dimension
template
- void
+ void
ParallelDataBase<deal_II_dimension,deal_II_space_dimension>::
reinit_all_fe_values<dealii::DH<deal_II_dimension,deal_II_space_dimension> >
(std::vector<std_cxx1x::shared_ptr<DataEntryBase<dealii::DH<deal_II_dimension,deal_II_space_dimension> > > > &dof_data,
for (deal_II_dimension : DIMENSIONS)
{
+#if deal_II_dimension < 3
template class DataOutRotation<deal_II_dimension, DoFHandler<deal_II_dimension> >;
+#endif
}
for (deal_II_dimension : DIMENSIONS)
{
+#if deal_II_dimension < 3
template class DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >;
template void DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >::
template void DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
add_data_vector<float> (const Vector<float> &vec,
const std::string &name);
+#endif
}
copy_data.dofs.resize(copy_data.dofs_per_cell);
cell->get_dof_indices (copy_data.dofs);
- const unsigned int max_dofs_per_cell = fe_collection.max_dofs_per_cell(),
- max_dofs_per_face = fe_collection.max_dofs_per_face();
-
- FullMatrix<double> cell_matrix(max_dofs_per_cell, max_dofs_per_cell);
- Vector<double> cell_vector(max_dofs_per_cell);
-
UpdateFlags update_flags = UpdateFlags (update_values |
update_JxW_values |
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# 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 :-(
+#
+
+ADD_SUBDIRECTORY(quick_tests)
+
+#
+# Custom targets to set and clean up the testsuite:
+#
+
+# Setup tests:
+ADD_CUSTOM_TARGET(setup_tests)
+
+# Clean all tests
+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
+ NUMDIFF_DIR
+ TEST_DIFF
+ TEST_OVERRIDE_LOCATION
+ TEST_PICKUP_REGEX
+ TEST_TIME_LIMIT
+ )
+ LIST(APPEND _options "-U${_var}")
+ IF(DEFINED ${_var})
+ LIST(APPEND _options "-D${_var}=${${_var}}")
+ ENDIF()
+ENDFOREACH()
+
+#
+# Glob together a list of all subfolders to set up:
+#
+FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*)
+SET(_categories all-headers build_tests mesh_converter ${_categories})
+LIST(REMOVE_DUPLICATES _categories)
+
+#
+# Define a subproject for every enabled category:
+#
+
+FOREACH(_category ${_categories})
+ IF(EXISTS ${CMAKE_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}
+ > /dev/null # Shoo!
+ DEPENDS ${_category_dir}
+ COMMENT "Processing tests/${_category}"
+ )
+ ADD_DEPENDENCIES(setup_tests setup_tests_${_category})
+
+ # depend on a valid build directory (libraries built, config in place):
+ ADD_DEPENDENCIES(setup_tests_${_category} setup_build_dir)
+
+ ADD_CUSTOM_TARGET(clean_tests_${_category}
+ COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
+ --build ${CMAKE_CURRENT_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}
+ )
+ ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
+
+ FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake
+ "SUBDIRS(${_category})\n"
+ )
+
+ ENDIF()
+ENDFOREACH()
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
+PROJECT(testsuite CXX)
+INCLUDE(${DEAL_II_TARGET_CONFIG})
+
+#
+# Header tests are special:
+#
+# Construct a list of all header files and build up a test that just tries
+# to compile a simple worker (test_header.cc) that only includes the given
+# header file. We omit linking to save some time.
+#
+
+SET(_category all-headers)
+
+FILE(GLOB_RECURSE _header ${DEAL_II_SOURCE_DIR}/include/deal.II/*.h)
+
+FOREACH(_full_file ${_header})
+ GET_FILENAME_COMPONENT(_file ${_full_file} NAME)
+
+ # TODO: A more sophisticated way to get the relative include path:
+ GET_FILENAME_COMPONENT(_path ${_full_file} PATH)
+ GET_FILENAME_COMPONENT(_path ${_path} NAME)
+ IF("${_path}" STREQUAL "std_cxx1x")
+ SET(_path "base/std_cxx1x")
+ ENDIF()
+
+ FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ STRING(TOLOWER ${_build} _build_lowercase)
+
+ SET(_test ${_category}/${_path}/${_file}.${_build_lowercase})
+ STRING(REGEX REPLACE "\\/" "-" _target ${_test})
+
+ # Respect TEST_PICKUP_REGEX:
+ IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR
+ _test MATCHES "${TEST_PICKUP_REGEX}" )
+
+ # Add an object library for each header file and build configuration:
+ ADD_LIBRARY(${_target} OBJECT EXCLUDE_FROM_ALL test_header.cc)
+
+ SET_TARGET_PROPERTIES(${_target} PROPERTIES
+ LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
+ COMPILE_DEFINITIONS "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_${_build}}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}"
+ )
+ SET_PROPERTY(TARGET ${_target} APPEND PROPERTY
+ INCLUDE_DIRECTORIES "${DEAL_II_INCLUDE_DIRS}"
+ )
+ SET_PROPERTY(TARGET ${_target} APPEND PROPERTY
+ COMPILE_DEFINITIONS HEADER=<deal.II/${_path}/${_file}>
+ )
+
+ ADD_CUSTOM_TARGET(${_target}.build
+ COMMAND
+ echo "${_test}: BUILD successful."
+ && echo "${_test}: PASSED."
+ )
+ ADD_DEPENDENCIES(${_target}.build ${_target})
+
+ # And finally add the test:
+ ADD_TEST(NAME ${_test}
+ COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.build -DTEST=${_test}
+ -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ SET_TESTS_PROPERTIES(${_test} PROPERTIES
+ LABEL "${_category}"
+ TIMEOUT ${TEST_TIME_LIMIT}
+ )
+ ENDIF()
+ ENDFOREACH()
+ENDFOREACH()
--- /dev/null
+#include HEADER
+
+// Make sure that config.h is always included:
+DEAL_II_NAMESPACE_OPEN
+DEAL_II_NAMESPACE_CLOSE
+
+int main()
+{
+ return 0;
+}
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
+PROJECT(testsuite CXX)
+INCLUDE(${DEAL_II_TARGET_CONFIG})
+
+#
+# build_tests tests are special:
+#
+# Try to configure and build every example step in debug and release
+# configuration. Error condition is that if a test is successfully
+# configured it must compile successfully...
+#
+# ... except for the tests listed below: They have to configure, build and
+# run successfully in the given build configuration:
+#
+
+SET(_category build_tests)
+
+# Run a minimalistic set of steps in debug configuration:
+SET(_debug_steps
+ step-1 step-2 step-3 step-4 step-5
+ step-6 step-47
+ )
+
+# Run all configuration independent steps in release configuration:
+SET(_release_steps
+ step-1 step-2 step-3 step-4 step-5
+ step-6 step-7 step-8 step-9 step-10
+ step-11 step-12 step-13 step-14 step-16
+ step-20 step-23 step-25 step-26 step-27
+ step-30 step-38 step-39 step-44 step-45
+ step-47 step-48 step-49
+ )
+
+FILE(GLOB _steps ${DEAL_II_SOURCE_DIR}/examples/step-*)
+
+FOREACH(_step_full ${_steps})
+ GET_FILENAME_COMPONENT(_step ${_step_full} NAME)
+
+ FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ STRING(TOLOWER ${_build} _build_lowercase)
+
+ SET(_test ${_category}/${_step}.${_build_lowercase})
+
+ # Respect TEST_PICKUP_REGEX:
+ IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR
+ _test MATCHES "${TEST_PICKUP_REGEX}" )
+
+ SET(_step_dir ${CMAKE_CURRENT_BINARY_DIR}/${_step}.${_build_lowercase})
+
+ FILE(GLOB _files ${_step_full}/*)
+ SET(_command)
+ FOREACH(_file ${_files})
+ IF(NOT _file MATCHES "/(doc|.svn)")
+ LIST(APPEND _command
+ COMMAND ${CMAKE_COMMAND} -E copy ${_file} ${_step_dir}
+ )
+ ENDIF()
+ ENDFOREACH()
+
+ # A rule how to copy the example step to the current directory:
+ ADD_CUSTOM_COMMAND(OUTPUT ${_step_dir}/CMakeLists.txt
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${_step_dir}
+ ${_command}
+ DEPENDS
+ ${_files}
+ ${DEAL_II_TARGET_DEBUG}
+ ${DEAL_II_TARGET_RELEASE}
+ )
+
+ # And a rule on how to configure the example step:
+ ADD_CUSTOM_COMMAND(OUTPUT ${_step_dir}/configure_output
+ COMMAND rm -f ${_step_dir}/failing_configure_output
+ COMMAND ${CMAKE_COMMAND}
+ -DDEAL_II_DIR=${DEAL_II_BINARY_DIR} -DCMAKE_BUILD_TYPE=${_build} .
+ > ${_step_dir}/configure_output 2>&1
+ || (mv ${_step_dir}/configure_output
+ ${_step_dir}/failing_configure_output
+ && echo "${_test}: CONFIGURE failed. Output:"
+ && cat ${_step_dir}/failing_configure_output) # succeed anyway!
+ WORKING_DIRECTORY ${_step_dir}
+ DEPENDS ${_step_dir}/CMakeLists.txt
+ ${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PACKAGE_NAME}Config.cmake
+ )
+
+ # And a rule on how to build the example step:
+ ADD_CUSTOM_COMMAND(OUTPUT ${_step_dir}/build_output
+ COMMAND [ ! -f ${_step_dir}/configure_output ]
+ || (rm -f ${_step_dir}/failing_build_output
+ &&${CMAKE_COMMAND} --build ${_step_dir} --target all
+ > ${_step_dir}/build_output 2>&1)
+ || (mv ${_step_dir}/build_output
+ ${_step_dir}/failing_build_output
+ && echo "${_test}: CONFIGURE successful."
+ && echo "${_test}: BUILD failed. Output:"
+ && cat ${_step_dir}/failing_build_output
+ && exit 1)
+ COMMAND [ -f ${_step_dir}/configure_output ]
+ || (rm -f ${_step_dir}/build_output
+ && rm -f ${_step_dir}/failing_build_output
+ && echo "${_test}: BUILD stage not invoked due to failing CONFIGURE") # succeed anyway!
+ WORKING_DIRECTORY ${_step_dir}
+ DEPENDS ${_step_dir}/configure_output
+ )
+
+ # And a rule on how to run the example step:
+ ADD_CUSTOM_COMMAND(OUTPUT ${_step_dir}/run_output
+ COMMAND [ ! -f ${_step_dir}/build_output ]
+ || (rm -f ${_step_dir}/failing_run_output
+ && ${CMAKE_COMMAND} --build ${_step_dir} --target run
+ > ${_step_dir}/run_output 2>&1)
+ || (mv ${_step_dir}/run_output
+ ${_step_dir}/failing_run_output
+ && echo "${_test}: CONFIGURE successful."
+ && echo "${_test}: BUILD successful."
+ && echo "${_test}: RUN failed. Output:"
+ && cat ${_step_dir}/failing_run_output
+ && exit 1)
+ COMMAND [ -f ${_step_dir}/build_output ]
+ || ( rm -f ${_step_dir}/run_output
+ && rm -f ${_step_dir}/failing_run_output
+ && echo "${_test}: RUN stage not invoked due to failing BUILD"
+ && exit 1)
+ WORKING_DIRECTORY ${_step_dir}
+ DEPENDS ${_step_dir}/build_output
+ )
+
+ ITEM_MATCHES(_match ${_step} ${_${_build_lowercase}_steps})
+ IF(_match)
+ # Add a full test (CONFIGURE, BUILD, RUN):
+ SET(_target ${_category}-${_step}.${_build_lowercase}.run)
+ ADD_CUSTOM_TARGET(${_target}
+ COMMAND
+ echo "${_test}: CONFIGURE successful."
+ && echo "${_test}: BUILD successful."
+ && echo "${_test}: RUN successful."
+ && echo "${_test}: PASSED."
+ DEPENDS ${_step_dir}/run_output
+ )
+ ELSE()
+ # Add a minimal test (CONFIGURE, BUILD):
+ SET(_target ${_category}-${_step}.${_build_lowercase}.build)
+ ADD_CUSTOM_TARGET(${_target}
+ COMMAND
+ echo "${_test}: CONFIGURE successful."
+ && echo "${_test}: BUILD successful."
+ && echo "${_test}: PASSED."
+ DEPENDS ${_step_dir}/build_output
+ )
+ ENDIF()
+
+ # And finally add the test:
+ ADD_TEST(NAME ${_test}
+ COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_test}
+ -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ SET_TESTS_PROPERTIES(${_test} PROPERTIES
+ LABEL "${_category}"
+ TIMEOUT ${TEST_TIME_LIMIT}
+ )
+
+ ENDIF()
+ ENDFOREACH()
+ENDFOREACH()
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
+PROJECT(testsuite CXX)
+INCLUDE(${DEAL_II_EXECUTABLE_CONFIG})
+
+#
+# Tests for the mesh_converter executable
+#
+
+SET(_category mesh_converter)
+
+FILE(GLOB _meshes ${CMAKE_CURRENT_SOURCE_DIR}/meshes/?d/*.inp)
+
+FOREACH(_full_file ${_meshes})
+ GET_FILENAME_COMPONENT(_mesh ${_full_file} NAME_WE)
+
+ SET(_test_full ${_category}/${_mesh})
+ SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_mesh}) # directory to run the test in
+ STRING(REGEX REPLACE "\\.inp$" ".ucd" _comparison_file ${_full_file})
+
+ # Is this a 3D or 2D mesh?
+ SET(_dim 3)
+ IF(_full_file MATCHES "meshes/2d")
+ SET(_dim 2)
+ ENDIF()
+
+ # Respect TEST_PICKUP_REGEX:
+ IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR
+ _test_full MATCHES "${TEST_PICKUP_REGEX}" )
+
+ FILE(MAKE_DIRECTORY ${_test_directory})
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/output
+ COMMAND rm -f ${_test_directory}/failing_output
+ COMMAND touch ${_test_directory}/output
+ COMMAND
+ mesh_converter_exe ${_dim} ${_full_file} output
+ || (mv ${_test_directory}/output
+ ${_test_directory}/failing_output
+ && echo "${_test_full}: RUN failed. ------ Result: ${_test_directory}/failing_output"
+ && echo "${_test_full}: RUN failed. ------ Partial output:"
+ && cat ${_test_directory}/failing_output
+ && exit 1)
+ COMMAND
+ ${PERL_EXECUTABLE} -pi ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
+ ${_test_directory}/output
+ WORKING_DIRECTORY ${_test_directory}
+ DEPENDS mesh_converter_exe ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
+ )
+ ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff
+ COMMAND rm -f ${_test_directory}/failing_diff
+ COMMAND touch ${_test_directory}/diff
+ COMMAND
+ ${TEST_DIFF} ${_test_directory}/output ${_comparison_file} > ${_test_directory}/diff
+ || (mv ${_test_directory}/diff
+ ${_test_directory}/failing_diff
+ && echo "${_test_full}: RUN successful."
+ && echo "${_test_full}: DIFF failed. ------ Source: ${_comparison_file}"
+ && echo "${_test_full}: DIFF failed. ------ Result: ${_test_directory}/output"
+ && echo "${_test_full}: DIFF failed. ------ Diff: ${_test_directory}/failing_diff"
+ && echo "${_test_full}: DIFF failed. ------ Diffs as follows:"
+ && cat ${_test_directory}/failing_diff
+ && exit 1)
+ WORKING_DIRECTORY ${_test_directory}
+ DEPENDS
+ ${_test_directory}/output
+ ${_comparison_file}
+ )
+
+ ADD_CUSTOM_TARGET(${_mesh}.diff DEPENDS ${_test_directory}/diff
+ COMMAND
+ echo "${_test_full}: RUN successful."
+ && echo "${_test_full}: DIFF successful."
+ && echo "${_test_full}: PASSED."
+ )
+
+ ADD_TEST(NAME ${_test_full}
+ COMMAND ${CMAKE_COMMAND}
+ -DTRGT=${_mesh}.diff
+ -DTEST=${_test_full}
+ -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
+ WORKING_DIRECTORY ${_test_directory}
+ )
+ SET_TESTS_PROPERTIES(${_test_full} PROPERTIES
+ LABEL "${_category}"
+ TIMEOUT ${TEST_TIME_LIMIT}
+ )
+
+ ENDIF()
+
+ENDFOREACH()
--- /dev/null
+*HEADING
+cubit(rent/Geometry/Mesh_conversion/Program/mesh/2d/2d_test.inp): 01/17/2009: 16
+*NODE
+ 1, -1.000000e+00, 0.000000e+00, 0.000000e+00
+ 2, -1.000000e+00, -1.666667e-01, 0.000000e+00
+ 3, -8.333333e-01, -1.666667e-01, 0.000000e+00
+ 4, -8.333333e-01, 0.000000e+00, 0.000000e+00
+ 5, -1.000000e+00, -3.333333e-01, 0.000000e+00
+ 6, -8.333333e-01, -3.333333e-01, 0.000000e+00
+ 7, -1.000000e+00, -5.000000e-01, 0.000000e+00
+ 8, -8.333333e-01, -5.000000e-01, 0.000000e+00
+ 9, -1.000000e+00, -6.666667e-01, 0.000000e+00
+ 10, -8.333333e-01, -6.666667e-01, 0.000000e+00
+ 11, -1.000000e+00, -8.333333e-01, 0.000000e+00
+ 12, -8.333333e-01, -8.333333e-01, 0.000000e+00
+ 13, -1.000000e+00, -1.000000e+00, 0.000000e+00
+ 14, -8.333333e-01, -1.000000e+00, 0.000000e+00
+ 15, -6.666667e-01, -1.666667e-01, 0.000000e+00
+ 16, -6.666667e-01, 0.000000e+00, 0.000000e+00
+ 17, -6.666667e-01, -3.333333e-01, 0.000000e+00
+ 18, -6.666667e-01, -5.000000e-01, 0.000000e+00
+ 19, -6.666667e-01, -6.666667e-01, 0.000000e+00
+ 20, -6.666667e-01, -8.333333e-01, 0.000000e+00
+ 21, -6.666667e-01, -1.000000e+00, 0.000000e+00
+ 22, -5.000000e-01, -1.666667e-01, 0.000000e+00
+ 23, -5.000000e-01, 0.000000e+00, 0.000000e+00
+ 24, -5.000000e-01, -3.333333e-01, 0.000000e+00
+ 25, -5.000000e-01, -5.000000e-01, 0.000000e+00
+ 26, -5.000000e-01, -6.666667e-01, 0.000000e+00
+ 27, -5.000000e-01, -8.333333e-01, 0.000000e+00
+ 28, -5.000000e-01, -1.000000e+00, 0.000000e+00
+ 29, -3.333333e-01, -1.666667e-01, 0.000000e+00
+ 30, -3.333333e-01, 0.000000e+00, 0.000000e+00
+ 31, -3.333333e-01, -3.333333e-01, 0.000000e+00
+ 32, -3.333333e-01, -5.000000e-01, 0.000000e+00
+ 33, -3.333333e-01, -6.666667e-01, 0.000000e+00
+ 34, -3.333333e-01, -8.333333e-01, 0.000000e+00
+ 35, -3.333333e-01, -1.000000e+00, 0.000000e+00
+ 36, -1.666667e-01, -1.666667e-01, 0.000000e+00
+ 37, -1.666667e-01, 0.000000e+00, 0.000000e+00
+ 38, -1.666667e-01, -3.333333e-01, 0.000000e+00
+ 39, -1.666667e-01, -5.000000e-01, 0.000000e+00
+ 40, -1.666667e-01, -6.666667e-01, 0.000000e+00
+ 41, -1.666667e-01, -8.333333e-01, 0.000000e+00
+ 42, -1.666667e-01, -1.000000e+00, 0.000000e+00
+ 43, -1.387779e-17, -1.666667e-01, 0.000000e+00
+ 44, 0.000000e+00, 0.000000e+00, 0.000000e+00
+ 45, -3.122502e-17, -3.333333e-01, 0.000000e+00
+ 46, -4.250073e-17, -5.000000e-01, 0.000000e+00
+ 47, -4.531965e-17, -6.666667e-01, 0.000000e+00
+ 48, -5.990217e-17, -8.333333e-01, 0.000000e+00
+ 49, 0.000000e+00, -1.000000e+00, 0.000000e+00
+ 50, 1.666667e-01, -1.666667e-01, 0.000000e+00
+ 51, 1.666667e-01, 1.387779e-17, 0.000000e+00
+ 52, 1.666667e-01, -3.333333e-01, 0.000000e+00
+ 53, 1.666667e-01, -5.000000e-01, 0.000000e+00
+ 54, 1.666667e-01, -6.666667e-01, 0.000000e+00
+ 55, 1.666667e-01, -8.333333e-01, 0.000000e+00
+ 56, 1.666667e-01, -1.000000e+00, 0.000000e+00
+ 57, 3.333333e-01, -1.666667e-01, 0.000000e+00
+ 58, 3.333333e-01, 3.122502e-17, 0.000000e+00
+ 59, 3.333333e-01, -3.333333e-01, 0.000000e+00
+ 60, 3.333333e-01, -5.000000e-01, 0.000000e+00
+ 61, 3.333333e-01, -6.666667e-01, 0.000000e+00
+ 62, 3.333333e-01, -8.333333e-01, 0.000000e+00
+ 63, 3.333333e-01, -1.000000e+00, 0.000000e+00
+ 64, 5.000000e-01, -1.666667e-01, 0.000000e+00
+ 65, 5.000000e-01, 4.943962e-17, 0.000000e+00
+ 66, 5.000000e-01, -3.333333e-01, 0.000000e+00
+ 67, 5.000000e-01, -5.000000e-01, 0.000000e+00
+ 68, 5.000000e-01, -6.666667e-01, 0.000000e+00
+ 69, 5.000000e-01, -8.333333e-01, 0.000000e+00
+ 70, 5.000000e-01, -1.000000e+00, 0.000000e+00
+ 71, 6.666667e-01, -1.666667e-01, 0.000000e+00
+ 72, 6.666667e-01, 4.705437e-17, 0.000000e+00
+ 73, 6.666667e-01, -3.333333e-01, 0.000000e+00
+ 74, 6.666667e-01, -5.000000e-01, 0.000000e+00
+ 75, 6.666667e-01, -6.666667e-01, 0.000000e+00
+ 76, 6.666667e-01, -8.333333e-01, 0.000000e+00
+ 77, 6.666667e-01, -1.000000e+00, 0.000000e+00
+ 78, 8.333333e-01, -1.666667e-01, 0.000000e+00
+ 79, 8.333333e-01, 6.033585e-17, 0.000000e+00
+ 80, 8.333333e-01, -3.333333e-01, 0.000000e+00
+ 81, 8.333333e-01, -5.000000e-01, 0.000000e+00
+ 82, 8.333333e-01, -6.666667e-01, 0.000000e+00
+ 83, 8.333333e-01, -8.333333e-01, 0.000000e+00
+ 84, 8.333333e-01, -1.000000e+00, 0.000000e+00
+ 85, 1.000000e+00, -1.666667e-01, 0.000000e+00
+ 86, 1.000000e+00, 0.000000e+00, 0.000000e+00
+ 87, 1.000000e+00, -3.333333e-01, 0.000000e+00
+ 88, 1.000000e+00, -5.000000e-01, 0.000000e+00
+ 89, 1.000000e+00, -6.666667e-01, 0.000000e+00
+ 90, 1.000000e+00, -8.333333e-01, 0.000000e+00
+ 91, 1.000000e+00, -1.000000e+00, 0.000000e+00
+ 92, 1.000000e+00, 1.666667e-01, 0.000000e+00
+ 93, 8.333333e-01, 1.666667e-01, 0.000000e+00
+ 94, 1.000000e+00, 3.333333e-01, 0.000000e+00
+ 95, 8.333333e-01, 3.333333e-01, 0.000000e+00
+ 96, 1.000000e+00, 5.000000e-01, 0.000000e+00
+ 97, 8.333333e-01, 5.000000e-01, 0.000000e+00
+ 98, 1.000000e+00, 6.666667e-01, 0.000000e+00
+ 99, 8.333333e-01, 6.666667e-01, 0.000000e+00
+ 100, 1.000000e+00, 8.333333e-01, 0.000000e+00
+ 101, 8.333333e-01, 8.333333e-01, 0.000000e+00
+ 102, 1.000000e+00, 1.000000e+00, 0.000000e+00
+ 103, 8.333333e-01, 1.000000e+00, 0.000000e+00
+ 104, 6.666667e-01, 1.666667e-01, 0.000000e+00
+ 105, 6.666667e-01, 3.333333e-01, 0.000000e+00
+ 106, 6.666667e-01, 5.000000e-01, 0.000000e+00
+ 107, 6.666667e-01, 6.666667e-01, 0.000000e+00
+ 108, 6.666667e-01, 8.333333e-01, 0.000000e+00
+ 109, 6.666667e-01, 1.000000e+00, 0.000000e+00
+ 110, 5.000000e-01, 1.666667e-01, 0.000000e+00
+ 111, 5.000000e-01, 3.333333e-01, 0.000000e+00
+ 112, 5.000000e-01, 5.000000e-01, 0.000000e+00
+ 113, 5.000000e-01, 6.666667e-01, 0.000000e+00
+ 114, 5.000000e-01, 8.333333e-01, 0.000000e+00
+ 115, 5.000000e-01, 1.000000e+00, 0.000000e+00
+ 116, 3.333333e-01, 1.666667e-01, 0.000000e+00
+ 117, 3.333333e-01, 3.333333e-01, 0.000000e+00
+ 118, 3.333333e-01, 5.000000e-01, 0.000000e+00
+ 119, 3.333333e-01, 6.666667e-01, 0.000000e+00
+ 120, 3.333333e-01, 8.333333e-01, 0.000000e+00
+ 121, 3.333333e-01, 1.000000e+00, 0.000000e+00
+ 122, 1.666667e-01, 1.666667e-01, 0.000000e+00
+ 123, 1.666667e-01, 3.333333e-01, 0.000000e+00
+ 124, 1.666667e-01, 5.000000e-01, 0.000000e+00
+ 125, 1.666667e-01, 6.666667e-01, 0.000000e+00
+ 126, 1.666667e-01, 8.333333e-01, 0.000000e+00
+ 127, 1.666667e-01, 1.000000e+00, 0.000000e+00
+ 128, 0.000000e+00, 1.666667e-01, 0.000000e+00
+ 129, 0.000000e+00, 3.333333e-01, 0.000000e+00
+ 130, 0.000000e+00, 5.000000e-01, 0.000000e+00
+ 131, 0.000000e+00, 6.666667e-01, 0.000000e+00
+ 132, 0.000000e+00, 8.333333e-01, 0.000000e+00
+ 133, 0.000000e+00, 1.000000e+00, 0.000000e+00
+*ELEMENT, TYPE=S4R, ELSET=EB1
+ 1, 1, 2, 3, 4
+ 2, 2, 5, 6, 3
+ 3, 5, 7, 8, 6
+ 4, 7, 9, 10, 8
+ 5, 9, 11, 12, 10
+ 6, 11, 13, 14, 12
+ 7, 4, 3, 15, 16
+ 8, 3, 6, 17, 15
+ 9, 6, 8, 18, 17
+ 10, 8, 10, 19, 18
+ 11, 10, 12, 20, 19
+ 12, 12, 14, 21, 20
+ 13, 16, 15, 22, 23
+ 14, 15, 17, 24, 22
+ 15, 17, 18, 25, 24
+ 16, 18, 19, 26, 25
+ 17, 19, 20, 27, 26
+ 18, 20, 21, 28, 27
+ 19, 23, 22, 29, 30
+ 20, 22, 24, 31, 29
+ 21, 24, 25, 32, 31
+ 22, 25, 26, 33, 32
+ 23, 26, 27, 34, 33
+ 24, 27, 28, 35, 34
+ 25, 30, 29, 36, 37
+ 26, 29, 31, 38, 36
+ 27, 31, 32, 39, 38
+ 28, 32, 33, 40, 39
+ 29, 33, 34, 41, 40
+ 30, 34, 35, 42, 41
+ 31, 37, 36, 43, 44
+ 32, 36, 38, 45, 43
+ 33, 38, 39, 46, 45
+ 34, 39, 40, 47, 46
+ 35, 40, 41, 48, 47
+ 36, 41, 42, 49, 48
+ 37, 44, 43, 50, 51
+ 38, 43, 45, 52, 50
+ 39, 45, 46, 53, 52
+ 40, 46, 47, 54, 53
+ 41, 47, 48, 55, 54
+ 42, 48, 49, 56, 55
+ 43, 51, 50, 57, 58
+ 44, 50, 52, 59, 57
+ 45, 52, 53, 60, 59
+ 46, 53, 54, 61, 60
+ 47, 54, 55, 62, 61
+ 48, 55, 56, 63, 62
+ 49, 58, 57, 64, 65
+ 50, 57, 59, 66, 64
+ 51, 59, 60, 67, 66
+ 52, 60, 61, 68, 67
+ 53, 61, 62, 69, 68
+ 54, 62, 63, 70, 69
+ 55, 65, 64, 71, 72
+ 56, 64, 66, 73, 71
+ 57, 66, 67, 74, 73
+ 58, 67, 68, 75, 74
+ 59, 68, 69, 76, 75
+ 60, 69, 70, 77, 76
+ 61, 72, 71, 78, 79
+ 62, 71, 73, 80, 78
+ 63, 73, 74, 81, 80
+ 64, 74, 75, 82, 81
+ 65, 75, 76, 83, 82
+ 66, 76, 77, 84, 83
+ 67, 79, 78, 85, 86
+ 68, 78, 80, 87, 85
+ 69, 80, 81, 88, 87
+ 70, 81, 82, 89, 88
+ 71, 82, 83, 90, 89
+ 72, 83, 84, 91, 90
+ 73, 86, 92, 93, 79
+ 74, 92, 94, 95, 93
+ 75, 94, 96, 97, 95
+ 76, 96, 98, 99, 97
+ 77, 98, 100, 101, 99
+ 78, 100, 102, 103, 101
+ 79, 79, 93, 104, 72
+ 80, 93, 95, 105, 104
+ 81, 95, 97, 106, 105
+ 82, 97, 99, 107, 106
+ 83, 99, 101, 108, 107
+ 84, 101, 103, 109, 108
+ 85, 72, 104, 110, 65
+ 86, 104, 105, 111, 110
+ 87, 105, 106, 112, 111
+ 88, 106, 107, 113, 112
+ 89, 107, 108, 114, 113
+ 90, 108, 109, 115, 114
+ 91, 65, 110, 116, 58
+ 92, 110, 111, 117, 116
+ 93, 111, 112, 118, 117
+ 94, 112, 113, 119, 118
+ 95, 113, 114, 120, 119
+ 96, 114, 115, 121, 120
+ 97, 58, 116, 122, 51
+ 98, 116, 117, 123, 122
+ 99, 117, 118, 124, 123
+ 100, 118, 119, 125, 124
+ 101, 119, 120, 126, 125
+ 102, 120, 121, 127, 126
+ 103, 51, 122, 128, 44
+ 104, 122, 123, 129, 128
+ 105, 123, 124, 130, 129
+ 106, 124, 125, 131, 130
+ 107, 125, 126, 132, 131
+ 108, 126, 127, 133, 132
+*SURFACE, NAME=SS1
+ 78, E2
+ 84, E2
+ 90, E2
+ 96, E2
+ 102, E2
+ 108, E2
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+133 114 0 0 0
+1 -1.00000000e+00 0.00000000e+00 0.00000000e+00
+2 -1.00000000e+00 -1.66666700e-01 0.00000000e+00
+3 -8.33333300e-01 -1.66666700e-01 0.00000000e+00
+4 -8.33333300e-01 0.00000000e+00 0.00000000e+00
+5 -1.00000000e+00 -3.33333300e-01 0.00000000e+00
+6 -8.33333300e-01 -3.33333300e-01 0.00000000e+00
+7 -1.00000000e+00 -5.00000000e-01 0.00000000e+00
+8 -8.33333300e-01 -5.00000000e-01 0.00000000e+00
+9 -1.00000000e+00 -6.66666700e-01 0.00000000e+00
+10 -8.33333300e-01 -6.66666700e-01 0.00000000e+00
+11 -1.00000000e+00 -8.33333300e-01 0.00000000e+00
+12 -8.33333300e-01 -8.33333300e-01 0.00000000e+00
+13 -1.00000000e+00 -1.00000000e+00 0.00000000e+00
+14 -8.33333300e-01 -1.00000000e+00 0.00000000e+00
+15 -6.66666700e-01 -1.66666700e-01 0.00000000e+00
+16 -6.66666700e-01 0.00000000e+00 0.00000000e+00
+17 -6.66666700e-01 -3.33333300e-01 0.00000000e+00
+18 -6.66666700e-01 -5.00000000e-01 0.00000000e+00
+19 -6.66666700e-01 -6.66666700e-01 0.00000000e+00
+20 -6.66666700e-01 -8.33333300e-01 0.00000000e+00
+21 -6.66666700e-01 -1.00000000e+00 0.00000000e+00
+22 -5.00000000e-01 -1.66666700e-01 0.00000000e+00
+23 -5.00000000e-01 0.00000000e+00 0.00000000e+00
+24 -5.00000000e-01 -3.33333300e-01 0.00000000e+00
+25 -5.00000000e-01 -5.00000000e-01 0.00000000e+00
+26 -5.00000000e-01 -6.66666700e-01 0.00000000e+00
+27 -5.00000000e-01 -8.33333300e-01 0.00000000e+00
+28 -5.00000000e-01 -1.00000000e+00 0.00000000e+00
+29 -3.33333300e-01 -1.66666700e-01 0.00000000e+00
+30 -3.33333300e-01 0.00000000e+00 0.00000000e+00
+31 -3.33333300e-01 -3.33333300e-01 0.00000000e+00
+32 -3.33333300e-01 -5.00000000e-01 0.00000000e+00
+33 -3.33333300e-01 -6.66666700e-01 0.00000000e+00
+34 -3.33333300e-01 -8.33333300e-01 0.00000000e+00
+35 -3.33333300e-01 -1.00000000e+00 0.00000000e+00
+36 -1.66666700e-01 -1.66666700e-01 0.00000000e+00
+37 -1.66666700e-01 0.00000000e+00 0.00000000e+00
+38 -1.66666700e-01 -3.33333300e-01 0.00000000e+00
+39 -1.66666700e-01 -5.00000000e-01 0.00000000e+00
+40 -1.66666700e-01 -6.66666700e-01 0.00000000e+00
+41 -1.66666700e-01 -8.33333300e-01 0.00000000e+00
+42 -1.66666700e-01 -1.00000000e+00 0.00000000e+00
+43 0.00000000e+00 -1.66666700e-01 0.00000000e+00
+44 0.00000000e+00 0.00000000e+00 0.00000000e+00
+45 0.00000000e+00 -3.33333300e-01 0.00000000e+00
+46 0.00000000e+00 -5.00000000e-01 0.00000000e+00
+47 0.00000000e+00 -6.66666700e-01 0.00000000e+00
+48 0.00000000e+00 -8.33333300e-01 0.00000000e+00
+49 0.00000000e+00 -1.00000000e+00 0.00000000e+00
+50 1.66666700e-01 -1.66666700e-01 0.00000000e+00
+51 1.66666700e-01 0.00000000e+00 0.00000000e+00
+52 1.66666700e-01 -3.33333300e-01 0.00000000e+00
+53 1.66666700e-01 -5.00000000e-01 0.00000000e+00
+54 1.66666700e-01 -6.66666700e-01 0.00000000e+00
+55 1.66666700e-01 -8.33333300e-01 0.00000000e+00
+56 1.66666700e-01 -1.00000000e+00 0.00000000e+00
+57 3.33333300e-01 -1.66666700e-01 0.00000000e+00
+58 3.33333300e-01 0.00000000e+00 0.00000000e+00
+59 3.33333300e-01 -3.33333300e-01 0.00000000e+00
+60 3.33333300e-01 -5.00000000e-01 0.00000000e+00
+61 3.33333300e-01 -6.66666700e-01 0.00000000e+00
+62 3.33333300e-01 -8.33333300e-01 0.00000000e+00
+63 3.33333300e-01 -1.00000000e+00 0.00000000e+00
+64 5.00000000e-01 -1.66666700e-01 0.00000000e+00
+65 5.00000000e-01 0.00000000e+00 0.00000000e+00
+66 5.00000000e-01 -3.33333300e-01 0.00000000e+00
+67 5.00000000e-01 -5.00000000e-01 0.00000000e+00
+68 5.00000000e-01 -6.66666700e-01 0.00000000e+00
+69 5.00000000e-01 -8.33333300e-01 0.00000000e+00
+70 5.00000000e-01 -1.00000000e+00 0.00000000e+00
+71 6.66666700e-01 -1.66666700e-01 0.00000000e+00
+72 6.66666700e-01 0.00000000e+00 0.00000000e+00
+73 6.66666700e-01 -3.33333300e-01 0.00000000e+00
+74 6.66666700e-01 -5.00000000e-01 0.00000000e+00
+75 6.66666700e-01 -6.66666700e-01 0.00000000e+00
+76 6.66666700e-01 -8.33333300e-01 0.00000000e+00
+77 6.66666700e-01 -1.00000000e+00 0.00000000e+00
+78 8.33333300e-01 -1.66666700e-01 0.00000000e+00
+79 8.33333300e-01 0.00000000e+00 0.00000000e+00
+80 8.33333300e-01 -3.33333300e-01 0.00000000e+00
+81 8.33333300e-01 -5.00000000e-01 0.00000000e+00
+82 8.33333300e-01 -6.66666700e-01 0.00000000e+00
+83 8.33333300e-01 -8.33333300e-01 0.00000000e+00
+84 8.33333300e-01 -1.00000000e+00 0.00000000e+00
+85 1.00000000e+00 -1.66666700e-01 0.00000000e+00
+86 1.00000000e+00 0.00000000e+00 0.00000000e+00
+87 1.00000000e+00 -3.33333300e-01 0.00000000e+00
+88 1.00000000e+00 -5.00000000e-01 0.00000000e+00
+89 1.00000000e+00 -6.66666700e-01 0.00000000e+00
+90 1.00000000e+00 -8.33333300e-01 0.00000000e+00
+91 1.00000000e+00 -1.00000000e+00 0.00000000e+00
+92 1.00000000e+00 1.66666700e-01 0.00000000e+00
+93 8.33333300e-01 1.66666700e-01 0.00000000e+00
+94 1.00000000e+00 3.33333300e-01 0.00000000e+00
+95 8.33333300e-01 3.33333300e-01 0.00000000e+00
+96 1.00000000e+00 5.00000000e-01 0.00000000e+00
+97 8.33333300e-01 5.00000000e-01 0.00000000e+00
+98 1.00000000e+00 6.66666700e-01 0.00000000e+00
+99 8.33333300e-01 6.66666700e-01 0.00000000e+00
+100 1.00000000e+00 8.33333300e-01 0.00000000e+00
+101 8.33333300e-01 8.33333300e-01 0.00000000e+00
+102 1.00000000e+00 1.00000000e+00 0.00000000e+00
+103 8.33333300e-01 1.00000000e+00 0.00000000e+00
+104 6.66666700e-01 1.66666700e-01 0.00000000e+00
+105 6.66666700e-01 3.33333300e-01 0.00000000e+00
+106 6.66666700e-01 5.00000000e-01 0.00000000e+00
+107 6.66666700e-01 6.66666700e-01 0.00000000e+00
+108 6.66666700e-01 8.33333300e-01 0.00000000e+00
+109 6.66666700e-01 1.00000000e+00 0.00000000e+00
+110 5.00000000e-01 1.66666700e-01 0.00000000e+00
+111 5.00000000e-01 3.33333300e-01 0.00000000e+00
+112 5.00000000e-01 5.00000000e-01 0.00000000e+00
+113 5.00000000e-01 6.66666700e-01 0.00000000e+00
+114 5.00000000e-01 8.33333300e-01 0.00000000e+00
+115 5.00000000e-01 1.00000000e+00 0.00000000e+00
+116 3.33333300e-01 1.66666700e-01 0.00000000e+00
+117 3.33333300e-01 3.33333300e-01 0.00000000e+00
+118 3.33333300e-01 5.00000000e-01 0.00000000e+00
+119 3.33333300e-01 6.66666700e-01 0.00000000e+00
+120 3.33333300e-01 8.33333300e-01 0.00000000e+00
+121 3.33333300e-01 1.00000000e+00 0.00000000e+00
+122 1.66666700e-01 1.66666700e-01 0.00000000e+00
+123 1.66666700e-01 3.33333300e-01 0.00000000e+00
+124 1.66666700e-01 5.00000000e-01 0.00000000e+00
+125 1.66666700e-01 6.66666700e-01 0.00000000e+00
+126 1.66666700e-01 8.33333300e-01 0.00000000e+00
+127 1.66666700e-01 1.00000000e+00 0.00000000e+00
+128 0.00000000e+00 1.66666700e-01 0.00000000e+00
+129 0.00000000e+00 3.33333300e-01 0.00000000e+00
+130 0.00000000e+00 5.00000000e-01 0.00000000e+00
+131 0.00000000e+00 6.66666700e-01 0.00000000e+00
+132 0.00000000e+00 8.33333300e-01 0.00000000e+00
+133 0.00000000e+00 1.00000000e+00 0.00000000e+00
+1 1 quad 1 2 3 4
+2 1 quad 2 5 6 3
+3 1 quad 5 7 8 6
+4 1 quad 7 9 10 8
+5 1 quad 9 11 12 10
+6 1 quad 11 13 14 12
+7 1 quad 4 3 15 16
+8 1 quad 3 6 17 15
+9 1 quad 6 8 18 17
+10 1 quad 8 10 19 18
+11 1 quad 10 12 20 19
+12 1 quad 12 14 21 20
+13 1 quad 16 15 22 23
+14 1 quad 15 17 24 22
+15 1 quad 17 18 25 24
+16 1 quad 18 19 26 25
+17 1 quad 19 20 27 26
+18 1 quad 20 21 28 27
+19 1 quad 23 22 29 30
+20 1 quad 22 24 31 29
+21 1 quad 24 25 32 31
+22 1 quad 25 26 33 32
+23 1 quad 26 27 34 33
+24 1 quad 27 28 35 34
+25 1 quad 30 29 36 37
+26 1 quad 29 31 38 36
+27 1 quad 31 32 39 38
+28 1 quad 32 33 40 39
+29 1 quad 33 34 41 40
+30 1 quad 34 35 42 41
+31 1 quad 37 36 43 44
+32 1 quad 36 38 45 43
+33 1 quad 38 39 46 45
+34 1 quad 39 40 47 46
+35 1 quad 40 41 48 47
+36 1 quad 41 42 49 48
+37 1 quad 44 43 50 51
+38 1 quad 43 45 52 50
+39 1 quad 45 46 53 52
+40 1 quad 46 47 54 53
+41 1 quad 47 48 55 54
+42 1 quad 48 49 56 55
+43 1 quad 51 50 57 58
+44 1 quad 50 52 59 57
+45 1 quad 52 53 60 59
+46 1 quad 53 54 61 60
+47 1 quad 54 55 62 61
+48 1 quad 55 56 63 62
+49 1 quad 58 57 64 65
+50 1 quad 57 59 66 64
+51 1 quad 59 60 67 66
+52 1 quad 60 61 68 67
+53 1 quad 61 62 69 68
+54 1 quad 62 63 70 69
+55 1 quad 65 64 71 72
+56 1 quad 64 66 73 71
+57 1 quad 66 67 74 73
+58 1 quad 67 68 75 74
+59 1 quad 68 69 76 75
+60 1 quad 69 70 77 76
+61 1 quad 72 71 78 79
+62 1 quad 71 73 80 78
+63 1 quad 73 74 81 80
+64 1 quad 74 75 82 81
+65 1 quad 75 76 83 82
+66 1 quad 76 77 84 83
+67 1 quad 79 78 85 86
+68 1 quad 78 80 87 85
+69 1 quad 80 81 88 87
+70 1 quad 81 82 89 88
+71 1 quad 82 83 90 89
+72 1 quad 83 84 91 90
+73 1 quad 86 92 93 79
+74 1 quad 92 94 95 93
+75 1 quad 94 96 97 95
+76 1 quad 96 98 99 97
+77 1 quad 98 100 101 99
+78 1 quad 100 102 103 101
+79 1 quad 79 93 104 72
+80 1 quad 93 95 105 104
+81 1 quad 95 97 106 105
+82 1 quad 97 99 107 106
+83 1 quad 99 101 108 107
+84 1 quad 101 103 109 108
+85 1 quad 72 104 110 65
+86 1 quad 104 105 111 110
+87 1 quad 105 106 112 111
+88 1 quad 106 107 113 112
+89 1 quad 107 108 114 113
+90 1 quad 108 109 115 114
+91 1 quad 65 110 116 58
+92 1 quad 110 111 117 116
+93 1 quad 111 112 118 117
+94 1 quad 112 113 119 118
+95 1 quad 113 114 120 119
+96 1 quad 114 115 121 120
+97 1 quad 58 116 122 51
+98 1 quad 116 117 123 122
+99 1 quad 117 118 124 123
+100 1 quad 118 119 125 124
+101 1 quad 119 120 126 125
+102 1 quad 120 121 127 126
+103 1 quad 51 122 128 44
+104 1 quad 122 123 129 128
+105 1 quad 123 124 130 129
+106 1 quad 124 125 131 130
+107 1 quad 125 126 132 131
+108 1 quad 126 127 133 132
+1 1 line 102 103
+2 1 line 103 109
+3 1 line 109 115
+4 1 line 115 121
+5 1 line 121 127
+6 1 line 127 133
--- /dev/null
+*HEADING
+cubit(y/Work/Current/Geometry/Mesh_conversion/mesh/2d/quad2.inp): 01/17/2009: 13
+*NODE
+ 1, -1.000000e+00, 1.000000e+00, 0.000000e+00
+ 2, -1.000000e+00, 0.000000e+00, 0.000000e+00
+ 3, 0.000000e+00, 0.000000e+00, 0.000000e+00
+ 4, 0.000000e+00, 1.000000e+00, 0.000000e+00
+ 5, -1.000000e+00, -1.000000e+00, 0.000000e+00
+ 6, 0.000000e+00, -1.000000e+00, 0.000000e+00
+ 7, 1.000000e+00, 0.000000e+00, 0.000000e+00
+ 8, 1.000000e+00, 1.000000e+00, 0.000000e+00
+ 9, 1.000000e+00, -1.000000e+00, 0.000000e+00
+*ELEMENT, TYPE=S4R, ELSET=EB14
+ 1, 1, 2, 3, 4
+ 2, 2, 5, 6, 3
+ 3, 4, 3, 7, 8
+ 4, 3, 6, 9, 7
+*SURFACE, NAME=SS1
+ 1, E1
+ 2, E1
+*SURFACE, NAME=SS2
+ 2, E2
+ 4, E2
+*SURFACE, NAME=SS3
+ 3, E3
+ 4, E3
+*SURFACE, NAME=SS4
+ 1, E4
+ 3, E4
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+9 12 0 0 0
+1 -1.00000000e+00 1.00000000e+00 0.00000000e+00
+2 -1.00000000e+00 0.00000000e+00 0.00000000e+00
+3 0.00000000e+00 0.00000000e+00 0.00000000e+00
+4 0.00000000e+00 1.00000000e+00 0.00000000e+00
+5 -1.00000000e+00 -1.00000000e+00 0.00000000e+00
+6 0.00000000e+00 -1.00000000e+00 0.00000000e+00
+7 1.00000000e+00 0.00000000e+00 0.00000000e+00
+8 1.00000000e+00 1.00000000e+00 0.00000000e+00
+9 1.00000000e+00 -1.00000000e+00 0.00000000e+00
+1 14 quad 1 2 3 4
+2 14 quad 2 5 6 3
+3 14 quad 4 3 7 8
+4 14 quad 3 6 9 7
+1 1 line 1 2
+2 1 line 2 5
+3 2 line 5 6
+4 2 line 6 9
+5 3 line 7 8
+6 3 line 9 7
+7 4 line 4 1
+8 4 line 8 4
--- /dev/null
+*HEADING
+cubit(y/Mesh_conversion/Mesh_conversion_update/mesh/CC_TEMP.inp): 06/13/2010: 18
+version: 12.1
+**
+********************************** P A R T S **********************************
+*PART, NAME=Part-Default
+**
+********************************** N O D E S **********************************
+*NODE, NSET=ALLNODES
+ 1, -5.000000e-01, -5.000000e-01, 5.000000e-01
+ 2, -5.000000e-01, -5.000000e-01, 0.000000e+00
+ 3, -5.000000e-01, 0.000000e+00, 0.000000e+00
+ 4, -5.000000e-01, 0.000000e+00, 5.000000e-01
+ 5, 0.000000e+00, -5.000000e-01, 5.000000e-01
+ 6, 0.000000e+00, -5.000000e-01, 0.000000e+00
+ 7, 0.000000e+00, 0.000000e+00, 0.000000e+00
+ 8, 0.000000e+00, 0.000000e+00, 5.000000e-01
+ 9, -5.000000e-01, -5.000000e-01, -5.000000e-01
+ 10, -5.000000e-01, 0.000000e+00, -5.000000e-01
+ 11, 0.000000e+00, -5.000000e-01, -5.000000e-01
+ 12, 0.000000e+00, 0.000000e+00, -5.000000e-01
+ 13, -5.000000e-01, 5.000000e-01, 0.000000e+00
+ 14, -5.000000e-01, 5.000000e-01, 5.000000e-01
+ 15, 0.000000e+00, 5.000000e-01, 0.000000e+00
+ 16, 0.000000e+00, 5.000000e-01, 5.000000e-01
+ 17, -5.000000e-01, 5.000000e-01, -5.000000e-01
+ 18, 0.000000e+00, 5.000000e-01, -5.000000e-01
+ 19, 5.000000e-01, -5.000000e-01, 5.000000e-01
+ 20, 5.000000e-01, -5.000000e-01, 0.000000e+00
+ 21, 5.000000e-01, 0.000000e+00, 0.000000e+00
+ 22, 5.000000e-01, 0.000000e+00, 5.000000e-01
+ 23, 5.000000e-01, -5.000000e-01, -5.000000e-01
+ 24, 5.000000e-01, 0.000000e+00, -5.000000e-01
+ 25, 5.000000e-01, 5.000000e-01, 0.000000e+00
+ 26, 5.000000e-01, 5.000000e-01, 5.000000e-01
+ 27, 5.000000e-01, 5.000000e-01, -5.000000e-01
+ 28, -2.500000e-01, 5.500000e-01, 2.500000e-01
+ 29, -2.500000e-01, 5.500000e-01, 0.000000e+00
+ 30, -2.500000e-01, 8.000000e-01, 0.000000e+00
+ 31, -2.500000e-01, 8.000000e-01, 2.500000e-01
+ 32, 0.000000e+00, 5.500000e-01, 2.500000e-01
+ 33, 0.000000e+00, 5.500000e-01, 0.000000e+00
+ 34, 0.000000e+00, 8.000000e-01, 0.000000e+00
+ 35, 0.000000e+00, 8.000000e-01, 2.500000e-01
+ 36, -2.500000e-01, 5.500000e-01, -2.500000e-01
+ 37, -2.500000e-01, 8.000000e-01, -2.500000e-01
+ 38, 0.000000e+00, 5.500000e-01, -2.500000e-01
+ 39, 0.000000e+00, 8.000000e-01, -2.500000e-01
+ 40, -2.500000e-01, 1.050000e+00, 0.000000e+00
+ 41, -2.500000e-01, 1.050000e+00, 2.500000e-01
+ 42, 0.000000e+00, 1.050000e+00, 0.000000e+00
+ 43, 0.000000e+00, 1.050000e+00, 2.500000e-01
+ 44, -2.500000e-01, 1.050000e+00, -2.500000e-01
+ 45, 0.000000e+00, 1.050000e+00, -2.500000e-01
+ 46, 2.500000e-01, 5.500000e-01, 2.500000e-01
+ 47, 2.500000e-01, 5.500000e-01, 0.000000e+00
+ 48, 2.500000e-01, 8.000000e-01, 0.000000e+00
+ 49, 2.500000e-01, 8.000000e-01, 2.500000e-01
+ 50, 2.500000e-01, 5.500000e-01, -2.500000e-01
+ 51, 2.500000e-01, 8.000000e-01, -2.500000e-01
+ 52, 2.500000e-01, 1.050000e+00, 0.000000e+00
+ 53, 2.500000e-01, 1.050000e+00, 2.500000e-01
+ 54, 2.500000e-01, 1.050000e+00, -2.500000e-01
+**
+********************************** E L E M E N T S ****************************
+*ELEMENT, TYPE=C3D8R, ELSET=EB1
+ 1, 1, 2, 3, 4, 5, 6, 7, 8
+ 2, 2, 9, 10, 3, 6, 11, 12, 7
+ 3, 4, 3, 13, 14, 8, 7, 15, 16
+ 4, 3, 10, 17, 13, 7, 12, 18, 15
+ 5, 5, 6, 7, 8, 19, 20, 21, 22
+ 6, 6, 11, 12, 7, 20, 23, 24, 21
+ 7, 8, 7, 15, 16, 22, 21, 25, 26
+ 8, 7, 12, 18, 15, 21, 24, 27, 25
+*ELEMENT, TYPE=C3D8R, ELSET=EB2
+ 9, 28, 29, 30, 31, 32, 33, 34, 35
+ 10, 29, 36, 37, 30, 33, 38, 39, 34
+ 11, 31, 30, 40, 41, 35, 34, 42, 43
+ 12, 30, 37, 44, 40, 34, 39, 45, 42
+ 13, 32, 33, 34, 35, 46, 47, 48, 49
+ 14, 33, 38, 39, 34, 47, 50, 51, 48
+ 15, 35, 34, 42, 43, 49, 48, 52, 53
+ 16, 34, 39, 45, 42, 48, 51, 54, 52
+**
+********************************** S I D E S E T S **********************************
+*ELSET, ELSET=SS1_S3
+ 1, 2, 5, 6
+*SURFACE, NAME=SS1
+SS1_S3, S3
+*ELSET, ELSET=SS2_S4
+ 10, 12, 14, 16, 2, 4, 6, 8
+*SURFACE, NAME=SS2
+SS2_S4, S4
+*ELSET, ELSET=SS3_S1
+ 9, 10, 11, 12, 1, 2, 3, 4
+*SURFACE, NAME=SS3
+SS3_S1, S1
+*ELSET, ELSET=SS4_S5
+ 11, 12, 15, 16
+*SURFACE, NAME=SS4
+SS4_S5, S5
+*ELSET, ELSET=SS100_S5
+ 3, 4, 7, 8
+*SURFACE, NAME=SS100
+SS100_S5, S5
+*ELSET, ELSET=SS101_S3
+ 9, 10, 13, 14
+*SURFACE, NAME=SS101
+SS101_S3, S3
+**
+********************************** P R O P E R T I E S ************************
+*SOLID SECTION, ELSET=EB1, MATERIAL=Default-Steel
+*SOLID SECTION, ELSET=EB2, MATERIAL=Default-Steel
+**
+*END PART
+**
+**
+**
+********************************** E N D P A R T S **********************************
+**
+**
+********************************** A S S E M B L Y ************************************
+**
+*ASSEMBLY, NAME=ASSEMBLY1
+**
+*INSTANCE, NAME=Part-Default_1, PART=Part-Default
+*END INSTANCE
+**
+*END ASSEMBLY
+**
+**
+**
+*MATERIAL, NAME = Default-Steel
+*ELASTIC, TYPE=ISOTROPIC
+2.068000e+05, 2.900000e-01
+*DENSITY
+7.000000e-06
+*CONDUCTIVITY,TYPE=ISO
+4.500000e-02
+*SPECIFIC HEAT
+5.000000e+02
+**
+**
+************************************** H I S T O R Y *************************************
+**
+*PREPRINT
+**
+**************************************** S T E P 1 ***************************************
+*STEP,INC=100,NAME=Default Set
+**
+*STATIC
+1, 1, 1e-05, 1
+**
+**
+**
+**
+*END STEP
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+54 48 0 0 0
+1 -5.00000000e-01 -5.00000000e-01 5.00000000e-01
+2 -5.00000000e-01 -5.00000000e-01 0.00000000e+00
+3 -5.00000000e-01 0.00000000e+00 0.00000000e+00
+4 -5.00000000e-01 0.00000000e+00 5.00000000e-01
+5 0.00000000e+00 -5.00000000e-01 5.00000000e-01
+6 0.00000000e+00 -5.00000000e-01 0.00000000e+00
+7 0.00000000e+00 0.00000000e+00 0.00000000e+00
+8 0.00000000e+00 0.00000000e+00 5.00000000e-01
+9 -5.00000000e-01 -5.00000000e-01 -5.00000000e-01
+10 -5.00000000e-01 0.00000000e+00 -5.00000000e-01
+11 0.00000000e+00 -5.00000000e-01 -5.00000000e-01
+12 0.00000000e+00 0.00000000e+00 -5.00000000e-01
+13 -5.00000000e-01 5.00000000e-01 0.00000000e+00
+14 -5.00000000e-01 5.00000000e-01 5.00000000e-01
+15 0.00000000e+00 5.00000000e-01 0.00000000e+00
+16 0.00000000e+00 5.00000000e-01 5.00000000e-01
+17 -5.00000000e-01 5.00000000e-01 -5.00000000e-01
+18 0.00000000e+00 5.00000000e-01 -5.00000000e-01
+19 5.00000000e-01 -5.00000000e-01 5.00000000e-01
+20 5.00000000e-01 -5.00000000e-01 0.00000000e+00
+21 5.00000000e-01 0.00000000e+00 0.00000000e+00
+22 5.00000000e-01 0.00000000e+00 5.00000000e-01
+23 5.00000000e-01 -5.00000000e-01 -5.00000000e-01
+24 5.00000000e-01 0.00000000e+00 -5.00000000e-01
+25 5.00000000e-01 5.00000000e-01 0.00000000e+00
+26 5.00000000e-01 5.00000000e-01 5.00000000e-01
+27 5.00000000e-01 5.00000000e-01 -5.00000000e-01
+28 -2.50000000e-01 5.50000000e-01 2.50000000e-01
+29 -2.50000000e-01 5.50000000e-01 0.00000000e+00
+30 -2.50000000e-01 8.00000000e-01 0.00000000e+00
+31 -2.50000000e-01 8.00000000e-01 2.50000000e-01
+32 0.00000000e+00 5.50000000e-01 2.50000000e-01
+33 0.00000000e+00 5.50000000e-01 0.00000000e+00
+34 0.00000000e+00 8.00000000e-01 0.00000000e+00
+35 0.00000000e+00 8.00000000e-01 2.50000000e-01
+36 -2.50000000e-01 5.50000000e-01 -2.50000000e-01
+37 -2.50000000e-01 8.00000000e-01 -2.50000000e-01
+38 0.00000000e+00 5.50000000e-01 -2.50000000e-01
+39 0.00000000e+00 8.00000000e-01 -2.50000000e-01
+40 -2.50000000e-01 1.05000000e+00 0.00000000e+00
+41 -2.50000000e-01 1.05000000e+00 2.50000000e-01
+42 0.00000000e+00 1.05000000e+00 0.00000000e+00
+43 0.00000000e+00 1.05000000e+00 2.50000000e-01
+44 -2.50000000e-01 1.05000000e+00 -2.50000000e-01
+45 0.00000000e+00 1.05000000e+00 -2.50000000e-01
+46 2.50000000e-01 5.50000000e-01 2.50000000e-01
+47 2.50000000e-01 5.50000000e-01 0.00000000e+00
+48 2.50000000e-01 8.00000000e-01 0.00000000e+00
+49 2.50000000e-01 8.00000000e-01 2.50000000e-01
+50 2.50000000e-01 5.50000000e-01 -2.50000000e-01
+51 2.50000000e-01 8.00000000e-01 -2.50000000e-01
+52 2.50000000e-01 1.05000000e+00 0.00000000e+00
+53 2.50000000e-01 1.05000000e+00 2.50000000e-01
+54 2.50000000e-01 1.05000000e+00 -2.50000000e-01
+1 1 hex 1 2 3 4 5 6 7 8
+2 1 hex 2 9 10 3 6 11 12 7
+3 1 hex 4 3 13 14 8 7 15 16
+4 1 hex 3 10 17 13 7 12 18 15
+5 1 hex 5 6 7 8 19 20 21 22
+6 1 hex 6 11 12 7 20 23 24 21
+7 1 hex 8 7 15 16 22 21 25 26
+8 1 hex 7 12 18 15 21 24 27 25
+9 2 hex 28 29 30 31 32 33 34 35
+10 2 hex 29 36 37 30 33 38 39 34
+11 2 hex 31 30 40 41 35 34 42 43
+12 2 hex 30 37 44 40 34 39 45 42
+13 2 hex 32 33 34 35 46 47 48 49
+14 2 hex 33 38 39 34 47 50 51 48
+15 2 hex 35 34 42 43 49 48 52 53
+16 2 hex 34 39 45 42 48 51 54 52
+1 1 quad 1 2 6 5
+2 1 quad 2 9 11 6
+3 1 quad 5 6 20 19
+4 1 quad 6 11 23 20
+5 2 quad 36 37 39 38
+6 2 quad 37 44 45 39
+7 2 quad 38 39 51 50
+8 2 quad 39 45 54 51
+9 2 quad 9 10 12 11
+10 2 quad 10 17 18 12
+11 2 quad 11 12 24 23
+12 2 quad 12 18 27 24
+13 3 quad 28 31 30 29
+14 3 quad 29 30 37 36
+15 3 quad 31 41 40 30
+16 3 quad 30 40 44 37
+17 3 quad 1 4 3 2
+18 3 quad 2 3 10 9
+19 3 quad 4 14 13 3
+20 3 quad 3 13 17 10
+21 4 quad 40 41 43 42
+22 4 quad 44 40 42 45
+23 4 quad 42 43 53 52
+24 4 quad 45 42 52 54
+25 100 quad 13 14 16 15
+26 100 quad 17 13 15 18
+27 100 quad 15 16 26 25
+28 100 quad 18 15 25 27
+29 101 quad 28 29 33 32
+30 101 quad 29 36 38 33
+31 101 quad 32 33 47 46
+32 101 quad 33 38 50 47
--- /dev/null
+*HEADING
+cubit(rrent/Geometry/Contact_test/contact_cubes_NTS_1_close.inp): 03/31/2010: 17
+*NODE
+ 1, -5.000000e-01, -5.000000e-01, 5.000000e-01
+ 2, -5.000000e-01, -5.000000e-01, 0.000000e+00
+ 3, -5.000000e-01, 0.000000e+00, 0.000000e+00
+ 4, -5.000000e-01, 0.000000e+00, 5.000000e-01
+ 5, 0.000000e+00, -5.000000e-01, 5.000000e-01
+ 6, 0.000000e+00, -5.000000e-01, 0.000000e+00
+ 7, 0.000000e+00, 0.000000e+00, 0.000000e+00
+ 8, 0.000000e+00, 0.000000e+00, 5.000000e-01
+ 9, -5.000000e-01, -5.000000e-01, -5.000000e-01
+ 10, -5.000000e-01, 0.000000e+00, -5.000000e-01
+ 11, 0.000000e+00, -5.000000e-01, -5.000000e-01
+ 12, 0.000000e+00, 0.000000e+00, -5.000000e-01
+ 13, -5.000000e-01, 5.000000e-01, 0.000000e+00
+ 14, -5.000000e-01, 5.000000e-01, 5.000000e-01
+ 15, 0.000000e+00, 5.000000e-01, 0.000000e+00
+ 16, 0.000000e+00, 5.000000e-01, 5.000000e-01
+ 17, -5.000000e-01, 5.000000e-01, -5.000000e-01
+ 18, 0.000000e+00, 5.000000e-01, -5.000000e-01
+ 19, 5.000000e-01, -5.000000e-01, 5.000000e-01
+ 20, 5.000000e-01, -5.000000e-01, 0.000000e+00
+ 21, 5.000000e-01, 0.000000e+00, 0.000000e+00
+ 22, 5.000000e-01, 0.000000e+00, 5.000000e-01
+ 23, 5.000000e-01, -5.000000e-01, -5.000000e-01
+ 24, 5.000000e-01, 0.000000e+00, -5.000000e-01
+ 25, 5.000000e-01, 5.000000e-01, 0.000000e+00
+ 26, 5.000000e-01, 5.000000e-01, 5.000000e-01
+ 27, 5.000000e-01, 5.000000e-01, -5.000000e-01
+ 28, -2.500000e-01, 5.500000e-01, 2.500000e-01
+ 29, -2.500000e-01, 5.500000e-01, 0.000000e+00
+ 30, -2.500000e-01, 8.000000e-01, 0.000000e+00
+ 31, -2.500000e-01, 8.000000e-01, 2.500000e-01
+ 32, 0.000000e+00, 5.500000e-01, 2.500000e-01
+ 33, 0.000000e+00, 5.500000e-01, 0.000000e+00
+ 34, 0.000000e+00, 8.000000e-01, 0.000000e+00
+ 35, 0.000000e+00, 8.000000e-01, 2.500000e-01
+ 36, -2.500000e-01, 5.500000e-01, -2.500000e-01
+ 37, -2.500000e-01, 8.000000e-01, -2.500000e-01
+ 38, 0.000000e+00, 5.500000e-01, -2.500000e-01
+ 39, 0.000000e+00, 8.000000e-01, -2.500000e-01
+ 40, -2.500000e-01, 1.050000e+00, 0.000000e+00
+ 41, -2.500000e-01, 1.050000e+00, 2.500000e-01
+ 42, 0.000000e+00, 1.050000e+00, 0.000000e+00
+ 43, 0.000000e+00, 1.050000e+00, 2.500000e-01
+ 44, -2.500000e-01, 1.050000e+00, -2.500000e-01
+ 45, 0.000000e+00, 1.050000e+00, -2.500000e-01
+ 46, 2.500000e-01, 5.500000e-01, 2.500000e-01
+ 47, 2.500000e-01, 5.500000e-01, 0.000000e+00
+ 48, 2.500000e-01, 8.000000e-01, 0.000000e+00
+ 49, 2.500000e-01, 8.000000e-01, 2.500000e-01
+ 50, 2.500000e-01, 5.500000e-01, -2.500000e-01
+ 51, 2.500000e-01, 8.000000e-01, -2.500000e-01
+ 52, 2.500000e-01, 1.050000e+00, 0.000000e+00
+ 53, 2.500000e-01, 1.050000e+00, 2.500000e-01
+ 54, 2.500000e-01, 1.050000e+00, -2.500000e-01
+*ELEMENT, TYPE=C3D8R, ELSET=EB1
+ 1, 1, 2, 3, 4, 5, 6, 7, 8
+ 2, 2, 9, 10, 3, 6, 11, 12, 7
+ 3, 4, 3, 13, 14, 8, 7, 15, 16
+ 4, 3, 10, 17, 13, 7, 12, 18, 15
+ 5, 5, 6, 7, 8, 19, 20, 21, 22
+ 6, 6, 11, 12, 7, 20, 23, 24, 21
+ 7, 8, 7, 15, 16, 22, 21, 25, 26
+ 8, 7, 12, 18, 15, 21, 24, 27, 25
+*ELEMENT, TYPE=C3D8R, ELSET=EB2
+ 9, 28, 29, 30, 31, 32, 33, 34, 35
+ 10, 29, 36, 37, 30, 33, 38, 39, 34
+ 11, 31, 30, 40, 41, 35, 34, 42, 43
+ 12, 30, 37, 44, 40, 34, 39, 45, 42
+ 13, 32, 33, 34, 35, 46, 47, 48, 49
+ 14, 33, 38, 39, 34, 47, 50, 51, 48
+ 15, 35, 34, 42, 43, 49, 48, 52, 53
+ 16, 34, 39, 45, 42, 48, 51, 54, 52
+*SURFACE, NAME=SS1
+ 1, S3
+ 2, S3
+ 5, S3
+ 6, S3
+*SURFACE, NAME=SS2
+ 10, S4
+ 12, S4
+ 14, S4
+ 16, S4
+ 2, S4
+ 4, S4
+ 6, S4
+ 8, S4
+*SURFACE, NAME=SS3
+ 9, S1
+ 10, S1
+ 11, S1
+ 12, S1
+ 1, S1
+ 2, S1
+ 3, S1
+ 4, S1
+*SURFACE, NAME=SS4
+ 11, S5
+ 12, S5
+ 15, S5
+ 16, S5
+*SURFACE, NAME=SS100
+ 3, S5
+ 4, S5
+ 7, S5
+ 8, S5
+*SURFACE, NAME=SS101
+ 9, S3
+ 10, S3
+ 13, S3
+ 14, S3
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+54 48 0 0 0
+1 -5.00000000e-01 -5.00000000e-01 5.00000000e-01
+2 -5.00000000e-01 -5.00000000e-01 0.00000000e+00
+3 -5.00000000e-01 0.00000000e+00 0.00000000e+00
+4 -5.00000000e-01 0.00000000e+00 5.00000000e-01
+5 0.00000000e+00 -5.00000000e-01 5.00000000e-01
+6 0.00000000e+00 -5.00000000e-01 0.00000000e+00
+7 0.00000000e+00 0.00000000e+00 0.00000000e+00
+8 0.00000000e+00 0.00000000e+00 5.00000000e-01
+9 -5.00000000e-01 -5.00000000e-01 -5.00000000e-01
+10 -5.00000000e-01 0.00000000e+00 -5.00000000e-01
+11 0.00000000e+00 -5.00000000e-01 -5.00000000e-01
+12 0.00000000e+00 0.00000000e+00 -5.00000000e-01
+13 -5.00000000e-01 5.00000000e-01 0.00000000e+00
+14 -5.00000000e-01 5.00000000e-01 5.00000000e-01
+15 0.00000000e+00 5.00000000e-01 0.00000000e+00
+16 0.00000000e+00 5.00000000e-01 5.00000000e-01
+17 -5.00000000e-01 5.00000000e-01 -5.00000000e-01
+18 0.00000000e+00 5.00000000e-01 -5.00000000e-01
+19 5.00000000e-01 -5.00000000e-01 5.00000000e-01
+20 5.00000000e-01 -5.00000000e-01 0.00000000e+00
+21 5.00000000e-01 0.00000000e+00 0.00000000e+00
+22 5.00000000e-01 0.00000000e+00 5.00000000e-01
+23 5.00000000e-01 -5.00000000e-01 -5.00000000e-01
+24 5.00000000e-01 0.00000000e+00 -5.00000000e-01
+25 5.00000000e-01 5.00000000e-01 0.00000000e+00
+26 5.00000000e-01 5.00000000e-01 5.00000000e-01
+27 5.00000000e-01 5.00000000e-01 -5.00000000e-01
+28 -2.50000000e-01 5.50000000e-01 2.50000000e-01
+29 -2.50000000e-01 5.50000000e-01 0.00000000e+00
+30 -2.50000000e-01 8.00000000e-01 0.00000000e+00
+31 -2.50000000e-01 8.00000000e-01 2.50000000e-01
+32 0.00000000e+00 5.50000000e-01 2.50000000e-01
+33 0.00000000e+00 5.50000000e-01 0.00000000e+00
+34 0.00000000e+00 8.00000000e-01 0.00000000e+00
+35 0.00000000e+00 8.00000000e-01 2.50000000e-01
+36 -2.50000000e-01 5.50000000e-01 -2.50000000e-01
+37 -2.50000000e-01 8.00000000e-01 -2.50000000e-01
+38 0.00000000e+00 5.50000000e-01 -2.50000000e-01
+39 0.00000000e+00 8.00000000e-01 -2.50000000e-01
+40 -2.50000000e-01 1.05000000e+00 0.00000000e+00
+41 -2.50000000e-01 1.05000000e+00 2.50000000e-01
+42 0.00000000e+00 1.05000000e+00 0.00000000e+00
+43 0.00000000e+00 1.05000000e+00 2.50000000e-01
+44 -2.50000000e-01 1.05000000e+00 -2.50000000e-01
+45 0.00000000e+00 1.05000000e+00 -2.50000000e-01
+46 2.50000000e-01 5.50000000e-01 2.50000000e-01
+47 2.50000000e-01 5.50000000e-01 0.00000000e+00
+48 2.50000000e-01 8.00000000e-01 0.00000000e+00
+49 2.50000000e-01 8.00000000e-01 2.50000000e-01
+50 2.50000000e-01 5.50000000e-01 -2.50000000e-01
+51 2.50000000e-01 8.00000000e-01 -2.50000000e-01
+52 2.50000000e-01 1.05000000e+00 0.00000000e+00
+53 2.50000000e-01 1.05000000e+00 2.50000000e-01
+54 2.50000000e-01 1.05000000e+00 -2.50000000e-01
+1 1 hex 1 2 3 4 5 6 7 8
+2 1 hex 2 9 10 3 6 11 12 7
+3 1 hex 4 3 13 14 8 7 15 16
+4 1 hex 3 10 17 13 7 12 18 15
+5 1 hex 5 6 7 8 19 20 21 22
+6 1 hex 6 11 12 7 20 23 24 21
+7 1 hex 8 7 15 16 22 21 25 26
+8 1 hex 7 12 18 15 21 24 27 25
+9 2 hex 28 29 30 31 32 33 34 35
+10 2 hex 29 36 37 30 33 38 39 34
+11 2 hex 31 30 40 41 35 34 42 43
+12 2 hex 30 37 44 40 34 39 45 42
+13 2 hex 32 33 34 35 46 47 48 49
+14 2 hex 33 38 39 34 47 50 51 48
+15 2 hex 35 34 42 43 49 48 52 53
+16 2 hex 34 39 45 42 48 51 54 52
+1 1 quad 1 2 6 5
+2 1 quad 2 9 11 6
+3 1 quad 5 6 20 19
+4 1 quad 6 11 23 20
+5 2 quad 36 37 39 38
+6 2 quad 37 44 45 39
+7 2 quad 38 39 51 50
+8 2 quad 39 45 54 51
+9 2 quad 9 10 12 11
+10 2 quad 10 17 18 12
+11 2 quad 11 12 24 23
+12 2 quad 12 18 27 24
+13 3 quad 28 31 30 29
+14 3 quad 29 30 37 36
+15 3 quad 31 41 40 30
+16 3 quad 30 40 44 37
+17 3 quad 1 4 3 2
+18 3 quad 2 3 10 9
+19 3 quad 4 14 13 3
+20 3 quad 3 13 17 10
+21 4 quad 40 41 43 42
+22 4 quad 44 40 42 45
+23 4 quad 42 43 53 52
+24 4 quad 45 42 52 54
+25 100 quad 13 14 16 15
+26 100 quad 17 13 15 18
+27 100 quad 15 16 26 25
+28 100 quad 18 15 25 27
+29 101 quad 28 29 33 32
+30 101 quad 29 36 38 33
+31 101 quad 32 33 47 46
+32 101 quad 33 38 50 47
--- /dev/null
+*NODE\r
+1, 0, 0, 0\r
+2, 0, 0, 50\r
+3, 50, 0, 50\r
+4, 50, 0, 0\r
+5, 0, 50, 0\r
+6, 0.705725, 50, 50\r
+7, 50, 50, 50\r
+8, 50, 50, 0\r
+**\r
+**\r
+*ELEMENT, TYPE=C3D8\r
+1, 1, 2, 3, 4, 5, 6, 7, 8\r
+*NSET, NSET=n, GENERATE\r
+1, 8\r
+*ELSET, ELSET=e, GENERATE\r
+1, 1\r
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+8 1 0 0 0
+1 0.00000000e+00 0.00000000e+00 0.00000000e+00
+2 0.00000000e+00 0.00000000e+00 5.00000000e+01
+3 5.00000000e+01 0.00000000e+00 5.00000000e+01
+4 5.00000000e+01 0.00000000e+00 0.00000000e+00
+5 0.00000000e+00 5.00000000e+01 0.00000000e+00
+6 7.05725000e-01 5.00000000e+01 5.00000000e+01
+7 5.00000000e+01 5.00000000e+01 5.00000000e+01
+8 5.00000000e+01 5.00000000e+01 0.00000000e+00
+1 0 hex 1 2 3 4 5 6 7 8
--- /dev/null
+*HEADING
+cubit(t/Geometry/Mesh_conversion/mesh/Test_cube/test_cube_1.inp): 11/06/2008: 09
+*NODE
+ 1, -1.000000e+00, -1.000000e+00, 1.000000e+00
+ 2, -1.000000e+00, -1.000000e+00, -1.000000e+00
+ 3, -1.000000e+00, 1.000000e+00, -1.000000e+00
+ 4, -1.000000e+00, 1.000000e+00, 1.000000e+00
+ 5, 1.000000e+00, -1.000000e+00, 1.000000e+00
+ 6, 1.000000e+00, -1.000000e+00, -1.000000e+00
+ 7, 1.000000e+00, 1.000000e+00, -1.000000e+00
+ 8, 1.000000e+00, 1.000000e+00, 1.000000e+00
+*ELEMENT, TYPE=C3D8R, ELSET=EB1
+ 1, 1, 2, 3, 4, 5, 6, 7, 8
+*SURFACE, NAME=SS1
+ 1, S6
+*SURFACE, NAME=SS2
+ 1, S4
+*SURFACE, NAME=SS3
+ 1, S3
+*SURFACE, NAME=SS4
+ 1, S1
+*SURFACE, NAME=SS5
+ 1, S5
+*SURFACE, NAME=SS6
+ 1, S2
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+8 7 0 0 0
+1 -1.00000000e+00 -1.00000000e+00 1.00000000e+00
+2 -1.00000000e+00 -1.00000000e+00 -1.00000000e+00
+3 -1.00000000e+00 1.00000000e+00 -1.00000000e+00
+4 -1.00000000e+00 1.00000000e+00 1.00000000e+00
+5 1.00000000e+00 -1.00000000e+00 1.00000000e+00
+6 1.00000000e+00 -1.00000000e+00 -1.00000000e+00
+7 1.00000000e+00 1.00000000e+00 -1.00000000e+00
+8 1.00000000e+00 1.00000000e+00 1.00000000e+00
+1 1 hex 1 2 3 4 5 6 7 8
+1 1 quad 1 5 8 4
+2 2 quad 2 3 7 6
+3 3 quad 1 2 6 5
+4 4 quad 1 4 3 2
+5 5 quad 3 4 8 7
+6 6 quad 5 8 7 6
--- /dev/null
+*HEADING
+cubit(metry/Mesh_conversion/mesh/Test_cube/test_cube_pave_1.inp): 11/06/2008: 10
+*NODE
+ 1, 1.000000e+00, 1.000000e+00, 0.000000e+00
+ 2, 5.000000e-01, 1.000000e+00, 0.000000e+00
+ 3, 5.583559e-01, 3.929331e-01, 0.000000e+00
+ 4, 1.000000e+00, 0.000000e+00, 0.000000e+00
+ 5, 1.000000e+00, 1.000000e+00, 1.000000e+00
+ 6, 5.000000e-01, 1.000000e+00, 1.000000e+00
+ 7, 5.583559e-01, 3.929331e-01, 1.000000e+00
+ 8, 1.000000e+00, 0.000000e+00, 1.000000e+00
+ 9, 0.000000e+00, 1.000000e+00, 0.000000e+00
+ 10, 1.562409e-01, 1.799288e-01, 0.000000e+00
+ 11, 0.000000e+00, 1.000000e+00, 1.000000e+00
+ 12, 1.562409e-01, 1.799288e-01, 1.000000e+00
+ 13, -5.000000e-01, 1.000000e+00, 0.000000e+00
+ 14, -3.897075e-01, 6.804246e-02, 0.000000e+00
+ 15, -5.000000e-01, 1.000000e+00, 1.000000e+00
+ 16, -3.897075e-01, 6.804246e-02, 1.000000e+00
+ 17, -1.000000e+00, 1.000000e+00, 0.000000e+00
+ 18, -1.000000e+00, 0.000000e+00, 0.000000e+00
+ 19, -1.000000e+00, 1.000000e+00, 1.000000e+00
+ 20, -1.000000e+00, 0.000000e+00, 1.000000e+00
+ 21, -1.000000e+00, -1.000000e+00, 0.000000e+00
+ 22, 0.000000e+00, -1.000000e+00, 0.000000e+00
+ 23, -1.000000e+00, -1.000000e+00, 1.000000e+00
+ 24, 0.000000e+00, -1.000000e+00, 1.000000e+00
+ 25, 1.000000e+00, -1.000000e+00, 0.000000e+00
+ 26, 1.000000e+00, -1.000000e+00, 1.000000e+00
+ 27, 1.000000e+00, 1.000000e+00, -1.000000e+00
+ 28, 5.000000e-01, 1.000000e+00, -1.000000e+00
+ 29, 5.583559e-01, 3.929331e-01, -1.000000e+00
+ 30, 1.000000e+00, 0.000000e+00, -1.000000e+00
+ 31, 0.000000e+00, 1.000000e+00, -1.000000e+00
+ 32, 1.562409e-01, 1.799288e-01, -1.000000e+00
+ 33, -5.000000e-01, 1.000000e+00, -1.000000e+00
+ 34, -3.897075e-01, 6.804246e-02, -1.000000e+00
+ 35, -1.000000e+00, 1.000000e+00, -1.000000e+00
+ 36, -1.000000e+00, 0.000000e+00, -1.000000e+00
+ 37, -1.000000e+00, -1.000000e+00, -1.000000e+00
+ 38, 0.000000e+00, -1.000000e+00, -1.000000e+00
+ 39, 1.000000e+00, -1.000000e+00, -1.000000e+00
+*ELEMENT, TYPE=C3D8R, ELSET=EB1
+ 1, 1, 2, 3, 4, 5, 6, 7, 8
+ 2, 2, 9, 10, 3, 6, 11, 12, 7
+ 3, 9, 13, 14, 10, 11, 15, 16, 12
+ 4, 13, 17, 18, 14, 15, 19, 20, 16
+ 5, 21, 22, 14, 18, 23, 24, 16, 20
+ 6, 10, 14, 22, 25, 12, 16, 24, 26
+ 7, 25, 4, 3, 10, 26, 8, 7, 12
+ 8, 27, 28, 29, 30, 1, 2, 3, 4
+ 9, 28, 31, 32, 29, 2, 9, 10, 3
+ 10, 31, 33, 34, 32, 9, 13, 14, 10
+ 11, 33, 35, 36, 34, 13, 17, 18, 14
+ 12, 37, 38, 34, 36, 21, 22, 14, 18
+ 13, 32, 34, 38, 39, 10, 14, 22, 25
+ 14, 39, 30, 29, 32, 25, 4, 3, 10
+*SURFACE, NAME=SS1
+ 1, S2
+ 2, S2
+ 3, S2
+ 4, S2
+ 5, S2
+ 6, S2
+ 7, S2
+*SURFACE, NAME=SS2
+ 8, S1
+ 9, S1
+ 10, S1
+ 11, S1
+ 12, S1
+ 13, S1
+ 14, S1
+*SURFACE, NAME=SS3
+ 5, S3
+ 6, S5
+ 12, S3
+ 13, S5
+*SURFACE, NAME=SS4
+ 4, S4
+ 5, S6
+ 11, S4
+ 12, S6
+*SURFACE, NAME=SS5
+ 1, S3
+ 2, S3
+ 3, S3
+ 4, S3
+ 8, S3
+ 9, S3
+ 10, S3
+ 11, S3
+*SURFACE, NAME=SS6
+ 1, S6
+ 7, S3
+ 8, S6
+ 14, S3
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+39 48 0 0 0
+1 1.00000000e+00 1.00000000e+00 0.00000000e+00
+2 5.00000000e-01 1.00000000e+00 0.00000000e+00
+3 5.58355900e-01 3.92933100e-01 0.00000000e+00
+4 1.00000000e+00 0.00000000e+00 0.00000000e+00
+5 1.00000000e+00 1.00000000e+00 1.00000000e+00
+6 5.00000000e-01 1.00000000e+00 1.00000000e+00
+7 5.58355900e-01 3.92933100e-01 1.00000000e+00
+8 1.00000000e+00 0.00000000e+00 1.00000000e+00
+9 0.00000000e+00 1.00000000e+00 0.00000000e+00
+10 1.56240900e-01 1.79928800e-01 0.00000000e+00
+11 0.00000000e+00 1.00000000e+00 1.00000000e+00
+12 1.56240900e-01 1.79928800e-01 1.00000000e+00
+13 -5.00000000e-01 1.00000000e+00 0.00000000e+00
+14 -3.89707500e-01 6.80424600e-02 0.00000000e+00
+15 -5.00000000e-01 1.00000000e+00 1.00000000e+00
+16 -3.89707500e-01 6.80424600e-02 1.00000000e+00
+17 -1.00000000e+00 1.00000000e+00 0.00000000e+00
+18 -1.00000000e+00 0.00000000e+00 0.00000000e+00
+19 -1.00000000e+00 1.00000000e+00 1.00000000e+00
+20 -1.00000000e+00 0.00000000e+00 1.00000000e+00
+21 -1.00000000e+00 -1.00000000e+00 0.00000000e+00
+22 0.00000000e+00 -1.00000000e+00 0.00000000e+00
+23 -1.00000000e+00 -1.00000000e+00 1.00000000e+00
+24 0.00000000e+00 -1.00000000e+00 1.00000000e+00
+25 1.00000000e+00 -1.00000000e+00 0.00000000e+00
+26 1.00000000e+00 -1.00000000e+00 1.00000000e+00
+27 1.00000000e+00 1.00000000e+00 -1.00000000e+00
+28 5.00000000e-01 1.00000000e+00 -1.00000000e+00
+29 5.58355900e-01 3.92933100e-01 -1.00000000e+00
+30 1.00000000e+00 0.00000000e+00 -1.00000000e+00
+31 0.00000000e+00 1.00000000e+00 -1.00000000e+00
+32 1.56240900e-01 1.79928800e-01 -1.00000000e+00
+33 -5.00000000e-01 1.00000000e+00 -1.00000000e+00
+34 -3.89707500e-01 6.80424600e-02 -1.00000000e+00
+35 -1.00000000e+00 1.00000000e+00 -1.00000000e+00
+36 -1.00000000e+00 0.00000000e+00 -1.00000000e+00
+37 -1.00000000e+00 -1.00000000e+00 -1.00000000e+00
+38 0.00000000e+00 -1.00000000e+00 -1.00000000e+00
+39 1.00000000e+00 -1.00000000e+00 -1.00000000e+00
+1 1 hex 1 2 3 4 5 6 7 8
+2 1 hex 2 9 10 3 6 11 12 7
+3 1 hex 9 13 14 10 11 15 16 12
+4 1 hex 13 17 18 14 15 19 20 16
+5 1 hex 21 22 14 18 23 24 16 20
+6 1 hex 10 14 22 25 12 16 24 26
+7 1 hex 25 4 3 10 26 8 7 12
+8 1 hex 27 28 29 30 1 2 3 4
+9 1 hex 28 31 32 29 2 9 10 3
+10 1 hex 31 33 34 32 9 13 14 10
+11 1 hex 33 35 36 34 13 17 18 14
+12 1 hex 37 38 34 36 21 22 14 18
+13 1 hex 32 34 38 39 10 14 22 25
+14 1 hex 39 30 29 32 25 4 3 10
+1 1 quad 5 8 7 6
+2 1 quad 6 7 12 11
+3 1 quad 11 12 16 15
+4 1 quad 15 16 20 19
+5 1 quad 23 20 16 24
+6 1 quad 12 26 24 16
+7 1 quad 26 12 7 8
+8 2 quad 27 30 29 28
+9 2 quad 28 29 32 31
+10 2 quad 31 32 34 33
+11 2 quad 33 34 36 35
+12 2 quad 37 36 34 38
+13 2 quad 32 39 38 34
+14 2 quad 39 32 29 30
+15 3 quad 21 22 24 23
+16 3 quad 22 25 26 24
+17 3 quad 37 38 22 21
+18 3 quad 38 39 25 22
+19 4 quad 17 18 20 19
+20 4 quad 21 23 20 18
+21 4 quad 35 36 18 17
+22 4 quad 37 21 18 36
+23 5 quad 1 2 6 5
+24 5 quad 2 9 11 6
+25 5 quad 9 13 15 11
+26 5 quad 13 17 19 15
+27 5 quad 27 28 2 1
+28 5 quad 28 31 9 2
+29 5 quad 31 33 13 9
+30 5 quad 33 35 17 13
+31 6 quad 1 5 8 4
+32 6 quad 25 4 8 26
+33 6 quad 27 1 4 30
+34 6 quad 39 30 4 25
--- /dev/null
+*HEADING
+cubit(rsion/Mesh_conversion/mesh/3d/test_cube_two_materials.inp): 01/20/2009: 07
+*NODE
+ 1, -1.000000e+00, -1.000000e+00, 1.000000e+00
+ 2, -1.000000e+00, -1.000000e+00, 0.000000e+00
+ 3, -1.000000e+00, 0.000000e+00, 0.000000e+00
+ 4, -1.000000e+00, 0.000000e+00, 1.000000e+00
+ 5, 0.000000e+00, -1.000000e+00, 1.000000e+00
+ 6, 0.000000e+00, -1.000000e+00, 0.000000e+00
+ 7, 0.000000e+00, 0.000000e+00, 0.000000e+00
+ 8, 0.000000e+00, 0.000000e+00, 1.000000e+00
+ 9, -1.000000e+00, -1.000000e+00, -1.000000e+00
+ 10, -1.000000e+00, 0.000000e+00, -1.000000e+00
+ 11, 0.000000e+00, -1.000000e+00, -1.000000e+00
+ 12, 0.000000e+00, 0.000000e+00, -1.000000e+00
+ 13, -1.000000e+00, 1.000000e+00, 0.000000e+00
+ 14, -1.000000e+00, 1.000000e+00, 1.000000e+00
+ 15, 0.000000e+00, 1.000000e+00, 0.000000e+00
+ 16, 0.000000e+00, 1.000000e+00, 1.000000e+00
+ 17, -1.000000e+00, 1.000000e+00, -1.000000e+00
+ 18, 0.000000e+00, 1.000000e+00, -1.000000e+00
+ 19, 1.000000e+00, -1.000000e+00, 1.000000e+00
+ 20, 1.000000e+00, -1.000000e+00, 0.000000e+00
+ 21, 1.000000e+00, 0.000000e+00, 0.000000e+00
+ 22, 1.000000e+00, 0.000000e+00, 1.000000e+00
+ 23, 1.000000e+00, -1.000000e+00, -1.000000e+00
+ 24, 1.000000e+00, 0.000000e+00, -1.000000e+00
+ 25, 1.000000e+00, 1.000000e+00, 0.000000e+00
+ 26, 1.000000e+00, 1.000000e+00, 1.000000e+00
+ 27, 1.000000e+00, 1.000000e+00, -1.000000e+00
+*ELEMENT, TYPE=C3D8R, ELSET=EB1
+ 1, 1, 2, 3, 4, 5, 6, 7, 8
+ 2, 2, 9, 10, 3, 6, 11, 12, 7
+ 3, 4, 3, 13, 14, 8, 7, 15, 16
+ 4, 3, 10, 17, 13, 7, 12, 18, 15
+ 5, 5, 6, 7, 8, 19, 20, 21, 22
+*ELEMENT, TYPE=C3D8R, ELSET=EB2
+ 6, 6, 11, 12, 7, 20, 23, 24, 21
+ 7, 8, 7, 15, 16, 22, 21, 25, 26
+ 8, 7, 12, 18, 15, 21, 24, 27, 25
+*SURFACE, NAME=SS1
+ 1, S6
+ 3, S6
+ 5, S6
+ 7, S6
+ 3, S5
+ 4, S5
+ 7, S5
+ 8, S5
+ 1, S1
+ 2, S1
+ 3, S1
+ 4, S1
+ 1, S3
+ 2, S3
+ 5, S3
+ 6, S3
+*SURFACE, NAME=SS2
+ 2, S4
+ 4, S4
+ 8, S4
+ 8, S2
+*SURFACE, NAME=SS3
+ 5, S2
+ 6, S4
+ 6, S2
+ 7, S2
--- /dev/null
+# FEM Mesh Converter
+# Mesh type: AVS UCD
+
+27 32 0 0 0
+1 -1.00000000e+00 -1.00000000e+00 1.00000000e+00
+2 -1.00000000e+00 -1.00000000e+00 0.00000000e+00
+3 -1.00000000e+00 0.00000000e+00 0.00000000e+00
+4 -1.00000000e+00 0.00000000e+00 1.00000000e+00
+5 0.00000000e+00 -1.00000000e+00 1.00000000e+00
+6 0.00000000e+00 -1.00000000e+00 0.00000000e+00
+7 0.00000000e+00 0.00000000e+00 0.00000000e+00
+8 0.00000000e+00 0.00000000e+00 1.00000000e+00
+9 -1.00000000e+00 -1.00000000e+00 -1.00000000e+00
+10 -1.00000000e+00 0.00000000e+00 -1.00000000e+00
+11 0.00000000e+00 -1.00000000e+00 -1.00000000e+00
+12 0.00000000e+00 0.00000000e+00 -1.00000000e+00
+13 -1.00000000e+00 1.00000000e+00 0.00000000e+00
+14 -1.00000000e+00 1.00000000e+00 1.00000000e+00
+15 0.00000000e+00 1.00000000e+00 0.00000000e+00
+16 0.00000000e+00 1.00000000e+00 1.00000000e+00
+17 -1.00000000e+00 1.00000000e+00 -1.00000000e+00
+18 0.00000000e+00 1.00000000e+00 -1.00000000e+00
+19 1.00000000e+00 -1.00000000e+00 1.00000000e+00
+20 1.00000000e+00 -1.00000000e+00 0.00000000e+00
+21 1.00000000e+00 0.00000000e+00 0.00000000e+00
+22 1.00000000e+00 0.00000000e+00 1.00000000e+00
+23 1.00000000e+00 -1.00000000e+00 -1.00000000e+00
+24 1.00000000e+00 0.00000000e+00 -1.00000000e+00
+25 1.00000000e+00 1.00000000e+00 0.00000000e+00
+26 1.00000000e+00 1.00000000e+00 1.00000000e+00
+27 1.00000000e+00 1.00000000e+00 -1.00000000e+00
+1 1 hex 1 2 3 4 5 6 7 8
+2 1 hex 2 9 10 3 6 11 12 7
+3 1 hex 4 3 13 14 8 7 15 16
+4 1 hex 3 10 17 13 7 12 18 15
+5 1 hex 5 6 7 8 19 20 21 22
+6 2 hex 6 11 12 7 20 23 24 21
+7 2 hex 8 7 15 16 22 21 25 26
+8 2 hex 7 12 18 15 21 24 27 25
+1 1 quad 1 5 8 4
+2 1 quad 4 8 16 14
+3 1 quad 5 19 22 8
+4 1 quad 8 22 26 16
+5 1 quad 13 14 16 15
+6 1 quad 17 13 15 18
+7 1 quad 15 16 26 25
+8 1 quad 18 15 25 27
+9 1 quad 1 4 3 2
+10 1 quad 2 3 10 9
+11 1 quad 4 14 13 3
+12 1 quad 3 13 17 10
+13 1 quad 1 2 6 5
+14 1 quad 2 9 11 6
+15 1 quad 5 6 20 19
+16 1 quad 6 11 23 20
+17 2 quad 9 10 12 11
+18 2 quad 10 17 18 12
+19 2 quad 12 18 27 24
+20 2 quad 21 25 27 24
+21 3 quad 19 22 21 20
+22 3 quad 11 12 24 23
+23 3 quad 20 21 24 23
+24 3 quad 22 26 25 21
--- /dev/null
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# A minimalistic set of tests:
+#
+
+ENABLE_TESTING()
+
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ STRING(TOLOWER ${_build} _build_lowercase)
+
+ #
+ # Test whether thread affinity is well behaved:
+ #
+ SET(_target affinity.${_build_lowercase})
+
+ ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL affinity.cc)
+ DEAL_II_INSOURCE_SETUP_TARGET(${_target} ${_build})
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
+ COMMAND ${_target} > ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK 2>&1 || (rm ${_target}-OK && exit 1)
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ ADD_CUSTOM_TARGET(${_target}.run DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK)
+
+ ADD_TEST(NAME ${_target}
+ COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.run -DTEST=${_target}
+ -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ SET_TESTS_PROPERTIES(${_target} PROPERTIES LABEL "sanity checks")
+
+ENDFOREACH()
+
+#
+# A custom test target:
+#
+ADD_CUSTOM_TARGET(test
+ COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
#include <deal.II/grid/tria.h>
+#include <stdio.h>
#include <sched.h>
int main ()
return -1;
}
- unsigned int bits_set = CPU_COUNT(&my_set);
+ unsigned int bits_set = 0;//not supported on old kernels: CPU_COUNT(&my_set);
+ for (int i=0;i<CPU_SETSIZE;++i)
+ bits_set += CPU_ISSET(i,&my_set);
if (bits_set==1)
{