From: Matthias Maier Date: Tue, 11 Sep 2012 15:14:21 +0000 (+0000) Subject: Merge branch 'trunk' into branch_cmake X-Git-Tag: v8.0.0~1079^2~919 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50ded01c0900b6f01c337db9823a06051e3776f1;p=dealii.git Merge branch 'trunk' into branch_cmake Conflicts: deal.II/common/Make.global_options.in deal.II/configure deal.II/contrib/configure deal.II/doc/news/changes.h deal.II/doc/publications/index.html deal.II/examples/step-42/doc/intro-step-42.tex deal.II/include/deal.II/base/config.h.in deal.II/include/deal.II/integrators/laplace.h deal.II/source/Makefile tests/integrators/laplacian_01.cc tests/integrators/laplacian_01/cmp/generic git-svn-id: https://svn.dealii.org/branches/branch_cmake@26288 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index ccbdaec7bd..97e5b93c7c 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -435,8 +435,31 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl dnl BOOST uses long long, so don't warn about this CXXFLAGSG="$CXXFLAGSG -Wno-long-long" - dnl See whether the gcc we use already has a flag for C++2011 features. + dnl Newer versions have a flag -Wunused-local-typedefs that, though in principle + dnl a good idea, triggers a lot in BOOST in various places. Unfortunately, + dnl this warning is included in -W/-Wall, so disable it if the compiler + dnl supports it. + CXXFLAGS="-Wunused-local-typedefs" + AC_MSG_CHECKING(whether the compiler supports the -Wunused-local-typedefs flag) + AC_TRY_COMPILE( + [ + ], + [;], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -Wno-unused-local-typedefs" + ], + [ + AC_MSG_RESULT(no) + dnl Nothing to do here then. We can't disable it if the + dnl flag doesn't exist + ]) + + + dnl See whether the gcc we use already has a flag for C++2011 features + dnl and whether we can mark functions as deprecated with an attributed DEAL_II_CHECK_CXX1X + DEAL_II_CHECK_DEPRECATED dnl On some gcc 4.3 snapshots, a 'const' qualifier on a return type triggers a @@ -977,8 +1000,12 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl dnl somewhere in BOOST with BOOST_ASSERT. I have no idea dnl what happens here dnl #284: "NULL references not allowed" - CXXFLAGSG="$CXXFLAGSG -DDEBUG -g --display_error_number --diag_suppress 68 --diag_suppress 111 --diag_suppress 128 --diag_suppress 155 --diag_suppress 177 --diag_suppress 175 --diag_suppress 185 --diag_suppress 236 --diag_suppress 284" - CXXFLAGSO="$CXXFLAGSO -fast -O2 --display_error_number --diag_suppress 68 --diag_suppress 111 --diag_suppress 128 --diag_suppress 155 --diag_suppress 177 --diag_suppress 175 --diag_suppress 185 --diag_suppress 236 --diag_suppress 284" + dnl #497: "declaration of "dim" hides template parameter" (while + dnl theoretically useful, pgCC unfortunately gets this one + dnl wrong on legitimate code where no such parameter is + dnl hidden, see the email by ayaydemir on 9/3/2012) + CXXFLAGSG="$CXXFLAGSG -DDEBUG -g --display_error_number --diag_suppress 68 --diag_suppress 111 --diag_suppress 128 --diag_suppress 155 --diag_suppress 177 --diag_suppress 175 --diag_suppress 185 --diag_suppress 236 --diag_suppress 284 --diag_suppress 497" + CXXFLAGSO="$CXXFLAGSO -fast -O2 --display_error_number --diag_suppress 68 --diag_suppress 111 --diag_suppress 128 --diag_suppress 155 --diag_suppress 177 --diag_suppress 175 --diag_suppress 185 --diag_suppress 236 --diag_suppress 284 --diag_suppress 497" CXXFLAGSPIC="-Kpic" dnl pgCC can't (as of writing this, with version 12.5 in mid-2012) compile a part of BOOST. @@ -1156,7 +1183,7 @@ dnl ------------------------------------------------------------- dnl Given the command line flag specified as argument to this macro, dnl test whether all components that we need from the C++1X dnl standard are actually available. If so, add the flag to -dnl CXXFLAGS.g and CXXFLAGS.o, and set a flag in config.h +dnl CXXFLAGSG and CXXFLAGSO, and set a flag in config.h dnl dnl Usage: DEAL_II_CHECK_CXX1X_COMPONENTS(cxxflag) dnl @@ -1336,6 +1363,74 @@ AC_DEFUN(DEAL_II_CHECK_CXX1X_COMPONENTS, dnl ]) + +dnl ------------------------------------------------------------- +dnl See if the compiler understands the attribute to mark functions +dnl as deprecated. +dnl +dnl Usage: DEAL_II_CHECK_DEPRECATED +dnl +dnl ------------------------------------------------------------- +AC_DEFUN(DEAL_II_CHECK_DEPRECATED, dnl +[ + AC_MSG_CHECKING(whether compiler has attributes to deprecate functions) + + + OLD_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="" + + dnl First see if the following compiles without error (it should + dnl produce a warning but we don't care about this + AC_TRY_COMPILE( + [ + int old_fn () __attribute__((deprecated)); + int old_fn (); + int (*fn_ptr)() = old_fn; + ], + [;], + [ + test1=yes + ], + [ + test1=no + ]) + + dnl Now try this again with -Werror. It should now fail + CXXFLAGS=-Werror + AC_TRY_COMPILE( + [ + int old_fn () __attribute__((deprecated)); + int old_fn (); + int (*fn_ptr)() = old_fn; + ], + [;], + [ + test2=yes + ], + [ + test2=no + ]) + CXXFLAGS="${OLD_CXXFLAGS}" + + if test "$test1$test2" = "yesno" ; then + AC_MSG_RESULT(yes) + AC_DEFINE(DEAL_II_DEPRECATED, [__attribute__((deprecated))], + [If the compiler supports this, then this variable is + defined to a string that when written after a function + name makes the compiler emit a warning whenever this + function is used somewhere that its use is deprecated.]) + else + AC_MSG_RESULT(no) + AC_DEFINE(DEAL_II_DEPRECATED, [], + [If the compiler supports this, then this variable is + defined to a string that when written after a function + name makes the compiler emit a warning whenever this + function is used somewhere that its use is deprecated.]) + fi +]) + + + dnl ------------------------------------------------------------- dnl Determine the C compiler in use. Return the name and possibly dnl version of this compiler in CC_VERSION. This function is almost @@ -1680,7 +1775,7 @@ AC_DEFUN(DEAL_II_SET_CC_FLAGS, dnl clang) CFLAGS="$CFLAGS -g" - CFLAGSO="$CFLAGS -fast -O2" + CFLAGSO="$CFLAGS -O2" CFLAGSPIC="-fPIC" ;; @@ -1978,6 +2073,7 @@ AC_DEFUN(DEAL_II_CHECK_DYNAMIC_CAST_BUG, AC_MSG_CHECKING(for dynamic_cast problem with shared libs) if (cd contrib/config/tests/darwin-dynamic-cast ; \ + echo $CXX > compile_line; \ $CXX -dynamiclib BaseClass.cpp -o libDynamicCastTestLib.dylib ; \ $CXX -L. -lDynamicCastTestLib main.cc -o main ; \ ./main) ; then @@ -1987,9 +2083,11 @@ AC_DEFUN(DEAL_II_CHECK_DYNAMIC_CAST_BUG, AC_DEFINE(DEAL_II_HAVE_DARWIN_DYNACAST_BUG, 1, [Defined if the compiler has a bug with dynamic casting and dynamic libraries]) - CXXFLAGSG="$CXXFLAGSG -mmacosx-version-min=10.4" - CXXFLAGSO="$CXXFLAGSO -mmacosx-version-min=10.4" - LDFLAGS="$LDFLAGS -mmacosx-version-min=10.4" + if(test "`sw_vers -productVersion`" != "10.8");then + CXXFLAGSG="$CXXFLAGSG -mmacosx-version-min=10.4" + CXXFLAGSO="$CXXFLAGSO -mmacosx-version-min=10.4" + LDFLAGS="$LDFLAGS -mmacosx-version-min=10.4" + fi fi rm -f contrib/config/tests/darwin-dynamic-cast/libDynamicCastTestLib.dylib rm -f contrib/config/tests/darwin-dynamic-cast/main.o @@ -5602,12 +5700,6 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_ARCH, dnl dnl from time-to-time; so make sure that what was specified is dnl actually correct. case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in - 2.3*) dnl - if test ! -d $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH \ - ; then - AC_MSG_ERROR([PETSc has not been compiled for the architecture specified with --with-petsc-arch]) - fi - ;; 3.*) dnl if test ! -d $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib \ ; then @@ -5683,18 +5775,6 @@ AC_DEFUN(DEAL_II_CHECK_PETSC_MPI_CONSISTENCY, dnl dnl dnl Like always, we have to cake care of version control! case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in - 2.3.*) dnl - AC_TRY_COMPILE( - [#include "$DEAL_II_PETSC_DIR/bmake/$DEAL_II_PETSC_ARCH/petscconf.h" - ], - [#ifdef PETSC_HAVE_MPIUNI - compile error; - #endif - ], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR([PETSc was not built for MPI, but deal.II is!] - )]) - ;; 3.*) dnl AC_TRY_COMPILE( [#include "$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/include/petscconf.h" @@ -5713,18 +5793,6 @@ AC_DEFUN(DEAL_II_CHECK_PETSC_MPI_CONSISTENCY, dnl esac else case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in - 2.3*) dnl - AC_TRY_COMPILE( - [#include "$DEAL_II_PETSC_DIR/bmake/$DEAL_II_PETSC_ARCH/petscconf.h" - ], - [#ifndef PETSC_HAVE_MPIUNI - compile error; - #endif - ], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR([PETSc was built for MPI, but deal.II is not!] - )]) - ;; 3.*) dnl AC_TRY_COMPILE( [#include "$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/include/petscconf.h" @@ -5757,11 +5825,6 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB, dnl [ AC_MSG_CHECKING([for PETSc libmpiuni library]) case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in - 2.3*) dnl - if test -f $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a ; then - DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a" - fi - ;; 3.*) dnl if test -f $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.a ; then DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.a" @@ -5793,7 +5856,7 @@ dnl ------------------------------------------------------------ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_COMPLEX, dnl [ case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in - 3.1*) + 3.3*) AC_MSG_CHECKING([for PETSc scalar complex]) DEAL_II_PETSC_COMPLEX=`cat $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/include/petscconf.h \ | grep "#define PETSC_USE_COMPLEX" \ @@ -6550,6 +6613,252 @@ AC_DEFUN(DEAL_II_CHECK_TRILINOS_HEADER_FILES, dnl CXXFLAGS="${OLD_CXXFLAGS}" ]) +dnl =========================================================================== +dnl http://www.gnu.org/software/autoconf-archive/ax_lib_hdf5.html +dnl =========================================================================== +dnl +dnl SYNOPSIS +dnl +dnl AX_LIB_HDF5([serial/parallel]) +dnl +dnl DESCRIPTION +dnl +dnl This macro provides tests of the availability of HDF5 library. +dnl +dnl The optional macro argument should be either 'serial' or 'parallel'. The +dnl former only looks for serial HDF5 installations via h5cc. The latter +dnl only looks for parallel HDF5 installations via h5pcc. If the optional +dnl argument is omitted, serial installations will be preferred over +dnl parallel ones. +dnl +dnl The macro adds a --with-hdf5 option accepting one of three values: +dnl +dnl no - do not check for the HDF5 library. +dnl yes - do check for HDF5 library in standard locations. +dnl path - complete path to where lib/libhdf5* libraries and +dnl include/H5* include files reside. +dnl +dnl If HDF5 is successfully found, this macro calls +dnl +dnl AC_SUBST(DEAL_II_HDF5_VERSION) +dnl AC_SUBST(DEAL_II_HDF5_CFLAGS) +dnl AC_SUBST(DEAL_II_HDF5_CPPFLAGS) +dnl AC_SUBST(DEAL_II_HDF5_LDFLAGS) +dnl AC_SUBST(DEAL_II_HDF5_INCDIR) +dnl AC_DEFINE(DEAL_II_HAVE_HDF5) +dnl +dnl and sets with_hdf5="yes". +dnl +dnl If HDF5 is disabled or not found, this macros sets with_hdf5="no". +dnl +dnl Your configuration script can test $with_hdf to take any further +dnl actions. HDF5_{C,CPP,LD}FLAGS may be used when building with C or C++. +dnl +dnl LICENSE +dnl +dnl Copyright (c) 2009 Timothy Brown +dnl Copyright (c) 2010 Rhys Ulerich +dnl +dnl Copying and distribution of this file, with or without modification, are +dnl permitted in any medium without royalty provided the copyright notice +dnl and this notice are preserved. This file is offered as-is, without any +dnl warranty. + +AC_DEFUN(DEAL_II_CONFIGURE_HDF5, dnl +[ + +AC_REQUIRE([AC_PROG_SED]) +AC_REQUIRE([AC_PROG_AWK]) +AC_REQUIRE([AC_PROG_GREP]) + +dnl Add a default --with-hdf5 configuration option. +AC_ARG_WITH([hdf5], + AS_HELP_STRING( + [--with-hdf5=[yes/no/PATH]], + m4_case(m4_normalize([$1]), + [serial], [location of h5cc for serial HDF5 configuration], + [parallel], [location of h5pcc for parallel HDF5 configuration], + [location of h5cc or h5pcc for HDF5 configuration]) + ), + [if test "$withval" = "no"; then + with_hdf5="no" + elif test "$withval" = "yes"; then + with_hdf5="yes" + warn_if_cannot_find_hdf5="yes" + elif test -z "$withval"; then + with_hdf5="yes" + H5CC="$withval" + else + warn_if_cannot_find_hdf5="yes" + with_hdf5="yes" + H5CC="$withval" + fi], + [with_hdf5="yes"] +) + +dnl Set defaults to blank +USE_CONTRIB_HDF5=no +DEAL_II_HDF5_VERSION="" +DEAL_II_HDF5_CFLAGS="" +DEAL_II_HDF5_CPPFLAGS="" +DEAL_II_HDF5_LDFLAGS="" +DEAL_II_HDF5_INCDIR="" + +dnl Try and find hdf5 compiler tools and options. +if test "$with_hdf5" = "yes"; then + if test -z "$H5CC"; then + dnl Check to see if H5CC is in the path. + AC_PATH_PROGS( + [H5CC], + m4_case(m4_normalize([$1]), + [serial], [h5cc], + [parallel], [h5pcc], + [h5cc h5pcc]), + []) + else + AC_MSG_CHECKING([Using provided HDF5 C wrapper]) + AC_MSG_RESULT([$H5CC]) + fi + AC_MSG_CHECKING([for HDF5 libraries]) + if test ! -x "$H5CC"; then + AC_MSG_RESULT([no]) + if test "$warn_if_cannot_find_hdf5" = "yes"; then + AC_MSG_WARN(m4_case(m4_normalize([$1]), + [serial], [ +Unable to locate serial HDF5 compilation helper script 'h5cc'. +Please specify --with-hdf5= as the full path to h5cc. +HDF5 support is being disabled (equivalent to --with-hdf5=no). +], [parallel],[ +Unable to locate parallel HDF5 compilation helper script 'h5pcc'. +Please specify --with-hdf5= as the full path to h5pcc. +HDF5 support is being disabled (equivalent to --with-hdf5=no). +], [ +Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. +Please specify --with-hdf5= as the full path to h5cc or h5pcc. +HDF5 support is being disabled (equivalent to --with-hdf5=no). +])) + fi + with_hdf5="no" + else + dnl h5cc provides both AM_ and non-AM_ options + dnl depending on how it was compiled either one of + dnl these are empty. Lets roll them both into one. + + dnl Look for "HDF5 Version: X.Y.Z" + DEAL_II_HDF5_VERSION=$(eval $H5CC -showconfig | grep 'HDF5 Version:' \ + | $AWK '{print $[]3}') + +dnl A ideal situation would be where everything we needed was +dnl in the AM_* variables. However most systems are not like this +dnl and seem to have the values in the non-AM variables. +dnl +dnl We try the following to find the flags: +dnl (1) Look for "NAME:" tags +dnl (2) Look for "NAME/H5_NAME:" tags +dnl (3) Look for "AM_NAME:" tags +dnl + dnl (1) + dnl Look for "CFLAGS: " + DEAL_II_HDF5_CFLAGS=$(eval $H5CC -showconfig | grep '\bCFLAGS:' \ + | $AWK -F: '{print $[]2}') + dnl Look for "CPPFLAGS" + DEAL_II_HDF5_CPPFLAGS=$(eval $H5CC -showconfig | grep '\bCPPFLAGS:' \ + | $AWK -F: '{print $[]2}') + dnl Look for "LD_FLAGS" + DEAL_II_HDF5_LDFLAGS=$(eval $H5CC -showconfig | grep '\bLDFLAGS:' \ + | $AWK -F: '{print $[]2}') + + dnl (2) + dnl CFLAGS/H5_CFLAGS: .../.... + dnl We could use $SED with something like the following + dnl 's/CFLAGS.*\/H5_CFLAGS.*[:]\(.*\)\/\(.*\)/\1/p' + if test -z "$DEAL_II_HDF5_CFLAGS"; then + DEAL_II_HDF5_CFLAGS=$(eval $H5CC -showconfig \ + | $SED -n 's/CFLAGS.*[:]\(.*\)\/\(.*\)/\1/p') + fi + dnl Look for "CPPFLAGS" + if test -z "$DEAL_II_HDF5_CPPFLAGS"; then + DEAL_II_HDF5_CPPFLAGS=$(eval $H5CC -showconfig \ + | $SED -n 's/CPPFLAGS.*[:]\(.*\)\/\(.*\)/\1/p') + fi + dnl Look for "LD_FLAGS" + if test -z "$DEAL_II_HDF5_LDFLAGS"; then + DEAL_II_HDF5_LDFLAGS=$(eval $H5CC -showconfig \ + | $SED -n 's/LDFLAGS.*[:]\(.*\)\/\(.*\)/\1/p') + fi + + dnl (3) + dnl Check to see if these are not empty strings. If so + dnl find the AM_ versions and use them. + if test -z "$DEAL_II_HDF5_CFLAGS"; then + DEAL_II_HDF5_CFLAGS=$(eval $H5CC -showconfig \ + | grep '\bAM_CFLAGS:' | $AWK -F: '{print $[]2}') + fi + if test -z "$DEAL_II_HDF5_CPPFLAGS"; then + DEAL_II_HDF5_CPPFLAGS=$(eval $H5CC -showconfig \ + | grep '\bAM_CPPFLAGS:' | $AWK -F: '{print $[]2}') + fi + if test -z "$DEAL_II_HDF5_LDFLAGS"; then + DEAL_II_HDF5_LDFLAGS=$(eval $H5CC -showconfig \ + | grep '\bAM_LDFLAGS:' | $AWK -F: '{print $[]2}') + fi + + dnl Frustratingly, the necessary -Idir,-Ldir still may not be found! + dnl Attempt to pry any more required include directories from wrapper. + for arg in `$H5CC -c -show` + do + case "$arg" in #( + -I*) echo $DEAL_II_HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ + || DEAL_II_HDF5_CPPFLAGS="$arg $DEAL_II_HDF5_CPPFLAGS" + ;; + esac + done + for arg in `$H5CC -show` + do + case "$arg" in #( + -L*) echo $DEAL_II_HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ + || DEAL_II_HDF5_LDFLAGS="$arg $DEAL_II_HDF5_LDFLAGS" + ;; + esac + done + + AC_MSG_RESULT([yes (version $[DEAL_II_HDF5_VERSION])]) + + dnl Look for any extra libraries also needed to link properly + EXTRA_LIBS=$(eval $H5CC -showconfig | grep 'Extra libraries:'\ + | $AWK -F: '{print $[]2}') + + dnl Look for HDF5's high level library + ax_lib_hdf5_save_LDFLAGS=$LDFLAGS + ax_lib_hdf5_save_LIBS=$LIBS + LDFLAGS=$DEAL_II_HDF5_LDFLAGS + AC_HAVE_LIBRARY([hdf5_hl], + [DEAL_II_HDF5_LDFLAGS="$DEAL_II_HDF5_LDFLAGS -lhdf5_hl"], + [], + [-lhdf5 $EXTRA_LIBS]) + LIBS=$ax_lib_hdf5_save_LIBS + LDFLAGS=$ax_lib_hdf5_save_LDFLAGS + + dnl Add the HDF5 library itself + DEAL_II_HDF5_LDFLAGS="$DEAL_II_HDF5_LDFLAGS -lhdf5" + + dnl Add any EXTRA_LIBS afterwards + if test "$EXTRA_LIBS"; then + DEAL_II_HDF5_LDFLAGS="$DEAL_II_HDF5_LDFLAGS $EXTRA_LIBS" + fi + + dnl remove "-I" from cpp flags to get include path + DEAL_II_HDF5_INCDIR=$(eval echo $DEAL_II_HDF5_CPPFLAGS | cut -c 3-) + + LDFLAGS="$LDFLAGS $DEAL_II_HDF5_LDFLAGS" + USE_CONTRIB_HDF5=yes + AC_DEFINE([DEAL_II_HAVE_HDF5], [1], [Defined if you have HDF5 support]) + fi +fi +]) + + + dnl ------------------------------------------------------------ @@ -6729,68 +7038,61 @@ AC_DEFUN(DEAL_II_CONFIGURE_METIS, dnl AC_ARG_WITH(metis, [AS_HELP_STRING([--with-metis=/path/to/metis], - [Specify the path to the Metis installation, of which the include and library directories are subdirs; use this if you want to override the METIS_DIR environment variable.])], + [Specify the path to the Metis installation, of which the include and library directories are subdirs; use this if you want to override the METIS_DIR environment variable.])], [ + AC_MSG_CHECKING([for METIS library directory]) USE_CONTRIB_METIS=yes DEAL_II_METIS_DIR="$withval" AC_MSG_RESULT($DEAL_II_METIS_DIR) - dnl Make sure that what was specified is actually correct - if test ! -d $DEAL_II_METIS_DIR/Lib ; then + dnl Make sure that what was specified is actually correct. The + dnl libraries could be in either $DEAL_II_METIS_DIR/lib (metis was + dnl make installed) or $DEAL_II_METIS_DIR/libmetis (metis was make + dnl only and PETSc). + if test ! -d $DEAL_II_METIS_DIR/lib \ + && test ! -d $DEAL_II_METIS_DIR/libmetis ; then AC_MSG_ERROR([Path to Metis specified with --with-metis does not point to a complete Metis installation]) fi - DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR" + dnl If lib is not found, we must have libraries in libmetis + dnl (which was found above). + if test -d $DEAL_II_METIS_DIR/lib ; then + DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/lib" + else + DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/libmetis" + fi + + if test ! -d $DEAL_II_METIS_DIR/include ; then + AC_MSG_ERROR([Path to Metis specified with --with-metis does not point to a complete Metis installation]) + fi + + DEAL_II_METIS_INCDIR="$DEAL_II_METIS_DIR/include" ], [ dnl Take something from the environment variables, if it is there if test "x$METIS_DIR" != "x" ; then + AC_MSG_CHECKING([for METIS from the environment]) USE_CONTRIB_METIS=yes DEAL_II_METIS_DIR="$METIS_DIR" AC_MSG_RESULT($DEAL_II_METIS_DIR) - dnl Make sure that what this is actually correct - if test ! -d $DEAL_II_METIS_DIR/Lib ; then + dnl Make sure that what this is actually correct (see notes above). + if test ! -d $DEAL_II_METIS_DIR/lib \ + && test ! -d $DEAL_II_METIS_DIR/libmetis ; then AC_MSG_ERROR([The path to Metis specified in the METIS_DIR environment variable does not point to a complete Metis installation]) fi - DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR" - else - USE_CONTRIB_METIS=no - DEAL_II_METIS_DIR="" - fi - ]) - AC_ARG_WITH(metis-libs, - [AS_HELP_STRING([--with-metis-libs=/path/to/metis], - [Specify the path to the METIS libraries; use this if you want to override the METIS_LIBDIR environment variable.])], - [ - USE_CONTRIB_METIS=yes - DEAL_II_METIS_LIBDIR="$withval" - AC_MSG_RESULT($DEAL_II_METIS_LIBDIR) + if test -d $DEAL_II_METIS_DIR/lib ; then + DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/lib" + else + DEAL_II_METIS_LIBDIR="$DEAL_II_METIS_DIR/libmetis" + fi - dnl Make sure that what was specified is actually correct - if test ! -d $DEAL_II_METIS_LIBDIR ; then - AC_MSG_ERROR([Path to Metis specified with --with-metis does not point to a complete Metis installation]) - fi - ], - [ - dnl Take something from the environment variables, if it is there - if test "x$METIS_LIBDIR" != "x" ; then - USE_CONTRIB_METIS=yes - DEAL_II_METIS_LIBDIR="$METIS_LIBDIR" - AC_MSG_RESULT($DEAL_II_METIS_LIBDIR) + DEAL_II_METIS_INCDIR="$DEAL_II_METIS_DIR/include" - dnl Make sure that what this is actually correct - if test ! -d $DEAL_II_METIS_LIBDIR ; then - AC_MSG_ERROR([The path to Metis specified in the METIS_DIR environment variable does not point to a complete Metis installation]) - fi else - dnl Unless --with-metis has been set before, declare that METIS - dnl is not desired. - if test "x$USE_CONTRIB_METIS" != "xyes" ; then - USE_CONTRIB_METIS=no - DEAL_II_METIS_LIBDIR="" - fi + USE_CONTRIB_METIS=no + DEAL_II_METIS_DIR="" fi ]) @@ -6800,6 +7102,10 @@ AC_DEFUN(DEAL_II_CONFIGURE_METIS, dnl to be used]) LDFLAGS="$LDFLAGS -L$DEAL_II_METIS_LIBDIR -lmetis" + if test "x$DEAL_II_LD_UNDERSTANDS_RPATH" = "xyes" ; then + LDFLAGS="$LDFLAGS $LD_PATH_OPTION$DEAL_II_METIS_LIBDIR" + fi + dnl AC_MSG_CHECKING(for Metis version) dnl DEAL_II_METIS_VERSION=`cat $DEAL_II_METIS_DIR/VERSION` dnl AC_MSG_RESULT($DEAL_II_METIS_VERSION) diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index 80928d3ba8..159d16c66d 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -76,6 +76,13 @@ DEAL_II_TRILINOS_VERSION_MINOR = @DEAL_II_TRILINOS_VERSION_MINOR@ DEAL_II_TRILINOS_VERSION_SUBMINOR = @DEAL_II_TRILINOS_VERSION_SUBMINOR@ DEAL_II_TRILINOS_LIBPREFIX = @DEAL_II_TRILINOS_LIBPREFIX@ +USE_CONTRIB_HDF5 = @USE_CONTRIB_HDF5@ +DEAL_II_HDF5_VERSION = @DEAL_II_HDF5_VERSION@ +DEAL_II_HDF5_CFLAGS = @DEAL_II_HDF5_CFLAGS@ +DEAL_II_HDF5_CPPFLAGS = @DEAL_II_HDF5_CPPFLAGS@ +DEAL_II_HDF5_LDFLAGS = @DEAL_II_HDF5_LDFLAGS@ +DEAL_II_HDF5_INCDIR = @DEAL_II_HDF5_INCDIR@ + USE_CONTRIB_BLAS = @USE_CONTRIB_BLAS@ USE_CONTRIB_LAPACK = @USE_CONTRIB_LAPACK@ @@ -90,7 +97,9 @@ DEAL_II_ARPACK_DIR = @DEAL_II_ARPACK_DIR@ DEAL_II_ARPACK_ARCH = @DEAL_II_ARPACK_ARCH@ USE_CONTRIB_METIS = @USE_CONTRIB_METIS@ +DEAL_II_METIS_DIR = @DEAL_II_METIS_DIR@ DEAL_II_METIS_LIBDIR = @DEAL_II_METIS_LIBDIR@ +DEAL_II_METIS_INCDIR = @DEAL_II_METIS_INCDIR@ USE_CONTRIB_HSL = @USE_CONTRIB_HSL@ USE_CONTRIB_UMFPACK = @USE_CONTRIB_UMFPACK@ @@ -162,31 +171,20 @@ endif # we can link to directly. This avoids problems with recent versions # of gcc. ifeq ($(USE_CONTRIB_PETSC),yes) - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) - lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH) - lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH) - else - lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib - lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib - endif + lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib + lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib ifeq ($(enable-shared),yes) - # Starting with PETSc versions 2.3.*: - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) - lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix)) - lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix)) + # Starting with PETSc versions 3.0.0: + ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),30) + lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) + lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) else - # which is the similar as for PETSc 3.0.0: - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),30) - lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) - lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix)) - else - # but after that (petsc-3.1++), we can use the simpler PETSc - # default "--with-single-library=1" like this: - lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) - lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) - endif - endif # if PETSC_VERSION + # but after that (petsc-3.1++), we can use the simpler PETSc + # default "--with-single-library=1" like this: + lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) + lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix)) + endif else # and finally this goes for static libraries lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix) @@ -200,7 +198,7 @@ endif # same for metis, except that there is only one library in that case ifeq ($(USE_CONTRIB_METIS),yes) - lib-contrib-metis = $(DEAL_II_METIS_LIBDIR)/libmetis.a + lib-contrib-metis = $(DEAL_II_METIS_LIBDIR)/libmetis$(lib-suffix) endif # List all trilinos libraries that we want to link with. These must be sorted @@ -273,16 +271,15 @@ lib-deal2.g = $(LIBDIR)/libdeal_II.g$(lib-suffix) \ # environment variable, since the compiler will evaluate the value of # that anyway at compile time include-path-petsc = $(DEAL_II_PETSC_DIR)/include -ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) - include-path-petsc-bmake = $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH) -else - include-path-petsc-bmake = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/include -endif +include-path-petsc-bmake = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/include include-path-slepc = $(DEAL_II_SLEPC_DIR)/include include-path-slepc-bmake = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_PETSC_ARCH)/include include-path-slepc-conf = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_PETSC_ARCH)/conf include-path-trilinos = $(DEAL_II_TRILINOS_INCDIR) include-path-mumps = $(DEAL_II_MUMPS_DIR)/include +include-path-metis = $(DEAL_II_METIS_INCDIR) +include-path-hdf5 = $(DEAL_II_HDF5_INCDIR) + # include paths as command line flags. while compilers allow a space between # the '-I' and the actual path, we also send these flags to the @@ -305,9 +302,6 @@ INCLUDE = -I$D/include \ # # also, note that this only works for PETSc before 2.3 :-] ifeq ($(USE_CONTRIB_PETSC),yes) - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),22) - include $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)/packages - endif INCLUDE += -I$(include-path-petsc) \ -I$(include-path-petsc-bmake) \ $(MPI_INCLUDE) @@ -327,6 +321,15 @@ ifeq ($(USE_CONTRIB_MUMPS),yes) INCLUDE += -I$(include-path-mumps) endif +ifeq ($(USE_CONTRIB_METIS),yes) + INCLUDE += -I$(include-path-metis) +endif + +ifeq ($(USE_CONTRIB_HDF5),yes) + INCLUDE += -I$(include-path-hdf5) +endif + + ifeq ($(enable-threads),yes) INCLUDE += -I$(shell echo $D/contrib/tbb/tbb*/include) endif @@ -353,24 +356,25 @@ ifeq ($(USE_CONTRIB_PETSC),yes) # set PETSC_DIR and PETSC_ARCH to be used in variables file PETSC_DIR = $(DEAL_II_PETSC_DIR) PETSC_ARCH = $(DEAL_II_PETSC_ARCH) - ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2) - ifeq ($(DEAL_II_PETSC_VERSION_MINOR),2) - include $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)/variables - else - include $(DEAL_II_PETSC_DIR)/bmake/common/variables - endif - else - # PETSC's $(PETSC_ARCH)/conf/petscvariables include file happens - # to have a variable $(CXX) of itself. we need to save our own - # variable and restore it later. this isn't pretty :-( - SAVE_CXX := $(CXX) - include $(DEAL_II_PETSC_DIR)/conf/variables - CXX := $(SAVE_CXX) - endif + + # PETSC's $(PETSC_ARCH)/conf/petscvariables include file happens + # to have a variable $(CXX) of itself. we need to save our own + # variable and restore it later. this isn't pretty :-( + SAVE_CXX := $(CXX) + include $(DEAL_II_PETSC_DIR)/conf/variables + CXX := $(SAVE_CXX) + CXXFLAGS.g += $(GCXX_PETSCFLAGS) CXXFLAGS.o += $(OCXX_PETSCFLAGS) endif +ifeq ($(USE_CONTRIB_HDF5),yes) + CFLAGS.g += $(DEAL_II_HDF5_CFLAGS) + CFLAGS.o += $(DEAL_II_HDF5_CFLAGS) + CXXFLAGS.g += $(DEAL_II_HDF5_CXXFLAGS) + CXXFLAGS.o += $(DEAL_II_HDF5_CXXFLAGS) +endif + ifneq ($(enable-threads),no) MT = MT else @@ -380,15 +384,13 @@ endif ifeq ($(BUILDTEST),yes) print-summary: - @echo "dealii-feature: revision=`svn info .. | grep Revision | sed 's/Revision: //'`" + @svn info .. | perl -ne 'print "dealii-feature: revision=$$_\n" if s/Revision: //; print "dealii-feature: branch=$$1\n" if m/svn\/dealii\/(.+)\/deal.II/;' @echo "dealii-feature: user=$(USER)" @echo "dealii-feature: host=`hostname`" @echo "dealii-feature: target=$(TARGET)" @echo "dealii-feature: compiler=$(GXX-VERSION-DETAILED)" @echo "dealii-feature: multithreading=$(enable-threads)" @echo "dealii-feature: shared_libs=$(enable-shared)" - @echo "dealii-feature: parser=$(subst no,,$(enable-parser))" - @echo "dealii-feature: PETSc=$(subst ..,,$(DEAL_II_PETSC_VERSION_MAJOR).$(DEAL_II_PETSC_VERSION_MINOR).$(DEAL_II_PETSC_VERSION_SUBMINOR))" @echo "dealii-feature: METIS=$(subst no,,$(USE_CONTRIB_METIS))" @cd $D/common/scripts ; make report_features && ./report_features endif diff --git a/deal.II/common/scripts/report_features.cc b/deal.II/common/scripts/report_features.cc index eb913867f6..70eed0faba 100644 --- a/deal.II/common/scripts/report_features.cc +++ b/deal.II/common/scripts/report_features.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2010, 2011 by the deal.II authors +// Copyright (C) 2010, 2011, 2012 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -42,6 +42,12 @@ extern "C" { # include #endif +// Output configuration options from config.h. +// The format of each line is +// +// deal-feature: FEATURE=value +// +// no spaces in any token! int main() { @@ -62,7 +68,7 @@ int main() #if defined(DEAL_II_COMPILER_SUPPORTS_MPI) # ifdef OMPI_MAJOR_VERSION - std::cout << "dealii-feature: MPI=OpenMPI
" + std::cout << "dealii-feature: MPI=OpenMPI-" << OMPI_MAJOR_VERSION << '.' << OMPI_MINOR_VERSION << '.' << OMPI_RELEASE_VERSION << std::endl; @@ -116,4 +122,31 @@ int main() #endif std::cout << std::endl; #endif + +#ifdef DEAL_II_USE_P4EST + std::cout << "dealii-feature: P4est=yes" << std::endl; +#endif + +#ifdef DEAL_II_HAVE_HDF5 + std::cout << "dealii-feature: HDF5=yes" << std::endl; +#endif + +#ifdef DEAL_II_HAVE_TECPLOT + std::cout << "dealii-feature: Tecplot=yes" << std::endl; +#endif + +#ifdef HAVE_LIBNETCDF + std::cout << "dealii-feature: NetCDF=yes" << std::endl; +#endif + +#ifdef HAVE_LIBZ + std::cout << "dealii-feature: LibZ=yes" << std::endl; +#endif + +#ifdef DEAL_II_DISABLE_PARSER + std::cout << "dealii-feature: parser=no" << std::endl; +#else + std::cout << "dealii-feature: parser=yes" << std::endl; +#endif + } diff --git a/deal.II/configure.in b/deal.II/configure.in index 747709fe0e..c7f7c4d868 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -23,7 +23,7 @@ dnl clearing the cache define([AC_CACHE_LOAD], )dnl define([AC_CACHE_SAVE], )dnl -AC_INIT(deal.II, 7.2.pre, dealii@dealii.org, deal.II) +AC_INIT(deal.II, 7.3.pre, dealii@dealii.org, deal.II) AC_REVISION($Revision$) AC_PREREQ(2.61) @@ -507,6 +507,15 @@ AC_SUBST(DEAL_II_TRILINOS_LIBDIR) AC_SUBST(DEAL_II_TRILINOS_SHARED) AC_SUBST(DEAL_II_TRILINOS_STATIC) +DEAL_II_CONFIGURE_HDF5 +AC_SUBST(USE_CONTRIB_HDF5) +AC_SUBST(DEAL_II_HDF5_VERSION) +AC_SUBST(DEAL_II_HDF5_CFLAGS) +AC_SUBST(DEAL_II_HDF5_CPPFLAGS) +AC_SUBST(DEAL_II_HDF5_LDFLAGS) +AC_SUBST(DEAL_II_HDF5_INCDIR) + + DEAL_II_CONFIGURE_ARPACK AC_SUBST(USE_CONTRIB_ARPACK) AC_SUBST(DEAL_II_ARPACK_DIR) @@ -650,7 +659,9 @@ DEAL_II_CONFIGURE_NETCDF DEAL_II_CONFIGURE_METIS AC_SUBST(USE_CONTRIB_METIS) +AC_SUBST(DEAL_II_METIS_DIR) AC_SUBST(DEAL_II_METIS_LIBDIR) +AC_SUBST(DEAL_II_METIS_INCDIR) dnl Check for UMFPack DEAL_II_WITH_UMFPACK diff --git a/deal.II/doc/authors.html b/deal.II/doc/authors.html index 03dbf70f3f..cb7b7df9ec 100644 --- a/deal.II/doc/authors.html +++ b/deal.II/doc/authors.html @@ -1,261 +1,305 @@ + "http://www.w3.org/TR/html4/loose.dtd"> - - - deal.II Credits - - - - - - - - -

deal.II Credits

- -

- The deal.II project was initially started by members - of the Numerical Methods group at the University of Heidelberg, Germany but - has since become a global, open source project. - The current maintainers of the library are: -

- - -

In order to get in contact with them, send email to authors -at dealii.org. -

- -

Many people have contributed to deal.II over the years, some of them very - substantial parts of the library. Their work - is greatly appreciated: no open source project can survice without a - community. The following people contributed major parts - of the library (in alphabetical order): -

- -
    -
  • Moritz Allmaras: - Step-29 tutorial program. - -
  • Michael Anderson: - Linear complexity grid reordering algorithm in 2d and 3d. - -
  • Andrea Bonito: - Step-38. - -
  • Markus Bürg: - Conical meshes and geometries;   step-45 tutorial program;   - VectorTools::project_boundary_values_curl_conforming;   MUMPS - interface, FE_Nedelec for arbitrary polynomial degrees. - -
  • John Burnell: - Configuration on Microsoft Windows systems. - -
  • Brian Carnes: - Hierarchical finite element classes;   + + + deal.II Credits + + + + + + + + +

    deal.II Credits

    + +

    + The deal.II project was initially started by members + of the Numerical Methods group at the University of Heidelberg, Germany but + has since become a global, open source project. + The current maintainers of the library are: +

    + + +

    In order to get in contact with them, send email to authors + at dealii.org. +

    + +

    Many people have contributed to deal.II over the years, some of them very + substantial parts of the library. Their work + is greatly appreciated: no open source project can survice without a + community. The following people contributed major parts + of the library (in alphabetical order), with many more that have + sent in fixed and small enhancements: +

    + +
      +
    • Moritz Allmaras: + Step-29 tutorial program. + +
    • Michael Anderson: + Linear complexity grid reordering algorithm in 2d and 3d. + +
    • Andrea Bonito: + Step-38. + +
    • Markus Bürg: + Conical meshes and geometries;   step-45 tutorial program;   + VectorTools::project_boundary_values_curl_conforming;   MUMPS + interface, FE_Nedelec for arbitrary polynomial degrees. + +
    • John Burnell: + Configuration on Microsoft Windows systems. + +
    • Brian Carnes: + Hierarchical finite element classes;   random fixes and enhancements. -
    • Ivan Christov: - Step-25 tutorial program. - -
    • Martin Genet: - Make SparseDirectUMFPACK work with block matrices. - -
    • Ralf Hartmann: - Ralf was one of the original developers and maintainers of the library until - 2011. He has written significant chunks of code throughout the library. - -
    • Timo Heister: - CompressedSimpleSparsityPattern class;   a lot of the work for - massively parallel computations;   step-32;   step-40;   many - enhancements all throughout the library. - -
    • Luca Heltai: - Gmsh format mesh reader and writer;   - some of the meshes in the GridGenerator class;   - generalization of FilteredMatrix;   - integration of the function parser library;   - cubit journal file to export to ucd mesh format;   - FEFieldFunction and ParsedFunction classes;   - work on the codimension-one meshes, DoFHandler, and finite - elements;   - singular integration;   - Step-34 tutorial program;   - random bug fixes and enhancements. - -
    • Bärbel Janssen: - Lots of work on multigrid for adaptive meshes;   multigrid in the - MeshWorker framework;   step-16. - -
    • Xing Jin: - step-24 tutorial program. - -
    • Oliver Kayser-Herold: - Lots of work on hp finite elements;   - integration of PETSc's LU decomposition;   - hanging node constraints for higher order elements in 3d. - -
    • Seungil Kim: - Help on the step-16 tutorial program. - -
    • Benjamin Shelton Kirk: - Tecplot output. - -
    • Katharina Kormann: - Support for arbitrary nodes in FE_Q. Matrix-free - framework. step-37 and step-48 tutorial programs. - -
    • Martin Kronbichler: - step-22, step-31, step-32, step-37, step-48, interfaces to - Trilinos, significant parts of ConstraintMatrix, matrix-free - computations, support for massively parallel computations, and - many enhancements in random places. - -
    • Tobias Leicht: - Lots of work on internal data structures: anisotropic refinement - (including step-30), faces - without level, - support for previously unorientable meshes; -   extension of DataOut to higher order mapping functions; DataPostprocessor; -   GridIn::read_tecplot; -   made SolutionTransfer independent of Triangulation::user_pointers; -   random bug fixes and enhancements. - -
    • Yan Li: - step-21 tutorial program. - -
    • Cataldo Manigrasso: - Work on the codimension-one meshes, DoFHandler, and finite - elements. - -
    • Andrew McBride: - FEValues extractors for symmetric tensors. - -
    • Helmut Müller: - Multiprocessor detection on Mac OS X. - -
    • Stefan Nauber: +
    • Ivan Christov: + Step-25 tutorial program. + +
    • Chih-Che Chueh: + Step-43 tutorial program. + +
    • Marco Engelhard: + Better support for output for Paraview. + +
    • Jörg Frohne: + step-41. Fixes in many places. + +
    • Thomas Geenen: + Support for different geometries. + +
    • Martin Genet: + Make SparseDirectUMFPACK work with block matrices. + +
    • Christian Goll: + Abstraction of material and boundary indicators. Enhancements in + various places. + +
    • Ralf Hartmann: + Ralf was one of the original developers and maintainers of the library until + 2011. He has written significant chunks of code throughout the library. + +
    • Eric Heien: + HDF5 output. + +
    • Timo Heister: + CompressedSimpleSparsityPattern class;   a lot of the work for + massively parallel computations;   step-32;   step-40;   many + enhancements all throughout the library. + +
    • Luca Heltai: + Gmsh format mesh reader and writer;   + some of the meshes in the GridGenerator class;   + generalization of FilteredMatrix;   + integration of the function parser library;   + cubit journal file to export to ucd mesh format;   + FEFieldFunction and ParsedFunction classes;   + work on the codimension-one meshes, DoFHandler, and finite + elements;   + singular integration;   + Step-34 tutorial program;   + random bug fixes and enhancements. + +
    • Bärbel Janssen: + Lots of work on multigrid for adaptive meshes;   multigrid in the + MeshWorker framework;   step-16. + +
    • Xing Jin: + step-24 tutorial program. + +
    • Oliver Kayser-Herold: + Lots of work on hp finite elements;   + integration of PETSc's LU decomposition;   + hanging node constraints for higher order elements in 3d. + +
    • Seungil Kim: + Help on the step-16 tutorial program. + +
    • Benjamin Shelton Kirk: + Tecplot output. + +
    • Katharina Kormann: + Support for arbitrary nodes in FE_Q. Matrix-free + framework. step-37 and step-48 tutorial programs. + +
    • Martin Kronbichler: + step-22, step-31, step-32, step-37, step-48, interfaces to + Trilinos, significant parts of ConstraintMatrix, matrix-free + computations, support for massively parallel computations, and + many enhancements in random places. + +
    • Tobias Leicht: + Lots of work on internal data structures: anisotropic refinement + (including step-30), faces + without level, + support for previously unorientable meshes; +   extension of DataOut to higher order mapping functions; DataPostprocessor; +   GridIn::read_tecplot; +   made SolutionTransfer independent of Triangulation::user_pointers; +   random bug fixes and enhancements. + +
    • Yan Li: + step-21 tutorial program. + +
    • Vijay Mahadevan: + Enhancements in the interface to PETSc. Support for reading GMSH + 2.5 format. + +
    • Matthias Maier: + Periodic boundary conditions. Enhancements throughout the library. + +
    • Cataldo Manigrasso: + Work on the codimension-one meshes, DoFHandler, and finite + elements. + +
    • Andrew McBride: + FEValues extractors for symmetric tensors. step-44. + +
    • Scott Miller: + Enhancements to FE_Nothing. + +
    • Helmut Müller: + Multiprocessor detection on Mac OS X. + +
    • Stefan Nauber: Postscript output. -
    • David Neckels: - step-33 tutorial program. +
    • David Neckels: + step-33 tutorial program. + +
    • M. Sebastian Pauletti: + Making meshes embedded in higher space dimensions more usable;   many + bug fixes and enhancements for codimension-one computations and + throughout the library. + +
    • Jean-Paul Pelteret: + step-44. -
    • M. Sebastian Pauletti: - Making meshes embedded in higher space dimensions more usable;   many - bug fixes and enhancements for codimension-one computations. +
    • Jonathan Pitt: + Enhancements to FE_Nothing. Changes in a variety of places. -
    • Adam Powell IV: - Configuration issues, Debian packages. +
    • Adam Powell IV: + Configuration issues, Debian packages. -
    • Florian Prill: +
    • Florian Prill: Gauss Lobatto quadrature, random bug fixes. -
    • Daniel Castanon Quiroz: - Torus domain and boundary. +
    • Daniel Castanon Quiroz: + Torus domain and boundary. -
    • Michael Rapson: - PointValueHistory class. +
    • Michael Rapson: + PointValueHistory class. -
    • Thomas Richter: +
    • Thomas Richter: Povray output;   multi-threading work;   refinement functions; -   MinRes linear solver. +   MinRes linear solver. -
    • Abner Salgado-Gonzalez: +
    • Abner Salgado-Gonzalez: step-35 tutorial program. -
    • Anna Schneebeli: +
    • Anna Schneebeli: Help and advice for Nedelec elements, writing the excellent report on Nedelec elements. -
    • Jan Schrage: +
    • Jan Schrage: Initial parts of the tutorial. -
    • Ralf B. Schulz: +
    • Ralf B. Schulz: Support for DLLs on Windows systems. -
    • Michael Stadler: - Reading 3d data in UCD, accepting boundary data in 3d; +
    • Jason Sheldon: + More generic FESystems. Enhancements in a variety of places. + +
    • Michael Stadler: + Reading 3d data in UCD, accepting boundary data in 3d;   Eulerian mappings. -
    • Martin Steigemann: - Graphical user interface for the ParameterHandler class. +
    • Martin Steigemann: + Graphical user interface for the ParameterHandler class. + +
    • Franz-Theo Suttmeier: + Initial parts of the linear algebra libraries. -
    • Franz-Theo Suttmeier: - Initial parts of the linear algebra libraries. +
    • Habib Talavatifard: + Bug fixes in the Trilinos interfaces. -
    • Habib Talavatifard: - Bug fixes in the Trilinos interfaces. +
    • Christophe Trophime: + Packaging and configuration issues. -
    • Christophe Trophime: - Packaging and configuration issues. +
    • Yaqi Wang: + The step-28 tutorial program; +   + some grid generation functions. -
    • Yaqi Wang: - The step-28 tutorial program; -   - some grid generation functions. +
    • Sven Wetterauer: + Step-15 tutorial program. -
    • Joshua White: - Arbitrary order Eulerian mappings. +
    • Joshua White: + Arbitrary order Eulerian mappings. -
    • Toby D. Young: - Interfaces to SLEPc;   many changes in the interfaces to PETSc; -   MUMPS interface. -
    +
  • Toby D. Young: + Interfaces to SLEPc;   many changes in the interfaces to PETSc; +   MUMPS interface; +   METIS interface. +
-

deal.II mailing list members

+

deal.II mailing list and discussion group members

-

- We thank the numerous people sending questions, suggestions, bug reports, bug - fixes and improvements. deal.II would be much less without their contribution. -

+

+ We thank the numerous people sending questions, suggestions, bug reports, bug + fixes and improvements. deal.II would be much less without their contribution. +

-

History

+

History

- deal.II draws from some ideas which were first implemented in the - predecessor library, - DEAL, developed by Guido Kanschat, Franz-Theo - Suttmeier, and Roland Becker. This library is now being maintained - by Franz-Theo Suttmeier at the University of - Siegen, Germany. + deal.II draws from some ideas which were first implemented in the + predecessor library, + DEAL, developed by Guido Kanschat, Franz-Theo + Suttmeier, and Roland Becker. This library is now being maintained + by Franz-Theo Suttmeier at the University of + Siegen, Germany.

-
- Valid HTML 4.01! - Valid CSS! - -
- - +
+ Valid HTML 4.01! + Valid CSS! + +
+ + diff --git a/deal.II/doc/development/makefiles.2.html b/deal.II/doc/development/makefiles.2.html index f73a697c7c..77e0eae366 100644 --- a/deal.II/doc/development/makefiles.2.html +++ b/deal.II/doc/development/makefiles.2.html @@ -77,7 +77,7 @@
- The deal.II mailing list
+ The deal.II Group

diff --git a/deal.II/doc/development/testsuite.html b/deal.II/doc/development/testsuite.html index 8b6269e237..a9becca692 100644 --- a/deal.II/doc/development/testsuite.html +++ b/deal.II/doc/development/testsuite.html @@ -5,7 +5,7 @@ The deal.II Testsuite - + @@ -270,6 +270,26 @@ tests nightly through a cron-job with this command, to have regular test runs.

+ +

+ To get a quick overview you can run +

+      make report+summary
+    
+ instead. This runs all the tests and outputs a table in the following format + at the end: +
+                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	      
+		 ...
+    
+

If a test failed, you have to find out what exactly went @@ -562,15 +582,15 @@ testname/cmp/generic

- If you don't have subversion write access, talk to us on the mailing - list; writing testcases is a worthy and laudable task, and we would + 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!

- The deal.II mailing list
+ The deal.II Group

The deal.II Development Page - + @@ -103,7 +103,7 @@


- The deal.II mailing list
+ The deal.II Group

Writing documentation - + @@ -457,7 +457,7 @@


- The deal.II mailing list
+ The deal.II Group

The deal.II Online Documentation - + @@ -42,7 +42,7 @@

Note that along with the rest of the documentation, the local HTML pages - of the tutorials need to be generated first. Please follow the + of the tutorials need to be generated first. Please follow the instructions in the ReadMe file on how to do this. @@ -132,25 +132,6 @@ Bangerth).

-
  • - A report on how - multithreading is implemented and - supported in deal.II (by Wolfgang - Bangerth). This report is also available as preprint - 2000-11 from the - - IWR preprint server. However, this report described a - previous version of the threading scheme. After - deal.II 3.4, this scheme was replaced by - another one that is more flexible and easier to use. While the - general observations of the report are still valid, the syntax - presented there is no longer. There is a short - document describing the new syntax and some considerations we - had in implementing it. -

    -
  • A brief report on mapping functions of higher polynomial @@ -230,12 +211,12 @@

    Contact

    -

    We have a mailing list for discussion +

    We have a discussion group for discussion of issues of general interest to users and developers of deal.II.

    More specific questions may be sent to the authors - immediately at the address firstName.last_name at + immediately at the address firstName.lastname at dealii.org.

    diff --git a/deal.II/doc/doxygen/headers/distributed.h b/deal.II/doc/doxygen/headers/distributed.h index b549dd4c83..93830f4e6a 100644 --- a/deal.II/doc/doxygen/headers/distributed.h +++ b/deal.II/doc/doxygen/headers/distributed.h @@ -52,6 +52,10 @@ * too many details. All the algorithms described below are implement in * classes and functions in namespace parallel::distributed. * + * One important aspect in parallel computations using MPI is that write + * access to matrix and vector elements requires a call to compress() after + * the operation is finished and before the object is used (for example read + * from). Also see @ref GlossCompress. * *

    Other resources

    * @@ -226,6 +230,33 @@ * information is provided by the * DoFTools::extract_locally_relevant_dofs() function. * + *
    Vectors with Ghost-elements
    + * + * A typical parallel application is dealing with two different kinds + * of parallel vectors: vectors with ghost elements (also called + * ghosted vectors) and vectors without ghost elements. Of course + * these might be different flavours (BlockVector, Vector; using + * Trilinos or PETSc, etc.). + * + * In vectors without ghost elements knowledge about a single entry i + * in the vector is only known to a single processor. They are + * constructed with an IndexSet reflecting the + * locally_owned_dofs(). There is no overlap in the IndexSets. + * Ghosted vectors are typically created using locally_active or + * locally_relevant IndexSets and contain elements on processors that + * are owned by a different processor. + * + * One important aspect is that we forbid any modification of ghosted + * vectors. This is because it would create subtle bugs if elements + * are edited on one processor but do not immediately transfer to the + * ghosted entries on the other processors. + * + * The usage is typically split up in the following way: ghosted + * vectors are used for data output, postprocessing, error estimation, + * input in integration. Vectors without ghost entries are used in all + * other places like assembling, solving, or any other form of + * manipulation. You can copy between vectors with and without ghost + * elements (you can see this in step-40 and step-32) using operator=. * *
    Sparsity patterns
    * diff --git a/deal.II/doc/doxygen/headers/glossary.h b/deal.II/doc/doxygen/headers/glossary.h index 008ed4e1e4..f1129b7982 100644 --- a/deal.II/doc/doxygen/headers/glossary.h +++ b/deal.II/doc/doxygen/headers/glossary.h @@ -1,3 +1,4 @@ + //------------------------------------------------------------------------- // $Id$ // Version: $Name$ @@ -356,8 +357,8 @@ * ways: * * - You tell the object that you want to compress what operation is - * intended. The TrilinosWrappers::VectorBase::compress() can take - * such an additional argument. + * intended. This can be done using the VectorOperation argument in + * the various compress() functions. * - You do a fake addition or set operation on the object in question. For * example, you can add a zero to an element of the matrix or vector, * which has no effect other than telling the object that the next diff --git a/deal.II/doc/doxygen/headers/vector_valued.h b/deal.II/doc/doxygen/headers/vector_valued.h index a1642ae729..367b222e5f 100644 --- a/deal.II/doc/doxygen/headers/vector_valued.h +++ b/deal.II/doc/doxygen/headers/vector_valued.h @@ -16,7 +16,8 @@ * @defgroup vector_valued Handling vector valued problems * * - * Vector-valued problems are partial differential equations in which the + * Vector-valued problems are systems of partial differential + * equations. These are problems where the * solution variable is not a scalar function, but a vector-valued function or * a set of functions. This includes, for example: *
      @@ -36,7 +37,9 @@ *
    * * This page gives an overview of how to implement such vector-valued problems - * efficiently in deal.II. + * easily in deal.II. In particular, it explains the usage of the class + * FESystem, which allows us to write code for systems of partial + * differential very much like we write code for single equations. * * * diff --git a/deal.II/doc/external-libs/hdf5.html b/deal.II/doc/external-libs/hdf5.html new file mode 100644 index 0000000000..e9e10181e4 --- /dev/null +++ b/deal.II/doc/external-libs/hdf5.html @@ -0,0 +1,48 @@ + + + + + The deal.II Readme on interfacing to HDF5 + + + + + + + + + + +

    Using and Installing HDF5

    +

    HDF5 + is a library for high-performance parallel data output. Deal.II can use it to write + graphical solutions. They can be displayed using paraview for example. +

    + +

    + This is how you can download, configure, and build hdf5: + +

    +wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.9.tar.gz
    +tar xf hdf5-1.8.9.tar.gz
    +cd hdf5-1.8.9/
    +./configure --prefix=`pwd`/build/ -enable-parallel
    +make install
    +    
    + + + You will end up with a script called h5pcc (or h5cc if you + decided to not build the parallel version) in the build/bin directory. + +

    Interfacing deal.II + to HDF5

    + +

    To be able to use the interface of deal.II + for HDF5 we then + configure deal.II with the following + additional option: + --with-hdf5=path/to/hdf5/build/bin/h5pcc +

    + + diff --git a/deal.II/doc/external-libs/hsl.html b/deal.II/doc/external-libs/hsl.html index fc70379a83..1851c620a0 100644 --- a/deal.II/doc/external-libs/hsl.html +++ b/deal.II/doc/external-libs/hsl.html @@ -115,7 +115,7 @@
    - The deal.II mailing list + The deal.II Group $Date$
    diff --git a/deal.II/doc/external-libs/p4est.html b/deal.II/doc/external-libs/p4est.html index 8230fdc550..d6ccafac98 100644 --- a/deal.II/doc/external-libs/p4est.html +++ b/deal.II/doc/external-libs/p4est.html @@ -56,7 +56,7 @@
    - The deal.II mailing list + The deal.II Group
    diff --git a/deal.II/doc/mail.html b/deal.II/doc/mail.html index 3b64eabd91..e1ea0cdc25 100644 --- a/deal.II/doc/mail.html +++ b/deal.II/doc/mail.html @@ -2,85 +2,66 @@ "http://www.w3.org/TR/html4/loose.dtd"> - deal.II Email Portal + deal.II Communications - +

    - deal.II Email Portal + deal.II Communications

    This page summarizes your possibilities of establishing contact to other deal.II users and to the deal.II - authors. We are sorry if all this looks a little complicated, but since - public email addresses are abused too often, we want to protect all - members of our mailing lists. + authors.


    - Users + User Group

    - All deal.II users (and everybody interested) can - enter themselves into the deal.II mailing list. + All deal.II users (and everybody interested) + are encouraged to join the deal.II + Discussion group on Google Groups.

    • - Join the mailing list -

      - If you want to receive comments of other users and react to them, - you should join the mailing list. To do this, don't write to - the list. -

      -

      - Either write an email to join at dealii.org or - go to the list's web site and follow the instructions. -

      + In order to join, go to + the deal.II + Discussion Group web page and register your email address + there. Or click on the membership button below. This is also a + good place to browse through existing discussion + topics. There, you can manage your group membership and email + delivery options.
    • - Unsubscribe from the list -

      - You can decide to leave the mailing list whenever you want. -

      -

      - Write an email to leave at dealii.org from your - registered address or go to the list's web site and follow the instructions. -

      -
    • -
    • - Write to the mailing list -

      - Send an email to dealii at dealii.org. - Please, use a significant subject line, such that everybody - can identify your message. Note that you must be subscribed - to the list before you can send a message! -

      -

      - Remember that you must be subscribed to write to the list. Here, - you means the email address identifying the sender of your mail. -

      -
    • -
    • - Reading archives of the mailing list -

      - All mails that have been sent through the mailing lists are - archived - and can be read from the mailing list archive page. -

      -

      The old archives can also be checked for reference. -

      + In order to post a question or a reply, you can either go to + the + the deal.II + Discussion Group page and click on the corresponding + button (preferred), or you can send email + to dealii@googlegroups.com. Or + just post from the window below. Note that you have to be a + group member with your specific sender address in order to be + allowed to post there.
    + +

    @@ -107,7 +88,7 @@
    - The deal.II mailing list + The deal.II Group

    diff --git a/deal.II/doc/news/7.1.0-vs-7.2.0.h b/deal.II/doc/news/7.1.0-vs-7.2.0.h new file mode 100644 index 0000000000..94f3a16b82 --- /dev/null +++ b/deal.II/doc/news/7.1.0-vs-7.2.0.h @@ -0,0 +1,750 @@ +/** + * @page changes_between_7_1_and_7_2 Changes between Version 7.1 and 7.2 + +

    +This is the list of changes made between the release of +deal.II version 7.1.0 and that of 7.2.0. +All entries are signed with the names of the author. +

    + + + + + + +

    Incompatibilities

    + +

    +Following are a few modifications to the library that unfortunately +are incompatible with previous versions of the library, but which we +deem necessary for the future maintainability of the +library. Unfortunately, some of these changes will require +modifications to application programs. We apologize for the +inconvenience this causes. +

    + +
      +
    1. Changed/fixed: Several operations on Trilinos vectors that change the +elements of these vectors were allowed accidentally for vectors that have +ghost elements. This is a source of errors because a change on one +MPI process will not show up on a different processor. Consequently, we +intended to disallow all functions that modify vectors with ghost elements +but this was not enforced for all of these functions. This is now fixed +but it may lead to errors if your code relied on the existing behavior. The +way to work around this is to only ever modify fully distributed vectors, +and then copy it into a vector with ghost elements. +
      +(Wolfgang Bangerth, 2012/08/06) + +
    2. Changed: The argument material_id of the estimate-functions of +the KellyErrorEstimator class is now of type types::material_id +with default value numbers::invalid_material_id, instead of type +unsigned int with default value numbers::invalid_unsigned_int. This +should not make a difference to most users unless you specified the +argument's default value by hand. +
      +(Wolfgang Bangerth, Christian Goll 2012/02/27) + +
    3. +The member functions Triangulation::set_boundary and +Triangulation::get_boundary now take a types::boundary_id instead of +an unsigned int as argument. This now matches the actual data type +used to store boundary indicators internally. +
      +(Wolfgang Bangerth, Christian Goll 2012/02/27) +
    + + + + + +

    General

    + + +
      +
    1. +New: We now support parallel output using HDF5/xdmf. +
      +(Eric Heien, Timo Heister, 2012/08/28) + +
    2. +New: We are now compatible with Trilinos 10.4.2, 10.8.5, and 10.12.2. See the +readme for more information. +
      +(Timo Heister, 2012/08/24) + +
    3. +Changed: To make the naming of types defined in namespace types +consistent, we have renamed types::subdomain_id_t to +types::subdomain_id. The old name has been retained as a typedef +but is now deprecated. +
      +(Wolfgang Bangerth, 2012/08/22) + +
    4. +Changed: Unify the concept of compress() for all linear algebra +objects. Introduce type VectorOperation to decide between +add and insert. Implement also for serial vectors. Note: +this breaks distributed::vector::compress(bool). See +@ref GlossCompress for more information. +
      +(Timo Heister, 2012/08/13) + +
    5. +Changed: Support for the METIS 4.x has been replaced with support for +METIS 5.x. Use --with-metis=path/to/metis to configure +with METIS 5.x. +
      +(Stefano Zampini, Toby D. Young 2012/08/13) + +
    6. +Changed: numerics/vectors.h is now called numerics/vector_tools.h and +numerics/matrices.h is now called numerics/matrix_tools.h The old files are +deprecated. +
      +(Timo Heister 2012/08/09) + +
    7. +New: officially added support for clang 3.1 or newer. +
      +(Timo Heister and Wolfgang Bangerth, 2012/08/07) + +
    8. +Changed: PETSc linking now prefers to use the libpetsc.so generated +by PETSc starting from version 3.1+. This fixes the problem +of linker errors on recent gcc/ubuntu versions. +
      +(Timo Heister, 2012/08/07) + +
    9. +Fixed: On some 64-bit systems, we build deal.II with the -m64 +flag but forgot to build UMFPACK with this flag as well, leading to +linker errors. This is now fixed. +
      +(Wolfgang Bangerth, 2012/07/31) + +Fixed: The Intel compiler, when using MPI, wants that mpi.h +is included before header files like stdio.h. This can't +be ensured in general because the inclusion might be indirectly, but +we now work around the problem in other ways. +
      +(Timo Heister, Wolfgang Bangerth, Michael Thomadakis, 2012/07/26) + +
    10. +Fixed: On some systems, the p4est library we use for distributed +parallel computations installs its libraries into a lib64/ +directory instead of the usual lib/. deal.II can now deal +with this. +
      +(Wolfgang Bangerth, 2012/07/25) + +
    11. +New: step-43 is an extension of step-21 that shows efficient methods +to solve multi-phase flow. +
      +(Chih-Che Chueh, Wolfgang Bangerth, 2012/06/06) + +
    12. +New: step-15 has been replaced by a program that demonstrates the +solution of nonlinear problem (the minimal surface equation) using +Newton's method. +
      +(Sven Wetterauer, 2012/06/03) + +
    13. +New: step-48 demonstrates the solution of a nonlinear wave equation +with an explicit time stepping method. The usage of Gauss-Lobatto +elements gives diagonal mass matrices, which obviates the solution of +linear systems of equations. The nonlinear right hand side is +evaluated with the matrix-free framework. +
      +(Katharina Kormann and Martin Kronbichler, 2012/05/05) + +
    14. +New: step-37 shows how the matrix-free framework can be utilized to +efficiently solve the Poisson equation without building global +matrices. It combines fast operator evaluation with a multigrid solver +based on polynomial Chebyshev smoother. +
      +(Katharina Kormann and Martin Kronbichler, 2012/05/05) + +
    15. +New: A new matrix-free interface has been implemented. The framework +is parallelized with MPI, TBB, and explicit vectorization instructions +(new data type VectorizedArray). The class MatrixFree caches +cell-based data in an efficient way. Common operations can be +implemented using the FEEvaluation class. +
      +(Katharina Kormann and Martin Kronbichler, 2012/05/05) + +
    16. +New: step-44 demonstrates one approach to modeling large +deformations of nearly-incompressible elastic solids. The +elastic response is governed by a non-linear, hyperelastic +free-energy function. The geometrical response is also +nonlinear, i.e., the program considers finite deformations. +
      +(Andrew McBride and Jean-Paul Pelteret, 2012/04/25) + +
    17. +New: step-41 demonstrates solving the obstacle problem, +a variational inequality. +
      +(Joerg Frohne, 2012/04/22) + +
    18. +Changed: The version of BOOST we ship with deal.II has been upgraded +to 1.49.0. +
      +(Martin Kronbichler, 2012/04/07) + +
    19. +New: We have added a brief section to the step-12 tutorial programs that +compares the DG solution computed there with one that one would obtain by +using a continuous finite element. +
      +(Wolfgang Bangerth, 2012/03/25) + +
    20. +New: Added support for codimension 2, i.e. for dim-dimensional objects +embedded into spacedim=dim+2 dimensional space. +
      +(Sebastian Pauletti, 2012/03/02) + +
    21. Changed: Material and Boundary indicators have been both of the +type unsigned char. Throughout the library, we changed their datatype +to types::material_id +resp. types::boundary_id, both typedefs of unsigned +char. Internal faces are now characterized by +numbers::internal_face_boundary_id(=static_cast@(-1)) +instead of 255, so we get rid of that mysterious number in the source +code. Material_ids are also assumed to lie in the range from 0 to +numbers::invalid_material_id-1 (where numbers::invalid_material_id = +static_cast(-1)). With this change, it is now +much easier to extend the range of boundary or material ids, if +needed. +
      +(Christian Goll 2012/02/27) + +
    22. New: Functions like FEValues::get_function_values have long been +able to extract values from pretty much any vector kind given to it (e.g. +of kind Vector, BlockVector, PETScWrappers::Vector, etc). The list of +allowed "vector" types now also includes IndexSet, which is interpreted +as a vector of elements that are either zero or one, depending on whether +an index is in the IndexSet or not. +
      +As a consequence of this, the DataOut::add_data_vector functions now also +work for such types of vectors, a use demonstrated in step-41. +
      +(Wolfgang Bangerth, 2012/02/14) + +
    23. New: It has long been a nuisance that the deal.II vector classes +could only be accessed using operator() whereas the C++ +std::vector class required operator[]. This +diminished the usefulness of template code. Historically, the reason +was that the deal.II vector classes should use the same operator as +the matrix classes, and C++ does not allow to use operator[] +for matrices since this operator can only take a single argument. +
      +In any case, all deal.II vector classes now support both kinds of +access operators interchangeably. +
      +(Wolfgang Bangerth, 2012/02/12) + +
    24. Fixed: Linking shared libraries on PowerPC systems (e.g. on +BlueGene systems) failed due to a miscommunication between compiler +and linker. This is now worked around. +
      +(Aron Ahmedia, Wolfgang Bangerth, 2012/02/06) + +
    25. New: There is now a distributed deal.II vector class +parallel::distributed::Vector that can be used with MPI. The +vector is based on a contiguous locally owned range and allows easy +access of ghost entries from other processors. The vector interface is +very similar to the non-distributed class Vector. +
      +(Katharina Kormann, Martin Kronbichler, 2012/01/25) + +
    26. Fixed: The common/scripts/make_dependencies program +now behaves like the C++ compiler when +searching include paths for # include "..." directives. +
      +(Timo Heister, 2012/01/10) + +
    27. Fixed: The Intel compiler complains that it can't copy Trilinos vector +reference objects, preventing the compiling of step-32. This is now fixed. +
      +(Wolfgang Bangerth, 2011/11/09) + +
    28. Fixed: Intel ICC 12.1 gets into trouble with BOOST because BOOST +believes that the compiler supports C++0x but one then still has to +specify the corresponding flag on the command line to avoid compiler +errors. This is now fixed. +
      +(Wolfgang Bangerth, 2011/11/06) + +
    29. Fixed: On some systems, mpiCC turns out to alias the +C compiler, not the C++ compiler as expected. Consequently, try to use +mpic++ or mpicxx before mpiCC as +these should really be unambiguous. +
      +(Wolfgang Bangerth, 2011/11/05) + +
    30. Fixed: Intel's ICC compiler identifies itself as icpc version +12.1.0 (gcc version 4.2.1 compatibility) which we mistook as being +GCC version 4.2. The same is true for the Intel C compiler. This is now fixed. +
      +(Wolfgang Bangerth, 2011/11/05) + +
    31. Fixed: deal.II could not be compiled with gcc 4.6.1 when MPI is +enabled due to a missing include file in file +source/base/utilities.cc. This is now fixed. +
      +(Wolfgang Bangerth, 2011/10/25) +
    + + + + + +

    Specific improvements

    + +
      +
    1. Changed: To support Trilinos version 10.12.x we need to cache the +result of has_ghost_elements() in parallel vectors at construction time +of the vector. Starting from 10.12 Trilinos will communicate in this +call, which therefore only works if called from all CPUs. +
      +(Timo Heister, 2012/08/22) + +
    2. New: The copy constructor of FullMatrix from IdentityMatrix +used to be explicit, but that didn't appear to be necessary in hindsight. +Consequently, it is now a regular copy constructor. +
      +(Wolfgang Bangerth, 2012/08/14) + +
    3. New: The Patterns::Map pattern allows to describe maps from keys +to values in input files. +
      +(Wolfgang Bangerth, 2012/08/01) + +
    4. Fixed: DoFTools::make_zero_boundary_constraints now also works for parallel distributed triangulations. +
      +(Wolfgang Bangerth, 2012/07/24) + +
    5. Fixed: GridTools::find_active_cell_around_point() works now also if the cell in which the point we look for lies is not adjacent to the closest vertex of p. The tests bits/find_cell_8 and _9 illustrate this. +
      +(Wolfgang Bangerth, Christian Goll 2012/07/20) + +
    6. Fixed: Using the SolutionTransfer class with hp::DoFHandler +and on meshes where some cells are associated with a FE_Nothing element +could result in an error. This is now fixed. +
      +(Wolfgang Bangerth, 2012/06/29) + +
    7. Fixed: The MappingQ1::transform_real_to_unit_cell function as +well as the equivalent ones in derived classes sometimes get into +trouble if they are asked to compute the preimage of this point +in reference cell coordinates. This is because for points outside +the reference cell, the mapping from unit to real cell is not +necessarily invertible, and consequently the Newton iteration to +find the preimage did not always converge, leading to an exception. +While this is not entirely wrong (we could, after all, not compute +the desired quantity), not all callers of this function were prepared +to accept this result -- in particular, the function +CellAccessor<3>::point_inside should have really just returned false +in such cases but instead let the exception so generated propagate +through. This should now be fixed. +
      +(Wolfgang Bangerth, Eric Heien, Sebastian Pauletti, 2012/06/27) + +
    8. Fixed: The function VectorTools::compute_no_normal_flux_constraints had +a bug that led to an exception whenever we were computing constraints for +vector fields located on edges shared between two faces of a 3d cell if those +faces were not parallel to the axes of the coordinate system. This is now fixed. +
      +(Wolfgang Bangerth, Jennifer Worthen, 2012/06/27) + +
    9. +Fixed: Due to an apparent bug in autoconf, it was not possible to +override the F77 environment variable to select anything +else than gfortran. This is now fixed. +
      +(Wolfgang Bangerth, 2012/06/08) + +
    10. Fixed: TrilinosWrappers::VectorBase::swap() is now working as expected. (thanks Uwe Köcher) +
      +(Timo Heister 2012/07/03) + +
    11. Fixed: Some instantiations for +DerivativeApproximation::approximate_derivative_tensor() were missing. +
      +(Timo Heister 2012/06/07) + +
    12. New: The finite element type FE_DGQArbitraryNodes is now +working also in codimension one spaces. +
      +(Luca Heltai, Andrea Mola 2012/06/06) + +
    13. Fixed: Computing the $W^{1,\infty}$ norm and seminorm in +VectorTools::integrate_difference was not implemented. This is now +fixed. +
      +(Wolfgang Bangerth 2012/06/02) + +
    14. Fixed: A problem in MappingQ::transform_real_to_unit_cell +that sometimes led the algorithm in this function to abort. +
      +(Wolfgang Bangerth 2012/05/30) + +
    15. New: The function DataOutInterface::write_pvd_record can be used +to provide Paraview with metadata that describes which time in a +simulation a particular output file corresponds to. +
      +(Marco Engelhard 2012/05/30) + +
    16. Fixed: A bug in 3d with hanging nodes in GridTools::find_cells_adjacent_to_vertex() +that caused find_active_cell_around_point() to fail in those cases. +
      +(Timo Heister, Wolfgang Bangerth 2012/05/30) + +
    17. New: DoFTools::make_periodicity_constraints implemented which +inserts algebraic constraints due to periodic boundary conditions +into a ConstraintMatrix. +
      +(Matthias Maier, 2012/05/22) + +
    18. New: The GridIn::read_unv function can now read meshes generated +by the Salome framework, see http://www.salome-platform.org/ . +
      +(Valentin Zingan, 2012/04/27) + +
    19. New: There is now a second DoFTools::map_dofs_to_support_points +function that also works for parallel::distributed::Triangulation +triangulations. +
      +(Wolfgang Bangerth, 2012/04/26) + +
    20. New: There is now a second DoFTools::extract_boundary_dofs +function that also works for parallel::distributed::Triangulation +triangulations. +
      +(Wolfgang Bangerth, 2012/04/26) + +
    21. New: The FullMatrix::extract_submatrix_from, FullMatrix::scatter_matrix_to, +FullMatrix::set functions are new. +
      +(Andrew McBride, Jean Paul Pelteret, Wolfgang Bangerth, 2012/04/24) + +
    22. Fixed: +The method FEValues::inverse_jacobian() previously returned the transpose of the +inverse Jacobians instead of just the inverse Jacobian as documented. This is now fixed. +
      +(Sebastian Pauletti, Katharina Kormann, Martin Kronbichler, 2012/03/11) + +
    23. Extended: +SolutionTransfer is now also able to transfer solutions between hp::DoFHandler where +the finite element index changes during refinement. +
      +(Katharina Kormann, Martin Kronbichler, 2012/03/10) + +
    24. Changed: +A new method to determine an initial guess for the Newton method was coded +in MappingQ::transform_real_to_unit_cell. +The code in transform_real_to_unit_cell was cleaned a little bit and a new code +for the @<2,3@> case was added. +
      +(Sebastian Pauletti, 2012/03/02) + +
    25. Changed: +In the context of codim@>0, Mapping::transform would require different inputs +depending on the mapping type. +For mapping_covariant, mapping_contravariant the input is DerivativeForm<1, dim, spacedim> +but for mapping_covariant_gradient, mapping_contravariant_gradient the input is Tensor<2,dim>. +
      +(Sebastian Pauletti, 2012/03/02) + +
    26. New: +A new class DerivativeForm was added. +This class is supposed to represent the derivatives of a mapping. +
      +(Sebastian Pauletti, 2012/03/02) + +
    27. Fixed: TrilinosWrappers::Vector::all_zero() in parallel. +
      +(Timo Heister, Jörg Frohne, 2012/03/06) + +
    28. New: GridGenerator::quarter_hyper_shell() in 3d. +
      +(Thomas Geenen, 2012/03/05) + +
    29. New: DataOut::write_vtu_in_parallel(). This routine uses MPI I/O to write +a big vtu file in parallel. +
      +(Timo Heister, 2012/02/29) + +
    30. Fixed: parallel::distributed::Triangulation::clear() forgot +to update the number cache of this class, leading to wrong results +when calling functions like +parallel::distributed::Triangulation::n_global_active_cells(); +
      +(Wolfgang Bangerth, 2012/02/20) + +
    31. Improved: FEFieldFunction allows now for the computation of Laplacians. +
      +(Christian Goll, 2012/02/16) + +
    32. New: The function IndexSet::fill_binary_vector creates a numerical +representation of an IndexSet containing zeros and ones. +
      +(Wolfgang Bangerth, 2012/02/12) + +
    33. New: The function IndexSet::clear resets an index set to be empty. +
      +(Wolfgang Bangerth, 2012/02/12) + +
    34. New: There are now global functions l1_norm() and linfty_norm() that compute +the respective norms of a rank-2 tensor. +
      +(Wolfgang Bangerth, 2012/02/08) + +
    35. New: VectorTools::interpolate_to_different_mesh implemented which interpolates between + DoFHandlers with different triangulations based on a common coarse grid. +
      +(Matthias Maier, 2012/02/08) + +
    36. Improved: DoFTools::map_dofs_to_support_points() now also works within the hp framework. +
      +(Christian Goll, 2012/02/02) + +
    37. Improved: There is now a constructor for FESystem that allows to +create collections of finite elements of arbitrary length. +
      +(Jason Sheldon, 2012/01/27) + +
    38. Improved: VectorTools::point_value() now also works within the hp framework. +
      +(Christian Goll, 2012/01/26) + +
    39. Fixed: GridTools::find_active_cell_around_point() for the hp-case works now also with MappingCollections containing only one mapping, as is the standard case in other functions using hp. +
      +(Christian Goll, 2012/01/26) + +
    40. Fixed: parallel::distributed::refine_and_coarsen_fixed_fraction() +contained a rounding bug that often produced wrong results. +
      +(Timo Heister, 2012/01/24) + +
    41. Improved: Utilities::break_text_into_lines now also splits the string at '\\n'. +
      +(Timo Heister, 2012/01/17) + +
    42. Fixed: When ./configure does not detect the presence +of zlib, writing output in VTU format failed to produce +a valid output file. +
      +(Timo Heister, 2012/01/03) + +
    43. Improved: PETScWrappers::SolverXXX class was +restricted to using default solver options for the KSP only. It is now +possible to override those by using PETSc command-line options +-ksp_*; giving greater flexibility in controlling PETSc +solvers. (See the class's documentation). +
      +(Vijay S. Mahadevan, 2011/12/22) + +
    44. New: The GridIn class now also reads the GMSH format 2.2 as written by +GMSH 2.5. +
      +(Vijay S. Mahadevan, Wolfgang Bangerth, 2011/12/19) + +
    45. Improved: The GridRefinement::refine_and_coarsen_optimize function +assumed that the expected convergence order was 2. It has now gotten an +argument by which the user can prescribe a different value. A bug has also +been fixed in which the function incorrectly assumed in its algorithm that +the mesh was two-dimensional. +
      +(Christian Goll, 2011/12/16) + +
    46. Fixed: Restriction and prolongation didn't work for elements of +kind FE_Nothing. Consequently, many other parts of the library also +didn't work, such as the SolutionTransfer class. This is now fixed. +
      +(Wolfgang Bangerth, 2011/12/15) + +
    47. Fixed: The DerivativeApproximation class now works for distributed computations. +
      +(Timo Heister, 2011/12/15) + +
    48. Changed: The ExcMessage exception class took an argument of +type char* that was displayed when the exception +was raised. However, character pointers are awkward to work with +because (i) they can not easily be composed to contain things like +file names that are only known at run-time, and (ii) the string +pointed to by the pointer had to live longer than the local expression +in which the exception is generated when using the AssertThrow macro +(because, when we create an exception, the exception object is passed +up the call stack until we find a catch-clause; at that time, however, +the scope in which the exception object was created has long been left). +This restriction made it impossible to construct the message using std::string +and then just do something like (std::string("file: ")+filename).c_str(). +
      +To remedy this flaw, the type of the argument to ExcMessage has been +changed to std::string since objects of this type are readily copyable +and therefore live long enough. +
      +(Wolfgang Bangerth, 2011/12/14) + +
    49. New: Setting up a class derived from DataPostprocessor required some +pretty mechanical steps in which one has to overload four member functions. +For common cases where a postprocessor only computes a single scalar or +a single vector, this is tedious and unnecessary. For these cases, the +new classes DataPostprocessorScalar and DataPostprocessorVector provide +short cuts that make life simpler. +
      +(Wolfgang Bangerth, 2011/12/14) + +
    50. Changed: The DataPostprocessor class previously required users of this +class to overload DataPostprocessor::get_names(), +DataPostprocessor::get_data_component_interpretation() +and DataPostprocessor::n_output_variables(). The latter function is redundant +since its output must equal the length of the arrays returned by the +first two of these functions. It has therefore been removed. +
      +(Wolfgang Bangerth, 2011/12/14) + +
    51. Improved: Objects of the type LogStream::Prefix can now be used +as a safe implementation of the push and pop mechanism for log +prefices. +
      +(Guido Kanschat, 2011/12/09) + +
    52. New: IndexSet::add_indices(IndexSet). +
      +(Timo Heister, 2011/12/09) + +
    53. Fixed: Finite element Hessians get computed for codimension one, +at least for FE_Poly derived classes. +
      +(Guido Kanschat, 2011/12/07) + +
    54. Changed: Output of ParameterHandler::print_parameters with argument +ParameterHandler::LaTeX was not particularly readable. The output has +therefore been rewritten to be more structured and readable. +
      +(Wolfgang Bangerth, 2011/11/28) + +
    55. Fixed: The TimerOutput class set the alignment of output to right-aligned +under some circumstances, but didn't reset this to the previous value at the +end of output. This is now fixed. +
      +(Wolfgang Bangerth, 2011/11/28) + +
    56. New: The copy constructor of the SparseMatrixEZ function now works +(rather than throwing an exception) if the copied matrix has size zero. +This is in accordance to the other matrix classes. +
      +(Wolfgang Bangerth, 2011/11/15) + +
    57. New: The class ScalarFunctionFromFunctionObject provides a quick way to +convert an arbitrary function into a function object that can be passed +to part of the library that require the Function@ interface. +The VectorFunctionFromScalarFunctionObject class does a similar thing. +
      +(Wolfgang Bangerth, 2011/11/15) + +
    58. New: The DoFTools::count_dofs_per_block function now also works +for objects of type hp::DoFHandler. +
      +(Jason Sheldon, 2011/11/13) + +
    59. New: FETools::get_fe_from_name() can now return objects of type FE_Nothing. +
      +(Scott Miller, Jonathan Pitt, 2011/11/10) + +
    60. New: Implementation of an alternative handling of +inhomogeneous constraints in ConstraintMatrix. This is controlled with +a new parameter use_inhomogeneities_for_rhs in +distribute_local_to_global() and determines whether the correct or +zero values (this was the case before and still is the default) are +kept in the linear system during the solution process. +
      +(Jörg Frohne, 2011/11/01) + +
    61. Fixed: SparseMatrix::mmult and SpareMatrix::Tmmult had a number of +issues that are now fixed: (i) rebuilding the sparsity pattern was allowed +even if several of the matrices involved in these operations shared a +sparsity pattern; (ii) the functions had a vector argument that had a default +value but the default value could not be used because it wasn't used in a +template context deducible by the compiler. +
      +(Wolfgang Bangerth, 2011/10/30) + +
    62. New: +parallel::distributed::Triangulation::mesh_reconstruction_after_repartitioning +setting which is necessary for save()/load() to be deterministic. Otherwise +the matrix assembly is done in a different order depending on the order of old +refinements. +
      +(Timo Heister, 2011/10/26) + +
    63. New: TriaAccessor<>::minimum_vertex_distance(). +
      +(Timo Heister, 2011/10/25) + +
    64. New: TableHandler::print_text now supports not only printing column +keys above their own column, but also in a separate header, to make it simpler +for external plotting programs to skip this line. +
      +(Wolfgang Bangerth, 2011/10/22) + +
    65. Fixed: Trying to write a TableHandler object that is empty resulted +in a segmentation fault. This is now fixed. +
      +(Wolfgang Bangerth, 2011/10/21) + +
    66. New: The TableHandler class can now pad columns that have only been +partially filled. See the documentation of the class for a description. +
      +(Wolfgang Bangerth, 2011/10/18) + +
    67. Fixed: In TableHandler::print_text, it can happen that the function +wants to print an empty string as the element of the table to be printed. +This can confuse machine readers of this table, for example for visualization, +since they then do not see this column in that row. To prevent this, we now +print "" in such places. +
      +(Wolfgang Bangerth, 2011/10/18) + +
    68. Fixed: Using Trilinos versions 10.4 and later on Debian failed to +configure due to a different naming scheme of Trilinos libraries on +Debian. This is now fixed. +
      +(Wolfgang Bangerth, 2011/10/17) + +
    69. Changed: The TableHandler class has been changed significantly +internally. It could previously store arbitrary values (though in practice, +only int, unsigned int, double and std::string were implemented). The class is +now restricted to this particular set of types. On the other hand, the +TableHandler class can now be serialized. +
      +(Wolfgang Bangerth, 2011/10/17) + +
    70. Fixed: searching in the doxygen documentation. +
      +(Timo Heister, 2011/10/13) + +
    71. New: parallel::distributed::Triangulation::save()/load() to store +the refinement information to disk. Also supports saving solution vectors +using the SolutionTransfer class. +
      +(Timo Heister, 2011/10/12) + +
    72. Fixed: The DataOut_DoFData::merge_patches did not compile with newer compilers. +This is now fixed. +
      +(Wolfgang Bangerth, 2011/10/11) +
    + + +*/ diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 9fbc5f42bc..649e991a96 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -1,9 +1,9 @@ /** - * @page changes_after_7_1 Changes after Version 7.1 + * @page changes_after_7_2 Changes after Version 7.2

    This is the list of changes made after the release of -deal.II version 7.1.0. +deal.II version 7.2.0. All entries are signed with the names of the author.

    @@ -24,34 +24,12 @@ inconvenience this causes.

      -
    1. Changed/fixed: Several operations on Trilinos vectors that change the -elements of these vectors were allowed accidentally for vectors that have -ghost elements. This is a source of errors because a change on one -MPI process will not show up on a different processor. Consequently, we -intended to disallow all functions that modify vectors with ghost elements -but this was not enforced for all of these functions. This is now fixed -but it may lead to errors if your code relied on the existing behavior. The -way to work around this is to only ever modify fully distributed vectors, -and then copy it into a vector with ghost elements. +
    2. Changed: the optional argument offset got removed from +DoFHandler and MGDoFHandler::distribute_dofs() because it was +never working correctly and it is not used.
      -(Wolfgang Bangerth, 2012/08/06) +(Timo Heister, 2012/09/03) -
    3. Changed: The argument material_id of the estimate-functions of -the KellyErrorEstimator class is now of type types::material_id_type -with default value types::invalid_material_id, instead of type -unsigned int with default value numbers::invalid_unsigned_int. This -should not make a difference to most users unless you specified the -argument's default value by hand. -
      -(Wolfgang Bangerth, Christian Goll 2012/02/27) - -
    4. -The member functions Triangulation::set_boundary and -Triangulation::get_boundary now take a types::boundary_id_t instead of -an unsigned int as argument. This now matches the actual data type -used to store boundary indicators internally. -
      -(Wolfgang Bangerth, Christian Goll 2012/02/27)
    @@ -62,197 +40,7 @@ used to store boundary indicators internally.
      -
    1. -New: officially added support for clang 3.1 or newer. -
      -(Timo Heister and Wolfgang Bangerth, 2012/08/07) - -
    2. -Changed: PETSc linking now prefers to use the libpetsc.so generated -by PETSc starting from version 3.1+. This fixes the problem -of linker errors on recent gcc/ubuntu versions. -
      -(Timo Heister, 2012/08/07) - -
    3. -Fixed: On some 64-bit systems, we build deal.II with the -m64 -flag but forgot to build UMFPACK with this flag as well, leading to -linker errors. This is now fixed. -
      -(Wolfgang Bangerth, 2012/07/31) - -Fixed: The Intel compiler, when using MPI, wants that mpi.h -is included before header files like stdio.h. This can't -be ensured in general because the inclusion might be indirectly, but -we now work around the problem in other ways. -
      -(Timo Heister, Wolfgang Bangerth, Michael Thomadakis, 2012/07/26) - -
    4. -Fixed: On some systems, the p4est library we use for distributed -parallel computations installs its libraries into a lib64/ -directory instead of the usual lib/. deal.II can now deal -with this. -
      -(Wolfgang Bangerth, 2012/07/25) - -
    5. -New: step-43 is an extension of step-21 that shows efficient methods -to solve multi-phase flow. -
      -(Chih-Che Chueh, Wolfgang Bangerth, 2012/06/06) - -
    6. -New: step-15 has been replaced by a program that demonstrates the -solution of nonlinear problem (the minimal surface equation) using -Newton's method. -
      -(Sven Wetterauer, 2012/06/03) - -
    7. -New: step-48 demonstrates the solution of a nonlinear wave equation -with an explicit time stepping method. The usage of Gauss-Lobatto -elements gives diagonal mass matrices, which obviates the solution of -linear systems of equations. The nonlinear right hand side is -evaluated with the matrix-free framework. -
      -(Katharina Kormann and Martin Kronbichler, 2012/05/05) - -
    8. -New: step-37 shows how the matrix-free framework can be utilized to -efficiently solve the Poisson equation without building global -matrices. It combines fast operator evaluation with a multigrid solver -based on polynomial Chebyshev smoother. -
      -(Katharina Kormann and Martin Kronbichler, 2012/05/05) - -
    9. -New: A new matrix-free interface has been implemented. The framework -is parallelized with MPI, TBB, and explicit vectorization instructions -(new data type VectorizedArray). The class MatrixFree caches -cell-based data in an efficient way. Common operations can be -implemented using the FEEvaluation class. -
      -(Katharina Kormann and Martin Kronbichler, 2012/05/05) - -
    10. -New: step-44 demonstrates one approach to modeling large -deformations of nearly-incompressible elastic solids. The -elastic response is governed by a non-linear, hyperelastic -free-energy function. The geometrical response is also -nonlinear, i.e., the program considers finite deformations. -
      -(Andrew McBride and Jean-Paul Pelteret, 2012/04/25) - -
    11. -Changed: The version of BOOST we ship with deal.II has been upgraded -to 1.49.0. -
      -(Martin Kronbichler, 2012/04/07) - -
    12. -New: We have added a brief section to the step-12 tutorial programs that -compares the DG solution computed there with one that one would obtain by -using a continuous finite element. -
      -(Wolfgang Bangerth, 2012/03/25) - -
    13. -New: Added support for codimension 2, i.e. for dim-dimensional objects -embedded into spacedim=dim+2 dimensional space. -
      -(Sebastian Pauletti, 2012/03/02) - -
    14. Changed: Material and Boundary indicators have been both of the -type unsigned char. Throughout the library, we changed their datatype -to types::material_id_t -resp. types::boundary_id_t, both typedefs of unsigned -char. Internal faces are now characterized by -types::internal_face_boundary_id(=static_cast@(-1)) -instead of 255, so we get rid of that mysterious number in the source -code. Material_ids are also assumed to lie in the range from 0 to -types::invalid_material_id-1 (where types::invalid_material_id = -static_cast(-1)). With this change, it is now -much easier to extend the range of boundary or material ids, if -needed. -
      -(Christian Goll 2012/02/27) - -
    15. New: Functions like FEValues::get_function_values have long been -able to extract values from pretty much any vector kind given to it (e.g. -of kind Vector, BlockVector, PETScWrappers::Vector, etc). The list of -allowed "vector" types now also includes IndexSet, which is interpreted -as a vector of elements that are either zero or one, depending on whether -an index is in the IndexSet or not. -
      -As a consequence of this, the DataOut::add_data_vector functions now also -work for such types of vectors, a use demonstrated in step-41. -
      -(Wolfgang Bangerth, 2012/02/14) - -
    16. New: It has long been a nuisance that the deal.II vector classes -could only be accessed using operator() whereas the C++ -std::vector class required operator[]. This -diminished the usefulness of template code. Historically, the reason -was that the deal.II vector classes should use the same operator as -the matrix classes, and C++ does not allow to use operator[] -for matrices since this operator can only take a single argument. -
      -In any case, all deal.II vector classes now support both kinds of -access operators interchangeably. -
      -(Wolfgang Bangerth, 2012/02/12) - -
    17. Fixed: Linking shared libraries on PowerPC systems (e.g. on -BlueGene systems) failed due to a miscommunication between compiler -and linker. This is now worked around. -
      -(Aron Ahmedia, Wolfgang Bangerth, 2012/02/06) - -
    18. New: There is now a distributed deal.II vector class -parallel::distributed::Vector that can be used with MPI. The -vector is based on a contiguous locally owned range and allows easy -access of ghost entries from other processors. The vector interface is -very similar to the non-distributed class Vector. -
      -(Katharina Kormann, Martin Kronbichler, 2012/01/25) - -
    19. Fixed: The common/scripts/make_dependencies program -now behaves like the C++ compiler when -searching include paths for # include "..." directives. -
      -(Timo Heister, 2012/01/10) - -
    20. Fixed: The Intel compiler complains that it can't copy Trilinos vector -reference objects, preventing the compiling of step-32. This is now fixed. -
      -(Wolfgang Bangerth, 2011/11/09) - -
    21. Fixed: Intel ICC 12.1 gets into trouble with BOOST because BOOST -believes that the compiler supports C++0x but one then still has to -specify the corresponding flag on the command line to avoid compiler -errors. This is now fixed. -
      -(Wolfgang Bangerth, 2011/11/06) - -
    22. Fixed: On some systems, mpiCC turns out to alias the -C compiler, not the C++ compiler as expected. Consequently, try to use -mpic++ or mpicxx before mpiCC as -these should really be unambiguous. -
      -(Wolfgang Bangerth, 2011/11/05) - -
    23. Fixed: Intel's ICC compiler identifies itself as icpc version -12.1.0 (gcc version 4.2.1 compatibility) which we mistook as being -GCC version 4.2. The same is true for the Intel C compiler. This is now fixed. -
      -(Wolfgang Bangerth, 2011/11/05) - -
    24. Fixed: deal.II could not be compiled with gcc 4.6.1 when MPI is -enabled due to a missing include file in file -source/base/utilities.cc. This is now fixed. -
      -(Wolfgang Bangerth, 2011/10/25) +
    25. Nothing so far.
    @@ -262,428 +50,22 @@ enabled due to a missing include file in file

    Specific improvements

      -
    1. New: The Patterns::Map pattern allows to describe maps from keys -to values in input files. -
      -(Wolfgang Bangerth, 2012/08/01) - -
        -
      1. Fixed: DoFTools::make_zero_boundary_constraints now also works for parallel distributed triangulations. -
        -(Wolfgang Bangerth, 2012/07/24) - -
      2. Fixed: GridTools::find_active_cell_around_point() works now also if the cell in which the point we look for lies is not adjacent to the closest vertex of p. The tests bits/find_cell_8 and _9 illustrate this. -
        -(Wolfgang Bangerth, Christian Goll 2012/07/20) - -
      3. Fixed: Using the SolutionTransfer class with hp::DoFHandler -and on meshes where some cells are associated with a FE_Nothing element -could result in an error. This is now fixed. -
        -(Wolfgang Bangerth, 2012/06/29) - -
      4. Fixed: The MappingQ1::transform_real_to_unit_cell function as -well as the equivalent ones in derived classes sometimes get into -trouble if they are asked to compute the preimage of this point -in reference cell coordinates. This is because for points outside -the reference cell, the mapping from unit to real cell is not -necessarily invertible, and consequently the Newton iteration to -find the preimage did not always converge, leading to an exception. -While this is not entirely wrong (we could, after all, not compute -the desired quantity), not all callers of this function were prepared -to accept this result -- in particular, the function -CellAccessor<3>::point_inside should have really just returned false -in such cases but instead let the exception so generated propagate -through. This should now be fixed. -
        -(Wolfgang Bangerth, Eric Heien, Sebastian Pauletti, 2012/06/27) - -
      5. Fixed: The function VectorTools::compute_no_normal_flux_constraints had -a bug that led to an exception whenever we were computing constraints for -vector fields located on edges shared between two faces of a 3d cell if those -faces were not parallel to the axes of the coordinate system. This is now fixed. -
        -(Wolfgang Bangerth, Jennifer Worthen, 2012/06/27) - -
      6. -Fixed: Due to an apparent bug in autoconf, it was not possible to -override the F77 environment variable to select anything -else than gfortran. This is now fixed. -
        -(Wolfgang Bangerth, 2012/06/08) - -
      7. Fixed: TrilinosWrappers::VectorBase::swap() is now working as expected. (thanks Uwe Köcher) -
        -(Timo Heister 2012/07/03) - -
      8. Fixed: Some instantiations for -DerivativeApproximation::approximate_derivative_tensor() were missing. -
        -(Timo Heister 2012/06/07) - -
      9. New: The finite element type FE_DGQArbitraryNodes is now -working also in codimension one spaces. -
        -(Luca Heltai, Andrea Mola 2012/06/06) - -
      10. Fixed: Computing the $W^{1,\infty}$ norm and seminorm in -VectorTools::integrate_difference was not implemented. This is now -fixed. -
        -(Wolfgang Bangerth 2012/06/02) - -
      11. Fixed: A problem in MappingQ::transform_real_to_unit_cell -that sometimes led the algorithm in this function to abort. -
        -(Wolfgang Bangerth 2012/05/30) - -
      12. New: The function DataOutInterface::write_pvd_record can be used -to provide Paraview with metadata that describes which time in a -simulation a particular output file corresponds to. -
        -(Marco Engelhard 2012/05/30) - -
      13. Fixed: A bug in 3d with hanging nodes in GridTools::find_cells_adjacent_to_vertex() -that caused find_active_cell_around_point() to fail in those cases. -
        -(Timo Heister, Wolfgang Bangerth 2012/05/30) - -
      14. New: DoFTools::make_periodicity_constraints implemented which -inserts algebraic constraints due to periodic boundary conditions -into a ConstraintMatrix. -
        -(Matthias Maier, 2012/05/22) - -
      15. New: The GridIn::read_unv function can now read meshes generated -by the Salome framework, see http://www.salome-platform.org/ . -
        -(Valentin Zingan, 2012/04/27) - -
      16. New: There is now a second DoFTools::map_dofs_to_support_points -function that also works for parallel::distributed::Triangulation -triangulations. -
        -(Wolfgang Bangerth, 2012/04/26) - -
      17. New: There is now a second DoFTools::extract_boundary_dofs -function that also works for parallel::distributed::Triangulation -triangulations. -
        -(Wolfgang Bangerth, 2012/04/26) - -
      18. New: The FullMatrix::extract_submatrix_from, FullMatrix::scatter_matrix_to, -FullMatrix::set functions are new. -
        -(Andrew McBride, Jean Paul Pelteret, Wolfgang Bangerth, 2012/04/24) - -
      19. Fixed: -The method FEValues::inverse_jacobian() previously returned the transpose of the -inverse Jacobians instead of just the inverse Jacobian as documented. This is now fixed. -
        -(Sebastian Pauletti, Katharina Kormann, Martin Kronbichler, 2012/03/11) - -
      20. Extended: -SolutionTransfer is now also able to transfer solutions between hp::DoFHandler where -the finite element index changes during refinement. -
        -(Katharina Kormann, Martin Kronbichler, 2012/03/10) - -
      21. Changed: -A new method to determine an initial guess for the Newton method was coded -in MappingQ::transform_real_to_unit_cell. -The code in transform_real_to_unit_cell was cleaned a little bit and a new code -for the @<2,3@> case was added. -
        -(Sebastian Pauletti, 2012/03/02) - -
      22. Changed: -In the context of codim@>0, Mapping::transform would require different inputs -depending on the mapping type. -For mapping_covariant, mapping_contravariant the input is DerivativeForm<1, dim, spacedim> -but for mapping_covariant_gradient, mapping_contravariant_gradient the input is Tensor<2,dim>. -
        -(Sebastian Pauletti, 2012/03/02) - -
      23. New: -A new class DerivativeForm was added. -This class is supposed to represent the derivatives of a mapping. -
        -(Sebastian Pauletti, 2012/03/02) - -
      24. Fixed: TrilinosWrappers::Vector::all_zero() in parallel. -
        -(Timo Heister, Jörg Frohne, 2012/03/06) - -
      25. New: GridGenerator::quarter_hyper_shell() in 3d. -
        -(Thomas Geenen, 2012/03/05) - -
      26. New: DataOut::write_vtu_in_parallel(). This routine uses MPI I/O to write -a big vtu file in parallel. -
        -(Timo Heister, 2012/02/29) - -
      27. Fixed: parallel::distributed::Triangulation::clear() forgot -to update the number cache of this class, leading to wrong results -when calling functions like -parallel::distributed::Triangulation::n_global_active_cells(); -
        -(Wolfgang Bangerth, 2012/02/20) - -
      28. Improved: FEFieldFunction allows now for the computation of Laplacians. -
        -(Christian Goll, 2012/02/16) - -
      29. New: The function IndexSet::fill_binary_vector creates a numerical -representation of an IndexSet containing zeros and ones. -
        -(Wolfgang Bangerth, 2012/02/12) - -
      30. New: The function IndexSet::clear resets an index set to be empty. -
        -(Wolfgang Bangerth, 2012/02/12) - -
      31. New: There are now global functions l1_norm() and linfty_norm() that compute -the respective norms of a rank-2 tensor. -
        -(Wolfgang Bangerth, 2012/02/08) - -
      32. New: VectorTools::interpolate_to_different_mesh implemented which interpolates between - DoFHandlers with different triangulations based on a common coarse grid. -
        -(Matthias Maier, 2012/02/08) - -
      33. Improved: DoFTools::map_dofs_to_support_points() now also works within the hp framework. -
        -(Christian Goll, 2012/02/02) - -
      34. Improved: There is now a constructor for FESystem that allows to -create collections of finite elements of arbitrary length. -
        -(Jason Sheldon, 2012/01/27) - -
      35. Improved: VectorTools::point_value() now also works within the hp framework. -
        -(Christian Goll, 2012/01/26) - -
      36. Fixed: GridTools::find_active_cell_around_point() for the hp-case works now also with MappingCollections containing only one mapping, as is the standard case in other functions using hp. -
        -(Christian Goll, 2012/01/26) - -
      37. Fixed: parallel::distributed::refine_and_coarsen_fixed_fraction() -contained a rounding bug that often produced wrong results. -
        -(Timo Heister, 2012/01/24) - -
      38. Improved: Utilities::break_text_into_lines now also splits the string at '\\n'. -
        -(Timo Heister, 2012/01/17) - -
      39. Fixed: When ./configure does not detect the presence -of zlib, writing output in VTU format failed to produce -a valid output file. -
        -(Timo Heister, 2012/01/03) - -
      40. Improved: PETScWrappers::SolverXXX class was -restricted to using default solver options for the KSP only. It is now -possible to override those by using PETSc command-line options --ksp_*; giving greater flexibility in controlling PETSc -solvers. (See the class's documentation). -
        -(Vijay S. Mahadevan, 2011/12/22) - -
      41. New: The GridIn class now also reads the GMSH format 2.2 as written by -GMSH 2.5. -
        -(Vijay S. Mahadevan, Wolfgang Bangerth, 2011/12/19) - -
      42. Improved: The GridRefinement::refine_and_coarsen_optimize function -assumed that the expected convergence order was 2. It has now gotten an -argument by which the user can prescribe a different value. A bug has also -been fixed in which the function incorrectly assumed in its algorithm that -the mesh was two-dimensional. -
        -(Christian Goll, 2011/12/16) - -
      43. Fixed: Restriction and prolongation didn't work for elements of -kind FE_Nothing. Consequently, many other parts of the library also -didn't work, such as the SolutionTransfer class. This is now fixed. -
        -(Wolfgang Bangerth, 2011/12/15) - -
      44. Fixed: The DerivativeApproximation class now works for distributed computations. -
        -(Timo Heister, 2011/12/15) - -
      45. Changed: The ExcMessage exception class took an argument of -type char* that was displayed when the exception -was raised. However, character pointers are awkward to work with -because (i) they can not easily be composed to contain things like -file names that are only known at run-time, and (ii) the string -pointed to by the pointer had to live longer than the local expression -in which the exception is generated when using the AssertThrow macro -(because, when we create an exception, the exception object is passed -up the call stack until we find a catch-clause; at that time, however, -the scope in which the exception object was created has long been left). -This restriction made it impossible to construct the message using std::string -and then just do something like (std::string("file: ")+filename).c_str(). -
        -To remedy this flaw, the type of the argument to ExcMessage has been -changed to std::string since objects of this type are readily copyable -and therefore live long enough. -
        -(Wolfgang Bangerth, 2011/12/14) - -
      46. New: Setting up a class derived from DataPostprocessor required some -pretty mechanical steps in which one has to overload four member functions. -For common cases where a postprocessor only computes a single scalar or -a single vector, this is tedious and unnecessary. For these cases, the -new classes DataPostprocessorScalar and DataPostprocessorVector provide -short cuts that make life simpler. -
        -(Wolfgang Bangerth, 2011/12/14) - -
      47. Changed: The DataPostprocessor class previously required users of this -class to overload DataPostprocessor::get_names(), -DataPostprocessor::get_data_component_interpretation() -and DataPostprocessor::n_output_variables(). The latter function is redundant -since its output must equal the length of the arrays returned by the -first two of these functions. It has therefore been removed. -
        -(Wolfgang Bangerth, 2011/12/14) - -
      48. Improved: Objects of the type LogStream::Prefix can now be used -as a safe implementation of the push and pop mechanism for log -prefices. -
        -(Guido Kanschat, 2011/12/09) - -
      49. New: IndexSet::add_indices(IndexSet). -
        -(Timo Heister, 2011/12/09) - -
      50. Fixed: Finite element Hessians get computed for codimension one, -at least for FE_Poly derived classes. -
        -(Guido Kanschat, 2011/12/07) - -
      51. Changed: Output of ParameterHandler::print_parameters with argument -ParameterHandler::LaTeX was not particularly readable. The output has -therefore been rewritten to be more structured and readable. -
        -(Wolfgang Bangerth, 2011/11/28) - -
      52. Fixed: The TimerOutput class set the alignment of output to right-aligned -under some circumstances, but didn't reset this to the previous value at the -end of output. This is now fixed. -
        -(Wolfgang Bangerth, 2011/11/28) - -
      53. New: The copy constructor of the SparseMatrixEZ function now works -(rather than throwing an exception) if the copied matrix has size zero. -This is in accordance to the other matrix classes. -
        -(Wolfgang Bangerth, 2011/11/15) - -
      54. New: The class ScalarFunctionFromFunctionObject provides a quick way to -convert an arbitrary function into a function object that can be passed -to part of the library that require the Function@ interface. -The VectorFunctionFromScalarFunctionObject class does a similar thing. -
        -(Wolfgang Bangerth, 2011/11/15) - -
      55. New: The DoFTools::count_dofs_per_block function now also works -for objects of type hp::DoFHandler. -
        -(Jason Sheldon, 2011/11/13) - -
      56. New: FETools::get_fe_from_name() can now return objects of type FE_Nothing. -
        -(Scott Miller, Jonathan Pitt, 2011/11/10) - -
      57. New: Implementation of an alternative handling of -inhomogeneous constraints in ConstraintMatrix. This is controlled with -a new parameter use_inhomogeneities_for_rhs in -distribute_local_to_global() and determines whether the correct or -zero values (this was the case before and still is the default) are -kept in the linear system during the solution process. -
        -(Jörg Frohne, 2011/11/01) - -
      58. Fixed: SparseMatrix::mmult and SpareMatrix::Tmmult had a number of -issues that are now fixed: (i) rebuilding the sparsity pattern was allowed -even if several of the matrices involved in these operations shared a -sparsity pattern; (ii) the functions had a vector argument that had a default -value but the default value could not be used because it wasn't used in a -template context deducible by the compiler. -
        -(Wolfgang Bangerth, 2011/10/30) - -
      59. New: -parallel::distributed::Triangulation::mesh_reconstruction_after_repartitioning -setting which is necessary for save()/load() to be deterministic. Otherwise -the matrix assembly is done in a different order depending on the order of old -refinements. -
        -(Timo Heister, 2011/10/26) - -
      60. New: TriaAccessor<>::minimum_vertex_distance(). -
        -(Timo Heister, 2011/10/25) - -
      61. New: TableHandler::print_text now supports not only printing column -keys above their own column, but also in a separate header, to make it simpler -for external plotting programs to skip this line. -
        -(Wolfgang Bangerth, 2011/10/22) - -
      62. Fixed: Trying to write a TableHandler object that is empty resulted -in a segmentation fault. This is now fixed. -
        -(Wolfgang Bangerth, 2011/10/21) - -
      63. New: The TableHandler class can now pad columns that have only been -partially filled. See the documentation of the class for a description. -
        -(Wolfgang Bangerth, 2011/10/18) - -
      64. Fixed: In TableHandler::print_text, it can happen that the function -wants to print an empty string as the element of the table to be printed. -This can confuse machine readers of this table, for example for visualization, -since they then do not see this column in that row. To prevent this, we now -print "" in such places. -
        -(Wolfgang Bangerth, 2011/10/18) - -
      65. Fixed: Using Trilinos versions 10.4 and later on Debian failed to -configure due to a different naming scheme of Trilinos libraries on -Debian. This is now fixed. -
        -(Wolfgang Bangerth, 2011/10/17) - -
      66. Changed: The TableHandler class has been changed significantly -internally. It could previously store arbitrary values (though in practice, -only int, unsigned int, double and std::string were implemented). The class is -now restricted to this particular set of types. On the other hand, the -TableHandler class can now be serialized. -
        -(Wolfgang Bangerth, 2011/10/17) - -
      67. Fixed: searching in the doxygen documentation. +
      68. New: TableHandler TextOutputFormat::simple_table_with_separate_column_description +that skips aligning the columns for increased performance.
        -(Timo Heister, 2011/10/13) +(Timo Heister, 2012/09/10) -
      69. New: parallel::distributed::Triangulation::save()/load() to store -the refinement information to disk. Also supports saving solution vectors -using the SolutionTransfer class. +
      70. Fixed: The Clang C++ compiler had some trouble dealing with obtaining +the return value of a Threads::Task object, due to a compiler bug in +dealing with friend declarations. This is now fixed.
        -(Timo Heister, 2011/10/12) +(Wolfgang Bangerth, 2012/09/04) -
      71. Fixed: The DataOut_DoFData::merge_patches did not compile with newer compilers. +
      72. Fixed: When applying a ConstraintMatrix to a block matrix +where the last few rows are empty, we ran into an unrelated assertion. This is now fixed.
        -(Wolfgang Bangerth, 2011/10/11) +(Jason Sheldon, Wolfgang Bangerth, 2012/09/04)
      diff --git a/deal.II/doc/news/news.html b/deal.II/doc/news/news.html index 4c0b4cc0ee..c8523aeaed 100644 --- a/deal.II/doc/news/news.html +++ b/deal.II/doc/news/news.html @@ -28,10 +28,28 @@ mailing list for additional news.

      -

      Changes in the library since the last major release are - here.

      +

      +

      Recent changes
      +
      + Changes in the library since the last major release are + here. +
      +

      +
      + 2012/09/03: Version 7.2 released +
      +
      + Version 7.2.0 was released today. This release provides four + new tutorial programs, a framework for matrix-free + computations, and a large number of enhancements and bug fixes + throughout the entire library. A complete list of new + features is found here. +
      + +
      2012/06/06: step-43 — an efficient solver for two-phase flow diff --git a/deal.II/doc/porting.html b/deal.II/doc/porting.html index 4c6be0b7c4..b554ad4620 100644 --- a/deal.II/doc/porting.html +++ b/deal.II/doc/porting.html @@ -5,7 +5,7 @@ Porting deal.II - + @@ -152,8 +152,7 @@
      -The deal.II -mailing list +The deal.II Group
      diff --git a/deal.II/doc/publications/index.html b/deal.II/doc/publications/index.html index e10389e24a..d824f9f8d2 100644 --- a/deal.II/doc/publications/index.html +++ b/deal.II/doc/publications/index.html @@ -271,7 +271,7 @@ Preconditioning for Allen-Cahn variational inequalities with non-local constraints
      - Journal of Computational Physics, vol. 231, pp. 5406-5420, 2012. + Journal of Computational Physics, vol. 231, pp. 5406-5402, 2012.
    2. A. Bonito, I. Kyza, R. H. Nochetto @@ -318,7 +318,16 @@ hp-adaptive finite element strategy for Maxwell's equations
      - Preprint 12/04, Karlsruhe Institute of Technology, 2012. + Preprint 12/04, Karlsruhe Institute of Technology (KIT), 2012. +
    3. + +
    4. M. Bürg +
      + A Fully Automatic hp-Adaptive Refinement Strategy + +
      + PhD Thesis, Karlsruhe Institute of Technology (KIT), 2012.
    5. A. Cangiani, J. Chapman, E. Georgoulis, M. Jensen @@ -330,6 +339,30 @@
    6. +
    7. A. Cangiani, J. Chapman, E. Georgoulis, M. Jensen +
      + On Local Super-Penalization of Interior Penalty Discontinuous Galerkin Methods +
      + arXiv:1205.5672v1 [math.NA], 2012. + +
    8. + +
    9. T. Carraro, J. Joos, B. Rüger, A. Weber, E. Ivers-Tiffée +
      + 3D finite element model for reconstructed mixed-conducting + cathodes: I. Performance quantification +
      + Electrochimica Acta, Volume 77, pp. 315-323, 2012. +
    10. + +
    11. T. Carraro, J. Joos, B. Rüger, A. Weber, E. Ivers-Tiffée +
      + 3D finite element model for reconstructed mixed-conducting + cathodes: II. Parameter sensitivity analysis +
      + Electrochimica Acta, Volume 77, pp. 309-314, 2012. +
    12. +
    13. C.-C. Chueh, N. Djilali, W. Bangerth
      An h-adaptive Operator Splitting Method for @@ -356,6 +389,16 @@ arXiv:1202.3583v1 [nlin.PS], 2012.
    14. +
    15. J. J. Gaitero, J. S. Dolado, C. Neuen, F. Heber, E. Koenders +
      + Computational 3d simulation of Calcium leaching in + cement matrices + +
      + Institut für numerische Simulation, Rheinische + Friedrich-Wilhelms-Universität Bonn, INS Preprint 1203, 2012. +
    16. +
    17. T. George, A. Gupta, V. Sarin
      An empirical analysis of the performance of iterative @@ -450,6 +493,26 @@
    18. +
    19. O. Jirousek, P. Zlamal +
      + Large-scale micro-finite element simulation of + compressive behavior of trabecular bone microstructure +
      + Proceedings of the 18th Conference on Engineering Mechanics, + Svratka, Czech Republic, May 14-17, 2012; paper #206, + pp. 543-549, 2012. +
    20. + +
    21. J. Joos, M. Ender, T. Carraro, A. Weber, E. Ivers-Tiffée +
      + Representative Volume Element Size for Accurate Solid Oxide + Fuel Cell Cathode Reconstructions from Focused Ion Beam Tomography + Data +
      + Electrochimica Acta, in press, 2012. + +
    22. +
    23. S. Joshi
      A model for the estimation of residual stresses in @@ -505,14 +568,13 @@ arXiv:1203.3384v1 [math.NA], 2012.
    24. -
    25. - T. Rees, M. Stoll +
    26. M. J. Rapson, J. C. Tapson, D. Karpul
      - A fast solver for an H1 regularized - optimal control problem + Unification and Extension of Monolithic State Space + and Iterative Cochlear Models
      - Preprint 12-06, Max-Planck-Institute Magdeburg, 2012. + Journal of the Acoustical Society of America, vol. 131, pp. 3935-3952, 2012.
    27. N. Richardson @@ -541,22 +603,21 @@ Vol. 28, pp. 111–132, 2012.
    28. -
    29. M. J. Rapson, D. Karpul, J. C. Tapson +
    30. M. Stoll, A. Wathen
      - Unification and extension of monolithic state space and - iterative cochlear models + All-at-once solution of time-dependent PDE-constrained optimization problems
      - J. Acoust. Soc. Am. Volume 131, Issue 5, pp. 3935-3952, 2012. + Preprint, University of Magdeburg, 2012 +
    31. -
    32. M. Stoll, A. Wathen +
    33. M. Thalhammer, J. Abhau
      - All-at-once solution of time-dependent PDE-constrained optimization problems + A numerical study of adaptive space and time discretisations for Gross–Pitaevskii equations
      - Preprint, University of Magdeburg, 2012 - + Journal of Computational Physics, vol. 231, pp. 6665-6681, 2012.
    34. M. Vavalis, M. Mu, G. Sarailidis @@ -571,10 +632,11 @@
    35. M. Wallraff, T. Leicht, M. Lange-Hegermann
      Numerical flux functions for Reynolds-averaged Navier-Stokes - and kω turbulence model computations with a line-preconditioned + and kω turbulence model computations with a line-preconditioned p-multigrid discontinuous Galerkin solver
      Int. J. Numer. Meth. Fluids, published online, 2012. +
    36. M. Wallraff, T. Leicht, M. Lange-Hegermann @@ -592,8 +654,35 @@
      RICAM Report 2012-06, 2012.
    37. -
    +
  • S. Yoon, M. A. Walkley, O. G. Harlen +
    + Two particle interactions in a confined viscoelastic fluid under shear + +
    + Journal of Non-Newtonian Fluid Mechanics, in press, 2012. + +
  • + +
  • T. D. Young, E. Romero, J. E. Roman +
    + Parallel finite element density functional theory exploiting grid refinement and subspace recycling + +
    + Comput. Phys. Commun., accepted, 2012. +
  • + +
  • S. Zhang, X. Lin, H. Zhang, D. A. Yuen, Y. Shi +
    + A new method for calculating displacements from + elastic dislocation over arbitrary 3-D fault surface with + extended FEM and Adaptive Mesh Refinement (AMR) +
    + Proceedings of the International Workshop on Deep Geothermal + Systems, Wuhan, China, June 29-30, 2012. +
  • +

    Publications in 2011

    @@ -862,6 +951,13 @@ +
  • J. Joos, T. Carraro, M. Ender, B. Rüger, A. Weber, E. Ivers-Tiffée +
    + Detailed Microstructure Analysis and 3D Simulations of Porous Electrodes +
    + ECS Trans. 35, pp. 2357-2368, 2011. +
  • +
  • F. Keller, H. Nirschl, W. Dörfler
    Primary charge effects on prolate spheroids with moderate aspect ratios @@ -1037,15 +1133,6 @@ 2011
  • -
  • M. J. Rapson, D. Karpul, J. C. Tapson -
    - Unification and Extension of Monolithic State Space - and Iterative Cochlear Models - -
    - Journal of the Acoustical Society of America, accepted, 2011. -
  • -
  • M. J. Rapson, J. C. Tapson
    Investigations into Time @@ -1105,26 +1192,6 @@ Submitted to Archive of Numerical Software, 2011.
  • -
  • M. Steigemann -
    - Simulation of Quasi-static Crack Propagation in Functionally - Graded Materials - -
    - in: Functionally Graded Materials, N.J. Reynolds, ed., Nova Science - Publishers, pp. 193-248, 2011. -
  • - -
  • - M. Stoll -
    - One-shot solution of a time-dependent time-periodic - PDE-constrained optimization problem - -
    - Preprint 11-04, Max-Planck-Institute Magdeburg, 2011. -
  • -
  • M. Stoll, J. Pearson, A. Wathen
    @@ -1461,7 +1528,8 @@ Reduction of Drift-Diffusion Equations in Electrical Networks

    - Hamburger Beiträge zur Angewandten Mathematik, Nr. 2010-09. + Scientific Computing in Electrical Engineering, SCEE 2010 + Mathematics in Industry, Volume 16, Part 5, 423-431, 2012.
  • M. Hinze, M. Kunkel @@ -1504,6 +1572,14 @@ J. C. F. Pereira and A. Sequeira (eds.), 2010.
  • +
  • J. Joos, B. Rüger, T. Carraro, A. Weber, E. Ivers-Tiffée +
    + Electrode Reconstruction by FIB/SEM and Microstructure + Modeling +
    + ECS Trans. 28, pp. 81-91, 2010. +
  • +
  • G. Kanschat, B. Rivière
    A strongly conservative finite element method for the coupling @@ -1698,15 +1774,6 @@ Engineering Fracture Mechanics, vol. 77, pp. 2145-2157, 2010
  • -
  • - M. Stoll, A. Wathen -
    - All-at-once solution of time-dependent Stokes control - -
    - Preprint 10-03, Max-Planck-Institute Magdeburg, 2010. -
  • -
  • M. Stoll, A. Wathen
    @@ -2098,6 +2165,14 @@ G. Choi and J. Y. Yoo, eds.), pp. 31-45, Springer, 2009.
  • +
  • B. Rüger, J. Joos, T. Carraro, A. Weber, E. Ivers-Tiffée +
    + 3D Electrode Microstructure Reconstruction and + Modelling +
    + ECS Trans. 25, pp. 1211-1220, 2009. +
  • +
  • D. Schötzau, L. Zhu
    @@ -4074,9 +4149,6 @@
    Preprint 2000-11 (SFB 359), IWR Heidelberg, October 1999.
    - This paper is also available - online. -
    (Abstract, BiBTeX entry)
  • @@ -4223,7 +4295,7 @@
    - The deal.II mailing list
    + The deal.II Group diff --git a/deal.II/doc/readme-petsc-trilinos.html b/deal.II/doc/readme-petsc-trilinos.html index d99508a796..fd35d55b3a 100644 --- a/deal.II/doc/readme-petsc-trilinos.html +++ b/deal.II/doc/readme-petsc-trilinos.html @@ -79,17 +79,6 @@ configuration.

    -

    - Note that in order to use PETSc with deal.II - with the current release version of deal.II - you will need to have at least PETSc version 2.3.0 installed, - earlier releases are no longer supported. There is no - correlation between deal.II version numbers - and PETSc version numbers. deal.II version - 7.0 has been tested up to PETSc release 3.1.0-p8, and newer version up - to at least PETSc release 3.2. -

    -

    There is an additional caveat: PETSc appears not to co-operate well when using threads and some programs crash when deal.II is @@ -148,9 +137,10 @@

    Trilinos starting with version 10.0

    - Note: Trilinos versions 10.6.x, 10.8.0, 10.8.1, and 10.10.2 are not compatible with + Note: Trilinos versions 10.6.x, 10.8.0, 10.8.1, 10.10.2, 10.12.1 are not compatible with deal.II. They contain subtle bugs related to (parallel) matrices and vectors. - We recommend staying with 10.4.2 for the time being. + Versions tested to work are 10.4.2, 10.8.5, and 10.12.2. We recommend only using + one of the tested versions for the time being.

    @@ -274,7 +264,7 @@ configure: error: *** Your Trilinos installation is not compatible with the C++


    - The deal.II mailing list + The deal.II Group $Date: 2008-10-14 05:36:48 -0500 (Tue, 14 Oct 2008) $
    diff --git a/deal.II/doc/readme.html b/deal.II/doc/readme.html index 10c07e859a..bbb9dc291b 100644 --- a/deal.II/doc/readme.html +++ b/deal.II/doc/readme.html @@ -533,6 +533,11 @@ at the command line, or, here.

    + +

    + (deal.II) version 7.2 (and higher) support + PETSc 3.x.x only; earlier releases are no longer supported. +

    @@ -556,59 +561,50 @@
    Trilinos

    - deal.II can also interface to Trilinos. The + deal.II can also interface + to Trilinos. The simplest way to use these interfaces is to pass --with-trilinos=/path/to/trilinos - to deal.II's ./configure script. More - configuration options can be found deal.II's ./configure script. Note + that not all versions of Trilinos are compatible + with deal.II. More details about compatibility and + configuration can be found here.

    -
    Metis

    - In order to generate partitionings of triangulations, we have - functions that - call METIS library. METIS is a library that - provides various methods to partition graphs, which we use to - define which cell belongs to which part of a triangulation. The - main point in using METIS is to generate partitions so that the - interfaces between cell blocks are as small as possible. This - data can, in turn, be used to distribute degrees of freedom onto - different processors when using PETSc and/or SLEPc in parallel - mode. -

    - -

    - As with PETSc and SLEPc, the use of METIS is optional. If you - wish to use it, you can do so by having a METIS installation - around at the time of calling - ./configure by either - setting the METIS_DIR environment - variable denoting the path to the METIS library, or using the - --with-metis flag. If METIS was installed as part - of /usr or /opt, instead of local directories - in a home directory for example, you can use configure - switches --with-metis-include, --with-metis-libs. + In order to generate partitionings of triangulations, we have + functions that + call METIS library. METIS is a library that + provides various methods to partition graphs, which we use to + define which cell belongs to which part of a + triangulation. The main point in using METIS is to generate + partitions so that the interfaces between cell blocks are as + small as possible. This data can, in turn, be used to + distribute degrees of freedom onto different processors when + using PETSc and/or SLEPc in parallel mode.

    - On some systems, when using shared libraries for deal.II, you may get - warnings of the kind libmetis.a(pmetis.o): relocation R_X86_64_32 - against `a local symbol' can not be used when making a shared - object; recompile with -fPIC when linking. This can be - avoided by recompiling METIS with -fPIC as a compiler - flag. + As with PETSc and SLEPc, the use of METIS is optional. If you + wish to use it, you can do so by having a METIS installation + around at the time of calling + ./configure by either setting + the METIS_DIR environment variable denoting the + path to the METIS library, or using the + --with-metis flag.

    - METIS is not needed when using p4est to parallelize - programs, see below. + (deal.II) version 7.2 (and higher) support + METIS 5.x.x only; earlier releases are no longer + supported.
    METIS is not needed when + using p4est to parallelize programs, see below.

    @@ -734,7 +730,18 @@ this page. - + +
    HDF5
    +
    + This adds HDF5/XDMF graphical output capabilities to deal.II. You need to + install the HDF5 library + separately. Configure with --with-hdf5= and point it to + the h5pcc or h5cc script inside your hdf5 installation. + + For a detailed description of how to compile HDF5 and linking with + deal.II, see this + page. +
    @@ -823,7 +830,7 @@
    - The deal.II mailing list + The deal.II Group $Date$
    diff --git a/deal.II/doc/screen.css b/deal.II/doc/screen.css index edeebac807..83ed8ce46b 100644 --- a/deal.II/doc/screen.css +++ b/deal.II/doc/screen.css @@ -205,6 +205,7 @@ code.global { color: #005030; } td.build { text-align: center; vertical-align: middle; + font-size: small; } diff --git a/deal.II/examples/step-11/step-11.cc b/deal.II/examples/step-11/step-11.cc index 55615a90ee..627fcdbbcf 100644 --- a/deal.II/examples/step-11/step-11.cc +++ b/deal.II/examples/step-11/step-11.cc @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include // Just this one is new: it declares // a class diff --git a/deal.II/examples/step-13/step-13.cc b/deal.II/examples/step-13/step-13.cc index 9c911d6d37..e8182e5bd0 100644 --- a/deal.II/examples/step-13/step-13.cc +++ b/deal.II/examples/step-13/step-13.cc @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index e3167db652..4a6185ee26 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-15/step-15.cc b/deal.II/examples/step-15/step-15.cc index a3375ddf0e..c1bf2328bc 100644 --- a/deal.II/examples/step-15/step-15.cc +++ b/deal.II/examples/step-15/step-15.cc @@ -43,8 +43,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-16/step-16.cc b/deal.II/examples/step-16/step-16.cc index 1e84f87815..ce5053886f 100644 --- a/deal.II/examples/step-16/step-16.cc +++ b/deal.II/examples/step-16/step-16.cc @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-17/doc/results.dox b/deal.II/examples/step-17/doc/results.dox index 1fdc303d36..3c01f39891 100644 --- a/deal.II/examples/step-17/doc/results.dox +++ b/deal.II/examples/step-17/doc/results.dox @@ -9,7 +9,10 @@ have different calling syntaxes - on my system, I have to use the command bsub with a whole host of options to run a job in parallel - so that the exact command line syntax varies. If you have found out how to run a job on your system, you should get output like this for a job on 8 processors, -and with a few more refinement cycles than in the code above: +and with a few more refinement cycles than in the code above (these +results were generated in 2004 with older versions of deal.II and a +version of METIS that generated different partitionings; consequently, +the numbers you get today are slightly different): @code Cycle 0: Number of active cells: 64 @@ -90,12 +93,12 @@ cycle 14, and 14 minutes including the second to last step. I lost the timing information for the last step, though, but you get the idea. All this is if the debug flag in the Makefile was changed to "off", i.e. "optimized", and with the generation of graphical output switched off for the reasons stated in -the program comments above. The biggest 2d computations we did had roughly 7.1 +the program comments above. The biggest 2d computations we did had roughly 7.1 million unknowns, and were done on 32 processes. It took about 40 minutes. Not surprisingly, the limiting factor for how far one can go is how much memory -one has, since every process has to hold the entire mesh and DoFHandler objects, +one has, since every process has to hold the entire mesh and DoFHandler objects, although matrices and vectors are split up. For the 7.1M computation, the memory -consumption was about 600 bytes per unknown, which is not bad, but one has to +consumption was about 600 bytes per unknown, which is not bad, but one has to consider that this is for every unknown, whether we store the matrix and vector entries locally or not. @@ -195,7 +198,7 @@ Cycle 6: The last step, going up to 1.5 million unknowns, takes about 55 minutes with 16 processes on 8 dual-processor machines (of the kind available in 2003). The -graphical output generated by +graphical output generated by this job is rather large (cycle 5 already prints around 82 MB of GMV data), so we contend ourselves with showing output from cycle 4: diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index 03d0f2422d..ae10f61ebd 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 0297cdfab8..5860756716 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -41,8 +41,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-20/step-20.cc b/deal.II/examples/step-20/step-20.cc index b0553e0126..8a3e1093f3 100644 --- a/deal.II/examples/step-20/step-20.cc +++ b/deal.II/examples/step-20/step-20.cc @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-21/step-21.cc b/deal.II/examples/step-21/step-21.cc index ac1853b7c8..a4d9e6148a 100644 --- a/deal.II/examples/step-21/step-21.cc +++ b/deal.II/examples/step-21/step-21.cc @@ -48,8 +48,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index 4911471547..5829d34fbf 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -43,8 +43,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-23/doc/intro.dox b/deal.II/examples/step-23/doc/intro.dox index c8feb1dba8..c7b70487af 100644 --- a/deal.II/examples/step-23/doc/intro.dox +++ b/deal.II/examples/step-23/doc/intro.dox @@ -403,9 +403,12 @@ a square $[-1,1]^2$ and \\ u_1 &=& 0, \\ - g &=& \left\{\begin{matrix}\sin (4\pi t) \\ 0\end{matrix} - \qquad {\textrm{for}\ t\le \frac 12, x=-1, -\frac 13 +#include // In a very similar vein, we are // also too lazy to write the code to @@ -84,7 +84,7 @@ // and // MatrixTools::create_laplace_matrix // functions. They are declared here: -#include +#include // Finally, here is an include file // that contains all sorts of tool diff --git a/deal.II/examples/step-24/step-24.cc b/deal.II/examples/step-24/step-24.cc index f959cadbba..742205e70d 100644 --- a/deal.II/examples/step-24/step-24.cc +++ b/deal.II/examples/step-24/step-24.cc @@ -39,8 +39,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-25/step-25.cc b/deal.II/examples/step-25/step-25.cc index 19f401aad8..eb57fcd4b4 100644 --- a/deal.II/examples/step-25/step-25.cc +++ b/deal.II/examples/step-25/step-25.cc @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-26/step-26.cc b/deal.II/examples/step-26/step-26.cc index 2597a72ae2..29b1620855 100644 --- a/deal.II/examples/step-26/step-26.cc +++ b/deal.II/examples/step-26/step-26.cc @@ -28,8 +28,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/deal.II/examples/step-27/step-27.cc b/deal.II/examples/step-27/step-27.cc index 5d917cf626..e5c5d798bd 100644 --- a/deal.II/examples/step-27/step-27.cc +++ b/deal.II/examples/step-27/step-27.cc @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-28/step-28.cc b/deal.II/examples/step-28/step-28.cc index c74b2c4e2f..64b0276c58 100644 --- a/deal.II/examples/step-28/step-28.cc +++ b/deal.II/examples/step-28/step-28.cc @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-29/step-29.cc b/deal.II/examples/step-29/step-29.cc index cd369dd70b..0c2bfeb3a9 100644 --- a/deal.II/examples/step-29/step-29.cc +++ b/deal.II/examples/step-29/step-29.cc @@ -36,9 +36,9 @@ #include #include -#include +#include #include -#include +#include #include diff --git a/deal.II/examples/step-3/step-3.cc b/deal.II/examples/step-3/step-3.cc index 1e9fa84ff9..5b4976d421 100644 --- a/deal.II/examples/step-3/step-3.cc +++ b/deal.II/examples/step-3/step-3.cc @@ -58,8 +58,8 @@ // we need for the treatment of // boundary values: #include -#include -#include +#include +#include // We're now almost to the end. The second to // last group of include files is for the diff --git a/deal.II/examples/step-31/step-31.cc b/deal.II/examples/step-31/step-31.cc index e294cf2016..0d78aa9046 100644 --- a/deal.II/examples/step-31/step-31.cc +++ b/deal.II/examples/step-31/step-31.cc @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include @@ -1085,7 +1085,7 @@ namespace Step31 stokes_constraints.clear (); DoFTools::make_hanging_node_constraints (stokes_dof_handler, stokes_constraints); - std::set no_normal_flux_boundaries; + std::set no_normal_flux_boundaries; no_normal_flux_boundaries.insert (0); VectorTools::compute_no_normal_flux_constraints (stokes_dof_handler, 0, no_normal_flux_boundaries, diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 386b9b1aff..e01eb034f4 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -57,8 +57,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -2554,7 +2554,7 @@ namespace Step32 stokes_constraints, velocity_mask); - std::set no_normal_flux_boundaries; + std::set no_normal_flux_boundaries; no_normal_flux_boundaries.insert (1); VectorTools::compute_no_normal_flux_constraints (stokes_dof_handler, 0, no_normal_flux_boundaries, @@ -4343,11 +4343,25 @@ namespace Step32 old_temperature_solution = temperature_solution; if (old_time_step > 0) { - stokes_solution.sadd (1.+time_step/old_time_step, -time_step/old_time_step, - old_old_stokes_solution); - temperature_solution.sadd (1.+time_step/old_time_step, - -time_step/old_time_step, - old_old_temperature_solution); + //Trilinos sadd does not like ghost vectors even as input. Copy into distributed vectors for now: + { + TrilinosWrappers::MPI::BlockVector distr_solution (stokes_rhs); + distr_solution = stokes_solution; + TrilinosWrappers::MPI::BlockVector distr_old_solution (stokes_rhs); + distr_old_solution = old_old_stokes_solution; + distr_solution .sadd (1.+time_step/old_time_step, -time_step/old_time_step, + distr_old_solution); + stokes_solution = distr_solution; + } + { + TrilinosWrappers::MPI::Vector distr_solution (temperature_rhs); + distr_solution = temperature_solution; + TrilinosWrappers::MPI::Vector distr_old_solution (temperature_rhs); + distr_old_solution = old_old_temperature_solution; + distr_solution .sadd (1.+time_step/old_time_step, -time_step/old_time_step, + distr_old_solution); + temperature_solution = distr_solution; + } } if ((timestep_number > 0) && (timestep_number % 100 == 0)) diff --git a/deal.II/examples/step-33/step-33.cc b/deal.II/examples/step-33/step-33.cc index 9394797e20..dccad4abe0 100644 --- a/deal.II/examples/step-33/step-33.cc +++ b/deal.II/examples/step-33/step-33.cc @@ -42,7 +42,7 @@ #include #include -#include +#include #include // Then, as mentioned in the introduction, we diff --git a/deal.II/examples/step-34/step-34.cc b/deal.II/examples/step-34/step-34.cc index cc27622beb..30e12e7997 100644 --- a/deal.II/examples/step-34/step-34.cc +++ b/deal.II/examples/step-34/step-34.cc @@ -46,7 +46,7 @@ #include #include -#include +#include // And here are a few C++ standard header // files that we will need: diff --git a/deal.II/examples/step-35/step-35.cc b/deal.II/examples/step-35/step-35.cc index 92674e08e9..cd57ab99b7 100644 --- a/deal.II/examples/step-35/step-35.cc +++ b/deal.II/examples/step-35/step-35.cc @@ -55,8 +55,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -433,7 +433,7 @@ namespace Step35 EquationData::Velocity vel_exact; std::map boundary_values; - std::vector boundary_indicators; + std::vector boundary_indicators; Triangulation triangulation; @@ -1118,7 +1118,7 @@ namespace Step35 vel_exact.set_component(d); boundary_values.clear(); - for (std::vector::const_iterator + for (std::vector::const_iterator boundaries = boundary_indicators.begin(); boundaries != boundary_indicators.end(); ++boundaries) diff --git a/deal.II/examples/step-36/step-36.cc b/deal.II/examples/step-36/step-36.cc index 40862d2aee..932c5990ae 100644 --- a/deal.II/examples/step-36/step-36.cc +++ b/deal.II/examples/step-36/step-36.cc @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-37/step-37.cc b/deal.II/examples/step-37/step-37.cc index 9f6e4b8987..a664f42dcc 100644 --- a/deal.II/examples/step-37/step-37.cc +++ b/deal.II/examples/step-37/step-37.cc @@ -41,7 +41,7 @@ #include #include -#include +#include // This includes the data structures for the // efficient implementation of matrix-free diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index dd89748fa8..b26b6b8db1 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -381,7 +381,7 @@ namespace Step38 Triangulation volume_mesh; GridGenerator::half_hyper_ball(volume_mesh); - std::set boundary_ids; + std::set boundary_ids; boundary_ids.insert (0); GridTools::extract_boundary_mesh (volume_mesh, triangulation, diff --git a/deal.II/examples/step-39/output.reference.dat b/deal.II/examples/step-39/output.reference.dat new file mode 100644 index 0000000000..35de96d7f0 --- /dev/null +++ b/deal.II/examples/step-39/output.reference.dat @@ -0,0 +1,13 @@ +#step dofs error estimate l2error iterations efficiency order l2order +0 256 2.974190e-01 9.904600e-01 4.524470e-03 14 0.300284 0.000000 0.000000 +1 400 2.585590e-01 7.386240e-01 2.885100e-03 16 0.350055 0.627480 2.016374 +2 544 1.892340e-01 6.575070e-01 1.479540e-03 16 0.287805 2.030277 4.343815 +3 688 1.503620e-01 4.547120e-01 9.005740e-04 16 0.330675 1.958261 4.228028 +4 832 1.053170e-01 3.548790e-01 4.750150e-04 17 0.296769 3.747254 6.731991 +5 1024 7.459510e-02 2.539050e-01 2.362060e-04 17 0.293791 3.322106 6.729380 +6 1216 5.291920e-02 1.836100e-01 1.224410e-04 17 0.288215 3.995439 7.647065 +7 1504 3.756820e-02 1.335280e-01 6.804430e-05 17 0.281351 3.223616 5.527534 +8 1984 2.657860e-02 9.576030e-02 3.998000e-05 17 0.277553 2.498686 3.839747 +9 2608 1.880990e-02 6.816520e-02 1.951950e-05 17 0.275946 2.528429 5.243492 +10 3472 1.328020e-02 4.780300e-02 1.006070e-05 17 0.277811 2.433078 4.632422 +11 4672 9.367220e-03 3.336360e-02 5.766390e-06 17 0.280762 2.351695 3.749897 diff --git a/deal.II/examples/step-39/step-39.cc b/deal.II/examples/step-39/step-39.cc index e29c8ff782..5672cb156f 100644 --- a/deal.II/examples/step-39/step-39.cc +++ b/deal.II/examples/step-39/step-39.cc @@ -59,7 +59,7 @@ // as quadrature and additional tools. #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-4/step-4.cc b/deal.II/examples/step-4/step-4.cc index 40bf96d41c..30a9ce595b 100644 --- a/deal.II/examples/step-4/step-4.cc +++ b/deal.II/examples/step-4/step-4.cc @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/deal.II/examples/step-40/step-40.cc b/deal.II/examples/step-40/step-40.cc index bc536fc339..3b201990e5 100644 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-41/Makefile b/deal.II/examples/step-41/Makefile index 74459bdba8..150d91c19f 100644 --- a/deal.II/examples/step-41/Makefile +++ b/deal.II/examples/step-41/Makefile @@ -45,6 +45,22 @@ clean-up-files = *gmv *gnuplot *gpl *eps *pov *vtk *ucd *.d2 # settings include $D/common/Make.global_options +################################################################ +# This example program will only work if Trilinos is installed. If this +# is not the case, then simply redefine the main targets to do nothing +ifneq ($(USE_CONTRIB_TRILINOS),yes) +default run clean: + @echo + @echo "===========================================================" + @echo "= This program cannot be compiled without Trilinos. Make=" + @echo "= sure you have Trilinos installed and detected during =" + @echo "= configuration of deal.II =" + @echo "===========================================================" + @echo + +else +# +################################################################ # Since the whole project consists of only one file, we need not # consider difficult dependencies. We only have to declare the @@ -141,4 +157,4 @@ Makefile.dep: $(target).cc Makefile \ # them: include Makefile.dep - +endif # CONTRIB_USE_TRILINOS diff --git a/deal.II/examples/step-41/doc/intro.dox b/deal.II/examples/step-41/doc/intro.dox index 42dec00a16..0014f3fd56 100644 --- a/deal.II/examples/step-41/doc/intro.dox +++ b/deal.II/examples/step-41/doc/intro.dox @@ -7,6 +7,7 @@ This material is based upon work partly supported by ThyssenKrupp Steel Europe. +

    Introduction

    This example is based on the Laplace equation in 2d and deals with the @@ -91,7 +92,7 @@ obstacle). An obvious way to obtain the variational formulation of the obstacle problem is to consider the total potential energy: @f{equation*} - E(u):=\dfrac{1}{2}\int\limits_{\Omega} \nabla u \cdot \nabla - \int\limits_{\Omega} fu. + E(u):=\dfrac{1}{2}\int\limits_{\Omega} \nabla u \cdot \nabla u - \int\limits_{\Omega} fu. @f} We have to find a solution $u\in G$ of the following minimization problem: @f{equation*} @@ -157,7 +158,7 @@ This yields: with @f{align*} a(u,v) &:= \left(\nabla u, \nabla v\right),\quad &&u,v\in V\\ - b(u,\mu) &:= \langle g-u,\mu\rangle,\quad &&u\in V,\quad\mu\in V'. + b(u,\mu) &:= \langle u,\mu\rangle,\quad &&u\in V,\quad\mu\in V'. @f} In other words, we can consider $\lambda$ as the negative of the additional, positive force that the obstacle exerts on the membrane. The inequality in the second line of the @@ -165,9 +166,8 @@ statement above only appears to have the wrong sign because we have $\mu-\lambda<0$ at points where $\lambda=0$, given the definition of $K$. The existence and uniqueness of $(u,\lambda)\in V\times K$ of this saddle -point problem has been stated in Grossmann and Roos: Numerical treatment of -partial differential equations, Springer-Verlag, Heidelberg-Berlin, 2007, 596 -pages, ISBN 978-3-540-71582-5. +point problem has been stated in Glowinski, Lions and Tr\'{e}moli\`{e}res: Numerical Analysis of Variational +Inequalities, North-Holland, 1981. diff --git a/deal.II/examples/step-41/step-41.cc b/deal.II/examples/step-41/step-41.cc index e5639e8a4e..a3d015cb24 100644 --- a/deal.II/examples/step-41/step-41.cc +++ b/deal.II/examples/step-41/step-41.cc @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-42/doc/intro-step-42.tex b/deal.II/examples/step-42/doc/intro-step-42.tex index a7e1fce28d..68f3e495d1 100644 --- a/deal.II/examples/step-42/doc/intro-step-42.tex +++ b/deal.II/examples/step-42/doc/intro-step-42.tex @@ -62,39 +62,42 @@ vanishes, because we consider a frictionless situation and the normal stress is As a starting point we want to minimise an energy functional: $$E(\tau) := \dfrac{1}{2}\int\limits_{\Omega}\tau A \tau d\tau,\quad \tau\in \Pi W^{div}$$ with -$$W^{div}:=\lbrace \tau\in L^2(\Omega,\mathbb{R}^{dim\times\dim}_{sym}),div(\tau)\in L^2(\Omega,\mathbb{R}^{dim})\rbrace$$ -and +$$W^{div}:=\lbrace \tau\in +L^2(\Omega,\mathbb{R}^{dim\times\dim}_{sym}):div(\tau)\in L^2(\Omega,\mathbb{R}^{dim})\rbrace$$ and $$\Pi \Sigma:=\lbrace \tau\in \Sigma, \mathcal{F}(\tau)\leq 0\rbrace$$ as the set of admissible stresses which is defined by a continious, convex flow function $\mathcal{F}$. With the goal to derive the dual formulation of the minimisation problem, we define a lagrange function: -$$L(\tau,\varphi) := E(\tau) + (\varphi, div(\tau)),\quad \lbrace\tau,\varphi\rbrace\in\Pi W^{div}\times U$$ -with $U := \lbrace u\in H^1(\Omega), u = g \text{ on } \Gamma_D,u_n\leq 0 \text{ on } \Gamma_C \rbrace$.\\ +$$L(\tau,\varphi) := E(\tau) + (\varphi, div(\tau)),\quad \lbrace\tau,\varphi\rbrace\in\Pi W^{div}\times V^+$$ +with +$$V^+ := \lbrace u\in V: u_n\leq g \text{ on } \Gamma_C \rbrace$$ +$$V:=\left[ H_0^1 \right]^{dim}:=\lbrace u\in \left[H^1(\Omega)\right]^{dim}: u += 0 \text{ on } \Gamma_D\rbrace$$ By building the fr\'echet derivatives of $L$ for both components we obtain the dual formulation for the stationary case which is known as \textbf{Hencky-Type-Model}:\\ -Find a pair $\lbrace\sigma,u\rbrace\in \Pi W\times U$ with +Find a pair $\lbrace\sigma,u\rbrace\in \Pi W\times V^+$ with $$\left(A\sigma,\tau - \sigma\right) + \left(u, div(\tau) - div(\sigma)\right) \geq 0,\quad \forall \tau\in \Pi W^{div}$$ -$$-\left(div(\sigma),\varphi - u\right) \geq 0,\quad \forall \varphi\in U.$$ +$$-\left(div(\sigma),\varphi - u\right) \geq 0,\quad \forall \varphi\in V^+.$$ By integrating by parts and multiplying the first inequality by $C=A^{-1}$ we achieve the primal-mixed version of our problem:\\ -Find a pair $\lbrace\sigma,u\rbrace\in \Pi W\times U$ with +Find a pair $\lbrace\sigma,u\rbrace\in \Pi W\times V^+$ with $$\left(\sigma,\tau - \sigma\right) - \left(C\varepsilon(u), \tau - \sigma\right) \geq 0,\quad \forall \tau\in \Pi W$$ -$$\left(\sigma,\varepsilon(\varphi) - \varepsilon(u)\right) \geq 0,\quad \forall \varphi\in U.$$ +$$\left(\sigma,\varepsilon(\varphi) - \varepsilon(u)\right) \geq 0,\quad \forall \varphi\in V^+.$$ Therein $\varepsilon$ denotes the linearised deformation tensor with $\varepsilon(u) := \dfrac{1}{2}\left(\nabla u + \nabla u^T\right)$ for small deformations.\\ Most materials - especially metals - have the property that they show some hardening effects during the forming process. There are different constitutive laws to describe those material behaviour. The most simple one is called linear isotropic hardening with the flow function $\mathcal{F}(\tau,\eta) = \vert\tau^D\vert - (\sigma_0 + \gamma\eta)$. It can be considered by establishing an additional term in our primal-mixed formulation:\\ -Find a pair $\lbrace(\sigma,\xi),u\rbrace\in \Pi (W\times L^2(\Omega,\mathbb{R}))\times U$ with +Find a pair $\lbrace(\sigma,\xi),u\rbrace\in \Pi (W\times L^2(\Omega,\mathbb{R}))\times V^+$ with $$\left(\sigma,\tau - \sigma\right) - \left(C\varepsilon(u), \tau - \sigma\right) + \gamma\left( \xi, \eta - \xi\right) \geq 0,\quad \forall (\tau,\eta)\in \Pi (W,L^2(\Omega,\mathbb{R}))$$ -$$\left(\sigma,\varepsilon(\varphi) - \varepsilon(u)\right) \geq 0,\quad \forall \varphi\in U,$$ +$$\left(\sigma,\varepsilon(\varphi) - \varepsilon(u)\right) \geq 0,\quad \forall \varphi\in V^+,$$ with the hardening parameter $\gamma > 0$.\\ Now we want to derive a primal problem which only depends on the displacement $u$. For that purpose we set $\eta = \xi$ and eliminate the stress $\sigma$ by applying the projection theorem on\\ $$\left(\sigma - C\varepsilon(u), \tau - \sigma\right) \geq 0,\quad \forall \tau\in \Pi W,$$ which yields with the second inequality:\\ -Find the displacement $u\in U$ with -$$\left(P_{\Pi}(C\varepsilon(u)),\varepsilon(\varphi) - \varepsilon(u)\right) \geq 0,\quad \forall \varphi\in U,$$ +Find the displacement $u\in V^+$ with +$$\left(P_{\Pi}(C\varepsilon(u)),\varepsilon(\varphi) - \varepsilon(u)\right) \geq 0,\quad \forall \varphi\in V^+,$$ with the projection: $$P_{\Pi}(\tau):=\begin{cases} \tau, & \text{if }\vert\tau^D\vert \leq \sigma_0 + \gamma\xi,\\ @@ -111,7 +114,7 @@ $$\alpha := \sigma_0 + \dfrac{\gamma}{2\mu+\gamma}\left(\vert\tau^D\vert - \sigm with a further material parameter $\mu>0$ called shear modulus.\\ So what we do is to calculate the stresses by using Hooke's law for linear elastic, isotropic materials $$\sigma = C \varepsilon(u) = 2\mu \varepsilon^D(u) + \kappa tr(\varepsilon(u))I = \left[2\mu\left(\mathbb{I} -\dfrac{1}{3} I\otimes I\right) + \kappa I\otimes I\right]\varepsilon(u)$$ -with the new material parameter $\kappa>0$ (bulk modulus). The variables $I$ and $\mathbb{I}$ denote the identity tensors of second and forth order.\\ +with the material parameter $\kappa>0$ (bulk modulus). The variables $I$ and $\mathbb{I}$ denote the identity tensors of second and forth order.\\ In the next step we test in a pointwise sense where the deviator part of the stress in a norm is bigger as the yield stress. If there are such points we project the deviator stress in those points back to the yield surface. Methods of this kind are called projections algorithm or radial-return-algorithm.\\ @@ -126,25 +129,28 @@ method - inexact since we use an iterative solver for the linearised problems in For the newton method we have to linearise the following semi-linearform $$a(\psi;\varphi) := \left(P_{\Pi}(C\varepsilon(\varphi)),\varepsilon(\varphi)\right).$$ -Becaus we have to find the solution $u$ in the convex set $U$, we have to apply an SQP-method (SQP: sequential quadratic +Becaus we have to find the solution $u$ in the convex set $V^+$, we have to apply an SQP-method (SQP: sequential quadratic programming). That means we have to solve a minimisation problem for a known $u^i$ in every SQP-step of the form \begin{eqnarray*} & & a(u^{i};u^{i+1} - u^i) + \dfrac{1}{2}a'(u^i;u^{i+1} - u^i,u^{i+1} - u^i)\\ &=& a(u^i;u^{i+1}) - a(u^i;u^i) +\\ & & \dfrac{1}{2}\left( a'(u^i;u^{i+1},u^{i+1}) - 2a'(u^i;u^i,u^{i+1}) - a'(u^i;u^i,u^i)\right)\\ - &\rightarrow& min,\quad u^{i+1}\in U. + &\rightarrow& min,\quad u^{i+1}\in V^+. \end{eqnarray*} Neglecting the constant terms $ a(u^i;u^i)$ and $ a'(u^i;u^i,u^i)$ we obtain the following minimisation problem -$$\dfrac{1}{2} a'(u^i;u^{i+1},u^{i+1}) - F(u^i)\rightarrow min,\quad u^{i+1}\in U$$ +$$\dfrac{1}{2} a'(u^i;u^{i+1},u^{i+1}) - F(u^i)\rightarrow min,\quad u^{i+1}\in V^+$$ with $$F(\varphi) := \left(a'(\varphi;\varphi,u^{i+1}) - a(\varphi;u^{i+1}) \right).$$ -In the case of our constitutive law the derivitive of the semi-linearform $a(.;.)$ at the point $u^i$ is +In the case of our constitutive law the derivative of the semi-linearform $a(.;.)$ at the point $u^i$ is $$a'(u^i;\psi,\varphi) =$$ $$ \begin{cases} -\left(\left[2\mu\left(\mathbb{I} - \dfrac{1}{3} I\otimes I\right) + \kappa I\otimes I\right]\varepsilon(\psi),\varepsilon(\varphi)\right), & \quad \vert\tau^D\vert \leq \sigma_0\\ -\left(\left[\dfrac{\alpha}{\vert\tau^D\vert}2\mu\left(\mathbb{I} - \dfrac{1}{3} I\otimes I - \dfrac{\tau^D\otimes\tau^D}{\vert\tau^D\vert}\right) + \kappa I\otimes I\right]\varepsilon(\psi),\varepsilon(\varphi) \right), & \quad \vert\tau^D\vert > \sigma_0 +\left(\left[2\mu\left(\mathbb{I} - \dfrac{1}{3} I\otimes I\right) + \kappa I\otimes I\right]\varepsilon(\psi),\varepsilon(\varphi)\right), & \quad + \vert \tau^D \vert \leq \sigma_0\\ +\left(\left[\dfrac{\alpha}{\vert\tau^D\vert}2\mu\left(\mathbb{I} - \dfrac{1}{3} I\otimes I - \dfrac{\tau^D\otimes\tau^D}{\vert\tau^D\vert}\right) + + \kappa I\otimes I\right]\varepsilon(\psi),\varepsilon(\varphi) \right), & + \quad \vert \tau^D \vert > \sigma_0 \end{cases} $$ with @@ -154,13 +160,59 @@ Again the first case is for elastic and the second for plastic deformation. \section{Formulation as a saddle point problem} On the line of step-41 we compose a saddle point problem out of the minimisation problem. Again we do so to gain a formulation -that allows us to solve a linear system of equations finally. +that allows us to solve a linear system of equations finally.\\ +We introduce a Lagrange multiplier $\lambda$ and the convex cone $K\subset W'$, +$W'$ dual space of the trace space $W$ of $V$ restricted to $\Gamma_C$, +$$K:=\{\mu\in W':\mu_T = 0,\quad\langle\mu n,v\rangle_{\Gamma_C}\geq 0,\quad +\forall v\in W, v \ge 0\text{ on }\Gamma_C \}$$ +of Lagrange multipliers, where $\langle\cdot,\cdot\rangle$ +denotes the duality pairing between $W'$ and $W$. Intuitively, $K$ is the cone +of all "non-positive functions", except that $ K\subset +\left( \left[ H_0^{\frac{1}{2}} \right]^{dim} \right)' $ and so contains other +objects besides regular functions as well. This yields:\\ + +\noindent +\textit{Find $u\in V$ and $\lambda\in K$ such that} +\begin{align*} + \hat{a}(u,v) + b(v,\lambda) &= f(v),\quad &&v\in V\\ + b(u,\mu - \lambda) &\leq \langle g,(\mu - + \lambda)n\rangle_{\Gamma_C},\quad&&\mu\in K, +\end{align*} +\textit{with} +\begin{align*} + \hat{a}(u,v) &:= a'(u^i;u,v)\\ + b(u,\mu) &:= \langle un,\mu n\rangle_{\Gamma_C},\quad &&u\in V,\quad\mu\in W'. +\end{align*} +As in the section before $u^i$ denotes the linearization point for the +semi-linearform $a(.;.)$. In contrast to step-41 we directly consider $\lambda$ +as the additional, positive force $\sigma(u)n$ that the obstacle +exerts on the boundary $\Gamma_C$ of the body.\\ + +\noindent +The existence and uniqueness of $(u,\lambda)\in V\times K$ of this saddle point +problem has been stated in Glowinski, Lions and Tr\'{e}moli\`{e}res: Numerical +Analysis of Variational Inequalities, North-Holland, 1981.\\ + +\noindent +NOTE: In this example as well as in the further documentation we make the +assumption that the normal vector $n$ equals to $(0,0,1)$. This comes up with +the starting condition of our deformable body. \section{Active Set methods to solve the saddle point problem} -\section{The primal-dual active set algorithm combined with the inexact semi smooth newton method} +The linearized problem is essentially like a pure elastic problem with contact like +in step-41. The only difference consists in the fact that the contact area +adjudges at the boundary instead of in the domain. But this has no further consequence +so that we refer to the documentation of step-41 with the only hint that +$\mathcal{S}$ containts all the vertices at the contact boundary $\Gamma_C$ this +time. + +\section{The primal-dual active set algorithm combined with the inexact semi smooth +newton method} -The inexact newton method works as follows: +Now we describe an algorithm that combines the newton-method, which we use for +the nonlinear constitutive law, with the semismooth newton method for the contact. It +works as follows: \begin{itemize} \item[(0)] Initialize $\mathcal{A}_k$ and $\mathcal{F}_k$, such that $\mathcal{S} = \mathcal{A}_k \cup \mathcal{F}_k$ and $\mathcal{A}_k \cap \mathcal{F}_k = \emptyset$ and set $k = 1$. \item[(1)] Assembel the newton matrix $a'(U^k;\varphi_i,\varphi_j)$ and the right-hand-side $F(U^k)$. @@ -172,11 +224,15 @@ The inexact newton method works as follows: \end{align*} % Note that $\mathcal{S}$ contains only dofs related to the boundary $\Gamma_C$. So in contrast to step-41 there are much more than $\vert \mathcal{S}\vert$ equations necessary to determine $U$ and $\Lambda$. \item[(3)] Define the new active and inactive sets by - $$\mathcal{A}_{k+1}:=\lbrace i\in\mathcal{S}:\Lambda^k_i + c\left(\left[BU^k\right]_i - G_i\left) < 0\rbrace,$$ - $$\mathcal{F}_{k+1}:=\lbrace i\in\mathcal{S}:\Lambda^k_i + c\left(\left[BU^k\right]_i - G_i\left) \geq 0\rbrace.$$ - \item[(4)] If $\mathcal{A}_{k+1} = \mathcal{A}_k$ and $\vert F(U^{k+1}\vert < \delta$ then stop, else set $k=k+1$ and go to step (1). + $$\mathcal{A}_{k+1}:=\lbrace i\in\mathcal{S}:\Lambda^k_i + + c\left(\left[BU^k\right]_i - G_i\right) > 0\rbrace,$$ + $$\mathcal{F}_{k+1}:=\lbrace i\in\mathcal{S}:\Lambda^k_i + + c\left(\left[BU^k\right]_i - G_i\right) \leq 0\rbrace.$$ + \item[(4)] If $\mathcal{A}_{k+1} = \mathcal{A}_k$ and $\vert + F\left(U^{k+1}\right) \vert < \delta$ then stop, else set $k=k+1$ and go to + step (1). \end{itemize} \section{Implementation} -\end{document} \ No newline at end of file +\end{document} diff --git a/deal.II/examples/step-42/step-42.cc b/deal.II/examples/step-42/step-42.cc index 1f434510dd..3085e6a0ce 100644 --- a/deal.II/examples/step-42/step-42.cc +++ b/deal.II/examples/step-42/step-42.cc @@ -12,11 +12,8 @@ // @sect3{Include files} - // The first few (many?) include - // files have already been used in - // the previous example, so we will - // not explain their meaning here - // again. + // We are using the the same + // include files as in step-42: #include #include @@ -31,8 +28,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -57,1429 +54,1356 @@ #include #include +#include #include #include #include #include #include - // This is new, however: in the previous - // example we got some unwanted output from - // the linear solvers. If we want to suppress - // it, we have to include this file and add a - // single line somewhere to the program (see - // the main() function below for that): -#include - - // The final step, as in previous - // programs, is to import all the - // deal.II class and function names - // into the global namespace: -using namespace dealii; - // @sect3{The Step4 class template} - -template class ConstitutiveLaw; +#include -template -class Step4 +namespace Step42 { -public: - Step4 (int _n_refinements_global, int _n_refinements_local); - void run (); - -private: - void make_grid (); - void setup_system(); - void assemble_mass_matrix (); - void assemble_nl_system (TrilinosWrappers::MPI::Vector &u); - void residual_nl_system (TrilinosWrappers::MPI::Vector &u, - Vector &sigma_eff_vector); - void projection_active_set (); - void dirichlet_constraints (); - void solve (); - void solve_newton (); - void output_results (const std::string& title) const; - void move_mesh (const TrilinosWrappers::MPI::Vector &_complete_displacement) const; - void output_results (TrilinosWrappers::MPI::Vector vector, const std::string& title) const; - void output_results (Vector vector, const std::string& title) const; - - MPI_Comm mpi_communicator; - - parallel::distributed::Triangulation triangulation; - - FESystem fe; - DoFHandler dof_handler; - - IndexSet locally_owned_dofs; - IndexSet locally_relevant_dofs; - - int n_refinements_global; - int n_refinements_local; - unsigned int number_iterations; - std::vector run_time; - - ConstraintMatrix constraints; - ConstraintMatrix constraints_hanging_nodes; - ConstraintMatrix constraints_dirichlet_hanging_nodes; - - TrilinosWrappers::SparseMatrix system_matrix_newton; - TrilinosWrappers::SparseMatrix mass_matrix; - - TrilinosWrappers::MPI::Vector solution; - TrilinosWrappers::MPI::Vector old_solution; - TrilinosWrappers::MPI::Vector system_rhs_newton; - TrilinosWrappers::MPI::Vector resid_vector; - TrilinosWrappers::MPI::Vector diag_mass_matrix_vector; - IndexSet active_set; - - ConditionalOStream pcout; - - TrilinosWrappers::PreconditionAMG::AdditionalData additional_data; - TrilinosWrappers::PreconditionAMG preconditioner_u; - TrilinosWrappers::PreconditionAMG preconditioner_t; - - std::auto_ptr > plast_lin_hard; - - double sigma_0; // Yield stress - double gamma; // Parameter for the linear isotropic hardening - double e_modul; // E-Modul - double nu; // Poisson ratio - - std_cxx1x::shared_ptr Mp_preconditioner; -}; - -template -class ConstitutiveLaw -{ -public: - ConstitutiveLaw (double _E, double _nu, double _sigma_0, double _gamma, MPI_Comm _mpi_communicator, ConditionalOStream _pcout); - // ConstitutiveLaw (double mu, double kappa); - void plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor, - SymmetricTensor<2,dim> &strain_tensor, - unsigned int &elast_points, - unsigned int &plast_points, - double &sigma_eff, - double &yield); - void linearized_plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor_linearized, - SymmetricTensor<4,dim> &stress_strain_tensor, - SymmetricTensor<2,dim> &strain_tensor); - inline SymmetricTensor<2,dim> get_strain (const FEValues &fe_values, - const unsigned int shape_func, - const unsigned int q_point) const; - -private: - SymmetricTensor<4,dim> stress_strain_tensor_mu; - SymmetricTensor<4,dim> stress_strain_tensor_kappa; - double E; - double nu; - double sigma_0; - double gamma; - double mu; - double kappa; - MPI_Comm mpi_communicator; - ConditionalOStream pcout; -}; - -template -ConstitutiveLaw::ConstitutiveLaw(double _E, double _nu, double _sigma_0, double _gamma, MPI_Comm _mpi_communicator, ConditionalOStream _pcout) - :E (_E), - nu (_nu), - sigma_0 (_sigma_0), - gamma (_gamma), - mpi_communicator (_mpi_communicator), - pcout (_pcout) -{ - mu = E/(2*(1+nu)); - kappa = E/(3*(1-2*nu)); - pcout<< "-----> mu = " << mu << ", kappa = " << kappa <(), unit_symmetric_tensor()); - stress_strain_tensor_mu = 2*mu*(identity_tensor() - outer_product(unit_symmetric_tensor(), unit_symmetric_tensor())/3.0); -} + using namespace dealii; + + // @sect3{The PlasticityContactProblem class template} + + // This class provides an interface + // for a constitutive law. In this + // example we are using an elastic + // plastic material with linear, + // isotropic hardening. + + template class ConstitutiveLaw; + + // @sect3{The PlasticityContactProblem class template} + + // This class supplies all function + // and variables needed to describe + // the nonlinear contact problem. It is + // close to step-41 but with some additional + // features like: handling hanging nodes, + // a newton method, using Trilinos and p4est + // for parallel distributed computing. + // To deal with hanging nodes makes + // life a bit more complicated since + // we need an other ConstraintMatrix now. + // We create a newton method for the + // active set method for the contact + // situation and to handle the nonlinear + // operator for the constitutive law. -template -inline -SymmetricTensor<2,dim> ConstitutiveLaw::get_strain (const FEValues &fe_values, - const unsigned int shape_func, - const unsigned int q_point) const -{ - const FEValuesExtractors::Vector displacement (0); - SymmetricTensor<2,dim> tmp; + template + class PlasticityContactProblem + { + public: + PlasticityContactProblem (int _n_refinements_global, int _n_refinements_local); + void run (); - tmp = fe_values[displacement].symmetric_gradient (shape_func,q_point); + private: + void make_grid (); + void setup_system(); + void assemble_nl_system (TrilinosWrappers::MPI::Vector &u); + void residual_nl_system (TrilinosWrappers::MPI::Vector &u); + void assemble_mass_matrix_diagonal (TrilinosWrappers::SparseMatrix &mass_matrix); + void update_solution_and_constraints (); + void dirichlet_constraints (); + void solve (); + void solve_newton (); + void refine_grid (); + void move_mesh (const TrilinosWrappers::MPI::Vector &_complete_displacement) const; + void output_results (const std::string& title) const; - return tmp; -} + int n_refinements_global; + int n_refinements_local; -template -void ConstitutiveLaw::plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor, - SymmetricTensor<2,dim> &strain_tensor, - unsigned int &elast_points, - unsigned int &plast_points, - double &sigma_eff, - double &yield) -{ - if (dim == 3) - { - SymmetricTensor<2,dim> stress_tensor; - stress_tensor = (stress_strain_tensor_kappa + stress_strain_tensor_mu)*strain_tensor; - double tmp = E/((1+nu)*(1-2*nu)); + MPI_Comm mpi_communicator; - SymmetricTensor<2,dim> deviator_stress_tensor = deviator(stress_tensor); + parallel::distributed::Triangulation triangulation; - double deviator_stress_tensor_norm = deviator_stress_tensor.norm (); + FESystem fe; + DoFHandler dof_handler; - yield = 0; - stress_strain_tensor = stress_strain_tensor_mu; - double beta = 1.0; - if (deviator_stress_tensor_norm >= sigma_0) - { - beta = (sigma_0 + gamma)/deviator_stress_tensor_norm; - stress_strain_tensor *= beta; - yield = 1; - plast_points += 1; - } - else - elast_points += 1; + IndexSet locally_owned_dofs; + IndexSet locally_relevant_dofs; -// std::cout<< beta < run_time; - sigma_eff = beta * deviator_stress_tensor_norm; - } -} + ConstraintMatrix constraints; + ConstraintMatrix constraints_hanging_nodes; + ConstraintMatrix constraints_dirichlet_hanging_nodes; -template -void ConstitutiveLaw::linearized_plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor_linearized, - SymmetricTensor<4,dim> &stress_strain_tensor, - SymmetricTensor<2,dim> &strain_tensor) -{ - if (dim == 3) - { - SymmetricTensor<2,dim> stress_tensor; - stress_tensor = (stress_strain_tensor_kappa + stress_strain_tensor_mu)*strain_tensor; - double tmp = E/((1+nu)*(1-2*nu)); + TrilinosWrappers::SparseMatrix system_matrix_newton; - stress_strain_tensor = stress_strain_tensor_mu; - stress_strain_tensor_linearized = stress_strain_tensor_mu; + TrilinosWrappers::MPI::Vector solution; + TrilinosWrappers::MPI::Vector old_solution; + TrilinosWrappers::MPI::Vector system_rhs_newton; + TrilinosWrappers::MPI::Vector resid_vector; + TrilinosWrappers::MPI::Vector diag_mass_matrix_vector; + IndexSet active_set; - SymmetricTensor<2,dim> deviator_stress_tensor = deviator(stress_tensor); + ConditionalOStream pcout; - double deviator_stress_tensor_norm = deviator_stress_tensor.norm (); + TrilinosWrappers::PreconditionAMG::AdditionalData additional_data; + TrilinosWrappers::PreconditionAMG preconditioner_u; + TrilinosWrappers::PreconditionAMG preconditioner_t; - double beta = 1.0; - if (deviator_stress_tensor_norm >= sigma_0) - { - beta = (sigma_0 + gamma)/deviator_stress_tensor_norm; - stress_strain_tensor *= beta; - stress_strain_tensor_linearized *= beta; - deviator_stress_tensor /= deviator_stress_tensor_norm; - stress_strain_tensor_linearized -= beta*2*mu*outer_product(deviator_stress_tensor, deviator_stress_tensor); - } + std::auto_ptr > plast_lin_hard; - stress_strain_tensor += stress_strain_tensor_kappa; - stress_strain_tensor_linearized += stress_strain_tensor_kappa; - } -} + double sigma_0; // Yield stress + double gamma; // Parameter for the linear isotropic hardening + double e_modul; // E-Modul + double nu; // Poisson ratio + }; -namespace EquationData -{ template - class RightHandSide : public Function + class ConstitutiveLaw { public: - RightHandSide () : Function(dim) {} - - virtual double value (const Point &p, - const unsigned int component = 0) const; - - virtual void vector_value (const Point &p, - Vector &values) const; + ConstitutiveLaw (double _E, + double _nu, + double _sigma_0, + double _gamma, + MPI_Comm _mpi_communicator, + ConditionalOStream _pcout); + + void plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor, + SymmetricTensor<2,dim> &strain_tensor, + unsigned int &elast_points, + unsigned int &plast_points, + double &yield); + void linearized_plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor_linearized, + SymmetricTensor<4,dim> &stress_strain_tensor, + SymmetricTensor<2,dim> &strain_tensor); + inline SymmetricTensor<2,dim> get_strain (const FEValues &fe_values, + const unsigned int shape_func, + const unsigned int q_point) const; + + private: + SymmetricTensor<4,dim> stress_strain_tensor_mu; + SymmetricTensor<4,dim> stress_strain_tensor_kappa; + double E; + double nu; + double sigma_0; + double gamma; + double mu; + double kappa; + MPI_Comm mpi_communicator; + ConditionalOStream pcout; }; template - double RightHandSide::value (const Point &p, - const unsigned int component) const + ConstitutiveLaw::ConstitutiveLaw(double _E, double _nu, double _sigma_0, double _gamma, MPI_Comm _mpi_communicator, ConditionalOStream _pcout) + :E (_E), + nu (_nu), + sigma_0 (_sigma_0), + gamma (_gamma), + mpi_communicator (_mpi_communicator), + pcout (_pcout) { - double return_value = 0.0; - - if (component == 0) - return_value = 0.0; - if (component == 1) - return_value = 0.0; - if (component == 2) - // if ((p(0)-0.5)*(p(0)-0.5)+(p(1)-0.5)*(p(1)-0.5) < 0.2) - // return_value = -5000; - // else - return_value = 0.0; - // for (unsigned int i=0; i mu = " << mu << ", kappa = " << kappa <(), unit_symmetric_tensor()); + stress_strain_tensor_mu = 2*mu*(identity_tensor() - outer_product(unit_symmetric_tensor(), unit_symmetric_tensor())/3.0); } template - void RightHandSide::vector_value (const Point &p, - Vector &values) const + inline + SymmetricTensor<2,dim> ConstitutiveLaw::get_strain (const FEValues &fe_values, + const unsigned int shape_func, + const unsigned int q_point) const { - for (unsigned int c=0; cn_components; ++c) - values(c) = RightHandSide::value (p, c); - } + const FEValuesExtractors::Vector displacement (0); + SymmetricTensor<2,dim> tmp; + tmp = fe_values[displacement].symmetric_gradient (shape_func,q_point); + + return tmp; + } template - class BoundaryValues : public Function + void ConstitutiveLaw::plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor, + SymmetricTensor<2,dim> &strain_tensor, + unsigned int &elast_points, + unsigned int &plast_points, + double &yield) { - public: - BoundaryValues () : Function(dim) {}; - - virtual double value (const Point &p, - const unsigned int component = 0) const; + if (dim == 3) + { + SymmetricTensor<2,dim> stress_tensor; + stress_tensor = (stress_strain_tensor_kappa + stress_strain_tensor_mu)*strain_tensor; + double tmp = E/((1+nu)*(1-2*nu)); - virtual void vector_value (const Point &p, - Vector &values) const; - }; + SymmetricTensor<2,dim> deviator_stress_tensor = deviator(stress_tensor); - template - double BoundaryValues::value (const Point &p, - const unsigned int component) const - { - double return_value = 0; + double deviator_stress_tensor_norm = deviator_stress_tensor.norm (); - if (component == 0) - return_value = 0.0; - if (component == 1) - return_value = 0.0; - if (component == 2) - return_value = 0.0; + yield = 0; + stress_strain_tensor = stress_strain_tensor_mu; + double beta = 1.0; + if (deviator_stress_tensor_norm >= sigma_0) + { + beta = (sigma_0 + gamma)/deviator_stress_tensor_norm; + stress_strain_tensor *= beta; + yield = 1; + plast_points += 1; + } + else + elast_points += 1; - return return_value; + stress_strain_tensor += stress_strain_tensor_kappa; + } } template - void BoundaryValues::vector_value (const Point &p, - Vector &values) const + void ConstitutiveLaw::linearized_plast_linear_hardening (SymmetricTensor<4,dim> &stress_strain_tensor_linearized, + SymmetricTensor<4,dim> &stress_strain_tensor, + SymmetricTensor<2,dim> &strain_tensor) { - for (unsigned int c=0; cn_components; ++c) - values(c) = BoundaryValues::value (p, c); - } - + if (dim == 3) + { + SymmetricTensor<2,dim> stress_tensor; + stress_tensor = (stress_strain_tensor_kappa + stress_strain_tensor_mu)*strain_tensor; + double tmp = E/((1+nu)*(1-2*nu)); - template - class Obstacle : public Function - { - public: - Obstacle () : Function(dim) {}; + stress_strain_tensor = stress_strain_tensor_mu; + stress_strain_tensor_linearized = stress_strain_tensor_mu; - virtual double value (const Point &p, - const unsigned int component = 0) const; + SymmetricTensor<2,dim> deviator_stress_tensor = deviator(stress_tensor); - virtual void vector_value (const Point &p, - Vector &values) const; - }; + double deviator_stress_tensor_norm = deviator_stress_tensor.norm (); - template - double Obstacle::value (const Point &p, - const unsigned int component) const - { - double R = 0.03; - double return_value = 0.0; - if (component == 0) - return_value = p(0); - if (component == 1) - return_value = p(1); - if (component == 2) + double beta = 1.0; + if (deviator_stress_tensor_norm >= sigma_0) { - // double hz = 0.98; - // double position_x = 0.5; - // double alpha = 12.0; - // double s_x = 0.5039649116; - // double s_y = hz + 0.00026316298; - // if (p(0) > position_x - R && p(0) < s_x) - // { - // return_value = -sqrt(R*R - (p(0)-position_x)*(p(0)-position_x)) + hz + R; - // } - // else if (p(0) >= s_x) - // { - // return_value = 12.0/90.0*p(0) + (s_y - alpha/90.0*s_x); - // } - // else - // return_value = 1e+10; - - // Hindernis Dortmund - double x1 = p(0); - double x2 = p(1); - if (((x2-0.5)*(x2-0.5)+(x1-0.5)*(x1-0.5)<=0.3*0.3)&&((x2-0.5)*(x2-0.5)+(x1-1.0)*(x1-1.0)>=0.4*0.4)&&((x2-0.5)*(x2-0.5)+x1*x1>=0.4*0.4)) - return_value = 0.999; - else - return_value = 1e+10; - - // Hindernis Werkzeug TKSE - // double shift_walze_x = 0.0; - // double shift_walze_y = 0.0; - // return_value = 0.032 + data->dicke - input_copy->mikro_height (p(0) + shift_walze_x, p(1) + shift_walze_y, p(2)); - - // Ball with radius R - // double R = 0.5; - // if (std::pow ((p(0)-1.0/2.0), 2) + std::pow ((p(1)-1.0/2.0), 2) < R*R) - // return_value = 1.0 + R - 0.001 - sqrt (R*R - std::pow ((p(0)-1.0/2.0), 2) - // - std::pow ((p(1)-1.0/2.0), 2)); - // else - // return_value = 1e+5; + beta = (sigma_0 + gamma)/deviator_stress_tensor_norm; + stress_strain_tensor *= beta; + stress_strain_tensor_linearized *= beta; + deviator_stress_tensor /= deviator_stress_tensor_norm; + stress_strain_tensor_linearized -= beta*2*mu*outer_product(deviator_stress_tensor, deviator_stress_tensor); } - return return_value; - // return 1e+10;//0.98; + stress_strain_tensor += stress_strain_tensor_kappa; + stress_strain_tensor_linearized += stress_strain_tensor_kappa; + } } - template - void Obstacle::vector_value (const Point &p, - Vector &values) const + namespace EquationData { - for (unsigned int c=0; cn_components; ++c) - values(c) = Obstacle::value (p, c); - } -} + template + class RightHandSide : public Function + { + public: + RightHandSide () : Function(dim) {} + virtual double value (const Point &p, + const unsigned int component = 0) const; - // @sect3{Implementation of the Step4 class} - - // Next for the implementation of the class - // template that makes use of the functions - // above. As before, we will write everything - -template -Step4::Step4 (int _n_refinements_global, int _n_refinements_local) - : - n_refinements_global (_n_refinements_global), - n_refinements_local (_n_refinements_local), - mpi_communicator (MPI_COMM_WORLD), - triangulation (mpi_communicator), - fe (FE_Q(1), dim), - dof_handler (triangulation), - pcout (std::cout, - (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)), - sigma_0 (400), - gamma (1.e-2), - e_modul (2.0e5), - nu (0.3) -{ - // double _E, double _nu, double _sigma_0, double _gamma - plast_lin_hard.reset (new ConstitutiveLaw (e_modul, nu, sigma_0, gamma, mpi_communicator, pcout)); -} + virtual void vector_value (const Point &p, + Vector &values) const; + }; -template -void Step4::make_grid () -{ - std::vector repet(3); - repet[0] = 1;//20; - repet[1] = 1; - repet[2] = 1; - - Point p1 (0,0,0); - Point p2 (1.0, 1.0, 1.0); - GridGenerator::subdivided_hyper_rectangle (triangulation, repet, p1, p2); - - Triangulation<3>::active_cell_iterator - cell = triangulation.begin_active(), - endc = triangulation.end(); - - /* boundary_indicators: - _______ - / 9 /| - /______ / | - 8| | 8| - | 8 | / - |_______|/ - 6 - */ - - for (; cell!=endc; ++cell) - for (unsigned int face=0; face::faces_per_cell; ++face) - { - if (cell->face (face)->center ()[2] == p2(2)) - cell->face (face)->set_boundary_indicator (9); - if (cell->face (face)->center ()[0] == p1(0) || - cell->face (face)->center ()[0] == p2(0) || - cell->face (face)->center ()[1] == p1(1) || - cell->face (face)->center ()[1] == p2(1)) - cell->face (face)->set_boundary_indicator (8); - if (cell->face (face)->center ()[2] == p1(2)) - cell->face (face)->set_boundary_indicator (6); - } + template + double RightHandSide::value (const Point &p, + const unsigned int component) const + { + double return_value = 0.0; + + if (component == 0) + return_value = 0.0; + if (component == 1) + return_value = 0.0; + if (component == 2) + // if ((p(0)-0.5)*(p(0)-0.5)+(p(1)-0.5)*(p(1)-0.5) < 0.2) + // return_value = -5000; + // else + return_value = 0.0; + // for (unsigned int i=0; i + void RightHandSide::vector_value (const Point &p, + Vector &values) const + { + for (unsigned int c=0; cn_components; ++c) + values(c) = RightHandSide::value (p, c); + } - triangulation.refine_global (n_refinements_global); - // Lokale Verfeinerung des Gitters - for (int step=0; step + class BoundaryValues : public Function { - cell = triangulation.begin_active(); // Iterator ueber alle Zellen - - for (; cell!=endc; ++cell) - for (unsigned int face=0; face::faces_per_cell; ++face) - { -// if (cell->face (face)->at_boundary() -// && cell->face (face)->boundary_indicator () == 9) -// { -// cell->set_refine_flag (); -// break; -// } -// else if (cell->level () == n_refinements + n_refinements_local - 1) -// { -// cell->set_refine_flag (); -// break; -// } - -// if (cell->face (face)->at_boundary() -// && cell->face (face)->boundary_indicator () == 9) -// { -// if (cell->face (face)->vertex (0)(0) <= 0.7 && -// cell->face (face)->vertex (1)(0) >= 0.3 && -// cell->face (face)->vertex (0)(1) <= 0.875 && -// cell->face (face)->vertex (2)(1) >= 0.125) -// { -// cell->set_refine_flag (); -// break; -// } -// } - - if (step == 0 && - cell->center ()(2) < n_refinements_local*9.0/64.0) - { - cell->set_refine_flag (); - break; - } - }; - triangulation.execute_coarsening_and_refinement (); + public: + BoundaryValues () : Function(dim) {}; + + virtual double value (const Point &p, + const unsigned int component = 0) const; + + virtual void vector_value (const Point &p, + Vector &values) const; }; -} -template -void Step4::setup_system () -{ - // setup dofs - { - dof_handler.distribute_dofs (fe); + template + double BoundaryValues::value (const Point &p, + const unsigned int component) const + { + double return_value = 0; + + if (component == 0) + return_value = 0.0; + if (component == 1) + return_value = 0.0; + if (component == 2) + return_value = 0.0; + + return return_value; + } - locally_owned_dofs = dof_handler.locally_owned_dofs (); - locally_relevant_dofs.clear(); - DoFTools::extract_locally_relevant_dofs (dof_handler, - locally_relevant_dofs); + template + void BoundaryValues::vector_value (const Point &p, + Vector &values) const + { + for (unsigned int c=0; cn_components; ++c) + values(c) = BoundaryValues::value (p, c); + } + + + template + class Obstacle : public Function + { + public: + Obstacle () : Function(dim) {}; + + virtual double value (const Point &p, + const unsigned int component = 0) const; + + virtual void vector_value (const Point &p, + Vector &values) const; + }; + + template + double Obstacle::value (const Point &p, + const unsigned int component) const + { + double R = 0.03; + double return_value = 0.0; + if (component == 0) + return_value = p(0); + if (component == 1) + return_value = p(1); + if (component == 2) + { + // double hz = 0.98; + // double position_x = 0.5; + // double alpha = 12.0; + // double s_x = 0.5039649116; + // double s_y = hz + 0.00026316298; + // if (p(0) > position_x - R && p(0) < s_x) + // { + // return_value = -sqrt(R*R - (p(0)-position_x)*(p(0)-position_x)) + hz + R; + // } + // else if (p(0) >= s_x) + // { + // return_value = 12.0/90.0*p(0) + (s_y - alpha/90.0*s_x); + // } + // else + // return_value = 1e+10; + + // Hindernis Dortmund + double x1 = p(0); + double x2 = p(1); + if (((x2-0.5)*(x2-0.5)+(x1-0.5)*(x1-0.5)<=0.3*0.3)&&((x2-0.5)*(x2-0.5)+(x1-1.0)*(x1-1.0)>=0.4*0.4)&&((x2-0.5)*(x2-0.5)+x1*x1>=0.4*0.4)) + return_value = 0.999; + else + return_value = 1e+10; + + // Hindernis Werkzeug TKSE + // double shift_walze_x = 0.0; + // double shift_walze_y = 0.0; + // return_value = 0.032 + data->dicke - input_copy->mikro_height (p(0) + shift_walze_x, p(1) + shift_walze_y, p(2)); + + // Ball with radius R + // double R = 0.5; + // if (std::pow ((p(0)-1.0/2.0), 2) + std::pow ((p(1)-1.0/2.0), 2) < R*R) + // return_value = 1.0 + R - 0.001 - sqrt (R*R - std::pow ((p(0)-1.0/2.0), 2) + // - std::pow ((p(1)-1.0/2.0), 2)); + // else + // return_value = 1e+5; + } + return return_value; + } + + template + void Obstacle::vector_value (const Point &p, + Vector &values) const + { + for (unsigned int c=0; cn_components; ++c) + values(c) = Obstacle::value (p, c); + } } - // setup hanging nodes and dirichlet constraints + + // @sect3{Implementation of the PlasticityContactProblem class} + + // Next for the implementation of the class + // template that makes use of the functions + // above. As before, we will write everything + + template + PlasticityContactProblem::PlasticityContactProblem (int _n_refinements_global, int _n_refinements_local) + : + n_refinements_global (_n_refinements_global), + n_refinements_local (_n_refinements_local), + mpi_communicator (MPI_COMM_WORLD), + triangulation (mpi_communicator), + fe (FE_Q(1), dim), + dof_handler (triangulation), + pcout (std::cout, + (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)), + sigma_0 (400), + gamma (1.e-2), + e_modul (2.0e5), + nu (0.3) { - // constraints_hanging_nodes.clear (); - constraints_hanging_nodes.reinit (locally_relevant_dofs); - DoFTools::make_hanging_node_constraints (dof_handler, - constraints_hanging_nodes); - constraints_hanging_nodes.close (); - - pcout << "Number of active cells: " - << triangulation.n_active_cells() - << std::endl - << "Total number of cells: " - << triangulation.n_cells() - << std::endl - << "Number of degrees of freedom: " - << dof_handler.n_dofs () - << std::endl; - - dirichlet_constraints (); + // double _E, double _nu, double _sigma_0, double _gamma + plast_lin_hard.reset (new ConstitutiveLaw (e_modul, nu, sigma_0, gamma, mpi_communicator, pcout)); } - // Initialzation for matrices and vectors + template + void PlasticityContactProblem::make_grid () { - solution.reinit (locally_relevant_dofs, mpi_communicator); - system_rhs_newton.reinit (locally_owned_dofs, mpi_communicator); - old_solution.reinit (system_rhs_newton); - resid_vector.reinit (system_rhs_newton); - diag_mass_matrix_vector.reinit (system_rhs_newton); - active_set.set_size (locally_relevant_dofs.size ()); + std::vector repet(3); + repet[0] = 1;//20; + repet[1] = 1; + repet[2] = 1; + + Point p1 (0,0,0); + Point p2 (1.0, 1.0, 1.0); + GridGenerator::subdivided_hyper_rectangle (triangulation, repet, p1, p2); + + Triangulation<3>::active_cell_iterator + cell = triangulation.begin_active(), + endc = triangulation.end(); + + /* boundary_indicators: + _______ + / 9 /| + /______ / | + 8| | 8| + | 8 | / + |_______|/ + 6 + */ + + for (; cell!=endc; ++cell) + for (unsigned int face=0; face::faces_per_cell; ++face) + { + if (cell->face (face)->center ()[2] == p2(2)) + cell->face (face)->set_boundary_indicator (9); + if (cell->face (face)->center ()[0] == p1(0) || + cell->face (face)->center ()[0] == p2(0) || + cell->face (face)->center ()[1] == p1(1) || + cell->face (face)->center ()[1] == p2(1)) + cell->face (face)->set_boundary_indicator (8); + if (cell->face (face)->center ()[2] == p1(2)) + cell->face (face)->set_boundary_indicator (6); + } + + triangulation.refine_global (n_refinements_global); + + // Lokale Verfeinerung des Gitters +// for (int step=0; step::faces_per_cell; ++face) +// { +// // if (cell->face (face)->at_boundary() +// // && cell->face (face)->boundary_indicator () == 9) +// // { +// // cell->set_refine_flag (); +// // break; +// // } +// // else if (cell->level () == n_refinements + n_refinements_local - 1) +// // { +// // cell->set_refine_flag (); +// // break; +// // } +// +// // if (cell->face (face)->at_boundary() +// // && cell->face (face)->boundary_indicator () == 9) +// // { +// // if (cell->face (face)->vertex (0)(0) <= 0.7 && +// // cell->face (face)->vertex (1)(0) >= 0.3 && +// // cell->face (face)->vertex (0)(1) <= 0.875 && +// // cell->face (face)->vertex (2)(1) >= 0.125) +// // { +// // cell->set_refine_flag (); +// // break; +// // } +// // } +// +// if (step == 0 && +// cell->center ()(2) < n_refinements_local*9.0/64.0) +// { +// cell->set_refine_flag (); +// break; +// } +// }; +// triangulation.execute_coarsening_and_refinement (); +// }; } - // setup sparsity pattern + template + void PlasticityContactProblem::setup_system () { - TrilinosWrappers::SparsityPattern sp (locally_owned_dofs, - mpi_communicator); + // setup dofs + { + dof_handler.distribute_dofs (fe); + + locally_owned_dofs = dof_handler.locally_owned_dofs (); + locally_relevant_dofs.clear(); + DoFTools::extract_locally_relevant_dofs (dof_handler, + locally_relevant_dofs); + } + + // setup hanging nodes and dirichlet constraints + { + constraints_hanging_nodes.clear (); + constraints_hanging_nodes.reinit (locally_relevant_dofs); + DoFTools::make_hanging_node_constraints (dof_handler, + constraints_hanging_nodes); + constraints_hanging_nodes.close (); + + pcout << "Number of active cells: " + << triangulation.n_active_cells() + << std::endl + << "Total number of cells: " + << triangulation.n_cells() + << std::endl + << "Number of degrees of freedom: " + << dof_handler.n_dofs () + << std::endl; + + dirichlet_constraints (); + } - DoFTools::make_sparsity_pattern (dof_handler, sp, constraints_dirichlet_hanging_nodes, false, - Utilities::MPI::this_mpi_process(mpi_communicator)); + // Initialzation for matrices and vectors + { + solution.reinit (locally_relevant_dofs, mpi_communicator); + system_rhs_newton.reinit (locally_owned_dofs, mpi_communicator); + old_solution.reinit (system_rhs_newton); + resid_vector.reinit (system_rhs_newton); + diag_mass_matrix_vector.reinit (system_rhs_newton); + active_set.clear (); + active_set.set_size (locally_relevant_dofs.size ()); + } - sp.compress(); + // setup sparsity pattern + { + TrilinosWrappers::SparsityPattern sp (locally_owned_dofs, + mpi_communicator); - system_matrix_newton.reinit (sp); + DoFTools::make_sparsity_pattern (dof_handler, sp, constraints_dirichlet_hanging_nodes, false, + Utilities::MPI::this_mpi_process(mpi_communicator)); - mass_matrix.reinit (sp); - } + sp.compress(); - assemble_mass_matrix (); - const unsigned int - start = (system_rhs_newton.local_range().first), - end = (system_rhs_newton.local_range().second); - for (unsigned int j=start; j -void Step4::assemble_mass_matrix () -{ - QTrapez face_quadrature_formula; + TrilinosWrappers::SparseMatrix mass_matrix; + mass_matrix.reinit (sp); + assemble_mass_matrix_diagonal (mass_matrix); + const unsigned int + start = (system_rhs_newton.local_range().first), + end = (system_rhs_newton.local_range().second); + for (unsigned int j=start; j fe_values_face (fe, face_quadrature_formula, - update_values | update_quadrature_points | update_JxW_values); + diag_mass_matrix_vector.compress (); + } + } - const unsigned int dofs_per_cell = fe.dofs_per_cell; - const unsigned int dofs_per_face = fe.dofs_per_face; - const unsigned int n_face_q_points = face_quadrature_formula.size(); + template + void PlasticityContactProblem::assemble_nl_system (TrilinosWrappers::MPI::Vector &u) + { + QGauss quadrature_formula(2); + QGauss face_quadrature_formula(2); + + FEValues fe_values (fe, quadrature_formula, + UpdateFlags(update_values | + update_gradients | + update_q_points | + update_JxW_values)); + + FEFaceValues fe_values_face (fe, face_quadrature_formula, + update_values | update_quadrature_points | + update_JxW_values); + + const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int n_q_points = quadrature_formula.size (); + const unsigned int n_face_q_points = face_quadrature_formula.size(); + + const EquationData::RightHandSide right_hand_side; + std::vector > right_hand_side_values (n_q_points, + Vector(dim)); + std::vector > right_hand_side_values_face (n_face_q_points, + Vector(dim)); + + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + Vector cell_rhs (dofs_per_cell); + + std::vector local_dof_indices (dofs_per_cell); + + typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), + endc = dof_handler.end(); + + const FEValuesExtractors::Vector displacement (0); + + TrilinosWrappers::MPI::Vector test_rhs(solution); + const double kappa = 1.0; + for (; cell!=endc; ++cell) + if (cell->is_locally_owned()) + { + fe_values.reinit (cell); + cell_matrix = 0; + cell_rhs = 0; + + right_hand_side.vector_value_list (fe_values.get_quadrature_points(), + right_hand_side_values); + + std::vector > strain_tensor (n_q_points); + fe_values[displacement].get_function_symmetric_gradients (u, strain_tensor); + + for (unsigned int q_point=0; q_point stress_strain_tensor_linearized; + SymmetricTensor<4,dim> stress_strain_tensor; + SymmetricTensor<2,dim> stress_tensor; + + plast_lin_hard->linearized_plast_linear_hardening (stress_strain_tensor_linearized, + stress_strain_tensor, + strain_tensor[q_point]); + + // if (q_point == 0) + // std::cout<< stress_strain_tensor_linearized <get_strain(fe_values, i, q_point); + + for (unsigned int j=0; jget_strain(fe_values, j, q_point) * + fe_values.JxW (q_point)); + } + + // the linearized part a(v^i;v^i,v) of the rhs + cell_rhs(i) += (stress_tensor * + strain_tensor[q_point] * + fe_values.JxW (q_point)); + + // the residual part a(v^i;v) of the rhs + cell_rhs(i) -= (strain_tensor[q_point] * stress_strain_tensor * + plast_lin_hard->get_strain(fe_values, i, q_point) * + fe_values.JxW (q_point)); + + // the residual part F(v) of the rhs + Tensor<1,dim> rhs_values; + rhs_values = 0; + cell_rhs(i) += (fe_values[displacement].value (i, q_point) * + rhs_values * + fe_values.JxW (q_point)); + } + } + + for (unsigned int face=0; face::faces_per_cell; ++face) + { + if (cell->face (face)->at_boundary() + && cell->face (face)->boundary_indicator () == 9) + { + fe_values_face.reinit (cell, face); + + right_hand_side.vector_value_list (fe_values_face.get_quadrature_points(), + right_hand_side_values_face); + + for (unsigned int q_point=0; q_point rhs_values; + rhs_values = 0; + for (unsigned int i=0; iget_dof_indices (local_dof_indices); + constraints.distribute_local_to_global (cell_matrix, cell_rhs, + local_dof_indices, + system_matrix_newton, system_rhs_newton, true); + }; - FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); + system_matrix_newton.compress (); + system_rhs_newton.compress (Add); + } - std::vector local_dof_indices (dofs_per_cell); + template + void PlasticityContactProblem::residual_nl_system (TrilinosWrappers::MPI::Vector &u) + { + QGauss quadrature_formula(2); + QGauss face_quadrature_formula(2); + + FEValues fe_values (fe, quadrature_formula, + UpdateFlags(update_values | + update_gradients | + update_q_points | + update_JxW_values)); + + FEFaceValues fe_values_face (fe, face_quadrature_formula, + update_values | update_quadrature_points | + update_JxW_values); + + const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int n_q_points = quadrature_formula.size (); + const unsigned int n_face_q_points = face_quadrature_formula.size(); + + const EquationData::RightHandSide right_hand_side; + std::vector > right_hand_side_values (n_q_points, + Vector(dim)); + std::vector > right_hand_side_values_face (n_face_q_points, + Vector(dim)); + + Vector cell_rhs (dofs_per_cell); + + std::vector local_dof_indices (dofs_per_cell); + + const FEValuesExtractors::Vector displacement (0); + + typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), + endc = dof_handler.end(); + + unsigned int elast_points = 0; + unsigned int plast_points = 0; + double yield = 0; + unsigned int cell_number = 0; + for (; cell!=endc; ++cell) + if (cell->is_locally_owned()) + { + fe_values.reinit (cell); + cell_rhs = 0; + + right_hand_side.vector_value_list (fe_values.get_quadrature_points(), + right_hand_side_values); + + std::vector > strain_tensor (n_q_points); + fe_values[displacement].get_function_symmetric_gradients (u, strain_tensor); + + for (unsigned int q_point=0; q_point stress_strain_tensor; + SymmetricTensor<2,dim> stress_tensor; + + plast_lin_hard->plast_linear_hardening (stress_strain_tensor, strain_tensor[q_point], + elast_points, plast_points, yield); + + for (unsigned int i=0; iget_strain(fe_values, i, q_point) * + fe_values.JxW (q_point)); + + Tensor<1,dim> rhs_values; + rhs_values = 0; + cell_rhs(i) += ((fe_values[displacement].value (i, q_point) * + rhs_values) * + fe_values.JxW (q_point)); + }; + }; + + for (unsigned int face=0; face::faces_per_cell; ++face) + { + if (cell->face (face)->at_boundary() + && cell->face (face)->boundary_indicator () == 9) + { + fe_values_face.reinit (cell, face); + + right_hand_side.vector_value_list (fe_values_face.get_quadrature_points(), + right_hand_side_values_face); + + for (unsigned int q_point=0; q_point rhs_values; + rhs_values = 0; + for (unsigned int i=0; iget_dof_indices (local_dof_indices); + constraints_dirichlet_hanging_nodes.distribute_local_to_global (cell_rhs, + local_dof_indices, + system_rhs_newton); + + cell_number += 1; + }; - const FEValuesExtractors::Vector displacement (0); + system_rhs_newton.compress (); - typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active(), - endc = dof_handler.end(); + unsigned int sum_elast_points = Utilities::MPI::sum(elast_points, mpi_communicator); + unsigned int sum_plast_points = Utilities::MPI::sum(plast_points, mpi_communicator); + pcout<< "Elast-Points = " << sum_elast_points < + void PlasticityContactProblem::update_solution_and_constraints () + { + clock_t start_proj, end_proj; -template -void Step4::dirichlet_constraints () -{ - /* boundary_indicators: - _______ - / 9 /| - /______ / | - 8| | 8| - | 8 | / - |_______|/ - 6 - */ - - constraints_dirichlet_hanging_nodes.reinit (locally_relevant_dofs); - constraints_dirichlet_hanging_nodes.merge (constraints_hanging_nodes); - - std::vector component_mask (dim, true); - component_mask[0] = true; - component_mask[1] = true; - component_mask[2] = true; - VectorTools::interpolate_boundary_values (dof_handler, - 6, - EquationData::BoundaryValues(), - constraints_dirichlet_hanging_nodes, - component_mask); - - component_mask[0] = true; - component_mask[1] = true; - component_mask[2] = false; - VectorTools::interpolate_boundary_values (dof_handler, - 8, - EquationData::BoundaryValues(), - constraints_dirichlet_hanging_nodes, - component_mask); - constraints_dirichlet_hanging_nodes.close (); -} + const EquationData::Obstacle obstacle; + std::vector vertex_touched (dof_handler.n_dofs (), false); -template -void Step4::solve () -{ - pcout << "Solving ..." << std::endl; - Timer t; + typename DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(), + endc = dof_handler.end(); - TrilinosWrappers::MPI::Vector distributed_solution (system_rhs_newton); - distributed_solution = solution; - - constraints_hanging_nodes.set_zero (distributed_solution); + TrilinosWrappers::MPI::Vector distributed_solution (system_rhs_newton); + distributed_solution = solution; + TrilinosWrappers::MPI::Vector lambda (solution); + lambda = resid_vector; + TrilinosWrappers::MPI::Vector diag_mass_matrix_vector_relevant (solution); + diag_mass_matrix_vector_relevant = diag_mass_matrix_vector; + + constraints.reinit(locally_relevant_dofs); + active_set.clear (); + IndexSet active_set_locally_owned; + active_set_locally_owned.set_size (locally_owned_dofs.size ()); + const double c = 100.0*e_modul; + + for (; cell!=endc; ++cell) + if (cell->is_locally_owned()) + for (unsigned int face=0; face::faces_per_cell; ++face) + if (cell->face (face)->at_boundary() + && cell->face (face)->boundary_indicator () == 9) + for (unsigned int v=0; v::vertices_per_cell; ++v) + { + unsigned int index_z = cell->face (face)->vertex_dof_index (v,2); + + if (vertex_touched[cell->face (face)->vertex_index(v)] == false) + vertex_touched[cell->face (face)->vertex_index(v)] = true; + else + continue; + + // the local row where + Point point (cell->face (face)->vertex (v)[0],/* + solution (index_x),*/ + cell->face (face)->vertex (v)[1], + cell->face (face)->vertex (v)[2]); + + double obstacle_value = obstacle.value (point, 2); + double solution_index_z = solution (index_z); + double gap = obstacle_value - point (2); + + if (lambda (index_z) + + c * + diag_mass_matrix_vector_relevant (index_z) * + (solution_index_z - gap) + > 0) + { + constraints.add_line (index_z); + constraints.set_inhomogeneity (index_z, gap); + + distributed_solution (index_z) = gap; + + if (locally_relevant_dofs.is_element (index_z)) + active_set.add_index (index_z); + + if (locally_owned_dofs.is_element (index_z)) + active_set_locally_owned.add_index (index_z); + + // std::cout<< index_z << ", " + // << "Error: " << lambda (index_z) + + // diag_mass_matrix_vector_relevant (index_z)*c*(solution_index_z - gap) + // << ", " << lambda (index_z) + // << ", " << diag_mass_matrix_vector_relevant (index_z) + // << ", " << obstacle_value + // << ", " << solution_index_z + // < + void PlasticityContactProblem::dirichlet_constraints () + { + /* boundary_indicators: + _______ + / 9 /| + /______ / | + 8| | 8| + | 8 | / + |_______|/ + 6 + */ + + constraints_dirichlet_hanging_nodes.reinit (locally_relevant_dofs); + constraints_dirichlet_hanging_nodes.merge (constraints_hanging_nodes); + + std::vector component_mask (dim, true); + component_mask[0] = true; + component_mask[1] = true; + component_mask[2] = true; + VectorTools::interpolate_boundary_values (dof_handler, + 6, + EquationData::BoundaryValues(), + constraints_dirichlet_hanging_nodes, + component_mask); + + component_mask[0] = true; + component_mask[1] = true; + component_mask[2] = false; + VectorTools::interpolate_boundary_values (dof_handler, + 8, + EquationData::BoundaryValues(), + constraints_dirichlet_hanging_nodes, + component_mask); + constraints_dirichlet_hanging_nodes.close (); + } + + template + void PlasticityContactProblem::solve () + { + pcout << "Solving ..." << std::endl; + Timer t; - // Solving iterative + TrilinosWrappers::MPI::Vector distributed_solution (system_rhs_newton); + distributed_solution = solution; - MPI_Barrier (mpi_communicator); - t.restart(); + constraints_hanging_nodes.set_zero (distributed_solution); - preconditioner_u.initialize (system_matrix_newton, additional_data); - - MPI_Barrier (mpi_communicator); - t.stop(); - if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) - run_time[6] += t.wall_time(); - - MPI_Barrier (mpi_communicator); - t.restart(); - -// ReductionControl reduction_control (10000, 1e-15, 1e-4); -// SolverCG -// solver (reduction_control, mpi_communicator); -// solver.solve (system_matrix_newton, distributed_solution, system_rhs_newton, preconditioner_u); - - PrimitiveVectorMemory mem; - TrilinosWrappers::MPI::Vector tmp (system_rhs_newton); - const double solver_tolerance = 1e-4 * - system_matrix_newton.residual (tmp, distributed_solution, system_rhs_newton); - SolverControl solver_control (system_matrix_newton.m(), solver_tolerance); - SolverFGMRES - solver(solver_control, mem, - SolverFGMRES:: - AdditionalData(30, true)); - solver.solve(system_matrix_newton, distributed_solution, system_rhs_newton, preconditioner_u); - - pcout << "Initial error: " << solver_control.initial_value() < -void Step4::solve_newton () -{ - double resid=0; - double resid_old=100000; - TrilinosWrappers::MPI::Vector res (system_rhs_newton); - TrilinosWrappers::MPI::Vector tmp_vector (system_rhs_newton); - Timer t; - - std::vector > constant_modes; - std::vector components (dim,true); - components[dim] = false; - DoFTools::extract_constant_modes (dof_handler, components, - constant_modes); - - additional_data.elliptic = true; - additional_data.n_cycles = 1; - additional_data.w_cycle = false; - additional_data.output_details = false; - additional_data.smoother_sweeps = 2; - additional_data.aggregation_threshold = 1e-2; - - IndexSet active_set_old (active_set); - Vector sigma_eff_vector; - sigma_eff_vector.reinit (triangulation.n_active_cells()); - unsigned int j = 0; - unsigned int number_assemble_system = 0; - for (; j<=100;j++) - { - pcout<< " " <(i)); - old_solution = tmp_vector; - old_solution.sadd(1-a,a, distributed_solution); - - MPI_Barrier (mpi_communicator); - t.restart(); - system_rhs_newton = 0; - sigma_eff_vector = 0; - solution = old_solution; - residual_nl_system (solution, sigma_eff_vector); - res = system_rhs_newton; - - const unsigned int - start_res = (res.local_range().first), - end_res = (res.local_range().second); - for (unsigned int n=start_res; n::type_dof_data, - data_component_interpretation); - data_out.add_data_vector (lambda, std::vector(dim, "Residual"), - DataOut::type_dof_data, - data_component_interpretation); - data_out.add_data_vector (active_set, std::vector(dim, "ActiveSet"), - DataOut::type_dof_data, - data_component_interpretation); + pcout << "Initial error: " << solver_control.initial_value() < subdomain (triangulation.n_active_cells()); - for (unsigned int i=0; i filenames; - for (unsigned int i=0; - i + void PlasticityContactProblem::solve_newton () + { + double resid=0; + double resid_old=100000; + TrilinosWrappers::MPI::Vector res (system_rhs_newton); + TrilinosWrappers::MPI::Vector tmp_vector (system_rhs_newton); + Timer t; + + std::vector > constant_modes; + std::vector components (dim,true); + components[dim] = false; + DoFTools::extract_constant_modes (dof_handler, components, + constant_modes); + + additional_data.elliptic = true; + additional_data.n_cycles = 1; + additional_data.w_cycle = false; + additional_data.output_details = false; + additional_data.smoother_sweeps = 2; + additional_data.aggregation_threshold = 1e-2; + + IndexSet active_set_old (active_set); + unsigned int j = 0; + unsigned int number_assemble_system = 0; + for (; j<=100;j++) + { + pcout<< " " <(i)); + old_solution = tmp_vector; + old_solution.sadd(1-a,a, distributed_solution); + + MPI_Barrier (mpi_communicator); + t.restart(); + system_rhs_newton = 0; + solution = old_solution; + residual_nl_system (solution); + res = system_rhs_newton; + + const unsigned int + start_res = (res.local_range().first), + end_res = (res.local_range().second); + for (unsigned int n=start_res; n vertex_touched (triangulation.n_vertices(), - false); - - for (typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active (); - cell != dof_handler.end(); ++cell) - if (cell->is_locally_owned()) - for (unsigned int v=0; v::vertices_per_cell; ++v) - { - if (vertex_touched[cell->vertex_index(v)] == false) - { - vertex_touched[cell->vertex_index(v)] = true; - - Point vertex_displacement; - for (unsigned int d=0; dvertex_dof_index(v,d)) != 0) - vertex_displacement[d] - = _complete_displacement(cell->vertex_dof_index(v,d)); - } - - cell->vertex(v) += vertex_displacement; - } - } -} + } -template -void Step4::output_results (TrilinosWrappers::MPI::Vector vector, - const std::string& title) const -{ - DataOut data_out; + template + void PlasticityContactProblem::move_mesh (const TrilinosWrappers::MPI::Vector &_complete_displacement) const + { + pcout<< "Moving mesh." < vertex_touched (triangulation.n_vertices(), + false); + + for (typename DoFHandler::active_cell_iterator + cell = dof_handler.begin_active (); + cell != dof_handler.end(); ++cell) + if (cell->is_locally_owned()) + for (unsigned int v=0; v::vertices_per_cell; ++v) + { + if (vertex_touched[cell->vertex_index(v)] == false) + { + vertex_touched[cell->vertex_index(v)] = true; + + Point vertex_displacement; + for (unsigned int d=0; dvertex_dof_index(v,d)) != 0) + vertex_displacement[d] + = _complete_displacement(cell->vertex_dof_index(v,d)); + } + + cell->vertex(v) += vertex_displacement; + } + } + } - data_out.attach_dof_handler (dof_handler); - data_out.add_data_vector (vector, "vector_to_plot"); + template + void PlasticityContactProblem::output_results (const std::string& title) const + { + move_mesh (solution); - data_out.build_patches (); + TrilinosWrappers::MPI::Vector lambda (solution); + lambda = resid_vector; - std::ofstream output_vtk (dim == 2 ? - (title + ".vtk").c_str () : - (title + ".vtk").c_str ()); - data_out.write_vtk (output_vtk); -} + DataOut data_out; -template -void Step4::output_results (Vector vector, const std::string& title) const -{ - DataOut data_out; + data_out.attach_dof_handler (dof_handler); - data_out.attach_dof_handler (dof_handler); - data_out.add_data_vector (vector, "vector_to_plot"); + const std::vector + data_component_interpretation + (dim, DataComponentInterpretation::component_is_part_of_vector); + data_out.add_data_vector (solution, std::vector(dim, "Displacement"), + DataOut::type_dof_data, + data_component_interpretation); + data_out.add_data_vector (lambda, std::vector(dim, "Residual"), + DataOut::type_dof_data, + data_component_interpretation); + data_out.add_data_vector (active_set, std::vector(dim, "ActiveSet"), + DataOut::type_dof_data, + data_component_interpretation); - data_out.build_patches (); + Vector subdomain (triangulation.n_active_cells()); + for (unsigned int i=0; i -void Step4::run () -{ - pcout << "Solving problem in " << dim << " space dimensions." << std::endl; + const std::string filename = (title + "-" + + Utilities::int_to_string + (triangulation.locally_owned_subdomain(), 4)); - run_time.resize (8); + std::ofstream output_vtu ((filename + ".vtu").c_str ()); + data_out.write_vtu (output_vtu); - clock_t start, end; + if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) + { + std::vector filenames; + for (unsigned int i=0; + i + void PlasticityContactProblem::run () + { + pcout << "Solving problem in " << dim << " space dimensions." << std::endl; - end = clock(); - run_time[0] = (double)(end-start)/CLOCKS_PER_SEC; + Timer t; + run_time.resize (8); - solve_newton (); + const unsigned int n_cycles = 5; + for (unsigned int cycle=0; cyclemain function} - // And this is the main function. It also - // looks mostly like in step-3, but if you - // look at the code below, note how we first - // create a variable of type - // Step4@<2@> (forcing - // the compiler to compile the class template - // with dim replaced by - // 2) and run a 2d simulation, - // and then we do the whole thing over in 3d. - // - // In practice, this is probably not what you - // would do very frequently (you probably - // either want to solve a 2d problem, or one - // in 3d, but not both at the same - // time). However, it demonstrates the - // mechanism by which we can simply change - // which dimension we want in a single place, - // and thereby force the compiler to - // recompile the dimension independent class - // templates for the dimension we - // request. The emphasis here lies on the - // fact that we only need to change a single - // place. This makes it rather trivial to - // debug the program in 2d where computations - // are fast, and then switch a single place - // to a 3 to run the much more computing - // intensive program in 3d for `real' - // computations. - // - // Each of the two blocks is enclosed in - // braces to make sure that the - // laplace_problem_2d variable - // goes out of scope (and releases the memory - // it holds) before we move on to allocate - // memory for the 3d case. Without the - // additional braces, the - // laplace_problem_2d variable - // would only be destroyed at the end of the - // function, i.e. after running the 3d - // problem, and would needlessly hog memory - // while the 3d run could actually use it. - // - // Finally, the first line of the function is - // used to suppress some output. Remember - // that in the previous example, we had the - // output from the linear solvers about the - // starting residual and the number of the - // iteration where convergence was - // detected. This can be suppressed through - // the deallog.depth_console(0) - // call. - // - // The rationale here is the following: the - // deallog (i.e. deal-log, not de-allog) - // variable represents a stream to which some - // parts of the library write output. It - // redirects this output to the console and - // if required to a file. The output is - // nested in a way so that each function can - // use a prefix string (separated by colons) - // for each line of output; if it calls - // another function, that may also use its - // prefix which is then printed after the one - // of the calling function. Since output from - // functions which are nested deep below is - // usually not as important as top-level - // output, you can give the deallog variable - // a maximal depth of nested output for - // output to console and file. The depth zero - // which we gave here means that no output is - // written. By changing it you can get more - // information about the innards of the - // library. int main (int argc, char *argv[]) { + using namespace dealii; + using namespace Step42; + deallog.depth_console (0); clock_t start, end; @@ -1488,16 +1412,16 @@ int main (int argc, char *argv[]) Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv); { - int _n_refinements_global = 1; + int _n_refinements_global = 2; int _n_refinements_local = 1; - + if (argc == 3) { _n_refinements_global = atoi(argv[1]); _n_refinements_local = atoi(argv[2]); } - - Step4<3> laplace_problem_3d (_n_refinements_global, _n_refinements_local); + + PlasticityContactProblem<3> laplace_problem_3d (_n_refinements_global, _n_refinements_local); laplace_problem_3d.run (); } diff --git a/deal.II/examples/step-43/step-43.cc b/deal.II/examples/step-43/step-43.cc index 0410e92663..551453329d 100644 --- a/deal.II/examples/step-43/step-43.cc +++ b/deal.II/examples/step-43/step-43.cc @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-44/step-44.cc b/deal.II/examples/step-44/step-44.cc index ee3bfd05e4..a60ee65ff4 100644 --- a/deal.II/examples/step-44/step-44.cc +++ b/deal.II/examples/step-44/step-44.cc @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-45/step-45.cc b/deal.II/examples/step-45/step-45.cc index 9a01ff0c5b..1374b9708a 100644 --- a/deal.II/examples/step-45/step-45.cc +++ b/deal.II/examples/step-45/step-45.cc @@ -38,7 +38,7 @@ #include #include -#include +#include #include diff --git a/deal.II/examples/step-46/step-46.cc b/deal.II/examples/step-46/step-46.cc index dbef54992b..54a7383279 100644 --- a/deal.II/examples/step-46/step-46.cc +++ b/deal.II/examples/step-46/step-46.cc @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-47/step-47.cc b/deal.II/examples/step-47/step-47.cc index cb905c9c48..4bcd524b5f 100644 --- a/deal.II/examples/step-47/step-47.cc +++ b/deal.II/examples/step-47/step-47.cc @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-48/step-48.cc b/deal.II/examples/step-48/step-48.cc index 451281dc28..7a4259e428 100644 --- a/deal.II/examples/step-48/step-48.cc +++ b/deal.II/examples/step-48/step-48.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index c5bd15aedf..9231a64bf4 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include // This one is new. We want to read a diff --git a/deal.II/examples/step-6/step-6.cc b/deal.II/examples/step-6/step-6.cc index fca0d404aa..caf09197cd 100644 --- a/deal.II/examples/step-6/step-6.cc +++ b/deal.II/examples/step-6/step-6.cc @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-7/step-7.cc b/deal.II/examples/step-7/step-7.cc index c6e3cce6ce..6b2e40229e 100644 --- a/deal.II/examples/step-7/step-7.cc +++ b/deal.II/examples/step-7/step-7.cc @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -61,7 +61,7 @@ // collects all important data during a run // and prints it at the end as a table. These // comes from the following two files: -#include +#include #include // And finally, we need to use the // FEFaceValues class, which is diff --git a/deal.II/examples/step-8/step-8.cc b/deal.II/examples/step-8/step-8.cc index 37c3d8bdf7..34beba20e0 100644 --- a/deal.II/examples/step-8/step-8.cc +++ b/deal.II/examples/step-8/step-8.cc @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/deal.II/examples/step-9/step-9.cc b/deal.II/examples/step-9/step-9.cc index 53374f6cb7..40d12c9b88 100644 --- a/deal.II/examples/step-9/step-9.cc +++ b/deal.II/examples/step-9/step-9.cc @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/deal.II/include/deal.II/base/data_out_base.h b/deal.II/include/deal.II/base/data_out_base.h index d126f615aa..7a0523028a 100644 --- a/deal.II/include/deal.II/base/data_out_base.h +++ b/deal.II/include/deal.II/base/data_out_base.h @@ -43,7 +43,7 @@ DEAL_II_NAMESPACE_OPEN class ParameterHandler; - +class XDMFEntry; /** * This is a base class for output of data on meshes of very general @@ -1407,7 +1407,13 @@ class DataOutBase * Output in deal.II * intermediate format. */ - deal_II_intermediate + deal_II_intermediate, + + /** + * Output in + * HDF5 format. + */ + hdf5 }; @@ -1808,7 +1814,29 @@ class DataOutBase const Deal_II_IntermediateFlags &flags, std::ostream &out); + template + static void write_hdf5_parallel ( + const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const char* filename, + MPI_Comm comm); + + template + static XDMFEntry create_xdmf_entry (const std::vector > &patches, + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const char* h5_filename, + const double cur_time, + MPI_Comm comm); + template + static void write_xdmf_file ( + const std::vector > &patches, + const std::vector &entries, + const char *filename, + MPI_Comm comm); + /** * Given an input stream that contains * data written by @@ -2462,6 +2490,15 @@ class DataOutInterface : private DataOutBase */ void write_deal_II_intermediate (std::ostream &out) const; + XDMFEntry create_xdmf_entry (const char *h5_filename, + const double cur_time, + MPI_Comm comm) const; + + void write_xdmf_file (const std::vector &entries, + const char *filename, + MPI_Comm comm) const; + + void write_hdf5_parallel (const char* filename, MPI_Comm comm) const; /** * Write data and grid to out * according to the given data @@ -3012,6 +3049,45 @@ class DataOutReader : public DataOutInterface +// A class to store relevant data to use when writing the light data XDMF file +// This should only contain valid data on the root node which writes the files, +// the rest of the nodes will have valid set to false +class XDMFEntry { +private: + // Whether this entry is valid and contains data to be written + bool valid; + // The name of the HDF5 heavy data file this entry references + std::string h5_filename; + // The simulation time associated with this entry + double entry_time; + // The number of nodes, cells and dimensionality associated with the data + unsigned int num_nodes, num_cells, dimension; + // The attributes associated with this entry and their dimension + std::map attribute_dims; + + // Small function to create indentation for XML file + std::string indent(const unsigned int indent_level) const { + std::string res = ""; + for (unsigned int i=0;iswitch * (subface_case)... case - * SubfaceCase@::case_x: + * SubfaceCase::case_x: * ... , which can be * written as switch * (static_cast@x + * direction, the second in + * y direction, and so on. */ static const unsigned int vertex_to_face[vertices_per_cell][dim]; @@ -1598,7 +1605,7 @@ struct GeometryInfo * area(=1) of the face. * * E.g. for - * internal::SubfaceCase@<3@>::cut_xy + * internal::SubfaceCase::cut_xy * the ratio is 1/4 for each of * the subfaces. */ diff --git a/deal.II/include/deal.II/base/numbers.h b/deal.II/include/deal.II/base/numbers.h index 0a51cea75f..05cdce2e96 100644 --- a/deal.II/include/deal.II/base/numbers.h +++ b/deal.II/include/deal.II/base/numbers.h @@ -14,6 +14,7 @@ #include +#include #include DEAL_II_NAMESPACE_OPEN @@ -35,24 +36,6 @@ DEAL_II_NAMESPACE_OPEN */ namespace numbers { - /** - * Representation of the - * largest number that - * can be put into an - * unsigned integer. This - * value is widely used - * throughout the library - * as a marker for an - * invalid unsigned - * integer value, such as - * an invalid array - * index, an invalid - * array size, and the - * like. - */ - static const unsigned int - invalid_unsigned_int = static_cast (-1); - /** * e */ diff --git a/deal.II/include/deal.II/base/parameter_handler.h b/deal.II/include/deal.II/base/parameter_handler.h index e7643d852d..9a81d2a33a 100644 --- a/deal.II/include/deal.II/base/parameter_handler.h +++ b/deal.II/include/deal.II/base/parameter_handler.h @@ -2866,7 +2866,7 @@ ParameterHandler::load (Archive & ar, const unsigned int) patterns.clear (); for (unsigned int j=0; j(Patterns::pattern_factory(descriptions[j]))); + patterns.push_back (std_cxx1x::shared_ptr(Patterns::pattern_factory(descriptions[j]))); } diff --git a/deal.II/include/deal.II/base/table.h b/deal.II/include/deal.II/base/table.h index 7d1f7d4658..531226662a 100644 --- a/deal.II/include/deal.II/base/table.h +++ b/deal.II/include/deal.II/base/table.h @@ -2055,7 +2055,7 @@ inline unsigned int TableBase::n_elements () const { - unsigned s = 1; + unsigned int s = 1; for (unsigned int n=0; nsimple_table_with_separate_column_description: This format + * is very similar to table_with_separate_column_description, + * but it skips aligning the columns with additional white space. This + * increases the performance o fwrite_text() for large tables. Example output: + * @code + * # 1: key1 + * # 2: key2 + * # 3: key3 + * 0 0 "" + * 1 0 "" + * 2 13 a + * 1 0 "" + * @endcode + * **/ enum TextOutputFormat { table_with_headers, - table_with_separate_column_description + table_with_separate_column_description, + simple_table_with_separate_column_description, }; /** diff --git a/deal.II/include/deal.II/base/table_indices.h b/deal.II/include/deal.II/base/table_indices.h index a5b99fc594..00cb35584f 100644 --- a/deal.II/include/deal.II/base/table_indices.h +++ b/deal.II/include/deal.II/base/table_indices.h @@ -79,7 +79,7 @@ class TableIndicesBase /** * Store the indices in an array. */ - unsigned indices[N]; + unsigned int indices[N]; }; @@ -99,7 +99,7 @@ class TableIndicesBase * @author Wolfgang Bangerth, 2002 */ template -class TableIndices +class TableIndices : public TableIndicesBase { /** * Standard constructor, setting @@ -147,7 +147,8 @@ class TableIndices<1> : public TableIndicesBase<1> TableIndices (const unsigned int index1); }; - +//TODO: Remove the default arguments and trickery below and put all +//the constructors into the class demplate /** * Array of indices of fixed size used for the TableBase diff --git a/deal.II/include/deal.II/base/tensor.h b/deal.II/include/deal.II/base/tensor.h index c5a5bf1216..e95edccfbf 100644 --- a/deal.II/include/deal.II/base/tensor.h +++ b/deal.II/include/deal.II/base/tensor.h @@ -555,7 +555,7 @@ Tensor::unroll (Vector &result) const { AssertDimension (result.size(),(Utilities::fixed_power(dim))); - unsigned index = 0; + unsigned int index = 0; unroll_recursion (result, index); } @@ -568,7 +568,7 @@ void Tensor::unroll_recursion (Vector &result, unsigned int &index) const { - for (unsigned i=0; i &src1, * inner product sumi,j src1[i][j]*src2[i][j]. * * @relates Tensor - * @author Guido Kanschat, 2000 + * @author Guido Kanschat, 2000 */ template inline @@ -706,7 +706,7 @@ Number double_contract (const Tensor<2, dim, Number> &src1, Number res = 0.; for (unsigned int i=0; i::unroll (Vector &result) const Assert (result.size()==dim, ExcDimensionMismatch(dim, result.size())); - unsigned index = 0; + unsigned int index = 0; unroll_recursion (result,index); } @@ -1211,7 +1211,7 @@ void Tensor<1,dim,Number>::unroll_recursion (Vector &result, unsigned int &index) const { - for (unsigned i=0; i struct TaskDescriptor; - /** * The task class for TBB that is * used by the TaskDescriptor @@ -3910,7 +3909,7 @@ namespace Threads template friend struct TaskEntryPoint; - template friend struct Task; + friend class dealii::Threads::Task; }; diff --git a/deal.II/include/deal.II/base/types.h b/deal.II/include/deal.II/base/types.h index a1d59a4418..e0a7aac194 100644 --- a/deal.II/include/deal.II/base/types.h +++ b/deal.II/include/deal.II/base/types.h @@ -29,8 +29,120 @@ namespace types * * See the @ref GlossSubdomainId * "glossary" for more information. + * + * There is a special value, + * numbers::invalid_subdomain_id + * that is used to indicate an + * invalid value of this type. */ - typedef unsigned int subdomain_id_t; + typedef unsigned int subdomain_id; + + /** + * @deprecated Old name for the typedef above. + */ + typedef subdomain_id subdomain_id_t; + + /** + * @deprecated Use numbers::invalid_subdomain_id + */ + const unsigned int invalid_subdomain_id = static_cast(-1); + + /** + * @deprecated Use numbers::artificial_subdomain_id + */ + const unsigned int artificial_subdomain_id = static_cast(-2); + + /** + * The type used to denote global dof + * indices. + */ + typedef unsigned int global_dof_index; + + /** + * @deprecated Use numbers::invalid_dof_index + */ + const global_dof_index invalid_dof_index = static_cast(-1); + + /** + * The type used to denote boundary indicators associated with every + * piece of the boundary and, in the case of meshes that describe + * manifolds in higher dimensions, associated with every cell. + * + * There is a special value, numbers::internal_face_boundary_id + * that is used to indicate an invalid value of this type and that + * is used as the boundary indicator for faces that are in the interior + * of the domain and therefore not part of any addressable boundary + * component. + */ + typedef unsigned char boundary_id; + + /** + * @deprecated Old name for the typedef above. + */ + typedef boundary_id boundary_id_t; + + /** + * The type used to denote material indicators associated with every + * cell. + * + * There is a special value, numbers::invalid_material_id + * that is used to indicate an invalid value of this type. + */ + typedef unsigned char material_id; + + /** + * @deprecated Old name for the typedef above. + */ + typedef material_id material_id_t; + +} + +// this part of the namespace numbers got moved to the bottom types.h file, +// because otherwise we get a circular inclusion of config.h, types.h, and +// numbers.h +namespace numbers +{ + /** + * Representation of the + * largest number that + * can be put into an + * unsigned integer. This + * value is widely used + * throughout the library + * as a marker for an + * invalid unsigned + * integer value, such as + * an invalid array + * index, an invalid + * array size, and the + * like. + */ + static const unsigned int + invalid_unsigned_int = static_cast (-1); + + /** + * An invalid value for indices of degrees + * of freedom. + */ + const types::global_dof_index invalid_dof_index = static_cast(-1); + + /** + * Invalid material_id which we + * need in several places as a + * default value. We assume that + * all material_ids lie in the + * range [0, invalid_material_id). + */ + const types::material_id invalid_material_id = static_cast(-1); + + /** + * The number which we reserve for + * internal faces. We assume that + * all boundary_ids lie in the + * range [0, + * internal_face_boundary_id). + */ + const types::boundary_id internal_face_boundary_id = static_cast(-1); /** * A special id for an invalid @@ -44,7 +156,7 @@ namespace types * See the @ref GlossSubdomainId * "glossary" for more information. */ - const unsigned int invalid_subdomain_id = static_cast(-1); + const types::subdomain_id invalid_subdomain_id = static_cast(-1); /** * The subdomain id assigned to a @@ -63,44 +175,7 @@ namespace types * the @ref distributed module for * more information. */ - const unsigned int artificial_subdomain_id = static_cast(-2); - - /** - * The type used to denote global dof - * indices. - */ - typedef unsigned int global_dof_index; - - /** - * An invalid value for indices of degrees - * of freedom. - */ - const global_dof_index invalid_dof_index = static_cast(-1); - - /** - * The type used to denote boundary indicators associated with every - * piece of the boundary and, in the case of meshes that describe - * manifolds in higher dimensions, associated with every cell. - */ - typedef unsigned char boundary_id_t; - - /** - * The number which we reserve for internal faces. - * We assume that all boundary_ids lie in the range [0, internal_face_boundary_id). - */ - const boundary_id_t internal_face_boundary_id = static_cast(-1); - - /** - * The type used to denote material indicators associated with every - * cell. - */ - typedef unsigned char material_id_t; - - /** - * Invalid material_id which we need in several places as a default value. - * We assume that all material_ids lie in the range [0, invalid_material_id). - */ - const material_id_t invalid_material_id = static_cast(-1); + const types::subdomain_id artificial_subdomain_id = static_cast(-2); } diff --git a/deal.II/include/deal.II/distributed/tria.h b/deal.II/include/deal.II/distributed/tria.h index 333216b6d3..c91de99454 100644 --- a/deal.II/include/deal.II/distributed/tria.h +++ b/deal.II/include/deal.II/distributed/tria.h @@ -174,6 +174,42 @@ namespace parallel * it relies on the p4est library that does not support this. Attempts * to refine cells anisotropically will result in errors. * + * + *

    Interaction with boundary description

    + * + * Refining and coarsening a distributed triangulation is a complicated + * process because cells may have to be migrated from one processor to + * another. On a single processor, materializing that part of the global + * mesh that we want to store here from what we have stored before therefore + * may involve several cycles of refining and coarsening the locally stored + * set of cells until we have finally gotten from the previous to the next + * triangulation. (This process is described in more detail in the + * @ref distributed_paper.) Unfortunately, in this process, some information + * can get lost relating to flags that are set by user code and that are + * inherited from mother to child cell but that are not moved along with + * a cell if that cell is migrated from one processor to another. + * + * An example are boundary indicators. Assume, for example, that you start + * with a single cell that is refined once globally, yielding four children. + * If you have four processors, each one owns one cell. Assume now that processor + * 1 sets the boundary indicators of the external boundaries of the cell it owns + * to 42. Since processor 0 does not own this cell, it doesn't set the boundary + * indicators of its ghost cell copy of this cell. Now, assume we do several mesh + * refinement cycles and end up with a configuration where suddenly finds itself + * as the owner of this cell. If boundary indicator 42 means that we need to + * integrate Neumann boundary conditions along this boundary, then processor 0 + * will forget to do so because it has never set the boundary indicator along + * this cell's boundary to 42. + * + * The way to avoid this dilemma is to make sure that things like setting + * boundary indicators or material ids is done immediately + * every time a parallel triangulation is refined. This is not necessary + * for sequential triangulations because, there, these flags are inherited + * from mother to child cell and remain with a cell even if it is refined + * and the children are later coarsened again, but this does not hold for + * distributed triangulations. + * + * * @author Wolfgang Bangerth, Timo Heister 2008, 2009, 2010, 2011 * @ingroup distributed */ @@ -356,7 +392,7 @@ namespace parallel * children that only exist * on other processors. */ - types::subdomain_id_t locally_owned_subdomain () const; + types::subdomain_id locally_owned_subdomain () const; /** * Return the number of @@ -575,7 +611,7 @@ namespace parallel * used for the current * processor. */ - types::subdomain_id_t my_subdomain; + types::subdomain_id my_subdomain; /** * A flag that indicates whether the @@ -813,7 +849,7 @@ namespace parallel * children that only exist * on other processors. */ - types::subdomain_id_t locally_owned_subdomain () const; + types::subdomain_id locally_owned_subdomain () const; /** * Dummy arrays. This class @@ -878,7 +914,7 @@ namespace parallel * children that only exist * on other processors. */ - types::subdomain_id_t locally_owned_subdomain () const; + types::subdomain_id locally_owned_subdomain () const; /** * Return the MPI diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index dedeae9968..3db0ddefe8 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -226,7 +226,7 @@ namespace internal const unsigned int local_index, dealii::internal::int2type<1>) { - return dof_handler.levels[obj_level]->lines. + return dof_handler.levels[obj_level]->dof_object. get_dof_index (dof_handler, obj_index, fe_index, @@ -245,7 +245,7 @@ namespace internal dealii::internal::int2type<1>, const unsigned int global_index) { - dof_handler.levels[obj_level]->lines. + dof_handler.levels[obj_level]->dof_object. set_dof_index (dof_handler, obj_index, fe_index, @@ -306,7 +306,7 @@ namespace internal const unsigned int local_index, dealii::internal::int2type<2>) { - return dof_handler.levels[obj_level]->quads. + return dof_handler.levels[obj_level]->dof_object. get_dof_index (dof_handler, obj_index, fe_index, @@ -325,7 +325,7 @@ namespace internal dealii::internal::int2type<2>, const unsigned int global_index) { - dof_handler.levels[obj_level]->quads. + dof_handler.levels[obj_level]->dof_object. set_dof_index (dof_handler, obj_index, fe_index, @@ -430,7 +430,7 @@ namespace internal const unsigned int local_index, dealii::internal::int2type<3>) { - return dof_handler.levels[obj_level]->hexes. + return dof_handler.levels[obj_level]->dof_object. get_dof_index (dof_handler, obj_index, fe_index, @@ -449,7 +449,7 @@ namespace internal dealii::internal::int2type<3>, const unsigned int global_index) { - dof_handler.levels[obj_level]->hexes. + dof_handler.levels[obj_level]->dof_object. set_dof_index (dof_handler, obj_index, fe_index, @@ -468,7 +468,7 @@ namespace internal const unsigned int local_index, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->lines. + return dof_handler.levels[obj_level]->dof_object. get_dof_index (dof_handler, obj_index, fe_index, @@ -488,7 +488,7 @@ namespace internal const dealii::internal::int2type<1> &, const unsigned int global_index) { - dof_handler.levels[obj_level]->lines. + dof_handler.levels[obj_level]->dof_object. set_dof_index (dof_handler, obj_index, fe_index, @@ -548,7 +548,7 @@ namespace internal const unsigned int local_index, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->quads. + return dof_handler.levels[obj_level]->dof_object. get_dof_index (dof_handler, obj_index, fe_index, @@ -568,7 +568,7 @@ namespace internal const dealii::internal::int2type<2> &, const unsigned int global_index) { - dof_handler.levels[obj_level]->quads. + dof_handler.levels[obj_level]->dof_object. set_dof_index (dof_handler, obj_index, fe_index, @@ -668,7 +668,7 @@ namespace internal const unsigned int local_index, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->hexes. + return dof_handler.levels[obj_level]->dof_object. get_dof_index (dof_handler, obj_index, fe_index, @@ -688,7 +688,7 @@ namespace internal const dealii::internal::int2type<3> &, const unsigned int global_index) { - dof_handler.levels[obj_level]->hexes. + dof_handler.levels[obj_level]->dof_object. set_dof_index (dof_handler, obj_index, fe_index, @@ -821,7 +821,7 @@ namespace internal const unsigned int fe_index, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->lines.fe_index_is_active(dof_handler, + return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler, obj_index, fe_index, obj_level); @@ -836,7 +836,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->lines.n_active_fe_indices (dof_handler, + return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler, obj_index); } @@ -851,7 +851,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<1> &) { - return dof_handler.levels[obj_level]->lines.nth_active_fe_index (dof_handler, + return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler, obj_level, obj_index, n); @@ -913,7 +913,7 @@ namespace internal const unsigned int fe_index, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->quads.fe_index_is_active(dof_handler, + return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler, obj_index, fe_index, obj_level); @@ -928,7 +928,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->quads.n_active_fe_indices (dof_handler, + return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler, obj_index); } @@ -943,7 +943,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<2> &) { - return dof_handler.levels[obj_level]->quads.nth_active_fe_index (dof_handler, + return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler, obj_level, obj_index, n); @@ -1022,7 +1022,7 @@ namespace internal const unsigned int fe_index, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->hexes.fe_index_is_active(dof_handler, + return dof_handler.levels[obj_level]->dof_object.fe_index_is_active(dof_handler, obj_index, fe_index, obj_level); @@ -1068,7 +1068,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->hexes.n_active_fe_indices (dof_handler, + return dof_handler.levels[obj_level]->dof_object.n_active_fe_indices (dof_handler, obj_index); } @@ -1083,7 +1083,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<3> &) { - return dof_handler.levels[obj_level]->hexes.nth_active_fe_index (dof_handler, + return dof_handler.levels[obj_level]->dof_object.nth_active_fe_index (dof_handler, obj_level, obj_index, n); diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 86fd9cbbe0..68fdcc45d8 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -293,18 +293,6 @@ class DoFHandler : public Subscriptor * is first discussed in the introduction * to the step-2 tutorial program. * - * The additional optional - * parameter @p offset allows you - * to reserve space for a finite - * number of additional vector - * entries in the beginning of - * all discretization vectors, by - * starting the enumeration of - * degrees of freedom on the grid - * at a nonzero value. By - * default, this value is of - * course zero. - * * A pointer of the transferred * finite element is * stored. Therefore, the @@ -317,8 +305,7 @@ class DoFHandler : public Subscriptor * releases the lock of this * object to the finite element. */ - virtual void distribute_dofs (const FiniteElement &fe, - const unsigned int offset = 0); + virtual void distribute_dofs (const FiniteElement &fe); /** * After distribute_dofs() with @@ -1073,7 +1060,7 @@ class DoFHandler : public Subscriptor * consideration. */ unsigned int - n_boundary_dofs (const std::set &boundary_indicators) const; + n_boundary_dofs (const std::set &boundary_indicators) const; /** * Access to an object informing @@ -1419,7 +1406,7 @@ class DoFHandler : public Subscriptor template <> unsigned int DoFHandler<1>::n_boundary_dofs () const; template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const; -template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set &) const; +template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set &) const; /* ----------------------- Inline functions ---------------------------------- */ diff --git a/deal.II/include/deal.II/dofs/dof_handler_policy.h b/deal.II/include/deal.II/dofs/dof_handler_policy.h index 65c9044016..c5c0f80d84 100644 --- a/deal.II/include/deal.II/dofs/dof_handler_policy.h +++ b/deal.II/include/deal.II/dofs/dof_handler_policy.h @@ -65,8 +65,7 @@ namespace internal */ virtual NumberCache - distribute_dofs (const unsigned int offset, - dealii::DoFHandler &dof_handler) const = 0; + distribute_dofs (dealii::DoFHandler &dof_handler) const = 0; /** * Renumber degrees of freedom as @@ -95,8 +94,7 @@ namespace internal */ virtual NumberCache - distribute_dofs (const unsigned int offset, - dealii::DoFHandler &dof_handler) const; + distribute_dofs (dealii::DoFHandler &dof_handler) const; /** * Renumber degrees of freedom as @@ -126,8 +124,7 @@ namespace internal */ virtual NumberCache - distribute_dofs (const unsigned int offset, - dealii::DoFHandler &dof_handler) const; + distribute_dofs (dealii::DoFHandler &dof_handler) const; /** * Renumber degrees of freedom as diff --git a/deal.II/include/deal.II/dofs/dof_levels.h b/deal.II/include/deal.II/dofs/dof_levels.h index cb9c40d733..5e9875551f 100644 --- a/deal.II/include/deal.II/dofs/dof_levels.h +++ b/deal.II/include/deal.II/dofs/dof_levels.h @@ -141,7 +141,7 @@ namespace internal * The object containing dof-indices * and related access-functions */ - DoFObjects<1> lines; + DoFObjects<1> dof_object; /** * Determine an estimate for the @@ -174,7 +174,7 @@ namespace internal * The object containing dof-indices * and related access-functions */ - internal::DoFHandler::DoFObjects<2> quads; + internal::DoFHandler::DoFObjects<2> dof_object; /** * Determine an estimate for the @@ -207,7 +207,7 @@ namespace internal * The object containing dof-indices * and related access-functions */ - internal::DoFHandler::DoFObjects<3> hexes; + internal::DoFHandler::DoFObjects<3> dof_object; /** * Determine an estimate for the @@ -241,7 +241,7 @@ namespace internal const unsigned int version) { this->DoFLevel<0>::serialize (ar, version); - ar & lines; + ar & dof_object; } @@ -250,7 +250,7 @@ namespace internal const unsigned int version) { this->DoFLevel<0>::serialize (ar, version); - ar & quads; + ar & dof_object; } @@ -259,7 +259,7 @@ namespace internal const unsigned int version) { this->DoFLevel<0>::serialize (ar, version); - ar & hexes; + ar & dof_object; } } } diff --git a/deal.II/include/deal.II/dofs/dof_renumbering.h b/deal.II/include/deal.II/dofs/dof_renumbering.h index f760b6d86c..8316bd811f 100644 --- a/deal.II/include/deal.II/dofs/dof_renumbering.h +++ b/deal.II/include/deal.II/dofs/dof_renumbering.h @@ -1149,12 +1149,42 @@ namespace DoFRenumbering * preserved, as is the relative * order within the untagged * ones. + * + * @pre The @p selected_dofs + * array must have as many elements as + * the @p dof_handler has degrees of + * freedom. */ template void sort_selected_dofs_back (DH& dof_handler, const std::vector& selected_dofs); + /** + * Sort those degrees of freedom + * which are tagged with @p true + * in the @p selected_dofs array + * on the level #level + * to the back of the DoF + * numbers. The sorting is + * stable, i.e. the relative + * order within the tagged + * degrees of freedom is + * preserved, as is the relative + * order within the untagged + * ones. + * + * @pre The @p selected_dofs + * array must have as many elements as + * the @p dof_handler has degrees of + * freedom on the given level. + */ + template + void + sort_selected_dofs_back (DH& dof_handler, + const std::vector& selected_dofs, + const unsigned int level); + /** * Computes the renumbering * vector needed by the @@ -1163,6 +1193,11 @@ namespace DoFRenumbering * renumbering on the DoFHandler * dofs but returns the * renumbering vector. + * + * @pre The @p selected_dofs + * array must have as many elements as + * the @p dof_handler has degrees of + * freedom. */ template void @@ -1170,6 +1205,28 @@ namespace DoFRenumbering const DH& dof_handler, const std::vector& selected_dofs); + /** + * Computes the renumbering + * vector on each level + * needed by the + * sort_selected_dofs_back() + * function. Does not perform the + * renumbering on the MGDoFHandler + * dofs but returns the + * renumbering vector. + * + * @pre The @p selected_dofs + * array must have as many elements as + * the @p dof_handler has degrees of + * freedom on the given level. + */ + template + void + compute_sort_selected_dofs_back (std::vector& new_dof_indices, + const DH& dof_handler, + const std::vector& selected_dofs, + const unsigned int level); + /** * Renumber the degrees of * freedom in a random way. diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index 0f6212e786..22a9d90963 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -496,7 +496,7 @@ namespace DoFTools SparsityPattern &sparsity_pattern, const ConstraintMatrix &constraints = ConstraintMatrix(), const bool keep_constrained_dofs = true, - const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id); + const types::subdomain_id subdomain_id = types::invalid_subdomain_id); /** * Locate non-zero entries for @@ -658,7 +658,7 @@ namespace DoFTools SparsityPattern &sparsity_pattern, const ConstraintMatrix &constraints = ConstraintMatrix(), const bool keep_constrained_dofs = true, - const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id); + const types::subdomain_id subdomain_id = types::invalid_subdomain_id); /** * @deprecated This is the old @@ -815,7 +815,7 @@ namespace DoFTools SparsityPattern &sparsity_pattern, const ConstraintMatrix &constraints, const bool keep_constrained_dofs = true, - const types::subdomain_id_t subdomain_id = numbers::invalid_unsigned_int); + const types::subdomain_id subdomain_id = numbers::invalid_unsigned_int); /** * This function does the same as @@ -1084,7 +1084,7 @@ namespace DoFTools template void make_periodicity_constraints (const DH &dof_handler, - const types::boundary_id_t boundary_component, + const types::boundary_id boundary_component, const int direction, dealii::ConstraintMatrix &constraint_matrix, const std::vector &component_mask = std::vector()); @@ -1104,7 +1104,7 @@ namespace DoFTools template void make_periodicity_constraints (const DH &dof_handler, - const types::boundary_id_t boundary_component, + const types::boundary_id boundary_component, const int direction, dealii::Tensor<1,DH::space_dimension> &offset, @@ -1335,7 +1335,7 @@ namespace DoFTools extract_boundary_dofs (const DH &dof_handler, const std::vector &component_mask, std::vector &selected_dofs, - const std::set &boundary_indicators = std::set()); + const std::set &boundary_indicators = std::set()); /** * This function does the same as the previous one but it @@ -1371,7 +1371,7 @@ namespace DoFTools extract_boundary_dofs (const DH &dof_handler, const std::vector &component_mask, IndexSet &selected_dofs, - const std::set &boundary_indicators = std::set()); + const std::set &boundary_indicators = std::set()); /** * This function is similar to @@ -1408,7 +1408,7 @@ namespace DoFTools extract_dofs_with_support_on_boundary (const DH &dof_handler, const std::vector &component_mask, std::vector &selected_dofs, - const std::set &boundary_indicators = std::set()); + const std::set &boundary_indicators = std::set()); /** * @name Hanging Nodes @@ -1458,7 +1458,7 @@ namespace DoFTools template void extract_subdomain_dofs (const DH &dof_handler, - const types::subdomain_id_t subdomain_id, + const types::subdomain_id subdomain_id, std::vector &selected_dofs); @@ -1589,7 +1589,7 @@ namespace DoFTools template void get_subdomain_association (const DH &dof_handler, - std::vector &subdomain); + std::vector &subdomain); /** * Count how many degrees of freedom are @@ -1633,7 +1633,7 @@ namespace DoFTools template unsigned int count_dofs_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain); + const types::subdomain_id subdomain); /** * Count how many degrees of freedom are @@ -1670,7 +1670,7 @@ namespace DoFTools template void count_dofs_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain, + const types::subdomain_id subdomain, std::vector &n_dofs_on_subdomain); /** @@ -1712,7 +1712,7 @@ namespace DoFTools template IndexSet dof_indices_with_subdomain_association (const DH &dof_handler, - const types::subdomain_id_t subdomain); + const types::subdomain_id subdomain); // @} /** @@ -2054,7 +2054,7 @@ namespace DoFTools * target_component. If this is * not the case, an assertion is * thrown. The indices not - * targetted by target_components + * targeted by target_components * are left untouched. */ template @@ -2100,7 +2100,7 @@ namespace DoFTools void count_dofs_per_block (const DH &dof, std::vector &dofs_per_block, - std::vector target_block + const std::vector &target_block = std::vector()); /** @@ -2419,7 +2419,7 @@ namespace DoFTools template void map_dof_to_boundary_indices (const DH &dof_handler, - const std::set &boundary_indicators, + const std::set &boundary_indicators, std::vector &mapping); /** diff --git a/deal.II/include/deal.II/dofs/function_map.h b/deal.II/include/deal.II/dofs/function_map.h index da45ed52fc..40b3635e4f 100644 --- a/deal.II/include/deal.II/dofs/function_map.h +++ b/deal.II/include/deal.II/dofs/function_map.h @@ -48,7 +48,7 @@ struct FunctionMap * name it in the fashion of the * STL local typedefs. */ - typedef std::map*> type; + typedef std::map*> type; }; DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/include/deal.II/fe/fe.h b/deal.II/include/deal.II/fe/fe.h index 63ebb18a03..d27e5a514d 100644 --- a/deal.II/include/deal.II/fe/fe.h +++ b/deal.II/include/deal.II/fe/fe.h @@ -1344,12 +1344,13 @@ class FiniteElement : public Subscriptor, * system_to_component_index() * returns. * - * Only for those - * spaces that couple the - * components, for example to - * make a shape function - * divergence free, will there be - * more than one @p true entry. + * Only for those spaces that couple the + * components, for example to make a + * shape function divergence free, will + * there be more than one @p true entry. + * Elements for which this is true are + * called non-primitive (see + * @ref GlossPrimitive). */ const std::vector & get_nonzero_components (const unsigned int i) const; diff --git a/deal.II/include/deal.II/fe/fe_base.h b/deal.II/include/deal.II/fe/fe_base.h index f2ccd8d29a..865bd7f33f 100644 --- a/deal.II/include/deal.II/fe/fe_base.h +++ b/deal.II/include/deal.II/fe/fe_base.h @@ -518,17 +518,21 @@ class FiniteElementData unsigned int n_dofs_per_object () const; /** - * Number of components. + * Number of components. See + * @ref GlossComponent "the glossary" + * for more information. */ unsigned int n_components () const; /** - * Number of blocks. + * Number of blocks. See + * @ref GlossBlock "the glossary" + * for more information. */ unsigned int n_blocks () const; /** - * Detailed infromation on block sizes. + * Detailed information on block sizes. */ const BlockIndices& block_indices() const; diff --git a/deal.II/include/deal.II/fe/mapping_q1.h b/deal.II/include/deal.II/fe/mapping_q1.h index 5c319e3839..b13c46cb67 100644 --- a/deal.II/include/deal.II/fe/mapping_q1.h +++ b/deal.II/include/deal.II/fe/mapping_q1.h @@ -313,13 +313,13 @@ class MappingQ1 : public Mapping * vectors. * * This vector has - * (dim-1)*GeometryInfo::faces_per_cell + * (dim-1)GeometryInfo::faces_per_cell * entries. The first - * GeometryInfo::faces_per_cell + * GeometryInfo::faces_per_cell * contain the vectors in the first * tangential direction for each * face; the second set of - * GeometryInfo::faces_per_cell + * GeometryInfo::faces_per_cell * entries contain the vectors in the * second tangential direction (only * in 3d, since there we have 2 diff --git a/deal.II/include/deal.II/grid/filtered_iterator.h b/deal.II/include/deal.II/grid/filtered_iterator.h index 6ddbcb3a05..895c407bd0 100644 --- a/deal.II/include/deal.II/grid/filtered_iterator.h +++ b/deal.II/include/deal.II/grid/filtered_iterator.h @@ -169,7 +169,7 @@ namespace IteratorFilters * shall have to be evaluated * to true. */ - SubdomainEqualTo (const types::subdomain_id_t subdomain_id); + SubdomainEqualTo (const types::subdomain_id subdomain_id); /** * Evaluation operator. Returns @@ -187,7 +187,7 @@ namespace IteratorFilters * Stored value to compare the * subdomain with. */ - const types::subdomain_id_t subdomain_id; + const types::subdomain_id subdomain_id; }; @@ -296,7 +296,7 @@ namespace IteratorFilters * class SubdomainEqualTo * { * public: - * SubdomainEqualTo (const types::subdomain_id_t subdomain_id) + * SubdomainEqualTo (const types::subdomain_id subdomain_id) * : subdomain_id (subdomain_id) {}; * * template @@ -305,7 +305,7 @@ namespace IteratorFilters * } * * private: - * const types::subdomain_id_t subdomain_id; + * const types::subdomain_id subdomain_id; * }; * @endcode * Objects like SubdomainEqualTo(3) can then be used as predicates. @@ -402,7 +402,7 @@ namespace IteratorFilters * Since comparison between filtered and unfiltered iterators is * defined, we could as well have let the @p endc variable in the * last example be of type - * Triangulation@::active_cell_iterator since it is unchanged + * Triangulation::active_cell_iterator since it is unchanged * and its value does not depend on the filter. * * @ingroup grid @@ -1124,7 +1124,7 @@ namespace IteratorFilters // ---------------- IteratorFilters::SubdomainEqualTo --------- inline - SubdomainEqualTo::SubdomainEqualTo (const types::subdomain_id_t subdomain_id) + SubdomainEqualTo::SubdomainEqualTo (const types::subdomain_id subdomain_id) : subdomain_id (subdomain_id) {} diff --git a/deal.II/include/deal.II/grid/grid_generator.h b/deal.II/include/deal.II/grid/grid_generator.h index 500f5e8624..044daec674 100644 --- a/deal.II/include/deal.II/grid/grid_generator.h +++ b/deal.II/include/deal.II/grid/grid_generator.h @@ -280,7 +280,7 @@ class GridGenerator subdivided_hyper_rectangle (Triangulation &tria, const std::vector< std::vector > &spacing, const Point &p, - const Table &material_id, + const Table &material_id, const bool colorize=false); /** diff --git a/deal.II/include/deal.II/grid/grid_out.h b/deal.II/include/deal.II/grid/grid_out.h index 824d896e5f..4fdc09c942 100644 --- a/deal.II/include/deal.II/grid/grid_out.h +++ b/deal.II/include/deal.II/grid/grid_out.h @@ -1545,7 +1545,7 @@ class GridOut * these faces are explicitly printed * in the write_* functions; * all faces with indicator - * types::internal_face_boundary_id are + * numbers::internal_face_boundary_id are * interior ones and an indicator with * value zero for faces at the boundary * are considered default. @@ -1580,7 +1580,7 @@ class GridOut * these lines are explicitly printed * in the write_* functions; * all lines with indicator - * types::internal_face_boundary_id are + * numbers::internal_face_boundary_id are * interior ones and an indicator with * value zero for faces at the boundary * are considered default. diff --git a/deal.II/include/deal.II/grid/grid_tools.h b/deal.II/include/deal.II/grid/grid_tools.h index 31d9e344c3..08a74019f5 100644 --- a/deal.II/include/deal.II/grid/grid_tools.h +++ b/deal.II/include/deal.II/grid/grid_tools.h @@ -266,6 +266,19 @@ namespace GridTools const Point &p); /** + * @deprecated This function might + * be acceptable to find a patch + * around a single vertex, but it + * wastes resources creating + * patches around all vertices. The + * function mail fail on + * anisotropic meshes, and an easy + * fix is not obvious. Therefore, + * it should be replaced by a + * function which computes all + * active vertex patches by looping + * over cells. + * * Find and return a vector of * iterators to active cells that * surround a given vertex @p vertex. @@ -575,7 +588,7 @@ namespace GridTools template void get_subdomain_association (const Triangulation &triangulation, - std::vector &subdomain); + std::vector &subdomain); /** * Count how many cells are uniquely @@ -602,7 +615,7 @@ namespace GridTools template unsigned int count_cells_with_subdomain_association (const Triangulation &triangulation, - const types::subdomain_id_t subdomain); + const types::subdomain_id subdomain); /** * Given two mesh containers @@ -897,8 +910,8 @@ namespace GridTools typename Container::face_iterator> extract_boundary_mesh (const Container &volume_mesh, Container &surface_mesh, - const std::set &boundary_ids - = std::set()); + const std::set &boundary_ids + = std::set()); /** @@ -945,7 +958,7 @@ namespace GridTools std::map collect_periodic_cell_pairs (const CellIterator &begin, const typename identity::type &end, - const types::boundary_id_t boundary_component, + const types::boundary_id boundary_component, int direction, const dealii::Tensor<1,CellIterator::AccessorType::space_dimension> &offset = dealii::Tensor<1,CellIterator::AccessorType::space_dimension>()); @@ -962,7 +975,7 @@ namespace GridTools template std::map collect_periodic_cell_pairs (const DH &dof_handler, - const types::boundary_id_t boundary_component, + const types::boundary_id boundary_component, int direction, const dealii::Tensor<1,DH::space_dimension> &offset = Tensor<1,DH::space_dimension>()); diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h index d6daa52fa2..366b45cdbd 100644 --- a/deal.II/include/deal.II/grid/tria.h +++ b/deal.II/include/deal.II/grid/tria.h @@ -110,8 +110,8 @@ struct CellData */ union { - types::boundary_id_t boundary_id; - types::material_id_t material_id; + types::boundary_id boundary_id; + types::material_id material_id; }; }; @@ -136,8 +136,8 @@ struct CellData * number describing the boundary condition to hold on this part of the * boundary. The triangulation creation function gives lines not in this * list either the boundary indicator zero (if on the boundary) or - * types::internal_face_boundary_id (if in the interior). Explicitely giving a - * line the indicator types::internal_face_boundary_id will result in an error, as well as giving + * numbers::internal_face_boundary_id (if in the interior). Explicitely giving a + * line the indicator numbers::internal_face_boundary_id will result in an error, as well as giving * an interior line a boundary indicator. * * @ingroup grid @@ -440,57 +440,41 @@ namespace internal * data is spread over quite a lot of arrays and other places. However, * there are ways powerful enough to work on these data structures * without knowing their exact relations. This is done through the - * concept of iterators (see the STL documentation and TriaRawIterator). + * concept of iterators (see the STL documentation and TriaIterator). * In order to make things as easy and dimension independent as possible, * use of class local typedefs is made, see below. * * The Triangulation class provides iterator which enable looping over all - * lines, cells, etc without knowing the exact representation used to + * cells without knowing the exact representation used to * describe them. Their names are typedefs imported from the Iterators * class (thus making them local types to this class) and are as follows: * *
      - *
    • @p raw_line_iterator: loop over all lines, used or not (declared for - * all dimensions). - * - *
    • @p line_iterator: loop over all used lines (declared for all dimensions). - * - *
    • @p active_line_iterator: loop over all active lines (declared for all - * dimensions). - * - *
    • @p raw_quad_iterator: loop over all quads, used or not (declared only - * for dim>=2). - * - *
    • @p quad_iterator: loop over all quads (declared only for @p dim>=2). - * - *
    • @p active_quad_iterator: loop over all active quads (declared only for - * @p dim>=2). + *
    • cell_iterator: loop over all cells used in the Triangulation + *
    • active_cell_iterator: loop over all active cells *
    * - * Additionaly, for @p dim==1, the following identities hold: + * For dim==1, these iterators are mapped as follows: * @verbatim - * typedef raw_line_iterator raw_cell_iterator; * typedef line_iterator cell_iterator; * typedef active_line_iterator active_cell_iterator; * @endverbatim - * while for @p dim==2 + * while for @p dim==2 we have the additional face iterator: * @verbatim - * typedef quad_line_iterator raw_cell_iterator; * typedef quad_iterator cell_iterator; * typedef active_quad_iterator active_cell_iterator; * - * typedef raw_line_iterator raw_face_iterator; - * typedef line_iterator face_iterator; +* typedef line_iterator face_iterator; * typedef active_line_iterator active_face_iterator; * @endverbatim * - * By using the cell iterators, you can write code nearly independent of + * By using the cell iterators, you can write code independent of * the spatial dimension. The same applies for substructure iterators, * where a substructure is defined as a face of a cell. The face of a * cell is a vertex in 1D and a line in 2D; however, vertices are * handled in a different way and therefore lines have no faces. * - * The Triangulation class offers functions like @p begin_active which gives + * The Triangulation class offers functions like begin_active() which gives * you an iterator to the first active cell. There are quite a lot of functions * returning iterators. Take a look at the class doc to get an overview. * @@ -600,7 +584,7 @@ namespace internal * more information. The mentioned class uses the interface described * directly below to transfer the data into the triangulation. * - *
  • Explicitely creating a triangulation: you can create a triangulation + *
  • Explicitly creating a triangulation: you can create a triangulation * by providing a list of vertices and a list of cells. Each such cell * consists of a vector storing the indices of the vertices of this cell * in the vertex list. To see how this works, you can take a look at the @@ -612,7 +596,7 @@ namespace internal * quite a complex task. For example in 2D, we have to create * lines between vertices (but only once, though there are two * cells which link these two vertices) and we have to create - * neighborship information. Grids being read in should + * neighborhood information. Grids being read in should * therefore not be too large, reading refined grids would be * inefficient (although there is technically no problem in * reading grids with several 10.000 or 100.000 cells; the @@ -627,7 +611,7 @@ namespace internal * vertex indices for each cell have to be in a defined order, see the * documentation of GeometryInfo. In one dimension, the first vertex * index must refer to that vertex with the lower coordinate value. In 2D - * and 3D, the correspondoing conditions are not easy to verify and no + * and 3D, the corresponding conditions are not easy to verify and no * full attempt to do so is made. * If you violate this condition, you may end up with matrix entries * having the wrong sign (clockwise vertex numbering, which results in @@ -638,9 +622,8 @@ namespace internal * There are more subtle conditions which must be imposed upon * the vertex numbering within cells. They do not only hold for * the data read from an UCD or any other input file, but also - * for the data passed to the - * Triangulation::create_triangulation () - * function. See the documentation for the GridIn class + * for the data passed to create_triangulation(). + * See the documentation for the GridIn class * for more details on this, and above all to the * GridReordering class that explains many of the * problems and an algorithm to reorder cells such that they @@ -657,13 +640,13 @@ namespace internal * parallel. It may be conceivable to implement a clean-up in the copy * operation, which eliminates holes of unused memory, re-joins * scattered data and so on. In principle this would be a useful - * operation but guaranteeing some parallelity in the two triangulations + * operation but guaranteeing some parallelism in the two triangulations * seems more important since usually data will have to be transferred * between the grids. * * * Finally, there is a special function for folks who like bad grids: - * Triangulation::distort_random. It moves all the vertices in the + * distort_random(). It moves all the vertices in the * grid a bit around by a random value, leaving behind a distorted mesh. * Note that you should apply this function to the final mesh, since * refinement smoothes the mesh a bit. @@ -693,8 +676,8 @@ namespace internal * function call i->set_refine_flag() marks the respective cell for * refinement. Marking non-active cells results in an error. * - * After all the cells you wanted to mark for refinement, call the - * @p execute_coarsening_and_refinement function to actually perform + * After all the cells you wanted to mark for refinement, call + * execute_coarsening_and_refinement() to actually perform * the refinement. This function itself first calls the * @p prepare_coarsening_and_refinement function to regularize the resulting * triangulation: since a face between two adjacent cells may only @@ -709,7 +692,7 @@ namespace internal * step than one needed by the finite element method. * * To coarsen a grid, the same way as above is possible by using - * i->set_coarsen_flag and calling @p execute_coarsening_and_refinement. + * i->set_coarsen_flag and calling execute_coarsening_and_refinement(). * * The reason for first coarsening, then refining is that the * refinement usually adds some additional cells to keep the triangulation @@ -725,20 +708,20 @@ namespace internal * towards the boundary or always at the center (see the example programs, * they do exactly these things). There are more advanced functions, * however, which are more suitable for automatic generation of hierarchical - * grids in the context of a-posteriori error estimation and adaptive finite + * grids in the context of a posteriori error estimation and adaptive finite * elements. These functions can be found in the GridRefinement class. * * *

    Smoothing of a triangulation

    * * Some degradation of approximation properties has been observed - * for grids which are too unstructured. Therefore, the - * @p prepare_coarsening_and_refinement function which is automatically called - * by the @p execute_coarsening_and_refinement function can do some + * for grids which are too unstructured. Therefore, + * prepare_coarsening_and_refinement() which is automatically called + * by execute_coarsening_and_refinement() can do some * smoothing of the triangulation. Note that mesh smoothing is only * done for two or more space dimensions, no smoothing is available * at present for one spatial dimension. In the following, let - * execute_* stand for @p execute_coarsening_and_refinement. + * execute_* stand for execute_coarsening_and_refinement(). * * For the purpose of smoothing, the * Triangulation constructor takes an argument specifying whether a @@ -755,188 +738,11 @@ namespace internal * and once with smoothing, since then in some refinement steps would need * to be refined twice. * - * The parameter taken by the constructor is an integer which may be composed - * bitwise by the constants defined in the enum MeshSmoothing. The meaning - * of these constants is explained in the following: - *
      - *
    • @p limit_level_difference_at_vertices: - * It can be shown, that degradation of approximation occurs if the - * triangulation contains vertices which are member of cells with levels - * differing by more than one. One such example is the following: - * - * @image html limit_level_difference_at_vertices.png "" - * - * It would seem that in two space dimensions, the maximum jump in levels - * between cells sharing a common vertex is two (as in the example - * above). However, this is not true if more than four cells meet at a - * vertex. It is not uncommon that a coarse (initial) mesh contains - * vertices at which six or even eight cells meet, when small features of - * the domain have to be resolved even on the coarsest mesh. In that case, - * the maximum difference in levels is three or four, respectively. The - * problem gets even worse in three space dimensions. - * - * Looking at an interpolation of the second derivative of the finite - * element solution (assuming bilinear finite elements), one sees that the - * numerical solution is almost totally wrong, compared with the true - * second derivative. Indeed, on regular meshes, there exist sharp - * estimations that the $H^2$-error is only $O(1)$, so we should not be - * surprised; however, the numerical solution may show a value for the - * second derivative which may be a factor of ten away from the true - * value. These problems are located on the small cell adjacent to the - * center vertex, where cells of non-subsequent levels meet, as well as on - * the upper and right neighbor of this cell (but with a less degree of - * deviation from the true value). - * - * If the smoothing indicator given to the constructor contains the bit for - * @p limit_level_difference_at_vertices, situations as the above one are - * eliminated by also marking the lower left cell for refinement. - * - * In case of anisotropic refinement, the level of a cell is not linked to - * the refinement of a cell as directly as in case of isotropic - * refinement. Furthermore, a cell can be strongly refined in one - * direction and not or at least much less refined in another. Therefore, - * it is very difficult to decide, which cases should be excluded from the - * refinement process. As a consequence, when using anisotropic - * refinement, the @p limit_level_difference_at_vertices flag must not be - * set. On the other hand, the implementation of multigrid methods in - * deal.II requires that this bit be set. - * - *
    • @p eliminate_unrefined_islands: - * Single cells which are not refined and are surrounded by cells which are - * refined usually also lead to a sharp decline in approximation properties - * locally. The reason is that the nodes on the faces between unrefined and - * refined cells are not real degrees of freedom but carry constraints. The - * patch without additional degrees of freedom is thus significantly larger - * then the unrefined cell itself. If in the parameter passed to the - * constructor the bit for @p eliminate_unrefined_islands is set, all cells - * which are not flagged for refinement but which are surrounded by more - * refined cells than unrefined cells are flagged for refinement. Cells - * which are not yet refined but flagged for that are accounted for the - * number of refined neighbors. Cells on the boundary are not accounted for - * at all. An unrefined island is, by this definition - * also a cell which (in 2D) is surrounded by three refined cells and one - * unrefined one, or one surrounded by two refined cells, one unrefined one - * and is at the boundary on one side. It is thus not a true island, as the - * name of the flag may indicate. However, no better name came to mind to - * the author by now. - * - *
    • eliminate_refined_*_islands: - * This algorithm seeks for isolated cells which are refined or flagged - * for refinement. This definition is unlike that for - * @p eliminate_unrefined_islands, which would mean that an island is - * defined as a cell which - * is refined but more of its neighbors are not refined than are refined. - * For example, in 2D, a cell's refinement would be reverted if at most - * one of its neighbors is also refined (or refined but flagged for - * coarsening). - * - * The reason for the change in definition of an island is, that this - * option would be a bit dangerous, since if you consider a - * chain of refined cells (e.g. along a kink in the solution), the cells - * at the two ends would be coarsened, after which the next outermost cells - * would need to be coarsened. Therefore, only one loop of flagging cells - * like this could be done to avoid eating up the whole chain of refined - * cells (`chain reaction'...). - * - * This algorithm also takes into account cells which are not actually - * refined but are flagged for refinement. If necessary, it takes away the - * refinement flag. - * - * Actually there are two versions of this flag, - * @p eliminate_refined_inner_islands and @p eliminate_refined_boundary_islands. - * There first eliminates islands defined by the definition above which are - * in the interior of the domain, while the second eliminates only those - * islands if the cell is at the boundary. The reason for this split of - * flags is that one often wants to eliminate such islands in the interior - * while those at the boundary may well be wanted, for example if one - * refines the mesh according to a criterion associated with a boundary - * integral or if one has rough boundary data. - * - *
    • @p do_not_produce_unrefined_islands: - * This flag prevents the occurrence of unrefined islands. In more detail: - * It prohibits the coarsening of a cell if 'most of the neighbors' will - * be refined after the step. - * - *
    • @p patch_level_1: - * A triangulation of patch level 1 consists of patches, i.e. of - * cells that are refined once. This flag ensures that a mesh of - * patch level 1 is still of patch level 1 after coarsening and - * refinement. It is, however, the user's responsibility to ensure - * that the mesh is of patch level 1 before calling - * execute_coarsening_and_refinement the first time. The easiest - * way to achieve this is by calling global_refine(1) straight - * after creation of the triangulation. It follows that if at - * least one of the children of a cell is or will be refined than - * all children need to be refined. If the @p patch_level_1 flag - * is set, than the flags @p eliminate_unrefined_islands, @p - * eliminate_refined_inner_islands and @p - * eliminate_refined_boundary_islands will be ignored as they will - * be fulfilled automatically. - * - *
    • @p coarsest_level_1: - * Each coarse grid cell is refined at least once, i.e. the - * triangulation might have active cells on level 1 but not on - * level 0. This flag ensures that a mesh which has - * coarsest_level_1 has still coarsest_level_1 after coarsening - * and refinement. It is, however, the user's responsibility to - * ensure that the mesh has coarsest_level_1 before calling - * execute_coarsening_and_refinement the first time. The easiest - * way to achieve this is by calling global_refine(1) straight - * after creation of the triangulation. It follows that active - * cells on level 1 may not be coarsenend. - * - * The main use of this flag is to ensure that each cell has at least one - * neighbor in each coordinate direction (i.e. each cell has at least a - * left or right, and at least an upper or lower neighbor in 2d). This is - * a necessary precondition for some algorihms that compute finite - * differences between cells. The DerivativeApproximation class is one of - * these algorithms that require that a triangulation is coarsest_level_1 - * unless all cells already have at least one neighbor in each coordinate - * direction on the coarsest level. + * The parameter taken by the constructor is an integer which may be + * composed bitwise by the constants defined in the enum + * #MeshSmoothing (see there for the possibilities). * - *
    • @p smoothing_on_refinement: - * This flag sums up all smoothing algorithms which may be performed upon - * refinement by flagging some more cells for refinement. - * - *
    • @p smoothing_on_coarsening: - * This flag sums up all smoothing algorithms which may be performed upon - * coarsening by flagging some more cells for coarsening. - * - *
    • @p maximum_smoothing: - * This flag includes all the above ones and therefore combines all - * smoothing algorithms implemented. - * - *
    • @p allow_anisotropic_smoothing: - * This flag is not included in @p maximum_smoothing. The flag is - * concerned with the following case: consider the case that an - * unrefined and a refined cell share a common face and that one - * of the children of the refined cell along the common face is - * flagged for further refinement. In that case, the resulting - * mesh would have more than one hanging node along one or more of - * the edges of the triangulation, a situation that is not - * allowed. Consequently, in order to perform the refinement, the - * coarser of the two original cells is also going to be refined. - * - * However, in many cases it is sufficient to refine the coarser - * of the two original cells in an anisotropic way to avoid the - * case of multiple hanging vertices on a single edge. Doing only - * the minimal anisotropic refinement can save cells and degrees - * of freedom. By specifying this flag, the library can produce - * these anisotropic refinements. - * - * The flag is not included by default since it may lead to - * anisotropically refined meshes even though no cell has ever - * been refined anisotropically explicitly by a user command. This - * surprising fact may lead to programs that do the wrong thing - * since they are not written for the additional cases that can - * happen with anisotropic meshes, see the discussion in the - * introduction to step-30. - * - *
    • @p none: - * Select no smoothing at all. - *
    - * - * @note While it is possible to pass all of the flags discussed above to + * @note While it is possible to pass all of the flags in #MeshSmoothing to * objects of type parallel::distributed::Triangulation, it is not always * possible to honor all of these smoothing options if they would require * knowledge of refinement/coarsening flags on cells not locally owned by @@ -977,12 +783,12 @@ namespace internal * use is like the material id of cells). * Boundary indicators may be in the range from zero to - * types::internal_face_boundary_id-1. The value - * types::internal_face_boundary_id is reserved to denote interior lines (in 2D) + * numbers::internal_face_boundary_id-1. The value + * numbers::internal_face_boundary_id is reserved to denote interior lines (in 2D) * and interior lines and quads (in 3D), which do not have a * boundary indicator. This way, a program can easily * determine, whether such an object is at the boundary or not. - * Material indicators may be in the range from zero to types::invalid_material_id-1. + * Material indicators may be in the range from zero to numbers::invalid_material_id-1. * * Lines in two dimensions and quads in three dimensions inherit their * boundary indicator to their children upon refinement. You should therefore @@ -1458,45 +1264,238 @@ class Triangulation : public Subscriptor */ enum MeshSmoothing { +/** + * No mesh smoothing at all, except that meshes have to remain one-irregular. + */ none = 0x0, +/** + * It can be shown, that degradation of approximation occurs if the + * triangulation contains vertices which are member of cells with levels + * differing by more than one. One such example is the following: + * + * @image html limit_level_difference_at_vertices.png "" + * + * It would seem that in two space dimensions, the maximum jump in levels + * between cells sharing a common vertex is two (as in the example + * above). However, this is not true if more than four cells meet at a + * vertex. It is not uncommon that a coarse (initial) mesh contains + * vertices at which six or even eight cells meet, when small features of + * the domain have to be resolved even on the coarsest mesh. In that case, + * the maximum difference in levels is three or four, respectively. The + * problem gets even worse in three space dimensions. + * + * Looking at an interpolation of the second derivative of the finite + * element solution (assuming bilinear finite elements), one sees that the + * numerical solution is almost totally wrong, compared with the true + * second derivative. Indeed, on regular meshes, there exist sharp + * estimations that the H2-error is only of order one, so we should not be + * surprised; however, the numerical solution may show a value for the + * second derivative which may be a factor of ten away from the true + * value. These problems are located on the small cell adjacent to the + * center vertex, where cells of non-subsequent levels meet, as well as on + * the upper and right neighbor of this cell (but with a less degree of + * deviation from the true value). + * + * If the smoothing indicator given to the constructor contains the bit for + * #limit_level_difference_at_vertices, situations as the above one are + * eliminated by also marking the lower left cell for refinement. + * + * In case of anisotropic refinement, the level of a cell is not linked to + * the refinement of a cell as directly as in case of isotropic + * refinement. Furthermore, a cell can be strongly refined in one + * direction and not or at least much less refined in another. Therefore, + * it is very difficult to decide, which cases should be excluded from the + * refinement process. As a consequence, when using anisotropic + * refinement, the #limit_level_difference_at_vertices flag must not be + * set. On the other hand, the implementation of multigrid methods in + * deal.II requires that this bit be set. + */ limit_level_difference_at_vertices = 0x1, - eliminate_unrefined_islands = 0x2, +/** + * Single cells which are not refined and are surrounded by cells which are + * refined usually also lead to a sharp decline in approximation properties + * locally. The reason is that the nodes on the faces between unrefined and + * refined cells are not real degrees of freedom but carry constraints. The + * patch without additional degrees of freedom is thus significantly larger + * then the unrefined cell itself. If in the parameter passed to the + * constructor the bit for #eliminate_unrefined_islands is set, all cells + * which are not flagged for refinement but which are surrounded by more + * refined cells than unrefined cells are flagged for refinement. Cells + * which are not yet refined but flagged for that are accounted for the + * number of refined neighbors. Cells on the boundary are not accounted for + * at all. An unrefined island is, by this definition + * also a cell which (in 2D) is surrounded by three refined cells and one + * unrefined one, or one surrounded by two refined cells, one unrefined one + * and is at the boundary on one side. It is thus not a true island, as the + * name of the flag may indicate. However, no better name came to mind to + * the author by now. + */ + eliminate_unrefined_islands = 0x2, +/** + * A triangulation of patch level 1 consists of patches, i.e. of + * cells that are refined once. This flag ensures that a mesh of + * patch level 1 is still of patch level 1 after coarsening and + * refinement. It is, however, the user's responsibility to ensure + * that the mesh is of patch level 1 before calling + * Triangulation::execute_coarsening_and_refinement() the first time. The easiest + * way to achieve this is by calling global_refine(1) straight + * after creation of the triangulation. It follows that if at + * least one of the children of a cell is or will be refined than + * all children need to be refined. If the #patch_level_1 flag + * is set, than the flags #eliminate_unrefined_islands, + * #eliminate_refined_inner_islands and + * #eliminate_refined_boundary_islands will be ignored as they will + * be fulfilled automatically. + */ patch_level_1 = 0x4, +/** + * Each coarse grid cell is refined at least once, i.e. the + * triangulation might have active cells on level 1 but not on + * level 0. This flag ensures that a mesh which has + * coarsest_level_1 has still coarsest_level_1 after coarsening + * and refinement. It is, however, the user's responsibility to + * ensure that the mesh has coarsest_level_1 before calling + * execute_coarsening_and_refinement the first time. The easiest + * way to achieve this is by calling global_refine(1) straight + * after creation of the triangulation. It follows that active + * cells on level 1 may not be coarsenend. + * + * The main use of this flag is to ensure that each cell has at least one + * neighbor in each coordinate direction (i.e. each cell has at least a + * left or right, and at least an upper or lower neighbor in 2d). This is + * a necessary precondition for some algorihms that compute finite + * differences between cells. The DerivativeApproximation class is one of + * these algorithms that require that a triangulation is coarsest_level_1 + * unless all cells already have at least one neighbor in each coordinate + * direction on the coarsest level. + */ coarsest_level_1 = 0x8, - +/** + * This flag is not included in @p maximum_smoothing. The flag is + * concerned with the following case: consider the case that an + * unrefined and a refined cell share a common face and that one + * of the children of the refined cell along the common face is + * flagged for further refinement. In that case, the resulting + * mesh would have more than one hanging node along one or more of + * the edges of the triangulation, a situation that is not + * allowed. Consequently, in order to perform the refinement, the + * coarser of the two original cells is also going to be refined. + * + * However, in many cases it is sufficient to refine the coarser + * of the two original cells in an anisotropic way to avoid the + * case of multiple hanging vertices on a single edge. Doing only + * the minimal anisotropic refinement can save cells and degrees + * of freedom. By specifying this flag, the library can produce + * these anisotropic refinements. + * + * The flag is not included by default since it may lead to + * anisotropically refined meshes even though no cell has ever + * been refined anisotropically explicitly by a user command. This + * surprising fact may lead to programs that do the wrong thing + * since they are not written for the additional cases that can + * happen with anisotropic meshes, see the discussion in the + * introduction to step-30. + */ allow_anisotropic_smoothing = 0x10, - +/** + * This algorithm seeks for isolated cells which are refined or flagged + * for refinement. This definition is unlike that for + * #eliminate_unrefined_islands, which would mean that an island is + * defined as a cell which + * is refined but more of its neighbors are not refined than are refined. + * For example, in 2D, a cell's refinement would be reverted if at most + * one of its neighbors is also refined (or refined but flagged for + * coarsening). + * + * The reason for the change in definition of an island is, that this + * option would be a bit dangerous, since if you consider a + * chain of refined cells (e.g. along a kink in the solution), the cells + * at the two ends would be coarsened, after which the next outermost cells + * would need to be coarsened. Therefore, only one loop of flagging cells + * like this could be done to avoid eating up the whole chain of refined + * cells (`chain reaction'...). + * + * This algorithm also takes into account cells which are not actually + * refined but are flagged for refinement. If necessary, it takes away the + * refinement flag. + * + * Actually there are two versions of this flag, + * #eliminate_refined_inner_islands and #eliminate_refined_boundary_islands. + * There first eliminates islands defined by the definition above which are + * in the interior of the domain, while the second eliminates only those + * islands if the cell is at the boundary. The reason for this split of + * flags is that one often wants to eliminate such islands in the interior + * while those at the boundary may well be wanted, for example if one + * refines the mesh according to a criterion associated with a boundary + * integral or if one has rough boundary data. + */ eliminate_refined_inner_islands = 0x100, +/** + * The result of this flag is very similar to + * #eliminate_refined_inner_islands. See the documentation there. + */ eliminate_refined_boundary_islands = 0x200, +/** + * This flag prevents the occurrence of unrefined islands. In more detail: + * It prohibits the coarsening of a cell if 'most of the neighbors' will + * be refined after the step. + */ do_not_produce_unrefined_islands = 0x400, +/** + * This flag sums up all smoothing algorithms which may be performed upon + * refinement by flagging some more cells for refinement. + */ smoothing_on_refinement = (limit_level_difference_at_vertices | eliminate_unrefined_islands), +/** + * This flag sums up all smoothing algorithms which may be performed upon + * coarsening by flagging some more cells for coarsening. + */ smoothing_on_coarsening = (eliminate_refined_inner_islands | eliminate_refined_boundary_islands | do_not_produce_unrefined_islands), +/** + * This flag includes all the above ones and therefore combines all + * smoothing algorithms implemented with the exception of + * anisotropic smoothening. + */ maximum_smoothing = 0xffff ^ allow_anisotropic_smoothing }; - + /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + */ typedef TriaRawIterator > raw_cell_iterator; typedef TriaIterator > cell_iterator; typedef TriaActiveIterator > active_cell_iterator; + /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + */ typedef TriaRawIterator > raw_face_iterator; typedef TriaIterator > face_iterator; typedef TriaActiveIterator > active_face_iterator; + /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + */ typedef typename IteratorSelector::raw_line_iterator raw_line_iterator; typedef typename IteratorSelector::line_iterator line_iterator; typedef typename IteratorSelector::active_line_iterator active_line_iterator; + /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + */ typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator; typedef typename IteratorSelector::quad_iterator quad_iterator; typedef typename IteratorSelector::active_quad_iterator active_quad_iterator; - typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator; + /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + */ + typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator; typedef typename IteratorSelector::hex_iterator hex_iterator; typedef typename IteratorSelector::active_hex_iterator active_hex_iterator; @@ -1806,7 +1805,7 @@ class Triangulation : public Subscriptor * boundary, for instance the material id * in a UCD input file. They are not * necessarily consecutive but must be in - * the range 0-(types::boundary_id_t-1). + * the range 0-(types::boundary_id-1). * Material IDs on boundaries are also * called boundary indicators and are * accessed with accessor functions @@ -1835,7 +1834,7 @@ class Triangulation : public Subscriptor * * @ingroup boundary */ - void set_boundary (const types::boundary_id_t number, + void set_boundary (const types::boundary_id number, const Boundary &boundary_object); /** @@ -1849,7 +1848,7 @@ class Triangulation : public Subscriptor * * @ingroup boundary */ - void set_boundary (const types::boundary_id_t number); + void set_boundary (const types::boundary_id number); /** * Return a constant reference to @@ -1860,7 +1859,7 @@ class Triangulation : public Subscriptor * * @ingroup boundary */ - const Boundary & get_boundary (const types::boundary_id_t number) const; + const Boundary & get_boundary (const types::boundary_id number) const; /** * Returns a vector containing @@ -1877,7 +1876,7 @@ class Triangulation : public Subscriptor * * @ingroup boundary */ - std::vector get_boundary_indicators() const; + std::vector get_boundary_indicators() const; /** * Copy a triangulation. This @@ -2605,6 +2604,8 @@ class Triangulation : public Subscriptor */ /*@{*/ /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Iterator to the first cell, used * or not, on level @p level. If a level * has no cells, a past-the-end iterator @@ -2654,6 +2655,8 @@ class Triangulation : public Subscriptor cell_iterator end (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return a raw iterator which is the first * iterator not on level. If @p level is * the last level, then this returns @@ -2671,6 +2674,8 @@ class Triangulation : public Subscriptor /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last cell, used or not. * @@ -2680,6 +2685,8 @@ class Triangulation : public Subscriptor raw_cell_iterator last_raw () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last cell of the level @p level, used * or not. @@ -2735,6 +2742,8 @@ class Triangulation : public Subscriptor */ /*@{*/ /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Iterator to the first face, used * or not. As faces have no level, * no argument can be given. @@ -2774,6 +2783,8 @@ class Triangulation : public Subscriptor raw_face_iterator end_face () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return a raw iterator which is past * the end. This is the same as * end() and is only for @@ -2790,6 +2801,8 @@ class Triangulation : public Subscriptor active_face_iterator end_active_face () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last face, used or not. * @@ -2827,6 +2840,8 @@ class Triangulation : public Subscriptor */ /*@{*/ /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Iterator to the first line, used or * not, on level @p level. If a level * has no lines, a past-the-end iterator @@ -2871,6 +2886,8 @@ class Triangulation : public Subscriptor line_iterator end_line (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return a raw iterator which is the * first iterator not on level. If @p * level is the last level, then this @@ -2887,6 +2904,8 @@ class Triangulation : public Subscriptor active_line_iterator end_active_line (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last line, used or not. */ @@ -2894,6 +2913,8 @@ class Triangulation : public Subscriptor last_raw_line () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last line of the level @p level, used * or not. @@ -2938,6 +2959,8 @@ class Triangulation : public Subscriptor /*@{ */ /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Iterator to the first quad, used or * not, on the given level. If a level * has no quads, a past-the-end iterator @@ -2980,6 +3003,8 @@ class Triangulation : public Subscriptor quad_iterator end_quad (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return a raw iterator which is the * first iterator not on level. If @p * level is the last level, then this @@ -2996,6 +3021,8 @@ class Triangulation : public Subscriptor active_quad_iterator end_active_quad (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last quad, used or not. */ @@ -3003,6 +3030,8 @@ class Triangulation : public Subscriptor last_raw_quad () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last quad of the level @p level, used * or not. @@ -3048,6 +3077,8 @@ class Triangulation : public Subscriptor /*@{ */ /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Iterator to the first hex, used * or not, on level @p level. If a level * has no hexs, a past-the-end iterator @@ -3087,6 +3118,8 @@ class Triangulation : public Subscriptor hex_iterator end_hex (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return a raw iterator which is the first * iterator not on level. If @p level is * the last level, then this returns @@ -3103,12 +3136,16 @@ class Triangulation : public Subscriptor active_hex_iterator end_active_hex (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last hex, used or not. */ raw_hex_iterator last_raw_hex () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return an iterator pointing to the * last hex of the level @p level, used * or not. @@ -3171,12 +3208,16 @@ class Triangulation : public Subscriptor */ /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Total Number of lines, used or * unused. */ unsigned int n_raw_lines () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Number of lines, used or * unused, on the given level. */ @@ -3206,12 +3247,16 @@ class Triangulation : public Subscriptor unsigned int n_active_lines (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Total number of quads, used or * unused. */ unsigned int n_raw_quads () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Number of quads, used or * unused, on the given level. */ @@ -3242,12 +3287,16 @@ class Triangulation : public Subscriptor unsigned int n_active_quads (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Total number of hexs, used or * unused. */ unsigned int n_raw_hexs () const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Number of hexs, used or * unused, on the given level. */ @@ -3280,6 +3329,8 @@ class Triangulation : public Subscriptor unsigned int n_active_hexs(const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Number of cells, used or * unused, on the given level. */ @@ -3317,6 +3368,8 @@ class Triangulation : public Subscriptor unsigned int n_active_cells (const unsigned int level) const; /** + * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases + * * Return total number of faces, * used or not. In 2d, the result * equals n_raw_lines(), while in 3d it @@ -3452,7 +3505,7 @@ class Triangulation : public Subscriptor * of those cells that are owned * by the current processor. */ - virtual types::subdomain_id_t locally_owned_subdomain () const; + virtual types::subdomain_id locally_owned_subdomain () const; /*@}*/ /** @@ -3712,7 +3765,7 @@ class Triangulation : public Subscriptor * objects, which are not * of type StraightBoundary. */ - std::map , Triangulation > > boundary; + std::map , Triangulation > > boundary; /** * Flag indicating whether @@ -3771,7 +3824,7 @@ class Triangulation : public Subscriptor * TriaAccessor::set_boundary_indicator) * were not a pointer. */ - std::map *vertex_to_boundary_id_map_1d; + std::map *vertex_to_boundary_id_map_1d; /** * A map that correlates each refinement listener that has been added diff --git a/deal.II/include/deal.II/grid/tria_accessor.h b/deal.II/include/deal.II/grid/tria_accessor.h index 25f0a3e24d..b12710e3f5 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.h +++ b/deal.II/include/deal.II/grid/tria_accessor.h @@ -1019,11 +1019,11 @@ class TriaAccessor : public TriaAccessorBase * object. * * If the return value is the special - * value types::internal_face_boundary_id, + * value numbers::internal_face_boundary_id, * then this object is in the * interior of the domain. */ - types::boundary_id_t boundary_indicator () const; + types::boundary_id boundary_indicator () const; /** * Set the boundary indicator. @@ -1052,14 +1052,14 @@ class TriaAccessor : public TriaAccessorBase * (a face not at the boundary of the * domain), or set set the boundary * indicator of an exterior face to - * types::internal_face_boundary_id + * numbers::internal_face_boundary_id * (this value is reserved for another * purpose). Algorithms may not work or * produce very confusing results if * boundary cells have a boundary - * indicator of types::internal_face_boundary_id + * indicator of numbers::internal_face_boundary_id * or if interior cells have boundary - * indicators other than types::internal_face_boundary_id. + * indicators other than numbers::internal_face_boundary_id. * Unfortunately, the current object * has no means of finding out whether it * really is at the boundary of the @@ -1069,7 +1069,7 @@ class TriaAccessor : public TriaAccessorBase * * @ingroup boundary */ - void set_boundary_indicator (const types::boundary_id_t) const; + void set_boundary_indicator (const types::boundary_id) const; /** * Do as set_boundary_indicator() @@ -1089,7 +1089,7 @@ class TriaAccessor : public TriaAccessorBase * * @ingroup boundary */ - void set_all_boundary_indicators (const types::boundary_id_t) const; + void set_all_boundary_indicators (const types::boundary_id) const; /** * Return whether this object is at the @@ -1930,11 +1930,11 @@ class TriaAccessor<0, 1, spacedim> * boundary indicator one. * * If the return value is the special - * value types::internal_face_boundary_id, + * value numbers::internal_face_boundary_id, * then this object is in the * interior of the domain. */ - types::boundary_id_t boundary_indicator () const; + types::boundary_id boundary_indicator () const; /** * @name Orientation of sub-objects @@ -2054,14 +2054,14 @@ class TriaAccessor<0, 1, spacedim> * (a face not at the boundary of the * domain), or set set the boundary * indicator of an exterior face to - * types::internal_face_boundary_id + * numbers::internal_face_boundary_id * (this value is reserved for another * purpose). Algorithms may not work or * produce very confusing results if * boundary cells have a boundary - * indicator of types::internal_face_boundary_id + * indicator of numbers::internal_face_boundary_id * or if interior cells have boundary - * indicators other than types::internal_face_boundary_id. + * indicators other than numbers::internal_face_boundary_id. * Unfortunately, the current object * has no means of finding out whether it * really is at the boundary of the @@ -2072,7 +2072,7 @@ class TriaAccessor<0, 1, spacedim> * @ingroup boundary */ void - set_boundary_indicator (const types::boundary_id_t); + set_boundary_indicator (const types::boundary_id); /** * Since this object only represents a @@ -2083,7 +2083,7 @@ class TriaAccessor<0, 1, spacedim> * @ingroup boundary */ void - set_all_boundary_indicators (const types::boundary_id_t); + set_all_boundary_indicators (const types::boundary_id); /** * @} */ @@ -2621,7 +2621,7 @@ class CellAccessor : public TriaAccessor * "glossary" for more * information. */ - types::material_id_t material_id () const; + types::material_id material_id () const; /** * Set the material id of this @@ -2635,7 +2635,7 @@ class CellAccessor : public TriaAccessor * "glossary" for more * information. */ - void set_material_id (const types::material_id_t new_material_id) const; + void set_material_id (const types::material_id new_material_id) const; /** * Set the material id of this @@ -2647,7 +2647,7 @@ class CellAccessor : public TriaAccessor * "glossary" for more * information. */ - void recursively_set_material_id (const types::material_id_t new_material_id) const; + void recursively_set_material_id (const types::material_id new_material_id) const; /** * @} */ @@ -2671,7 +2671,7 @@ class CellAccessor : public TriaAccessor * parallel::distributed::Triangulation * object. */ - types::subdomain_id_t subdomain_id () const; + types::subdomain_id subdomain_id () const; /** * Set the subdomain id of this @@ -2685,7 +2685,7 @@ class CellAccessor : public TriaAccessor * parallel::distributed::Triangulation * object. */ - void set_subdomain_id (const types::subdomain_id_t new_subdomain_id) const; + void set_subdomain_id (const types::subdomain_id new_subdomain_id) const; /** * Set the subdomain id of this @@ -2701,7 +2701,7 @@ class CellAccessor : public TriaAccessor * parallel::distributed::Triangulation * object. */ - void recursively_set_subdomain_id (const types::subdomain_id_t new_subdomain_id) const; + void recursively_set_subdomain_id (const types::subdomain_id new_subdomain_id) const; /** * @} */ diff --git a/deal.II/include/deal.II/grid/tria_accessor.templates.h b/deal.II/include/deal.II/grid/tria_accessor.templates.h index e15a341ac3..fd90e894a4 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.templates.h +++ b/deal.II/include/deal.II/grid/tria_accessor.templates.h @@ -1820,7 +1820,7 @@ TriaAccessor::number_of_children () const template -types::boundary_id_t +types::boundary_id TriaAccessor::boundary_indicator () const { Assert (structdim::boundary_indicator () const template void TriaAccessor:: -set_boundary_indicator (const types::boundary_id_t boundary_ind) const +set_boundary_indicator (const types::boundary_id boundary_ind) const { Assert (structdimused(), TriaAccessorExceptions::ExcCellNotUsed()); @@ -1847,7 +1847,7 @@ set_boundary_indicator (const types::boundary_id_t boundary_ind) const template void TriaAccessor:: -set_all_boundary_indicators (const types::boundary_id_t boundary_ind) const +set_all_boundary_indicators (const types::boundary_id boundary_ind) const { set_boundary_indicator (boundary_ind); @@ -1878,7 +1878,7 @@ TriaAccessor::at_boundary () const { // error checking is done // in boundary_indicator() - return (boundary_indicator() != types::internal_face_boundary_id); + return (boundary_indicator() != numbers::internal_face_boundary_id); } @@ -2236,7 +2236,7 @@ TriaAccessor<0, 1, spacedim>::at_boundary () const template inline -types::boundary_id_t +types::boundary_id TriaAccessor<0, 1, spacedim>::boundary_indicator () const { switch (vertex_kind) @@ -2252,7 +2252,7 @@ TriaAccessor<0, 1, spacedim>::boundary_indicator () const } default: - return types::internal_face_boundary_id; + return numbers::internal_face_boundary_id; } } @@ -2373,7 +2373,7 @@ int TriaAccessor<0, 1, spacedim>::isotropic_child_index (const unsigned int) template inline void -TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const types::boundary_id_t b) +TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const types::boundary_id b) { Assert (tria->vertex_to_boundary_id_map_1d->find (this->vertex_index()) != tria->vertex_to_boundary_id_map_1d->end(), @@ -2386,7 +2386,7 @@ TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const types::boundary_id_t template inline -void TriaAccessor<0, 1, spacedim>::set_all_boundary_indicators (const types::boundary_id_t b) +void TriaAccessor<0, 1, spacedim>::set_all_boundary_indicators (const types::boundary_id b) { set_boundary_indicator (b); } @@ -2856,7 +2856,7 @@ CellAccessor::is_locally_owned () const #ifndef DEAL_II_USE_P4EST return true; #else - const types::subdomain_id_t subdomain = this->subdomain_id(); + const types::subdomain_id subdomain = this->subdomain_id(); if (subdomain == types::artificial_subdomain_id) return false; @@ -2879,7 +2879,7 @@ CellAccessor::is_ghost () const #ifndef DEAL_II_USE_P4EST return false; #else - const types::subdomain_id_t subdomain = this->subdomain_id(); + const types::subdomain_id subdomain = this->subdomain_id(); if (subdomain == types::artificial_subdomain_id) return false; diff --git a/deal.II/include/deal.II/grid/tria_iterator.h b/deal.II/include/deal.II/grid/tria_iterator.h index e24919e9a0..0c32918742 100644 --- a/deal.II/include/deal.II/grid/tria_iterator.h +++ b/deal.II/include/deal.II/grid/tria_iterator.h @@ -231,12 +231,7 @@ template class TriaActiveIterator; * @author documentation update Guido Kanschat, 2004 */ template -class TriaRawIterator : -#ifdef HAVE_STD_ITERATOR_CLASS - public std::iterator -#else - public bidirectional_iterator -#endif +class TriaRawIterator : public std::iterator { public: /** diff --git a/deal.II/include/deal.II/grid/tria_levels.h b/deal.II/include/deal.II/grid/tria_levels.h index 37b0bac873..24bf5a87a7 100644 --- a/deal.II/include/deal.II/grid/tria_levels.h +++ b/deal.II/include/deal.II/grid/tria_levels.h @@ -138,7 +138,7 @@ namespace internal * cells with a given subdomain * number. */ - std::vector subdomain_ids; + std::vector subdomain_ids; /** * One integer for every consecutive @@ -242,7 +242,7 @@ namespace internal std::vector refine_flags; std::vector coarsen_flags; std::vector > neighbors; - std::vector subdomain_ids; + std::vector subdomain_ids; std::vector parents; // The following is not used diff --git a/deal.II/include/deal.II/grid/tria_objects.h b/deal.II/include/deal.II/grid/tria_objects.h index 23d6bda87f..f64e7fd589 100644 --- a/deal.II/include/deal.II/grid/tria_objects.h +++ b/deal.II/include/deal.II/grid/tria_objects.h @@ -141,8 +141,8 @@ namespace internal { union { - types::boundary_id_t boundary_id; - types::material_id_t material_id; + types::boundary_id boundary_id; + types::material_id material_id; }; @@ -174,7 +174,7 @@ namespace internal * example, in one dimension, this field * stores the material id of a line, which * is a number between 0 and - * types::invalid_material_id-1. In more + * numbers::invalid_material_id-1. In more * than one dimension, lines have no * material id, but they may be at the * boundary; then, we store the @@ -184,8 +184,8 @@ namespace internal * boundary conditions hold on this * part. The boundary indicator also * is a number between zero and - * types::internal_face_boundary_id-1; - * the id types::internal_face_boundary_id + * numbers::internal_face_boundary_id-1; + * the id numbers::internal_face_boundary_id * is reserved for lines * in the interior and may be used * to check whether a line is at the @@ -712,7 +712,7 @@ namespace internal inline TriaObjects::BoundaryOrMaterialId::BoundaryOrMaterialId () { - material_id = types::invalid_material_id; + material_id = numbers::invalid_material_id; } diff --git a/deal.II/include/deal.II/hp/dof_handler.h b/deal.II/include/deal.II/hp/dof_handler.h index e26959fca6..a493349218 100644 --- a/deal.II/include/deal.II/hp/dof_handler.h +++ b/deal.II/include/deal.II/hp/dof_handler.h @@ -863,7 +863,7 @@ namespace hp * consideration. */ unsigned int - n_boundary_dofs (const std::set &boundary_indicators) const; + n_boundary_dofs (const std::set &boundary_indicators) const; /** * Return the number of @@ -1107,7 +1107,7 @@ namespace hp * Create default tables for * the active_fe_indices in * the - * dealii::internal::hp::DoFLevels. They + * dealii::internal::hp::DoFLevel. They * are initialized with the a * zero indicator, meaning * that fe[0] is going to be @@ -1239,7 +1239,7 @@ namespace hp * form of a linked list, is * the same as used for the * arrays used in the - * hp::DoFLevel + * internal::hp::DoFLevel * hierarchy. Starting indices * into this array are provided * by the vertex_dofs_offsets diff --git a/deal.II/include/deal.II/hp/dof_levels.h b/deal.II/include/deal.II/hp/dof_levels.h index f526ccab2a..7fc4b81bed 100644 --- a/deal.II/include/deal.II/hp/dof_levels.h +++ b/deal.II/include/deal.II/hp/dof_levels.h @@ -164,7 +164,7 @@ namespace internal * store the dof-indices and related functions of * lines */ - internal::hp::DoFObjects<1> lines; + internal::hp::DoFObjects<1> dof_object; /** * Determine an estimate for the @@ -190,7 +190,7 @@ namespace internal * store the dof-indices and related functions of * quads */ - internal::hp::DoFObjects<2> quads; + internal::hp::DoFObjects<2> dof_object; /** * Determine an estimate for the @@ -217,7 +217,7 @@ namespace internal * store the dof-indices and related functions of * hexes */ - internal::hp::DoFObjects<3> hexes; + internal::hp::DoFObjects<3> dof_object; /** * Determine an estimate for the diff --git a/deal.II/include/deal.II/hp/fe_collection.h b/deal.II/include/deal.II/hp/fe_collection.h index 1255ea88ca..cfe2769964 100644 --- a/deal.II/include/deal.II/hp/fe_collection.h +++ b/deal.II/include/deal.II/hp/fe_collection.h @@ -116,6 +116,11 @@ namespace hp * this collection. This number must * be the same for all elements in the * collection. + * + * This function calls + * FiniteElement::n_components. See + * @ref GlossComponent "the glossary" + * for more information. */ unsigned int n_components () const; @@ -236,6 +241,15 @@ namespace hp FECollection::n_components () const { Assert (finite_elements.size () > 0, ExcNoFiniteElements()); + + // note that there is no need + // here to enforce that indeed + // all elements have the same + // number of components since we + // have already done this when + // adding a new element to the + // collection. + return finite_elements[0]->n_components (); } diff --git a/deal.II/include/deal.II/integrators/advection.h b/deal.II/include/deal.II/integrators/advection.h new file mode 100644 index 0000000000..56cdbbcdd4 --- /dev/null +++ b/deal.II/include/deal.II/integrators/advection.h @@ -0,0 +1,390 @@ +//--------------------------------------------------------------------------- +// $Id$ +// +// Copyright (C) 2010, 2011, 2012 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- +#ifndef __deal2__integrators_advection_h +#define __deal2__integrators_advection_h + + +#include +#include +#include +#include +#include +#include +#include + +DEAL_II_NAMESPACE_OPEN + +namespace LocalIntegrators +{ +/** + * @brief Local integrators related to advection along a vector field and its DG formulations + * + * All advection operators depend on an advection velocity denoted by + * w in the formulas below. It is denoted as velocity + * in the parameter lists. + * + * The functions cell_matrix() and both upwind_value_matrix() are + * taking the equation in weak form, that is, the directional + * derivative is on the test function. + * + * @ingroup Integrators + * @author Guido Kanschat + * @date 2012 + */ + namespace Advection + { +/** + * Advection along the direction w in weak form + * with derivative on the test function + * \f[ + * m_{ij} = \int_Z u_j\,(\mathbf w \cdot \nabla) v_i \, dx. + * \f] + * + * The FiniteElement in fe may be scalar or vector valued. In + * the latter case, the advection operator is applied to each component + * separately. + * + * @param M: The advection matrix obtained as result + * @param fe: The FEValues object describing the local trial function + * space. #update_values and #update_gradients, and #update_JxW_values + * must be set. + * @param fetest: The FEValues object describing the local test + * function space. #update_values and #update_gradients must be set. + * @param velocity: The advection velocity, a vector of dimension + * dim. Each component may either contain a vector of length + * one, in which case a constant velocity is assumed, or a vector with + * as many entries as quadrature points if the velocity is not constant. + * @param factor is an optional multiplication factor for the result. + * + * @ingroup Integrators + * @author Guido Kanschat + * @date 2012 + */ + template + void cell_matrix ( + FullMatrix& M, + const FEValuesBase& fe, + const FEValuesBase& fetest, + const VectorSlice > >& velocity, + const double factor = 1.) + { + const unsigned int n_dofs = fe.dofs_per_cell; + const unsigned int t_dofs = fetest.dofs_per_cell; + const unsigned int n_components = fe.get_fe().n_components(); + + AssertDimension(velocity.size(), dim); + // If the size of the + // velocity vectors is one, + // then do not increment + // between quadrature points. + const unsigned int v_increment = (velocity[0].size() == 1) ? 0 : 1; + + if (v_increment == 1) + { + AssertVectorVectorDimension(velocity, dim, fe.n_quadrature_points); + } + + AssertDimension(M.n(), n_dofs); + AssertDimension(M.m(), t_dofs); + + for (unsigned k=0;k + inline void + cell_residual ( + Vector& result, + const FEValuesBase& fe, + const std::vector >& input, + const VectorSlice > >& velocity, + double factor = 1.) + { + const unsigned int nq = fe.n_quadrature_points; + const unsigned int n_dofs = fe.dofs_per_cell; + Assert(input.size() == nq, ExcDimensionMismatch(input.size(), nq)); + Assert(result.size() == n_dofs, ExcDimensionMismatch(result.size(), n_dofs)); + + AssertDimension(velocity.size(), dim); + const unsigned int v_increment = (velocity[0].size() == 1) ? 0 : 1; + if (v_increment == 1) + { + AssertVectorVectorDimension(velocity, dim, fe.n_quadrature_points); + } + + for (unsigned k=0;k + inline void + cell_residual ( + Vector& result, + const FEValuesBase& fe, + const VectorSlice > > >& input, + const VectorSlice > >& velocity, + double factor = 1.) + { + const unsigned int nq = fe.n_quadrature_points; + const unsigned int n_dofs = fe.dofs_per_cell; + const unsigned int n_comp = fe.get_fe().n_components(); + + AssertVectorVectorDimension(input, n_comp, fe.n_quadrature_points); + Assert(result.size() == n_dofs, ExcDimensionMismatch(result.size(), n_dofs)); + + AssertDimension(velocity.size(), dim); + const unsigned int v_increment = (velocity[0].size() == 1) ? 0 : 1; + if (v_increment == 1) + { + AssertVectorVectorDimension(velocity, dim, fe.n_quadrature_points); + } + + for (unsigned k=0;kvelocity is + * provided as a VectorSlice, + * having dim vectors, + * one for each velocity + * component. Each of the + * vectors must either have only + * a single entry, if t he + * advection velocity is + * constant, or have an entry + * for each quadrature point. + * + * The finite element can have + * several components, in which + * case each component is + * advected by the same velocity. + */ + template + void upwind_value_matrix( + FullMatrix& M, + const FEValuesBase& fe, + const FEValuesBase& fetest, + const VectorSlice > >& velocity, + double factor = 1.) + { + const unsigned int n_dofs = fe.dofs_per_cell; + const unsigned int t_dofs = fetest.dofs_per_cell; + unsigned int n_components = fe.get_fe().n_components(); + AssertDimension (M.m(), n_dofs); + AssertDimension (M.n(), n_dofs); + + AssertDimension(velocity.size(), dim); + const unsigned int v_increment = (velocity[0].size() == 1) ? 0 : 1; + if (v_increment == 1) + { + AssertVectorVectorDimension(velocity, dim, fe.n_quadrature_points); + } + + for (unsigned k=0;k 0) + { + for (unsigned i=0;ivelocity is + * provided as a VectorSlice, + * having dim vectors, + * one for each velocity + * component. Each of the + * vectors must either have only + * a single entry, if t he + * advection velocity is + * constant, or have an entry + * for each quadrature point. + * + * The finite element can have + * several components, in which + * case each component is + * advected the same way. + */ + template + void upwind_value_matrix ( + FullMatrix& M11, + FullMatrix& M12, + FullMatrix& M21, + FullMatrix& M22, + const FEValuesBase& fe1, + const FEValuesBase& fe2, + const FEValuesBase& fetest1, + const FEValuesBase& fetest2, + const VectorSlice > >& velocity, + const double factor = 1.) + { + const unsigned int n1 = fe1.dofs_per_cell; + // Multiply the quadrature point + // index below with this factor to + // have simpler data for constant + // velocities. + AssertDimension(velocity.size(), dim); + const unsigned int v_increment = (velocity[0].size() == 1) ? 0 : 1; + if (v_increment == 1) + { + AssertVectorVectorDimension(velocity, dim, fe1.n_quadrature_points); + } + + for (unsigned k=0;k 0) + { + M11(i,j) += dx_nbeta + * fe1.shape_value(j,k) + * fetest1.shape_value(i,k); + M21(i,j) -= dx_nbeta + * fe1.shape_value(j,k) + * fetest2.shape_value(i,k); + } + else + { + M22(i,j) -= dx_nbeta + * fe2.shape_value(j,k) + * fetest2.shape_value(i,k); + M12(i,j) += dx_nbeta + * fe2.shape_value(j,k) + * fetest1.shape_value(i,k); + } + } + else + { + for (unsigned int d=0;d 0) + { + M11(i,j) += dx_nbeta + * fe1.shape_value_component(j,k,d) + * fetest1.shape_value_component(i,k,d); + M21(i,j) -= dx_nbeta + * fe1.shape_value_component(j,k,d) + * fetest2.shape_value_component(i,k,d); + } + else + { + M22(i,j) -= dx_nbeta + * fe2.shape_value_component(j,k,d) + * fetest2.shape_value_component(i,k,d); + M12(i,j) += dx_nbeta + * fe2.shape_value_component(j,k,d) + * fetest1.shape_value_component(i,k,d); + } + } + } + } + } +} + + +DEAL_II_NAMESPACE_CLOSE + +#endif diff --git a/deal.II/include/deal.II/integrators/divergence.h b/deal.II/include/deal.II/integrators/divergence.h index 8734fff170..665fd73caf 100644 --- a/deal.II/include/deal.II/integrators/divergence.h +++ b/deal.II/include/deal.II/integrators/divergence.h @@ -87,14 +87,14 @@ namespace LocalIntegrators AssertDimension(M.m(), t_dofs); AssertDimension(M.n(), n_dofs); - for (unsigned k=0;kHdiv. The test functions + * may be discontinuous. + * + * The function cell_matrix() is the Frechet derivative of this function with respect + * to the test functions. + */ + template + void cell_residual( + Vector& result, + const FEValuesBase& fetest, + const VectorSlice > > >& input, + const double factor = 1.) + { + AssertDimension(fetest.get_fe().n_components(), 1); + AssertVectorVectorDimension(input, dim, fetest.n_quadrature_points); + const unsigned int t_dofs = fetest.dofs_per_cell; + Assert (result.size() == t_dofs, ExcDimensionMismatch(result.size(), t_dofs)); + + for (unsigned int k=0;k& Du = fe.shape_grad(j,k); M(i,j) += dx * vv * Du[d]; @@ -144,15 +178,44 @@ namespace LocalIntegrators } } + /** + * The residual of the gradient operator in strong form. + * \f[ + * \int_Z \mathbf v\cdot\nabla u \,dx + * \f] + * This is the strong gradient operator and the trial + * space should be at least H1. The test functions + * may be discontinuous. + * + * The function cell_residual() is the Frechet derivative of this function with respect to the test functions. + */ + template + void gradient_residual( + Vector& result, + const FEValuesBase& fetest, + const std::vector >& input, + const double factor = 1.) + { + AssertDimension(fetest.get_fe().n_components(), dim); + AssertDimension(input.size(), fetest.n_quadrature_points); + const unsigned int t_dofs = fetest.dofs_per_cell; + Assert (result.size() == t_dofs, ExcDimensionMismatch(result.size(), t_dofs)); + + for (unsigned int k=0;k void @@ -171,11 +234,11 @@ namespace LocalIntegrators AssertDimension(M.m(), t_dofs); AssertDimension(M.n(), n_dofs); - for (unsigned k=0;k ndx = factor * fe.JxW(k) * fe.normal_vector(k); - for (unsigned i=0;i @@ -209,15 +272,16 @@ namespace LocalIntegrators AssertDimension(result.size(), t_dofs); AssertVectorVectorDimension (data, dim, fe.n_quadrature_points); - for (unsigned k=0;k ndx = factor * fe.normal_vector(k) * fe.JxW(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe1.normal_vector(k); - for (unsigned i=0;i>>>>>> trunk for (unsigned int d=0;d& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); for (unsigned i=0;i& n = fe.normal_vector(k); + for (unsigned int i=0;i>>>>>> trunk { const double dnv = fe.shape_grad(i,k) * n; const double dnu = Dinput[k] * n; @@ -257,11 +272,15 @@ namespace LocalIntegrators AssertVectorVectorDimension(Dinput, n_comp, fe.n_quadrature_points); AssertVectorVectorDimension(data, n_comp, fe.n_quadrature_points); - for (unsigned k=0;k& n = fe.normal_vector(k); +<<<<<<< HEAD for (unsigned i=0;i>>>>>> trunk for (unsigned int d=0;d& n = fe1.normal_vector(k); for (unsigned int d=0;d>>>>>> trunk { const double dx = fe1.JxW(k); const Point& n = fe1.normal_vector(k); +<<<<<<< HEAD for (unsigned i=0;i>>>>>> trunk { const double vi = fe1.shape_value(i,k); const Tensor<1,dim>& Dvi = fe1.shape_grad(i,k); @@ -446,12 +474,20 @@ namespace LocalIntegrators const double penalty = .5 * pen * (nui + nue); +<<<<<<< HEAD for (unsigned k=0;k>>>>>> trunk { const double dx = fe1.JxW(k); const Point& n = fe1.normal_vector(k); +<<<<<<< HEAD for (unsigned i=0;i>>>>>> trunk for (unsigned int d=0;d::cell( L2::cell_matrix(dinfo.matrix(2,false).matrix, info.fe_values(1)); } * @endcode - * See step-42 for a worked out example of this code. + * See step-39 for a worked out example of this code. * * @ingroup Integrators */ diff --git a/deal.II/include/deal.II/integrators/maxwell.h b/deal.II/include/deal.II/integrators/maxwell.h index 4c9d61efe8..077690306e 100644 --- a/deal.II/include/deal.II/integrators/maxwell.h +++ b/deal.II/include/deal.II/integrators/maxwell.h @@ -184,11 +184,11 @@ namespace LocalIntegrators // all dimensions const unsigned int d_max = (dim==2) ? 1 : dim; - for (unsigned k=0;k& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe1.normal_vector(k); - for (unsigned i=0;i #include #include +#include #include @@ -736,8 +737,14 @@ class BlockMatrixBase : public Subscriptor /** * Call the compress() function on all * the subblocks of the matrix. + * + * + * See @ref GlossCompress "Compressing + * distributed objects" for more + * information. */ - void compress (); + void compress (::dealii::VectorOperation::values operation + =::dealii::VectorOperation::unknown); /** * Multiply the entire matrix by a @@ -2316,11 +2323,11 @@ BlockMatrixBase::diag_element (const unsigned int i) const template inline void -BlockMatrixBase::compress () +BlockMatrixBase::compress (::dealii::VectorOperation::values operation) { for (unsigned int r=0; r > */ ~BlockVector (); + /** + * Call the compress() function on all + * the subblocks. + * + * This functionality only needs to be + * called if using MPI based vectors and + * exists in other objects for + * compatibility. + * + * See @ref GlossCompress "Compressing + * distributed objects" for more + * information. + */ + void compress (::dealii::VectorOperation::values operation + =::dealii::VectorOperation::unknown); + /** * Copy operator: fill all components of * the vector with the given scalar @@ -523,6 +539,14 @@ BlockVector::operator = (const BlockVector &v) return *this; } +template +inline +void BlockVector::compress (::dealii::VectorOperation::values operation) +{ + for (unsigned int i=0; in_blocks();++i) + this->components[i].compress(operation); +} + template diff --git a/deal.II/include/deal.II/lac/block_vector_base.h b/deal.II/include/deal.II/lac/block_vector_base.h index 88c9e0e183..f5f3aaecbc 100644 --- a/deal.II/include/deal.II/lac/block_vector_base.h +++ b/deal.II/include/deal.II/lac/block_vector_base.h @@ -280,12 +280,8 @@ namespace internal */ template class Iterator : -#ifdef HAVE_STD_ITERATOR_CLASS public std::iterator::value_type> -#else - random_access_iterator::value_type,int> -#endif { private: /** @@ -787,8 +783,19 @@ class BlockVectorBase : public Subscriptor /** * Call the compress() function on all * the subblocks of the matrix. + * + * This functionality only needs to be + * called if using MPI based vectors and + * exists in other objects for + * compatibility. + * + * See @ref GlossCompress "Compressing + * distributed objects" for more + * information. */ - void compress (); + void compress (::dealii::VectorOperation::values operation + =::dealii::VectorOperation::unknown); + /** * Access to a single block. @@ -1633,8 +1640,8 @@ namespace internal template Iterator:: - Iterator (BlockVector &parent, - const unsigned global_index) + Iterator (BlockVector &parent, + const unsigned int global_index) : parent (&parent), global_index (global_index) @@ -1824,10 +1831,10 @@ BlockVectorBase::collect_sizes () template inline void -BlockVectorBase::compress () +BlockVectorBase::compress (::dealii::VectorOperation::values operation) { for (unsigned int i=0; iM other degrees of freedom + * where M is also relatively small (no larger than at most around the * average number of entries per row of a linear system). It is not * meant to describe full rank linear systems. * @@ -82,18 +82,34 @@ namespace internals *

    Description of constraints

    * * Each "line" in objects of this class corresponds to one constrained degree - * of freedom, with the number of the line being $i_1$, and the entries in - * this line being pairs $(i_j,a_{i_j})$. Note that the constraints are linear - * in the $x_i$, and that there might be a constant (non-homogeneous) term in + * of freedom, with the number of the line being i, entered by + * using add_line() or add_lines(). The entries in + * this line are pairs of the form + * (j,aij), which are added by add_entry() or + * add_entries(). The organization is essentially a + * SparsityPattern, but with only a few lines containing nonzero + * elements, and therefore no data wasted on the others. For each + * line, which has been added by the mechanism above, an elimination + * of the constrained degree of freedom of the form + * @f[ + * x_i = \sum_j a_{ij} x_j + b_i + * @f] + * is performed, where bi is optional and set by + * set_inhomogeneity(). Thus, if a constraint is formulated for + * instance as a zero mean value of several degrees of freedom, one of + * the degrees has to be chosen to be eliminated. + * + * Note that the constraints are linear + * in the xi, and that there might be a constant (non-homogeneous) term in * the constraint. This is exactly the form we need for hanging node * constraints, where we need to constrain one degree of freedom in terms of * others. There are other conditions of this form possible, for example for * implementing mean value conditions as is done in the step-11 * tutorial program. The name of the class stems from the fact that these - * constraints can be represented in matrix form as $X x = b$, and this object - * then describes the matrix $X$ (as well as, incidentally, the vector $b$ -- + * constraints can be represented in matrix form as X x = b, and this object + * then describes the matrix X (and the vector b; * originally, the ConstraintMatrix class was only meant to handle homogenous - * constraints where $b=0$, thus the name). The most frequent way to + * constraints where b=0, thus the name). The most frequent way to * create/fill objects of this type is using the * DoFTools::make_hanging_node_constraints() function. The use of these * objects is first explained in step-6. @@ -264,8 +280,8 @@ class ConstraintMatrix : public Subscriptor * * This function essentially exists to * allow adding several constraints of - * the form $x_i=0$ all at once, where - * the set of indices $i$ for which these + * the form xi=0 all at once, where + * the set of indices i for which these * constraints should be added are given * by the argument of this function. On * the other hand, just as if the @@ -286,8 +302,8 @@ class ConstraintMatrix : public Subscriptor * * This function essentially exists to * allow adding several constraints of - * the form $x_i=0$ all at once, where - * the set of indices $i$ for which these + * the form xi=0 all at once, where + * the set of indices i for which these * constraints should be added are given * by the argument of this function. On * the other hand, just as if the @@ -308,8 +324,8 @@ class ConstraintMatrix : public Subscriptor * * This function essentially exists to * allow adding several constraints of - * the form $x_i=0$ all at once, where - * the set of indices $i$ for which these + * the form xi=0 all at once, where + * the set of indices i for which these * constraints should be added are given * by the argument of this function. On * the other hand, just as if the @@ -393,16 +409,16 @@ class ConstraintMatrix : public Subscriptor * This function also resolves chains * of constraints. For example, degree * of freedom 13 may be constrained to - * $u_{13}=u_3/2+u_7/2$ while degree of + * u13=u3/2+u7/2 while degree of * freedom 7 is itself constrained as - * $u_7=u_2/2+u_4/2$. Then, the + * u7=u2/2+u4/2. Then, the * resolution will be that - * $u_{13}=u_3/2+u_2/4+u_4/4$. Note, + * u13=u3/2+u2/4+u4/4. Note, * however, that cycles in this graph * of constraints are not allowed, - * i.e. for example $u_4$ may not be + * i.e. for example u4 may not be * constrained, directly or indirectly, - * to $u_{13}$ again. + * to u13 again. */ void close (); @@ -412,7 +428,7 @@ class ConstraintMatrix : public Subscriptor * the constraints represented by this * object. Both objects may or may not * be closed (by having their function - * @p close called before). If this + * close() called before). If this * object was closed before, then it * will be closed afterwards as * well. Note, however, that if the @@ -443,7 +459,7 @@ class ConstraintMatrix : public Subscriptor * * This function is useful if you are * building block matrices, where all - * blocks are built by the same @p + * blocks are built by the same * DoFHandler object, i.e. the matrix * size is larger than the number of * degrees of freedom. Since several @@ -451,7 +467,7 @@ class ConstraintMatrix : public Subscriptor * to the same degrees of freedom, * you'd generate several constraint * objects, then shift them, and - * finally @p merge them together + * finally merge() them together * again. */ void shift (const unsigned int offset); @@ -489,12 +505,12 @@ class ConstraintMatrix : public Subscriptor * with number @p index is a * constrained one. * - * Note that if @p close was called + * Note that if close() was called * before, then this function is * significantly faster, since then the * constrained degrees of freedom are * sorted and we can do a binary - * search, while before @p close was + * search, while before close() was * called, we have to perform a linear * search through all entries. */ @@ -527,7 +543,7 @@ class ConstraintMatrix : public Subscriptor * to. For example, in 2d a hanging * node is constrained only to its two * neighbors, so the returned value - * would be @p 2. However, for higher + * would be 2. However, for higher * order elements and/or higher * dimensions, or other types of * constraints, this number is no more @@ -1384,7 +1400,7 @@ class ConstraintMatrix : public Subscriptor * any other type having the same * interface. * - * Note that if called with a @p + * Note that if called with a * TrilinosWrappers::MPI::Vector it may * not contain ghost elements. */ @@ -1566,11 +1582,12 @@ class ConstraintMatrix : public Subscriptor * A list of unsigned integers that * contains the position of the * ConstraintLine of a constrained degree - * of freedom, or @p + * of freedom, or * numbers::invalid_unsigned_int if the * degree of freedom is not - * constrained. The @p invalid_unsigned - * int return value returns thus whether + * constrained. The + * numbers::invalid_unsigned_int + * return value returns thus whether * there is a constraint line for a given * degree of freedom index. Note that * this class has no notion of how many @@ -1737,7 +1754,7 @@ class ConstraintMatrix : public Subscriptor * Creates a list of affected rows for * distribution without any additional * information, otherwise similar to the - * other @p make_sorted_row_list + * other make_sorted_row_list() * function. */ void diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index ea3f98ab40..970ee190aa 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -1455,7 +1455,7 @@ namespace internals // check whether the // constraints are really empty. const unsigned int length = size(); -#ifdef DEBUG + // make sure that we are in the // range of the vector AssertIndexRange (length, total_row_indices.size()+1); @@ -1463,7 +1463,6 @@ namespace internals Assert (total_row_indices[i].constraint_position == numbers::invalid_unsigned_int, ExcInternalError()); -#endif step = length/2; while (step > 0) @@ -1757,25 +1756,20 @@ namespace internals AssertIndexRange (column_end-1, global_rows.size()); const SparsityPattern & sparsity = sparse_matrix->get_sparsity_pattern(); -#ifndef DEBUG + if (sparsity.n_nonzero_elements() == 0) return; -#endif + const std::size_t * row_start = sparsity.get_rowstart_indices(); const unsigned int * sparsity_struct = sparsity.get_column_numbers(); const unsigned int row = global_rows.global_row(i); const unsigned int loc_row = global_rows.local_row(i); -#ifdef DEBUG - const unsigned int * col_ptr = sparsity.n_nonzero_elements() == 0 ? 0 : + const unsigned int * col_ptr = sparsity.row_length(row) == 0 ? 0 : &sparsity_struct[row_start[row]]; - number * val_ptr = sparsity.n_nonzero_elements() == 0 ? 0 : + number * val_ptr = sparsity.row_length(row) == 0 ? 0 : &sparse_matrix->global_entry (row_start[row]); -#else - const unsigned int * col_ptr = &sparsity_struct[row_start[row]]; - number * val_ptr = &sparse_matrix->global_entry (row_start[row]); -#endif const bool optimize_diagonal = sparsity.optimize_diagonal(); unsigned int counter = optimize_diagonal; diff --git a/deal.II/include/deal.II/lac/full_matrix.h b/deal.II/include/deal.II/lac/full_matrix.h index 6e33ecc93a..eab4bd0d8d 100644 --- a/deal.II/include/deal.II/lac/full_matrix.h +++ b/deal.II/include/deal.II/lac/full_matrix.h @@ -290,7 +290,7 @@ class FullMatrix : public Table<2,number> * FullMatrix M(IdentityMatrix(n)); * @endverbatim */ - explicit FullMatrix (const IdentityMatrix &id); + FullMatrix (const IdentityMatrix &id); /** * @} */ @@ -921,10 +921,12 @@ class FullMatrix : public Table<2,number> const unsigned int src_offset_j = 0); /** - * Adda single element at the + * Add a single element at the * given position. */ - void add(const unsigned int row, const unsigned int column, const number value); + void add (const unsigned int row, + const unsigned int column, + const number value); /** * Add an array of values given by diff --git a/deal.II/include/deal.II/lac/full_matrix.templates.h b/deal.II/include/deal.II/lac/full_matrix.templates.h index 6ec578dd75..77b7b2672e 100644 --- a/deal.II/include/deal.II/lac/full_matrix.templates.h +++ b/deal.II/include/deal.II/lac/full_matrix.templates.h @@ -397,7 +397,7 @@ void FullMatrix::add_row (const unsigned int i, Assert (!this->empty(), ExcEmptyMatrix()); const unsigned int size_m = m(); - for (unsigned l=0; l inline void - Vector::compress (const bool add_ghost_data) + Vector::compress (::dealii::VectorOperation::values operation) { compress_start (); - compress_finish (add_ghost_data); + if (operation == ::dealii::VectorOperation::insert) + compress_finish (false); + else + compress_finish (true); } diff --git a/deal.II/include/deal.II/lac/petsc_matrix_base.h b/deal.II/include/deal.II/lac/petsc_matrix_base.h index 727eee8567..03d6f676ba 100644 --- a/deal.II/include/deal.II/lac/petsc_matrix_base.h +++ b/deal.II/include/deal.II/lac/petsc_matrix_base.h @@ -20,6 +20,7 @@ # include # include # include +# include # include # include @@ -671,8 +672,8 @@ namespace PETScWrappers * for more information. * more information. */ - void compress (); - + void compress (::dealii::VectorOperation::values operation + =::dealii::VectorOperation::unknown); /** * Return the value of the entry * (i,j). This may be an @@ -837,6 +838,72 @@ namespace PETScWrappers */ PetscReal frobenius_norm () const; + + /** + * Return the square of the norm + * of the vector $v$ with respect + * to the norm induced by this + * matrix, + * i.e. $\left(v,Mv\right)$. This + * is useful, e.g. in the finite + * element context, where the + * $L_2$ norm of a function + * equals the matrix norm with + * respect to the mass matrix of + * the vector representing the + * nodal values of the finite + * element function. + * + * Obviously, the matrix needs to + * be quadratic for this operation. + * + * The implementation of this function + * is not as efficient as the one in + * the @p MatrixBase class used in + * deal.II (i.e. the original one, not + * the PETSc wrapper class) since PETSc + * doesn't support this operation and + * needs a temporary vector. + * + * Note that if the current object + * represents a parallel distributed + * matrix (of type + * PETScWrappers::MPI::SparseMatrix), + * then the given vector has to be + * a distributed vector as + * well. Conversely, if the matrix is + * not distributed, then neither + * may the vector be. + */ + PetscScalar matrix_norm_square (const VectorBase &v) const; + + + /** + * Compute the matrix scalar + * product $\left(u,Mv\right)$. + * + * The implementation of this function + * is not as efficient as the one in + * the @p MatrixBase class used in + * deal.II (i.e. the original one, not + * the PETSc wrapper class) since PETSc + * doesn't support this operation and + * needs a temporary vector. + * + * Note that if the current object + * represents a parallel distributed + * matrix (of type + * PETScWrappers::MPI::SparseMatrix), + * then both vectors have to be + * distributed vectors as + * well. Conversely, if the matrix is + * not distributed, then neither of the + * vectors may be. + */ + PetscScalar matrix_scalar_product (const VectorBase &u, + const VectorBase &v) const; + + #if DEAL_II_PETSC_VERSION_GTE(3,1,0) /** * Return the trace of the @@ -1053,7 +1120,6 @@ namespace PETScWrappers #endif is_symmetric (const double tolerance = 1.e-12); -#if DEAL_II_PETSC_VERSION_GTE(2,3,0) /** * Test whether a matrix is * Hermitian, i.e. it is the @@ -1069,9 +1135,8 @@ namespace PETScWrappers PetscBool #endif is_hermitian (const double tolerance = 1.e-12); -#endif - /* + /** * Abstract PETSc object that helps view * in ASCII other PETSc objects. Currently * this function simply writes non-zero diff --git a/deal.II/include/deal.II/lac/petsc_parallel_vector.h b/deal.II/include/deal.II/lac/petsc_parallel_vector.h index d7f40bfbcf..df431183bd 100644 --- a/deal.II/include/deal.II/lac/petsc_parallel_vector.h +++ b/deal.II/include/deal.II/lac/petsc_parallel_vector.h @@ -543,7 +543,7 @@ namespace PETScWrappers for (unsigned int i=0; i solver_data; + }; } DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/include/deal.II/lac/petsc_vector.h b/deal.II/include/deal.II/lac/petsc_vector.h index 5c34f2bd0a..cdee298854 100644 --- a/deal.II/include/deal.II/lac/petsc_vector.h +++ b/deal.II/include/deal.II/lac/petsc_vector.h @@ -399,7 +399,7 @@ namespace PETScWrappers for (unsigned int i=0; i # include +# include # include # include @@ -294,9 +295,9 @@ namespace PETScWrappers * * See @ref GlossCompress "Compressing distributed objects" * for more information. - * more information. */ - void compress (); + void compress (::dealii::VectorOperation::values operation + =::dealii::VectorOperation::unknown); /** * Set all components of the vector to @@ -564,7 +565,7 @@ namespace PETScWrappers * collective piecewise * multiply operation of * this vector - * with \f$v\f$. + * with v. */ VectorBase & mult (const VectorBase &v); @@ -572,7 +573,7 @@ namespace PETScWrappers * Same as above, but a * collective piecewise * multiply operation of - * \f$u\f$ with \f$v\f$. + * u with v. */ VectorBase & mult (const VectorBase &u, const VectorBase &v); @@ -823,33 +824,6 @@ namespace PETScWrappers */ IndexSet ghost_indices; - /** - * PETSc doesn't allow to mix additions - * to matrix entries and overwriting - * them (to make synchronisation of - * parallel computations - * simpler). Since the interface of the - * existing classes don't support the - * notion of not interleaving things, - * we have to emulate this - * ourselves. The way we do it is to, - * for each access operation, store - * whether it is an insertion or an - * addition. If the previous one was of - * different type, then we first have - * to flush the PETSc buffers; - * otherwise, we can simply go on. - * - * The following structure and variable - * declare and store the previous - * state. - */ - struct LastAction - { - enum Values { none, insert, add }; - }; - - /** * Store whether the last action was a * write or add operation. This @@ -858,7 +832,7 @@ namespace PETScWrappers * even though the vector object they * refer to is constant. */ - mutable LastAction::Values last_action; + mutable ::dealii::VectorOperation::values last_action; /** * Make the reference class a friend. @@ -954,10 +928,10 @@ namespace PETScWrappers const VectorReference & VectorReference::operator = (const PetscScalar &value) const { - Assert ((vector.last_action == VectorBase::LastAction::insert) + Assert ((vector.last_action == VectorOperation::insert) || - (vector.last_action == VectorBase::LastAction::none), - ExcWrongMode (VectorBase::LastAction::insert, + (vector.last_action == VectorOperation::unknown), + ExcWrongMode (VectorOperation::insert, vector.last_action)); #ifdef PETSC_USE_64BIT_INDICES @@ -970,7 +944,7 @@ namespace PETScWrappers = VecSetValues (vector, 1, &petsc_i, &value, INSERT_VALUES); AssertThrow (ierr == 0, ExcPETScError(ierr)); - vector.last_action = VectorBase::LastAction::insert; + vector.last_action = VectorOperation::insert; return *this; } @@ -981,13 +955,13 @@ namespace PETScWrappers const VectorReference & VectorReference::operator += (const PetscScalar &value) const { - Assert ((vector.last_action == VectorBase::LastAction::add) + Assert ((vector.last_action == VectorOperation::add) || - (vector.last_action == VectorBase::LastAction::none), - ExcWrongMode (VectorBase::LastAction::add, + (vector.last_action == VectorOperation::unknown), + ExcWrongMode (VectorOperation::add, vector.last_action)); - vector.last_action = VectorBase::LastAction::add; + vector.last_action = VectorOperation::add; // we have to do above actions in any // case to be consistent with the MPI @@ -1019,13 +993,13 @@ namespace PETScWrappers const VectorReference & VectorReference::operator -= (const PetscScalar &value) const { - Assert ((vector.last_action == VectorBase::LastAction::add) + Assert ((vector.last_action == VectorOperation::add) || - (vector.last_action == VectorBase::LastAction::none), - ExcWrongMode (VectorBase::LastAction::add, + (vector.last_action == VectorOperation::unknown), + ExcWrongMode (VectorOperation::add, vector.last_action)); - vector.last_action = VectorBase::LastAction::add; + vector.last_action = VectorOperation::add; // we have to do above actions in any // case to be consistent with the MPI @@ -1058,13 +1032,13 @@ namespace PETScWrappers const VectorReference & VectorReference::operator *= (const PetscScalar &value) const { - Assert ((vector.last_action == VectorBase::LastAction::insert) + Assert ((vector.last_action == VectorOperation::insert) || - (vector.last_action == VectorBase::LastAction::none), - ExcWrongMode (VectorBase::LastAction::insert, + (vector.last_action == VectorOperation::unknown), + ExcWrongMode (VectorOperation::insert, vector.last_action)); - vector.last_action = VectorBase::LastAction::insert; + vector.last_action = VectorOperation::insert; // we have to do above actions in any // case to be consistent with the MPI @@ -1098,13 +1072,13 @@ namespace PETScWrappers const VectorReference & VectorReference::operator /= (const PetscScalar &value) const { - Assert ((vector.last_action == VectorBase::LastAction::insert) + Assert ((vector.last_action == VectorOperation::insert) || - (vector.last_action == VectorBase::LastAction::none), - ExcWrongMode (VectorBase::LastAction::insert, + (vector.last_action == VectorOperation::unknown), + ExcWrongMode (VectorOperation::insert, vector.last_action)); - vector.last_action = VectorBase::LastAction::insert; + vector.last_action = VectorOperation::insert; // we have to do above actions in any // case to be consistent with the MPI diff --git a/deal.II/include/deal.II/lac/precondition_block.templates.h b/deal.II/include/deal.II/lac/precondition_block.templates.h index 3e2771741c..a4c97a8bc1 100644 --- a/deal.II/include/deal.II/lac/precondition_block.templates.h +++ b/deal.II/include/deal.II/lac/precondition_block.templates.h @@ -561,23 +561,6 @@ void PreconditionBlockJacobi const Vector &src, bool adding) const { - // introduce the following typedef - // since in the use of exceptions, - // strict C++ requires us to - // specify them fully as they are - // from a template dependent base - // class. thus, we'd have to write - // PreconditionBlock::ExcNoMatrixGivenToUse, - // which is lengthy, but also poses - // some problems to the - // preprocessor due to the comma in - // the template arg list. we could - // then wrap the whole thing into - // parentheses, but that creates a - // parse error for gcc for the - // exceptions that do not take - // args... - typedef PreconditionBlock BaseClass; Assert(this->A!=0, ExcNotInitialized()); const MATRIX &M=*this->A; @@ -741,24 +724,6 @@ void PreconditionBlockSOR::forward ( const bool transpose_diagonal, const bool) const { - // introduce the following typedef - // since in the use of exceptions, - // strict C++ requires us to - // specify them fully as they are - // from a template dependent base - // class. thus, we'd have to write - // PreconditionBlock::ExcNoMatrixGivenToUse, - // which is lengthy, but also poses - // some problems to the - // preprocessor due to the comma in - // the template arg list. we could - // then wrap the whole thing into - // parentheses, but that creates a - // parse error for gcc for the - // exceptions that do not take - // args... - typedef PreconditionBlock BaseClass; - Assert (this->A!=0, ExcNotInitialized()); const MATRIX &M=*this->A; @@ -849,24 +814,6 @@ void PreconditionBlockSOR::backward ( const bool transpose_diagonal, const bool) const { - // introduce the following typedef - // since in the use of exceptions, - // strict C++ requires us to - // specify them fully as they are - // from a template dependent base - // class. thus, we'd have to write - // PreconditionBlock::ExcNoMatrixGivenToUse, - // which is lengthy, but also poses - // some problems to the - // preprocessor due to the comma in - // the template arg list. we could - // then wrap the whole thing into - // parentheses, but that creates a - // parse error for gcc for the - // exceptions that do not take - // args... - typedef PreconditionBlock BaseClass; - Assert (this->A!=0, ExcNotInitialized()); const MATRIX &M=*this->A; diff --git a/deal.II/include/deal.II/lac/sparsity_tools.h b/deal.II/include/deal.II/lac/sparsity_tools.h index a0d9531ac2..4434860f5d 100644 --- a/deal.II/include/deal.II/lac/sparsity_tools.h +++ b/deal.II/include/deal.II/lac/sparsity_tools.h @@ -254,6 +254,15 @@ namespace SparsityTools int, << "The number of partitions you gave is " << arg1 << ", but must be greater than zero."); + + /** + * Exception + */ + DeclException1 (ExcMETISError, + int, + << " An error with error number " << arg1 + << " occurred while calling a METIS function"); + /** * Exception */ diff --git a/deal.II/include/deal.II/lac/tridiagonal_matrix.h b/deal.II/include/deal.II/lac/tridiagonal_matrix.h index b512c5517c..857ef2027a 100644 --- a/deal.II/include/deal.II/lac/tridiagonal_matrix.h +++ b/deal.II/include/deal.II/lac/tridiagonal_matrix.h @@ -294,7 +294,7 @@ class TridiagonalMatrix * compute_eigenvalues(), you can * access each eigenvalue here. */ - number eigenvalue(const unsigned i) const; + number eigenvalue(const unsigned int i) const; //@} ///@name Miscellanea //@{ diff --git a/deal.II/include/deal.II/lac/trilinos_block_sparse_matrix.h b/deal.II/include/deal.II/lac/trilinos_block_sparse_matrix.h index 20034ccfc4..767c2082a4 100644 --- a/deal.II/include/deal.II/lac/trilinos_block_sparse_matrix.h +++ b/deal.II/include/deal.II/lac/trilinos_block_sparse_matrix.h @@ -246,20 +246,6 @@ namespace TrilinosWrappers void reinit (const ::dealii::BlockSparseMatrix &deal_ii_sparse_matrix, const double drop_tolerance=1e-13); - /** - * This function calls the compress() - * command of all matrices after - * the assembly is - * completed. Note that all MPI - * processes need to call this - * command (whereas the individual - * assembly routines will most probably - * only be called on each processor - * individually) before any - * can complete it. - */ - void compress (); - /** * Returns the state of the * matrix, i.e., whether diff --git a/deal.II/include/deal.II/lac/trilinos_block_vector.h b/deal.II/include/deal.II/lac/trilinos_block_vector.h index 9ad16d347a..a5c22e2d03 100644 --- a/deal.II/include/deal.II/lac/trilinos_block_vector.h +++ b/deal.II/include/deal.II/lac/trilinos_block_vector.h @@ -18,6 +18,7 @@ #ifdef DEAL_II_USE_TRILINOS # include +# include # include # include # include @@ -42,489 +43,6 @@ namespace TrilinosWrappers class BlockSparseMatrix; - namespace MPI - { -/** - * An implementation of block vectors based on the vector class - * implemented in TrilinosWrappers. While the base class provides for - * most of the interface, this class handles the actual allocation of - * vectors and provides functions that are specific to the underlying - * vector type. - * - * The model of distribution of data is such that each of the blocks - * is distributed across all MPI processes named in the MPI - * communicator. I.e. we don't just distribute the whole vector, but - * each component. In the constructors and reinit() functions, one - * therefore not only has to specify the sizes of the individual - * blocks, but also the number of elements of each of these blocks to - * be stored on the local process. - * - * @ingroup Vectors - * @ingroup TrilinosWrappers - * @see @ref GlossBlockLA "Block (linear algebra)" - * @author Martin Kronbichler, Wolfgang Bangerth, 2008, 2009 - */ - class BlockVector : public BlockVectorBase - { - public: - /** - * Typedef the base class for simpler - * access to its own typedefs. - */ - typedef BlockVectorBase BaseClass; - - /** - * Typedef the type of the underlying - * vector. - */ - typedef BaseClass::BlockType BlockType; - - /** - * Import the typedefs from the base - * class. - */ - typedef BaseClass::value_type value_type; - typedef BaseClass::pointer pointer; - typedef BaseClass::const_pointer const_pointer; - typedef BaseClass::reference reference; - typedef BaseClass::const_reference const_reference; - typedef BaseClass::size_type size_type; - typedef BaseClass::iterator iterator; - typedef BaseClass::const_iterator const_iterator; - - /** - * Default constructor. Generate an - * empty vector without any blocks. - */ - BlockVector (); - - /** - * Constructor. Generate a block - * vector with as many blocks as - * there are entries in @p - * partitioning. Each Epetra_Map - * contains the layout of the - * distribution of data among the MPI - * processes. - */ - BlockVector (const std::vector ¶llel_partitioning); - - /** - * Constructor. Generate a block - * vector with as many blocks as - * there are entries in - * @p partitioning. Each IndexSet - * together with the MPI communicator - * contains the layout of the - * distribution of data among the MPI - * processes. - */ - BlockVector (const std::vector ¶llel_partitioning, - const MPI_Comm &communicator = MPI_COMM_WORLD); - - /** - * Copy-Constructor. Set all the - * properties of the parallel vector - * to those of the given argument and - * copy the elements. - */ - BlockVector (const BlockVector &V); - - /** - * Creates a block vector - * consisting of - * num_blocks - * components, but there is no - * content in the individual - * components and the user has to - * fill appropriate data using a - * reinit of the blocks. - */ - BlockVector (const unsigned int num_blocks); - - /** - * Destructor. Clears memory - */ - ~BlockVector (); - - /** - * Copy operator: fill all - * components of the vector that - * are locally stored with the - * given scalar value. - */ - BlockVector & - operator = (const value_type s); - - /** - * Copy operator for arguments of - * the same type. - */ - BlockVector & - operator = (const BlockVector &V); - - /** - * Copy operator for arguments of - * the localized Trilinos vector - * type. - */ - BlockVector & - operator = (const ::dealii::TrilinosWrappers::BlockVector &V); - - /** - * Another copy function. This - * one takes a deal.II block - * vector and copies it into a - * TrilinosWrappers block - * vector. Note that the number - * of blocks has to be the same - * in the vector as in the input - * vector. Use the reinit() - * command for resizing the - * BlockVector or for changing - * the internal structure of the - * block components. - * - * Since Trilinos only works on - * doubles, this function is - * limited to accept only one - * possible number type in the - * deal.II vector. - */ - template - BlockVector & - operator = (const ::dealii::BlockVector &V); - - /** - * Reinitialize the BlockVector to - * contain as many blocks as there - * are Epetra_Maps given in the input - * argument, according to the - * parallel distribution of the - * individual components described - * in the maps. - * - * If fast==false, the vector - * is filled with zeros. - */ - void reinit (const std::vector ¶llel_partitioning, - const bool fast = false); - - /** - * Reinitialize the BlockVector to - * contain as many blocks as there - * are index sets given in the input - * argument, according to the - * parallel distribution of the - * individual components described - * in the maps. - * - * If fast==false, the vector - * is filled with zeros. - */ - void reinit (const std::vector ¶llel_partitioning, - const MPI_Comm &communicator = MPI_COMM_WORLD, - const bool fast = false); - - /** - * Change the dimension to that - * of the vector V. The same - * applies as for the other - * reinit() function. - * - * The elements of V are not - * copied, i.e. this function is - * the same as calling reinit - * (V.size(), fast). - * - * Note that you must call this - * (or the other reinit() - * functions) function, rather - * than calling the reinit() - * functions of an individual - * block, to allow the block - * vector to update its caches of - * vector sizes. If you call - * reinit() on one of the - * blocks, then subsequent - * actions on this object may - * yield unpredictable results - * since they may be routed to - * the wrong block. - */ - void reinit (const BlockVector &V, - const bool fast = false); - - /** - * Change the number of blocks to - * num_blocks. The individual - * blocks will get initialized with - * zero size, so it is assumed that - * the user resizes the - * individual blocks by herself - * in an appropriate way, and - * calls collect_sizes - * afterwards. - */ - void reinit (const unsigned int num_blocks); - - /** - * This reinit function is meant to - * be used for parallel - * calculations where some - * non-local data has to be - * used. The typical situation - * where one needs this function is - * the call of the - * FEValues::get_function_values - * function (or of some - * derivatives) in parallel. Since - * it is usually faster to retrieve - * the data in advance, this - * function can be called before - * the assembly forks out to the - * different processors. What this - * function does is the following: - * It takes the information in the - * columns of the given matrix and - * looks which data couples between - * the different processors. That - * data is then queried from the - * input vector. Note that you - * should not write to the - * resulting vector any more, since - * the some data can be stored - * several times on different - * processors, leading to - * unpredictable results. In - * particular, such a vector cannot - * be used for matrix-vector - * products as for example done - * during the solution of linear - * systems. - */ - void import_nonlocal_data_for_fe (const TrilinosWrappers::BlockSparseMatrix &m, - const BlockVector &v); - - /** - * Compress the underlying - * representation of the Trilinos - * object, i.e. flush the buffers - * of the vector object if it has - * any. This function is - * necessary after writing into a - * vector element-by-element and - * before anything else can be - * done on it. - * - * The (defaulted) argument can - * be used to specify the - * compress mode - * (Add or - * Insert) in case - * the vector has not been - * written to since the last - * time this function was - * called. The argument is - * ignored if the vector has - * been added or written to - * since the last time - * compress() was called. - * - * See @ref GlossCompress "Compressing distributed objects" - * for more information. - * more information. - */ - void compress (const Epetra_CombineMode last_action = Zero); - - /** - * Returns the state of the - * vector, i.e., whether - * compress() needs to be - * called after an operation - * requiring data - * exchange. Does only return - * non-true values when used in - * debug mode, since - * it is quite expensive to - * keep track of all operations - * that lead to the need for - * compress(). - */ - bool is_compressed () const; - - /** - * Swap the contents of this - * vector and the other vector - * v. One could do this - * operation with a temporary - * variable and copying over the - * data elements, but this - * function is significantly more - * efficient since it only swaps - * the pointers to the data of - * the two vectors and therefore - * does not need to allocate - * temporary storage and move - * data around. - * - * Limitation: right now this - * function only works if both - * vectors have the same number - * of blocks. If needed, the - * numbers of blocks should be - * exchanged, too. - * - * This function is analog to the - * the swap() function of all C++ - * standard containers. Also, - * there is a global function - * swap(u,v) that simply calls - * u.swap(v), again in analogy - * to standard functions. - */ - void swap (BlockVector &v); - - /** - * Print to a stream. - */ - void print (std::ostream &out, - const unsigned int precision = 3, - const bool scientific = true, - const bool across = true) const; - - /** - * Exception - */ - DeclException0 (ExcIteratorRangeDoesNotMatchVectorSize); - - /** - * Exception - */ - DeclException0 (ExcNonMatchingBlockVectors); - }; - - - -/*----------------------- Inline functions ----------------------------------*/ - - - inline - BlockVector::BlockVector () - {} - - - - inline - BlockVector::BlockVector (const std::vector ¶llel_partitioning) - { - reinit (parallel_partitioning, false); - } - - - - inline - BlockVector::BlockVector (const std::vector ¶llel_partitioning, - const MPI_Comm &communicator) - { - reinit (parallel_partitioning, communicator, false); - } - - - - inline - BlockVector::BlockVector (const unsigned int num_blocks) - { - reinit (num_blocks); - } - - - - inline - BlockVector::BlockVector (const BlockVector& v) - : - BlockVectorBase () - { - this->components.resize (v.n_blocks()); - this->block_indices = v.block_indices; - - for (unsigned int i=0; in_blocks(); ++i) - this->components[i] = v.components[i]; - } - - - - inline - bool - BlockVector::is_compressed () const - { - bool compressed = true; - for (unsigned int row=0; row - BlockVector & - BlockVector::operator = (const ::dealii::BlockVector &v) - { - if (n_blocks() != v.n_blocks()) - { - std::vector block_sizes (v.n_blocks(), 0); - block_indices.reinit (block_sizes); - if (components.size() != n_blocks()) - components.resize(n_blocks()); - } - - for (unsigned int i=0; in_blocks(); ++i) - this->components[i] = v.block(i); - - collect_sizes(); - - return *this; - } - - - inline - void - BlockVector::swap (BlockVector &v) - { - Assert (n_blocks() == v.n_blocks(), - ExcDimensionMismatch(n_blocks(),v.n_blocks())); - - for (unsigned int row=0; row
  • %Table of contents