diff --git a/AMDiS/Makefile.in b/AMDiS/Makefile.in
index e7566807f6e3333475b563ca70bfe29bceffb31e..e9c5bf1ac8d8fe42b6542b15014796a2e5651527 100644
--- a/AMDiS/Makefile.in
+++ b/AMDiS/Makefile.in
@@ -140,7 +140,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PETSC_DIR = @PETSC_DIR@
 RANLIB = @RANLIB@
-SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
diff --git a/AMDiS/aclocal.m4 b/AMDiS/aclocal.m4
index 6cec4be818e153e5623e6e61d48999b94d619b09..c6b83dae620f453eff109d72b180b3a18307599f 100644
--- a/AMDiS/aclocal.m4
+++ b/AMDiS/aclocal.m4
@@ -1578,27 +1578,10 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-    if AC_TRY_EVAL(ac_compile); then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -4305,9 +4288,6 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 # Is the compiler the GNU C compiler?
 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -4441,11 +4421,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -4457,7 +4437,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -4537,7 +4517,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -6373,7 +6353,6 @@ do
     done
   done
 done
-IFS=$as_save_IFS
 lt_ac_max=0
 lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6406,7 +6385,6 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
 done
 ])
 SED=$lt_cv_path_SED
-AC_SUBST([SED])
 AC_MSG_RESULT([$SED])
 ])
 
diff --git a/AMDiS/bin/Makefile.in b/AMDiS/bin/Makefile.in
index e6ba2240ef6dcc038d26cb512bce1c0ecef7b212..0bfc59ce6cce943695d764eae103e5abe0382e9b 100644
--- a/AMDiS/bin/Makefile.in
+++ b/AMDiS/bin/Makefile.in
@@ -420,7 +420,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PETSC_DIR = @PETSC_DIR@
 RANLIB = @RANLIB@
-SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
diff --git a/AMDiS/configure b/AMDiS/configure
index 5d40cff820352854455581d98cfc9ba1be51fc47..b4b86c5b1ace0f94d81500d481763d162ccdc3f7 100755
--- a/AMDiS/configure
+++ b/AMDiS/configure
@@ -462,7 +462,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT AMDIS_DEBUG_TRUE AMDIS_DEBUG_FALSE CXX CC AMDIS_INTEL_TRUE AMDIS_INTEL_FALSE AMDIS_OPENMP_TRUE AMDIS_OPENMP_FALSE OPENMP_FLAG MPI_DIR PETSC_DIR USE_PARALLEL_AMDIS_TRUE USE_PARALLEL_AMDIS_FALSE USE_PARALLEL_DOMAIN_AMDIS_TRUE USE_PARALLEL_DOMAIN_AMDIS_FALSE ENABLE_UMFPACK_TRUE ENABLE_UMFPACK_FALSE ENABLE_MKL_TRUE ENABLE_MKL_FALSE DUNE_DIR ENABLE_DUNE_TRUE ENABLE_DUNE_FALSE ENABLE_BOOST_TRUE ENABLE_BOOST_FALSE CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT AMDIS_DEBUG_TRUE AMDIS_DEBUG_FALSE CXX CC AMDIS_INTEL_TRUE AMDIS_INTEL_FALSE AMDIS_OPENMP_TRUE AMDIS_OPENMP_FALSE OPENMP_FLAG MPI_DIR PETSC_DIR USE_PARALLEL_AMDIS_TRUE USE_PARALLEL_AMDIS_FALSE USE_PARALLEL_DOMAIN_AMDIS_TRUE USE_PARALLEL_DOMAIN_AMDIS_FALSE ENABLE_UMFPACK_TRUE ENABLE_UMFPACK_FALSE ENABLE_MKL_TRUE ENABLE_MKL_FALSE DUNE_DIR ENABLE_DUNE_TRUE ENABLE_DUNE_FALSE ENABLE_BOOST_TRUE ENABLE_BOOST_FALSE CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -3967,7 +3967,6 @@ do
     done
   done
 done
-IFS=$as_save_IFS
 lt_ac_max=0
 lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -4002,7 +4001,6 @@ done
 fi
 
 SED=$lt_cv_path_SED
-
 echo "$as_me:$LINENO: result: $SED" >&5
 echo "${ECHO_T}$SED" >&6
 
@@ -4443,7 +4441,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4446 "configure"' > conftest.$ac_ext
+  echo '#line 4444 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5578,7 +5576,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:5581:" \
+echo "$as_me:5579:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6641,11 +6639,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6644: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6642: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6648: \$? = $ac_status" >&5
+   echo "$as_me:6646: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6909,11 +6907,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6912: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6910: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6916: \$? = $ac_status" >&5
+   echo "$as_me:6914: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7013,11 +7011,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7016: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7014: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7020: \$? = $ac_status" >&5
+   echo "$as_me:7018: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8478,31 +8476,10 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 8485 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -9379,7 +9356,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9382 "configure"
+#line 9359 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9479,7 +9456,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9482 "configure"
+#line 9459 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9810,9 +9787,6 @@ CC=$lt_compiler
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -9946,11 +9920,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -9962,7 +9936,7 @@ postdeps=$lt_postdeps
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -10042,7 +10016,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -11822,11 +11796,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11825: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11799: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11829: \$? = $ac_status" >&5
+   echo "$as_me:11803: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11926,11 +11900,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11929: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11903: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11933: \$? = $ac_status" >&5
+   echo "$as_me:11907: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12458,31 +12432,10 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 12465 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -12866,9 +12819,6 @@ CC=$lt_compiler_CXX
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_CXX
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -13002,11 +12952,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_CXX
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_CXX
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -13018,7 +12968,7 @@ postdeps=$lt_postdeps_CXX
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -13098,7 +13048,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_CXX
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -13520,11 +13470,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13523: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13473: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13527: \$? = $ac_status" >&5
+   echo "$as_me:13477: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13624,11 +13574,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13627: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13577: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13631: \$? = $ac_status" >&5
+   echo "$as_me:13581: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15069,31 +15019,10 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 15076 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -15477,9 +15406,6 @@ CC=$lt_compiler_F77
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_F77
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -15613,11 +15539,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_F77
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_F77
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -15629,7 +15555,7 @@ postdeps=$lt_postdeps_F77
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -15709,7 +15635,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_F77
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -15851,11 +15777,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15854: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15780: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15858: \$? = $ac_status" >&5
+   echo "$as_me:15784: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16119,11 +16045,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16122: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16048: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16126: \$? = $ac_status" >&5
+   echo "$as_me:16052: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16223,11 +16149,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16226: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16152: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16230: \$? = $ac_status" >&5
+   echo "$as_me:16156: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17688,31 +17614,10 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 17695 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -18096,9 +18001,6 @@ CC=$lt_compiler_GCJ
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_GCJ
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -18232,11 +18134,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_GCJ
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_GCJ
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -18248,7 +18150,7 @@ postdeps=$lt_postdeps_GCJ
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -18328,7 +18230,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_GCJ
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -18580,9 +18482,6 @@ CC=$lt_compiler_RC
 # Is the compiler the GNU C compiler?
 with_gcc=$GCC_RC
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
 # An ERE matcher.
 EGREP=$lt_EGREP
 
@@ -18716,11 +18615,11 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_RC
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_RC
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -18732,7 +18631,7 @@ postdeps=$lt_postdeps_RC
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -18812,7 +18711,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
 link_all_deplibs=$link_all_deplibs_RC
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
 # Run-time system search path for libraries
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -19736,7 +19635,6 @@ s,@host@,$host,;t t
 s,@host_cpu@,$host_cpu,;t t
 s,@host_vendor@,$host_vendor,;t t
 s,@host_os@,$host_os,;t t
-s,@SED@,$SED,;t t
 s,@EGREP@,$EGREP,;t t
 s,@LN_S@,$LN_S,;t t
 s,@ECHO@,$ECHO,;t t
diff --git a/AMDiS/libtool b/AMDiS/libtool
index 2f043c9f5248b46431d7049b4fa298d4f4e10020..e22d47bd9b0fc7f75d7f8cf68b04c615f65c2860 100755
--- a/AMDiS/libtool
+++ b/AMDiS/libtool
@@ -30,10 +30,10 @@
 # the same distribution terms that you use for the rest of that program.
 
 # A sed program that does not truncate output.
-SED="/bin/sed"
+SED="/usr/bin/sed"
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="/bin/sed -e 1s/^X//"
+Xsed="/usr/bin/sed -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
@@ -44,7 +44,7 @@ available_tags=" CXX F77"
 
 # ### BEGIN LIBTOOL CONFIG
 
-# Libtool was configured on host NWRW15:
+# Libtool was configured on host p2q081:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -66,12 +66,12 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=i686-pc-linux-gnu
+host=x86_64-unknown-linux-gnu
 host_os=linux-gnu
 
 # The build system.
 build_alias=
-build=i686-pc-linux-gnu
+build=x86_64-unknown-linux-gnu
 build_os=linux-gnu
 
 # An echo program that does not interpret backslashes.
@@ -82,25 +82,22 @@ AR="ar"
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="gcc"
+LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
 
 # LTCC compiler flags.
 LTCFLAGS="-g -O2"
 
 # A language-specific compiler.
-CC="gcc"
+CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
 
 # Is the compiler the GNU C compiler?
 with_gcc=yes
 
-gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
-gcc_ver=`gcc -dumpversion`
-
 # An ERE matcher.
 EGREP="grep -E"
 
 # The linker used to build libraries.
-LD="/usr/bin/ld"
+LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -174,7 +171,7 @@ dlopen_self=unknown
 dlopen_self_static=unknown
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag="-static"
+link_static_flag=""
 
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=" -fno-builtin"
@@ -232,11 +229,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+predep_objects=""
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+postdep_objects=""
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -248,7 +245,7 @@ postdeps=""
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+compiler_lib_search_path=""
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -328,10 +325,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=`echo " /u/witkowski/local/lib/i386-redhat-linux/4.1.2/ /u/witkowski/local/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+sys_lib_search_path_spec=" /fastfs/wir/local/lib/x86_64-suse-linux/4.1.2/ /fastfs/wir/local/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/ /usr/lib/gcc/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/ /lib/x86_64-suse-linux/4.1.2/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.1.2/ /usr/lib/../lib64/ /fastfs/wir/local/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../ /lib/ /usr/lib/"
 
 # Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso "
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
@@ -6763,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
 # End:
 # ### BEGIN LIBTOOL TAG CONFIG: CXX
 
-# Libtool was configured on host NWRW15:
+# Libtool was configured on host p2q081:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -6785,12 +6782,12 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=i686-pc-linux-gnu
+host=x86_64-unknown-linux-gnu
 host_os=linux-gnu
 
 # The build system.
 build_alias=
-build=i686-pc-linux-gnu
+build=x86_64-unknown-linux-gnu
 build_os=linux-gnu
 
 # An echo program that does not interpret backslashes.
@@ -6801,25 +6798,22 @@ AR="ar"
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="gcc"
+LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
 
 # LTCC compiler flags.
 LTCFLAGS="-g -O2"
 
 # A language-specific compiler.
-CC="g++"
+CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpiCC"
 
 # Is the compiler the GNU C compiler?
 with_gcc=yes
 
-gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
-gcc_ver=`gcc -dumpversion`
-
 # An ERE matcher.
 EGREP="grep -E"
 
 # The linker used to build libraries.
-LD="/usr/bin/ld"
+LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -6893,7 +6887,7 @@ dlopen_self=unknown
 dlopen_self_static=unknown
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag="-static"
+link_static_flag=""
 
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=" -fno-builtin"
@@ -6948,11 +6942,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=`echo "/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbeginS.o" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+predep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbeginS.o"
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=`echo "/usr/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+postdep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtendS.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -6960,11 +6954,11 @@ predeps=""
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
+postdeps="-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -ldl -lnsl -lutil -ldl -lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s"
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=`echo "-L/u/witkowski/local/lib -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.." | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+compiler_lib_search_path="-L/usr/lib64 -L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -7044,10 +7038,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=`echo " /u/witkowski/local/lib/i386-redhat-linux/4.1.2/ /u/witkowski/local/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+sys_lib_search_path_spec=" /fastfs/wir/local/lib/x86_64-suse-linux/4.1.2/ /fastfs/wir/local/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/ /usr/lib/gcc/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/ /lib/x86_64-suse-linux/4.1.2/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.1.2/ /usr/lib/../lib64/ /fastfs/wir/local/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../ /lib/ /usr/lib/"
 
 # Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso "
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
@@ -7071,7 +7065,7 @@ include_expsyms=""
 
 # ### BEGIN LIBTOOL TAG CONFIG: F77
 
-# Libtool was configured on host NWRW15:
+# Libtool was configured on host p2q081:
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -7093,12 +7087,12 @@ fast_install=yes
 
 # The host system.
 host_alias=
-host=i686-pc-linux-gnu
+host=x86_64-unknown-linux-gnu
 host_os=linux-gnu
 
 # The build system.
 build_alias=
-build=i686-pc-linux-gnu
+build=x86_64-unknown-linux-gnu
 build_os=linux-gnu
 
 # An echo program that does not interpret backslashes.
@@ -7109,7 +7103,7 @@ AR="ar"
 AR_FLAGS="cru"
 
 # A C compiler.
-LTCC="gcc"
+LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
 
 # LTCC compiler flags.
 LTCFLAGS="-g -O2"
@@ -7118,16 +7112,13 @@ LTCFLAGS="-g -O2"
 CC="g77"
 
 # Is the compiler the GNU C compiler?
-with_gcc=yes
-
-gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
-gcc_ver=`gcc -dumpversion`
+with_gcc=
 
 # An ERE matcher.
 EGREP="grep -E"
 
 # The linker used to build libraries.
-LD="/usr/bin/ld"
+LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -7259,11 +7250,11 @@ striplib="strip --strip-unneeded"
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+predep_objects=""
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+postdep_objects=""
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -7275,7 +7266,7 @@ postdeps=""
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+compiler_lib_search_path=""
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method="pass_all"
@@ -7355,10 +7346,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
 link_all_deplibs=unknown
 
 # Compile-time system search path for libraries
-sys_lib_search_path_spec=`echo " /u/witkowski/local/lib/i386-redhat-linux/3.4.6/ /u/witkowski/local/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
+sys_lib_search_path_spec=" /fastfs/wir/local/lib/x86_64-suse-linux/3.3.5/ /fastfs/wir/local/lib/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/ /usr/lib/gcc/x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../ /lib/x86_64-suse-linux/3.3.5/ /lib/ /usr/lib/x86_64-suse-linux/3.3.5/ /usr/lib/"
 
 # Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso "
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
diff --git a/AMDiS/src/Debug.cc b/AMDiS/src/Debug.cc
index ec187a044cbc2b07422a97886ad881504c799b99..e3857d421f5e2bd20f92ce9e58e4135a1c943e8e 100644
--- a/AMDiS/src/Debug.cc
+++ b/AMDiS/src/Debug.cc
@@ -77,6 +77,23 @@ namespace AMDiS {
     }
 
 
+    void highlightElementIndexMesh(FiniteElemSpace *feSpace, int idx, 
+				   std::string filename)
+    {
+      std::map<int, double> vec;    
+      TraverseStack stack;
+      ElInfo *elInfo = stack.traverseFirst(feSpace->getMesh(), -1, Mesh::CALL_LEAF_EL);
+      
+      while (elInfo) {		  
+	int index = elInfo->getElement()->getIndex();
+	vec[index] = (index == idx ? 1.0 : 0.0);
+	elInfo = stack.traverseNext(elInfo);
+      }
+
+      ElementFileWriter::writeFile(vec, feSpace, filename);
+    }
+
+
     void colorDofVectorByLocalElementDofs(DOFVector<double>& vec, Element *el)
     {
       // === Get local indices of the given element. ===
@@ -121,12 +138,12 @@ namespace AMDiS {
       
       TraverseStack stack;
       ElInfo *elInfo = stack.traverseFirst(feSpace->getMesh(), -1, 
-					   Mesh::CALL_EVERY_EL_PREORDER);
+					   Mesh::CALL_LEAF_EL);
       while (elInfo) {
 	basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), dofVec);
 	for (int i = 0; i < nBasFcts; i++) 
 	  if (dofVec[i] == dof)
-	    return elInfo->getElement();
+	    return elInfo->getElement();	  
 	
 	elInfo = stack.traverseNext(elInfo);
       }
@@ -155,7 +172,7 @@ namespace AMDiS {
       Element *el = getDofIndexElement(feSpace, dof);
       Element *parEl = getLevel0ParentElement(feSpace->getMesh(), el);
       
-      std::cout << "DOF-INFO:  dof = " << dof
+      std::cout << "[DBG] DOF-INFO:  dof = " << dof
 		<< "  elidx = " << el->getIndex()
 		<< "  pelidx = " << parEl->getIndex() << std::endl;	 
       
@@ -164,8 +181,8 @@ namespace AMDiS {
 					   Mesh::CALL_EVERY_EL_PREORDER);
       while (elInfo) {
 	if (elInfo->getElement()->getIndex() == parEl->getIndex())
-	  std::cout << "EL INFO TO " << parEl->getIndex() << ": " 
-		    << elInfo->getType() << std::endl;
+	  std::cout << "[DBG] EL INFO TO " << parEl->getIndex() << ": " 
+		    << " tzpe = " << elInfo->getType() << std::endl;
 	
 	elInfo = stack.traverseNext(elInfo);
       }	  
diff --git a/AMDiS/src/Debug.h b/AMDiS/src/Debug.h
index 2c7927a28a54d6d6eda1e40db0fea52bdbd1c6ad..161507d72720977afe09381a88c968232b412e06 100644
--- a/AMDiS/src/Debug.h
+++ b/AMDiS/src/Debug.h
@@ -73,6 +73,9 @@ namespace AMDiS {
      */
     void writeElementIndexMesh(FiniteElemSpace *feSpace, std::string filename);
 
+    void highlightElementIndexMesh(FiniteElemSpace *feSpace, int idx, 
+				   std::string filename);
+
     void colorDofVectorByLocalElementDofs(DOFVector<double>& vec, Element *el);
     
     bool colorDofVectorByLocalElementDofs(DOFVector<double>& vec, 
diff --git a/AMDiS/src/Element.h b/AMDiS/src/Element.h
index df610d11c4c307eb86c14c33d098efca49b6558c..e1f06894a222126365f5a7bc842af2431d458104 100644
--- a/AMDiS/src/Element.h
+++ b/AMDiS/src/Element.h
@@ -346,11 +346,21 @@ namespace AMDiS {
     /** \brief
      * Returns which side of child[childnr] corresponds to side sidenr of this 
      * Element. If the child has no corresponding side, the return value is negative. 
-     * isBisected is true after the function call, if the side of the child is only 
-     * a part of element's side, false otherwise. 
      */
     virtual int getSideOfChild(int childnr, int sidenr, int elType = 0) const = 0;
 
+    /** \brief
+     * Generalization of \ref getSideOfChild to arbitrary subObject. Thus, e.g., in 3d
+     * we can ask for the local id of a verte, edge or face on the elements children.
+     *
+     * \param[in]  childnr    Either 0 or 1 for the left or right children.
+     * \param[in]  subObj     Defines whether we ask for VERTEX, EDGE or FACE.
+     * \param[in]  ithObj     Number of the object on the parent.
+     * \param[in]  elType     Type of the element. Important only in 3D.
+     */
+    virtual int getSubObjOfChild(int childnr, GeoIndex subObj, int ithObj, 
+				 int elType = 0) const = 0;
+
     /** \brief
      * Returns which vertex of elements parent corresponds to the vertexnr of
      * the element, if the element is the childnr-th child of the parent.
diff --git a/AMDiS/src/Line.h b/AMDiS/src/Line.h
index e54f3242073c0935d4dbb233493dae5e22298c60..76d57ed51b9a77c966a7beef843aad8e0f884273 100644
--- a/AMDiS/src/Line.h
+++ b/AMDiS/src/Line.h
@@ -84,7 +84,7 @@ namespace AMDiS {
 
     inline int getEdgeOfFace(int /* face */, int /*edge*/ ) const 
     {
-      ERROR_EXIT("called for a line\n");
+      ERROR_EXIT("This does not work in 2D!\n");
       return 0;
     }
 
@@ -100,7 +100,7 @@ namespace AMDiS {
     }
 
     /// implements Element::getSideOfChild()
-    virtual int getSideOfChild(int child, int side, int) const 
+    int getSideOfChild(int child, int side, int) const 
     {
       FUNCNAME("Line::getSideOfChild()");
       TEST_EXIT_DBG(child == 0 || child == 1)("Child must be either 0 or 1!\n");
@@ -108,8 +108,14 @@ namespace AMDiS {
       return sideOfChild[child][side];
     }
 
+    int getSubObjOfChild(int childnr, GeoIndex subObj, int ithObj, int elType) const
+    {
+      ERROR_EXIT("Not yet implemented!\n");
+      return 0;
+    }
+
     /// implements Element::getVertexOfParent()
-    virtual int getVertexOfParent(int child, int side, int) const 
+    int getVertexOfParent(int child, int side, int) const 
     {
       FUNCNAME("Line::getVertexOfParent()");
       TEST_EXIT_DBG(child == 0 || child == 1)("Child must be either 0 or 1!\n");
diff --git a/AMDiS/src/MeshStructure.cc b/AMDiS/src/MeshStructure.cc
index c2643ec3fd38755027214aeb034f987c59f86a1c..ecce7dea808b19bba3019c215d573d3705437794 100644
--- a/AMDiS/src/MeshStructure.cc
+++ b/AMDiS/src/MeshStructure.cc
@@ -11,6 +11,7 @@ namespace AMDiS {
 
   const int MeshStructure::unsignedLongSize = sizeof(unsigned long int) * 8;
 
+
   void MeshStructure::insertElement(bool isLeaf) 
   {
     // overflow? -> next index
@@ -30,6 +31,7 @@ namespace AMDiS {
     nElements++;
   }
 
+
   void MeshStructure::clear()
   {
     currentCode = 0;
@@ -39,6 +41,7 @@ namespace AMDiS {
     currentElement = 0;
   }
 
+
   void MeshStructure::init(Mesh *mesh) 
   {
     clear();
@@ -53,28 +56,6 @@ namespace AMDiS {
     commit();
   }
 
-  void MeshStructure::init(Element *el, int ithSide, int elType, bool reverseOrder)
-  {
-    FUNCNAME("MeshStructure::init()");
-
-    clear();
-
-    int s1 = el->getSideOfChild(0, ithSide, elType);
-    int s2 = el->getSideOfChild(1, ithSide, elType);
-    
-    TEST_EXIT(s1 != -1 || s2 != -1)("This should not happen!\n");
-    
-    if (!el->isLeaf()) {
-      if (s1 == -1)
-	addAlongSide(el->getSecondChild(), s2, el->getChildType(elType), reverseOrder);
-      else if (s2 == -1)
-	addAlongSide(el->getFirstChild(), s1, el->getChildType(elType), reverseOrder);
-      else
-	addAlongSide(el, ithSide, elType, reverseOrder);
-    }
-
-    commit();    
-  }
 
   void MeshStructure::init(BoundaryObject &bound)
   {
@@ -84,56 +65,58 @@ namespace AMDiS {
 
     clear();
 
-    int s1 = el->getSideOfChild(0, bound.ithObj, bound.elType);
-    int s2 = el->getSideOfChild(1, bound.ithObj, bound.elType);
+    int s1 = el->getSubObjOfChild(0, bound.subObj, bound.ithObj, bound.elType);
+    int s2 = el->getSubObjOfChild(1, bound.subObj, bound.ithObj, bound.elType);
     
     TEST_EXIT(s1 != -1 || s2 != -1)("This should not happen!\n");
     
     if (!el->isLeaf()) {
       if (s1 == -1)
-	addAlongSide(el->getSecondChild(), s2, 
+	addAlongSide(el->getSecondChild(), bound.subObj, s2, 
 		     el->getChildType(bound.elType), bound.reverseMode);
       else if (s2 == -1)
-	addAlongSide(el->getFirstChild(), s1, 
+	addAlongSide(el->getFirstChild(), bound.subObj, s1, 
 		     el->getChildType(bound.elType), bound.reverseMode);
       else
-	addAlongSide(el, bound.ithObj, bound.elType, bound.reverseMode);
+	addAlongSide(el, bound.subObj, bound.ithObj, bound.elType, bound.reverseMode);
     }
 
     commit();    
   }
 
-  void MeshStructure::addAlongSide(Element *el, int ithSide, int elType, 
-				   bool reverseOrder)
+
+  void MeshStructure::addAlongSide(Element *el, GeoIndex subObj, int ithObj, 
+				   int elType, bool reverseOrder)
   {
     FUNCNAME("MeshStructure::addAlongSide()");
 
     if (debugMode) {
       MSG("addAlondSide(%d, %d, %d, %d)\n",
-	  el->getIndex(), ithSide, elType, reverseOrder);
+	  el->getIndex(), ithObj, elType, reverseOrder);
       MSG("Element is leaf: %d\n", el->isLeaf());
     }
     
     insertElement(el->isLeaf());
     
     if (!el->isLeaf()) {
-      int s1 = el->getSideOfChild(0, ithSide, elType);
-      int s2 = el->getSideOfChild(1, ithSide, elType);
+      int s1 = el->getSubObjOfChild(0, subObj, ithObj, elType);
+      int s2 = el->getSubObjOfChild(1, subObj, ithObj, elType);
 
       if (!reverseOrder) {
 	if (s1 != -1) 
-	  addAlongSide(el->getFirstChild(), s1, el->getChildType(elType), false);
+	  addAlongSide(el->getFirstChild(), subObj, s1, el->getChildType(elType), false);
 	if (s2 != -1)
-	  addAlongSide(el->getSecondChild(), s2, el->getChildType(elType), false);
+	  addAlongSide(el->getSecondChild(), subObj, s2, el->getChildType(elType), false);
       } else {
 	if (s2 != -1)
-	  addAlongSide(el->getSecondChild(), s2, el->getChildType(elType), false);
+	  addAlongSide(el->getSecondChild(), subObj, s2, el->getChildType(elType), false);
 	if (s1 != -1) 
-	  addAlongSide(el->getFirstChild(), s1, el->getChildType(elType), false);
+	  addAlongSide(el->getFirstChild(), subObj, s1, el->getChildType(elType), false);
       }
     }
   }
 
+
   void MeshStructure::reset() 
   {
     currentIndex = 0;
@@ -146,6 +129,7 @@ namespace AMDiS {
       currentCode = 0;
   }
 
+
   bool MeshStructure::nextElement(MeshStructure *insert)
   {
     FUNCNAME("MeshStructure::nextElement()");
@@ -172,6 +156,7 @@ namespace AMDiS {
     return true;
   }
 
+
   bool MeshStructure::skipBranch(MeshStructure *insert)
   {
     FUNCNAME("MeshStructure::skipBranch()");
@@ -187,6 +172,7 @@ namespace AMDiS {
     }
   }
 
+
   void MeshStructure::merge(MeshStructure *structure1,
 			    MeshStructure *structure2,
 			    MeshStructure *result)
@@ -219,6 +205,7 @@ namespace AMDiS {
     result->commit();
   }
 
+
   void MeshStructure::fitMeshToStructure(Mesh *mesh,
 					 RefinementManager *manager,
 					 bool checkPartition,
@@ -271,7 +258,7 @@ namespace AMDiS {
     }
 
     // refine mesh
-    bool finished;
+    bool finished = true;
 
     do {
       finished = true;
@@ -290,6 +277,7 @@ namespace AMDiS {
     } while (!finished);
   }
 
+
   bool MeshStructure::compare(MeshStructure &other)
   {
     return (other.getCode() == code);
diff --git a/AMDiS/src/MeshStructure.h b/AMDiS/src/MeshStructure.h
index 2a5f6107e64875a4bbf529618453aec0bded58dd..1b10066cd29a166f7796f098285a4b25ef7c7f79 100644
--- a/AMDiS/src/MeshStructure.h
+++ b/AMDiS/src/MeshStructure.h
@@ -45,9 +45,7 @@ namespace AMDiS {
 
     /// Creates a mesh structure code from a mesh object by traversing it in preorder.
     void init(Mesh *mesh);
-
-    void init(Element *el, int ithSide, int elType, bool reverseOrder);
-
+   
     void init(BoundaryObject &bound);
 
     void init(const std::vector<unsigned long int>& initCode, int n) 
@@ -160,7 +158,7 @@ namespace AMDiS {
     /// Insert a new element to the structure code. Is used by the init function.
     void insertElement(bool isLeaf);
 
-    void addAlongSide(Element *el, int ithSide, int elType, bool reverseOrder);
+    void addAlongSide(Element *el, GeoIndex subObj, int ithObj, int elType, bool reverseOrder);
 
     /// Merges two mesh structure codes to one structure code.     
     void merge(MeshStructure *structure1,
diff --git a/AMDiS/src/ProblemVec.cc b/AMDiS/src/ProblemVec.cc
index 40b6b4ad20b0f54ec96f394cb3663fd300c09aae..f2c288702bd875f7556cd5acdc7134ecc684539f 100644
--- a/AMDiS/src/ProblemVec.cc
+++ b/AMDiS/src/ProblemVec.cc
@@ -564,7 +564,7 @@ namespace AMDiS {
     // here is reached already because of time adaption
     allowFirstRefinement();
 
-    TEST_EXIT_DBG(static_cast<unsigned int>(nComponents == marker.size()))
+    TEST_EXIT_DBG(static_cast<unsigned int>(nComponents) == marker.size())
       ("Wrong number of markers!\n");
 
     Flag markFlag = 0;
diff --git a/AMDiS/src/Tetrahedron.cc b/AMDiS/src/Tetrahedron.cc
index 71eb822de119f10c0fa85cfa17a00dcb62b342ea..be3b836660f09d5c7ea120612dac7b0ed6ef390f 100644
--- a/AMDiS/src/Tetrahedron.cc
+++ b/AMDiS/src/Tetrahedron.cc
@@ -73,6 +73,7 @@ namespace AMDiS {
 					     {4, 2, 0},  // face 2
 					     {3, 1, 0}}; // face 3
 
+
   bool Tetrahedron::hasSide(Element* sideElem) const
   {
     FUNCNAME("Tetrahedron::hasSide()");
@@ -81,6 +82,7 @@ namespace AMDiS {
     return false;
   }
 
+
   int Tetrahedron::getVertexOfPosition(GeoIndex position,
 				       int positionIndex,
 				       int vertexIndex) const 
@@ -105,6 +107,7 @@ namespace AMDiS {
     }
   }
 
+
   const FixVec<int, WORLD>& Tetrahedron::sortFaceIndices(int face, 
 							 FixVec<int,WORLD> *vec) const
   {
@@ -275,21 +278,42 @@ namespace AMDiS {
     FUNCNAME("Tetrahedron::getVertexDofsAtEdge()");
 
     if (!child[0])
-      return;
+      return;    
 
     BoundaryObject nextBound0 = bound, nextBound1 = bound;
     prepareNextBound(nextBound0, 0);
     prepareNextBound(nextBound1, 1);
 
-    if (bound.ithObj == 0) {
-      child[0]->getVertexDofs(feSpace, nextBound0, dofs);
-      dofs.push_back(child[0]->getDOF(3));
-      child[1]->getVertexDofs(feSpace, nextBound1, dofs);
-    } else {
-      if (nextBound0.ithObj != -1)
+    switch (bound.ithObj) {
+    case 0:      
+      nextBound0.reverseMode = false;
+      nextBound1.reverseMode = false;
+
+      if (bound.reverseMode) {
+	child[1]->getVertexDofs(feSpace, nextBound0, dofs);
+	dofs.push_back(child[0]->getDOF(3));
+	child[0]->getVertexDofs(feSpace, nextBound1, dofs);
+      } else {
 	child[0]->getVertexDofs(feSpace, nextBound0, dofs);
+	dofs.push_back(child[0]->getDOF(3));
+	child[1]->getVertexDofs(feSpace, nextBound1, dofs);
+      }
+
+      break;
+    case 5:
+      TEST_EXIT_DBG(nextBound0.ithObj == nextBound1.ithObj)("Should not happen!\n");
 
       if (nextBound0.ithObj != -1)
+	child[0]->getVertexDofs(feSpace, nextBound0, dofs);      
+      break;
+    default:
+      TEST_EXIT_DBG(nextBound0.ithObj == -1 || nextBound1.ithObj == -1)
+	("This should not happen!\n");
+      
+      if (nextBound0.ithObj != -1)
+	child[0]->getVertexDofs(feSpace, nextBound0, dofs);      
+
+      if (nextBound1.ithObj != -1)
 	child[1]->getVertexDofs(feSpace, nextBound1, dofs);
     }
   }
diff --git a/AMDiS/src/Tetrahedron.h b/AMDiS/src/Tetrahedron.h
index 0b312eb46d7fede67b5dd61a306947dc572e8d0a..5a62b11347f627d291aba5e40ed88928bf1a2fd5 100644
--- a/AMDiS/src/Tetrahedron.h
+++ b/AMDiS/src/Tetrahedron.h
@@ -206,32 +206,66 @@ namespace AMDiS {
     static const int edgeOfFace[4][3];
 
     /// implements Element::getSideOfChild()
-    virtual int getSideOfChild(int child, int side, int elType = 0) const 
+    int getSideOfChild(int child, int side, int elType = 0) const 
     {
       FUNCNAME("Tetrahedron::getSideOfChild()");
-      TEST_EXIT_DBG(child==0 || child==1)("child must be in (0,1)\n");
-      TEST_EXIT_DBG(side >= 0 && side <= 3)("side must be between 0 and 3\n");
-      TEST_EXIT_DBG(elType >= 0 && elType <= 2)("elType must be between 0 and 2\n");
+
+      TEST_EXIT_DBG(child == 0 || child == 1)("Child must be in (0,1)!\n");
+      TEST_EXIT_DBG(side >= 0 && side <= 3)("Side must be between 0 and 3!\n");
+      TEST_EXIT_DBG(elType >= 0 && elType <= 2)("ElType must be between 0 and 2!\n");
+
       return sideOfChild[elType][child][side];
     }
 
+    /** \brief
+     * Returns for an edge number its local edge number on a child element. See
+     * \ref edgeOfChild for mor information.
+     */
+    inline int getEdgeOfChild(int child, int edge, int elType) const
+    {
+      FUNCNAME("Tetrahedron::getEdgeOfChild()");
+
+      TEST_EXIT_DBG(child == 0 || child == 1)("Child must be in (0,1)!\n");
+      TEST_EXIT_DBG(edge >= 0 && edge <= 5)("Side must be between 0 and 3!\n");
+      TEST_EXIT_DBG(elType >= 0 && elType <= 2)("ElType must be between 0 and 2!\n");
+
+      return edgeOfChild[elType][child][edge];
+    }
+
+    int getSubObjOfChild(int childnr, GeoIndex subObj, int ithObj, int elType) const
+    {
+      FUNCNAME("Tetrahedron::getSubObjOfChild()");
+
+      TEST_EXIT_DBG(subObj == EDGE || subObj == FACE)("Not yet implemented!\n");
+
+      if (subObj == FACE)
+	return getSideOfChild(childnr, ithObj, elType);
+      else
+	return getEdgeOfChild(childnr, ithObj, elType);
+    }
+
     /// implements Element::getVertexOfParent()
-    virtual int getVertexOfParent(int child, int side, int elType = 0) const 
+    int getVertexOfParent(int child, int side, int elType = 0) const 
     {
       FUNCNAME("Tetrahedron::getVertexOfParent()");
-      TEST_EXIT_DBG(child==0 || child==1)("child must be in (0,1)\n");
-      TEST_EXIT_DBG(side >= 0 && side <= 3)("side must be between 0 and 3\n");
-      TEST_EXIT_DBG(elType >= 0 && elType <= 2)("elType must be between 0 and 2\n");
+
+      TEST_EXIT_DBG(child == 0 || child == 1)("Child must be in (0,1)!\n");
+      TEST_EXIT_DBG(side >= 0 && side <= 3)("Side must be between 0 and 3!\n");
+      TEST_EXIT_DBG(elType >= 0 && elType <= 2)("ElType must be between 0 and 2!\n");
+
       return vertexOfParent[elType][child][side];
     }
 
     inline int getEdgeOfFace(int face, int edge) const 
     {
-      TEST_EXIT_DBG(face >= 0 && face < 4)("invalid face\n");
-      TEST_EXIT_DBG(edge >= 0 && edge < 3)("invalid edge\n");
+      FUNCNAME("Tetrahedron::getEdgeOfFace()");
+
+      TEST_EXIT_DBG(face >= 0 && face < 4)("Invalid face number!\n");
+      TEST_EXIT_DBG(edge >= 0 && edge < 3)("Invalid edge number!\n");
+
       return edgeOfFace[face][edge];
     }
-
+   
   protected:
 
     /// vertexOfEdge[i][j] is the local number of the j-vertex of edge i
diff --git a/AMDiS/src/Triangle.h b/AMDiS/src/Triangle.h
index 54d07f681d10e4516bd77b50c3c8d27b73f07730..91e5d114525f632c6f67f5db95a756116b83691e 100644
--- a/AMDiS/src/Triangle.h
+++ b/AMDiS/src/Triangle.h
@@ -124,17 +124,28 @@ namespace AMDiS {
     virtual int getSideOfChild(int child, int side, int) const 
     {
       FUNCNAME("Triangle::getSideOfChild()");
-      TEST_EXIT_DBG(child==0 || child==1)("child must be in (0,1)\n");
+
+      TEST_EXIT_DBG(child == 0 || child == 1)("child must be in (0,1)\n");
       TEST_EXIT_DBG(side >= 0 && side <= 2)("side must be between 0 and 2\n");
 
       return sideOfChild[child][side];
     }
 
+    int getSubObjOfChild(int childnr, GeoIndex subObj, int ithObj, int elType) const
+    {
+      FUNCNAME("Triangle::getSubObjOfChild()");
+
+      TEST_EXIT_DBG(subObj == EDGE)("Not yet implemented!\n");
+
+      return getSideOfChild(childnr, ithObj, elType);
+    }
+
     /// implements Element::getVertexOfParent()
     virtual int getVertexOfParent(int child, int side, int = 0) const 
     {
       FUNCNAME("Triangle::getVertexOfParent()");
-      TEST_EXIT_DBG(child==0 || child==1)("child must be in (0,1)\n");
+
+      TEST_EXIT_DBG(child == 0 || child == 1)("child must be in (0,1)\n");
       TEST_EXIT_DBG(side >= 0 && side <= 2)("side must be between 0 and 2\n");
 
       return vertexOfParent[child][side];
diff --git a/AMDiS/src/parallel/InteriorBoundary.cc b/AMDiS/src/parallel/InteriorBoundary.cc
index ee21d882df49ea3656c09ba58b9c2990c75f6fc8..878eb36e30652e3c9d9808e3b850eea4d0c2898a 100644
--- a/AMDiS/src/parallel/InteriorBoundary.cc
+++ b/AMDiS/src/parallel/InteriorBoundary.cc
@@ -18,13 +18,41 @@ namespace AMDiS {
       break;
 
     case 3:
-      if (ithObj == 2 || ithObj == 3) {
+      if (subObj == EDGE) {	
+	int el0_v0 = el->getVertexOfEdge(ithObj, 0);
+	int el0_v1 = el->getVertexOfEdge(ithObj, 1);
+	int el1_v0 = el->getVertexOfEdge(otherBound.ithObj, 0);
+	int el1_v1 = el->getVertexOfEdge(otherBound.ithObj, 1);
+
+	const BasisFunction *basFcts = feSpace->getBasisFcts();
+	int nBasFcts = basFcts->getNumber();
+	std::vector<DegreeOfFreedom> localDofs0(nBasFcts), localDofs1(nBasFcts);
+	basFcts->getLocalIndices(el, feSpace->getAdmin(), localDofs0);
+	basFcts->getLocalIndices(otherBound.el, feSpace->getAdmin(), localDofs1);
+
+	TEST_EXIT_DBG(localDofs0[el0_v0] == localDofs1[el1_v0] ||
+		      localDofs0[el0_v0] == localDofs1[el1_v1])
+	  ("This should not happen!\n");
+	TEST_EXIT_DBG(localDofs0[el0_v1] == localDofs1[el1_v0] ||
+		      localDofs0[el0_v1] == localDofs1[el1_v1])
+	  ("This should not happen!\n");
+	
+ 	if (localDofs0[el0_v0] != localDofs1[el1_v0])
+	  otherMode = true; 	
+      }
+
+      if (subObj == FACE && ithObj != 1) {
 	const BasisFunction *basFcts = feSpace->getBasisFcts();
 	int nBasFcts = basFcts->getNumber();
 	std::vector<DegreeOfFreedom> localDofs0(nBasFcts), localDofs1(nBasFcts);
-    	basFcts->getLocalIndices(el, feSpace->getAdmin(), localDofs0);
+	basFcts->getLocalIndices(el, feSpace->getAdmin(), localDofs0);
 	basFcts->getLocalIndices(otherBound.el, feSpace->getAdmin(), localDofs1);
-	otherMode = (localDofs0[0] != localDofs1[0]);
+	
+	if (ithObj == 2 || ithObj == 3)
+	  otherMode = (localDofs0[0] != localDofs1[0]);
+	  
+	if (ithObj == 0)
+	  otherMode = localDofs0[1] != localDofs1[1];	
       }
       break;
 
diff --git a/AMDiS/src/parallel/ParallelDomainBase.cc b/AMDiS/src/parallel/ParallelDomainBase.cc
index 559728afc919245664cc9948cabc6ae193df4cd3..a102ed85159a7c41991d021a983078151330085d 100644
--- a/AMDiS/src/parallel/ParallelDomainBase.cc
+++ b/AMDiS/src/parallel/ParallelDomainBase.cc
@@ -135,6 +135,10 @@ namespace AMDiS {
 
     createInteriorBoundaryInfo();
 
+#if (DEBUG != 0)
+    ParallelDomainDbg::printBoundaryInfo(*this);
+#endif
+
     // === Create new global and local DOF numbering. ===
 
     createLocalGlobalNumbering();
@@ -156,7 +160,7 @@ namespace AMDiS {
     ParallelDomainDbg::testCommonDofs(*this, true);
     MSG("Debug mode tests finished!\n");
 
-    debug::writeMesh(feSpace, -1, "macromesh");   
+    debug::writeMesh(feSpace, -1, "macro_mesh");   
 #endif
 
     // === Create periodic dof mapping, if there are periodic boundaries. ===
@@ -172,13 +176,13 @@ namespace AMDiS {
       refineManager->globalRefine(mesh, globalRefinement);
 
 #if (DEBUG != 0)
-    debug::writeMesh(feSpace, -1, "grmesh");
+      debug::writeMesh(feSpace, -1, "gr_mesh");
 #endif
 
       updateLocalGlobalNumbering();
-
+      
       // === Update periodic mapping, if there are periodic boundaries. ===
-
+      
       createPeriodicMap();
     }
 
@@ -358,8 +362,6 @@ namespace AMDiS {
   {
     FUNCNAME("ParallelDomainBase::checkMeshChange()");
 
-    int dim = mesh->getDim();
-
     // === If mesh has not been changed on all ranks, return. ===
 
     int recvAllValues = 0;
@@ -380,16 +382,20 @@ namespace AMDiS {
       RankToBoundMap allBound;
 
       for (InteriorBoundary::iterator it(myIntBoundary); !it.end(); ++it)
-	if (it->rankObj.subObj == INDEX_OF_DIM(dim - 1, dim))
+	if (it->rankObj.subObj == EDGE || it->rankObj.subObj == FACE)
 	  allBound[it.getRank()].push_back(*it);
 
       for (InteriorBoundary::iterator it(otherIntBoundary); !it.end(); ++it)
-	if (it->rankObj.subObj == INDEX_OF_DIM(dim - 1, dim))
+	if (it->rankObj.subObj == EDGE || it->rankObj.subObj == FACE)
 	  allBound[it.getRank()].push_back(*it);
 
 
       // === Check the boundaries and adapt mesh if necessary. ===
 
+#if (DEBUG != 0)
+      MSG("Run checkAndAdaptBoundary ...\n");
+#endif
+
       bool meshChanged = checkAndAdaptBoundary(allBound);
 
       // === Check on all ranks if at least one rank's mesh has changed. ===
@@ -397,6 +403,10 @@ namespace AMDiS {
       int sendValue = static_cast<int>(!meshChanged);
       recvAllValues = 0;
       mpiComm.Allreduce(&sendValue, &recvAllValues, 1, MPI_INT, MPI_SUM);
+
+#if (DEBUG != 0)
+      MSG("Mesh changed on %d ranks!\n", recvAllValues);
+#endif
     } while (recvAllValues != 0);
 
 
@@ -408,7 +418,7 @@ namespace AMDiS {
 		  TIME_USED(first, clock()));
 
     // === Because the mesh has been changed, update the DOF numbering and mappings. ===
-   
+
     updateLocalGlobalNumbering();
   }
 
@@ -455,6 +465,7 @@ namespace AMDiS {
 
 	  bool b = fitElementToMeshCode(recvCodes[i], 
 					boundIt->rankObj.el,
+					boundIt->rankObj.subObj,
 					boundIt->rankObj.ithObj, 
 					boundIt->rankObj.elType);  
 
@@ -472,7 +483,8 @@ namespace AMDiS {
 
   bool ParallelDomainBase::fitElementToMeshCode(MeshStructure &code, 
 						Element *el, 
-						int ithSide, 
+						GeoIndex subObj,
+						int ithObj, 
 						int elType)
   {
     FUNCNAME("ParallelDomainBase::fitElementToMeshCode()");
@@ -481,9 +493,9 @@ namespace AMDiS {
 
     if (code.empty())
       return false;
-    
-    int s1 = el->getSideOfChild(0, ithSide, elType);
-    int s2 = el->getSideOfChild(1, ithSide, elType);
+
+    int s1 = el->getSubObjOfChild(0, subObj, ithObj, elType);
+    int s2 = el->getSubObjOfChild(1, subObj, ithObj, elType);
 
     TEST_EXIT_DBG(s1 != -1 || s2 != -1)("This should not happen!\n");
 
@@ -497,7 +509,7 @@ namespace AMDiS {
 	elInfo = stack.traverseNext(elInfo);
       }
 
-      meshChanged = fitElementToMeshCode2(code, stack, ithSide, elType);
+      meshChanged = fitElementToMeshCode2(code, stack, subObj, ithObj, elType);
       return meshChanged;
     }
 
@@ -505,15 +517,22 @@ namespace AMDiS {
       if (code.getNumElements() == 1 && code.isLeafElement())
 	return false;     
 
-      ERROR_EXIT("NOT YET WORKING!\n");
-      
-      ElInfo *elInfo = el->getMesh()->createNewElInfo();    
-      //      el->getMesh()->fillElInfo(elInfo, el, Mesh::FILL_NEIGH | Mesh::FILL_BOUND);
+      meshChanged = true;
+
+      TraverseStack stack;
+      ElInfo *elInfo = 
+	stack.traverseFirst(el->getMesh(), -1, Mesh::CALL_EVERY_EL_PREORDER | Mesh::FILL_NEIGH | Mesh::FILL_BOUND);
+
+      while (elInfo && elInfo->getElement() != el) {
+	elInfo = stack.traverseNext(elInfo);
+      }
+
+      TEST_EXIT_DBG(elInfo)("This should not happen!\n");
+
       el->setMark(1);
+      refineManager->setMesh(el->getMesh());
+      refineManager->setStack(&stack);
       refineManager->refineFunction(elInfo);
-      delete elInfo;
-
-      meshChanged = true;
     }
 
     if (s1 != -1) {
@@ -525,7 +544,8 @@ namespace AMDiS {
 	elInfo = stack.traverseNext(elInfo);
       }
 
-      meshChanged |= fitElementToMeshCode2(code, stack, s1, el->getChildType(elType));
+      meshChanged |= 
+	fitElementToMeshCode2(code, stack, subObj, s1, el->getChildType(elType));
     } else {
       TraverseStack stack;
       ElInfo *elInfo = 
@@ -535,7 +555,8 @@ namespace AMDiS {
 	elInfo = stack.traverseNext(elInfo);
       }
 
-      meshChanged |= fitElementToMeshCode2(code, stack, s2, el->getChildType(elType));
+      meshChanged |= 
+	fitElementToMeshCode2(code, stack, subObj, s2, el->getChildType(elType));
     }
 
     return meshChanged;
@@ -544,7 +565,8 @@ namespace AMDiS {
 
   bool ParallelDomainBase::fitElementToMeshCode2(MeshStructure &code, 
 						 TraverseStack &stack,
-						 int ithSide, 
+						 GeoIndex subObj,
+						 int ithObj, 
 						 int elType)
   {
     FUNCNAME("ParallelDomainBase::fitElementToMeshCode2()");
@@ -578,13 +600,13 @@ namespace AMDiS {
       value = true;
     }
 
-    int s1 = el->getSideOfChild(0, ithSide, elType);
-    int s2 = el->getSideOfChild(1, ithSide, elType);
+    int s1 = el->getSubObjOfChild(0, subObj, ithObj, elType);
+    int s2 = el->getSubObjOfChild(1, subObj, ithObj, elType);
 
     if (s1 != -1) {
       stack.traverseNext(elInfo);
       code.nextElement();
-      value |= fitElementToMeshCode2(code, stack, s1, el->getChildType(elType));
+      value |= fitElementToMeshCode2(code, stack, subObj, s1, el->getChildType(elType));
       elInfo = stack.getElInfo();
     } else {
       do {
@@ -597,7 +619,7 @@ namespace AMDiS {
 
     if (s2 != -1) {
       code.nextElement();
-      value |= fitElementToMeshCode2(code, stack, s2, el->getChildType(elType));
+      value |= fitElementToMeshCode2(code, stack, subObj, s2, el->getChildType(elType));
     } else {
       int level = elInfo->getLevel();
 
@@ -952,6 +974,8 @@ namespace AMDiS {
     std::map<GlobalEdge, int> edgeOwner;
     // Maps each edge in ranks partition to the element object that contains this edge.
     std::map<GlobalEdge, BoundaryObject> rankEdges;
+    // Stores to every element index a pointer to this element.
+    std::map<int, Element*> elIndexMap;
 
 
     // === Traverse whole mesh and fill the maps defined above.                    ===
@@ -960,6 +984,9 @@ namespace AMDiS {
     ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_LEAF_EL);
     while (elInfo) {
       Element *el = elInfo->getElement();
+
+      elIndexMap[el->getIndex()] = el;
+
       basFcts->getLocalIndices(el, feSpace->getAdmin(), localIndices);
 
       PartitionElementData *partitionData = dynamic_cast<PartitionElementData*>
@@ -1137,11 +1164,13 @@ namespace AMDiS {
 	 it != stdMpiEdge.getRecvData().end(); ++it) {
       for (unsigned int i = 0; i < it->second.size(); i++) {
 	TEST_EXIT_DBG(stdMpiObjs.getRecvData(it->first).size() > i)
-	  ("Should not happen!\n");
+	  ("This should not happen!\n");
 	
 	AtomicBoundary& b = myIntBoundary.getNewAtomic(it->first); 
 	b.rankObj = rankEdges[it->second[i]];
 	b.neighObj = stdMpiObjs.getRecvData(it->first)[i];
+	b.neighObj.el = elIndexMap[b.neighObj.elIndex];
+	b.rankObj.setReverseMode(b.neighObj, feSpace);
 	
 	sendObjects[it->first].push_back(b.rankObj);
 
@@ -1165,12 +1194,14 @@ namespace AMDiS {
 	it != recvObjs.end(); ++it) {
       if (it->second.size() > 0) {	
 	TEST_EXIT_DBG(it->second.size() == stdMpiObjs.getRecvData(it->first).size())
-	  ("Should not happen!\n");
+	  ("This should not happen!\n");
 
 	for (unsigned int i = 0; i < it->second.size(); i++) {
 	  AtomicBoundary& b = otherIntBoundary.getNewAtomic(it->first); 
 	  b.rankObj = it->second[i];
-	  b.neighObj = stdMpiObjs.getRecvData(it->first)[i];  	  
+	  b.neighObj = stdMpiObjs.getRecvData(it->first)[i];  	 
+	  b.neighObj.el = elIndexMap[b.neighObj.elIndex]; 
+	  b.neighObj.setReverseMode(b.rankObj, feSpace);
 	}
       }
     }
@@ -1527,22 +1558,38 @@ namespace AMDiS {
       DofContainer dofs;	
       it->rankObj.el->getVertexDofs(feSpace, it->rankObj, dofs);
       it->rankObj.el->getNonVertexDofs(feSpace, it->rankObj, dofs);
+     
+      for (int i = 0; i < static_cast<int>(dofs.size()); i++) {
+	/* FOR DEBUGGING
+	  WorldVector<double> cs;
+	  mesh->getDofIndexCoords(dofs[i], feSpace, cs);
+	  MSG("SEND EL %d DOF %d TO %d\n", it->rankObj.elIndex, *(dofs[i]), it.getRank());
+	  MSG("COORDS: %f %f %f\n", cs[0], cs[1], cs[2]);
+	*/
 
-      for (int i = 0; i < static_cast<int>(dofs.size()); i++)
 	sendDofs[it.getRank()].push_back(dofs[i]);      
+      }
     }
 
+
     for (InteriorBoundary::iterator it(otherIntBoundary); !it.end(); ++it) {
       DofContainer dofs;
       it->rankObj.el->getVertexDofs(feSpace, it->rankObj, dofs);
       it->rankObj.el->getNonVertexDofs(feSpace, it->rankObj, dofs);
-      
+     
       for (int i = 0; i < static_cast<int>(dofs.size()); i++) {
 	DofContainer::iterator eraseIt = 
 	  find(rankDofs.begin(), rankDofs.end(), dofs[i]);
 	if (eraseIt != rankDofs.end()) 
 	  rankDofs.erase(eraseIt);	 
-	
+
+	/* FOR DEBUGGING
+	   WorldVector<double> cs;
+	   mesh->getDofIndexCoords(dofs[i], feSpace, cs);	
+	   MSG("RECV EL %d DOF %d FROM %d\n", it->rankObj.elIndex, *(dofs[i]), it.getRank());
+	   MSG("COORDS: %f %f %f\n", cs[0], cs[1], cs[2]);
+	*/
+
 	recvDofs[it.getRank()].push_back(dofs[i]);
       }
     }
@@ -1588,8 +1635,13 @@ namespace AMDiS {
       i++;
     }
 
+
     // === Send new DOF indices. ===
 
+#if (DEBUG != 0)
+    ParallelDomainDbg::testDofContainerCommunication(*this, sendDofs, recvDofs);
+#endif
+
     StdMpi<std::vector<DegreeOfFreedom> > stdMpi(mpiComm, false);
     for (RankToDofContainer::iterator sendIt = sendDofs.begin();
 	 sendIt != sendDofs.end(); ++sendIt, i++) {
@@ -1603,6 +1655,7 @@ namespace AMDiS {
     stdMpi.recv(recvDofs);
     stdMpi.startCommunication<int>(MPI_INT);
 
+
     for (RankToDofContainer::iterator recvIt = recvDofs.begin();
 	 recvIt != recvDofs.end(); ++recvIt) {      
       int j = 0;
@@ -1613,6 +1666,7 @@ namespace AMDiS {
       }
     }
 
+
     // === Create now the local to global index and local to dof index mappings.  ===
 
     createLocalMappings(rankDofsNewLocalIndex, rankOwnedDofsNewLocalIndex,
@@ -1626,13 +1680,15 @@ namespace AMDiS {
     updateDofAdmins();
 
     lastMeshChangeIndex = mesh->getChangeIndex();
-
+    
 #if (DEBUG != 0)
     debug::testSortedDofs(mesh, elMap);
+    debug::writeMesh(feSpace, -1, "last_update_mesh");
     ParallelDomainDbg::testCommonDofs(*this, true);
 #endif
   }
 
+
   void ParallelDomainBase::createLocalMappings(DofIndexMap &rankDofsNewLocalIndex,
 					       DofIndexMap &rankOwnedDofsNewLocalIndex,
 					       DofIndexMap &rankDofsNewGlobalIndex)
@@ -1742,6 +1798,7 @@ namespace AMDiS {
     sort(rankOwnedDofs.begin(), rankOwnedDofs.end(), cmpDofsByValue);
   }
 
+
   void ParallelDomainBase::createPeriodicMap()
   {
     FUNCNAME("ParallelDomainBase::createPeriodicMap()");
@@ -1999,6 +2056,7 @@ namespace AMDiS {
     probStat->deserialize(in);
   }
 
+
   void ParallelDomainBase::serialize(std::ostream &out, PeriodicDofMap &data)
   {
     int mapSize = data.size();
@@ -2012,6 +2070,7 @@ namespace AMDiS {
     }
   }
 
+
   void ParallelDomainBase::deserialize(std::istream &in, PeriodicDofMap &data)
   {
     data.clear();
diff --git a/AMDiS/src/parallel/ParallelDomainBase.h b/AMDiS/src/parallel/ParallelDomainBase.h
index 4b9b9b3622f05381ed1022787d53984493e4fa74..e21b614ef150bb015ab8e5ebe8037c8fd31ff777 100644
--- a/AMDiS/src/parallel/ParallelDomainBase.h
+++ b/AMDiS/src/parallel/ParallelDomainBase.h
@@ -295,12 +295,14 @@ namespace AMDiS {
 
     bool fitElementToMeshCode(MeshStructure &code, 
 			      Element *el, 
-			      int ithSide, 
+			      GeoIndex subObj,
+			      int ithObj, 
 			      int elType);
     
     bool fitElementToMeshCode2(MeshStructure &code, 
 			       TraverseStack &stack,
-			       int ithSide, 
+			       GeoIndex subObj,
+			       int ithObj, 
 			       int elType);
 
     /// Writes a vector of dof pointers to an output stream.
diff --git a/AMDiS/src/parallel/ParallelDomainDbg.cc b/AMDiS/src/parallel/ParallelDomainDbg.cc
index 6d5a8fe3cf5e005f853f6a356847a91274ac429f..feba89231cc5b95e865f98e0694578f859a2b3f0 100644
--- a/AMDiS/src/parallel/ParallelDomainDbg.cc
+++ b/AMDiS/src/parallel/ParallelDomainDbg.cc
@@ -240,6 +240,30 @@ namespace AMDiS {
   }
 
 
+  void ParallelDomainDbg::testDofContainerCommunication(ParallelDomainBase &pdb, 
+							RankToDofContainer &sendDofs,
+							RankToDofContainer &recvDofs)
+  {
+    FUNCNAME("ParallelDomainDbg::testDofContainerCommunication()");
+
+    std::map<int, int> sendNumber;
+    for (RankToDofContainer::iterator it = sendDofs.begin(); it != sendDofs.end(); ++it)
+      sendNumber[it->first] = it->second.size();
+    
+    StdMpi<int> stdMpi(pdb.mpiComm);
+    stdMpi.send(sendNumber);
+    for (RankToDofContainer::iterator it = recvDofs.begin(); it != recvDofs.end(); ++it)    
+      stdMpi.recv(it->first);
+    stdMpi.startCommunication<int>(MPI_INT);    
+       
+    for (std::map<int, int>::iterator it = stdMpi.getRecvData().begin();
+	 it != stdMpi.getRecvData().end(); ++it)
+      TEST_EXIT(it->second == static_cast<int>(recvDofs[it->first].size()))
+	("Rank expectes %d DOFs to receive from rank %d, but %d DOFs are received!\n", 
+	 recvDofs[it->first].size(), it->first, it->second);
+  }
+
+
   void ParallelDomainDbg::printMapLocalGlobal(ParallelDomainBase &pdb, int rank)
   {    
     if (rank == -1 || pdb.mpiRank == rank) {
@@ -345,4 +369,26 @@ namespace AMDiS {
     }
   }
 
+
+  void ParallelDomainDbg::printBoundaryInfo(ParallelDomainBase &pdb)
+  {
+    FUNCNAME("ParallelDomainDbg::printBoundaryInfo()");
+
+    for (InteriorBoundary::iterator it(pdb.myIntBoundary); !it.end(); ++it) {
+      MSG("Rank owned boundary with rank %d: \n", it.getRank());
+      MSG("  ranks obj-ind: %d  sub-obj: %d   ith-obj: %d\n",
+	  it->rankObj.elIndex, it->rankObj.subObj, it->rankObj.ithObj);
+      MSG("  neigh obj-ind: %d  sub-obj: %d   ith-obj: %d\n",
+	  it->neighObj.elIndex, it->neighObj.subObj, it->neighObj.ithObj);
+    }
+
+    for (InteriorBoundary::iterator it(pdb.otherIntBoundary); !it.end(); ++it) {
+      MSG("Other owned boundary with rank %d: \n", it.getRank());
+      MSG("  ranks obj-ind: %d  sub-obj: %d   ith-obj: %d\n",
+	  it->rankObj.elIndex, it->rankObj.subObj, it->rankObj.ithObj);
+      MSG("  neigh obj-ind: %d  sub-obj: %d   ith-obj: %d\n",
+	  it->neighObj.elIndex, it->neighObj.subObj, it->neighObj.ithObj);
+    }
+  }
+
 }
diff --git a/AMDiS/src/parallel/ParallelDomainDbg.h b/AMDiS/src/parallel/ParallelDomainDbg.h
index 4224adbccc42f463201ac6f8b8e3b4467517a78f..e00f4571806729c1695bbc42b158e398d5656607 100644
--- a/AMDiS/src/parallel/ParallelDomainDbg.h
+++ b/AMDiS/src/parallel/ParallelDomainDbg.h
@@ -26,7 +26,11 @@
 
 namespace AMDiS {
    
-  class ParallelDomainDbg {
+  class ParallelDomainDbg 
+  {
+  protected:
+    typedef ParallelDomainBase::RankToDofContainer RankToDofContainer;
+
   public:
     /** \brief
      * Tests the interior boundaries on all ranks if their order fits together.
@@ -54,6 +58,18 @@ namespace AMDiS {
      */
     static void testAllElements(ParallelDomainBase &pdb);
 
+    /** \brief
+     * Tests for all ranks simultaneously, if the number of all send and received 
+     * DOFs fits together for all communication partners.
+     *
+     * \param[in]  pdb        Parallel problem definition used for debugging.
+     * \param[in]  sendDofs   The map of all DOFs the rank will send.
+     * \param[in]  recvDofs   The map of all DOFs the rank will receive.
+     */
+    static void testDofContainerCommunication(ParallelDomainBase &pdb, 
+					      RankToDofContainer &sendDofs,
+					      RankToDofContainer &recvDofs);
+
     /** \brief
      * This function is used for debugging only. It prints all information from
      * the local to global dof mapping, see \ref mapLocalGlobalDofs.
@@ -89,6 +105,13 @@ namespace AMDiS {
 			      int rank, 
 			      DofContainer& rankDofs, 
 			      DofContainer& rankAllDofs);
+
+    /** \brief
+     * This functions prints all information about all interior boundaries on all ranks.
+     *
+     * \param[in]  pdb           Parallel problem definition used for debugging.
+     */
+    static void printBoundaryInfo(ParallelDomainBase &pdb);
   };
   
 } // namespace AMDiS
diff --git a/AMDiS/src/parallel/StdMpi.cc b/AMDiS/src/parallel/StdMpi.cc
index 6e1e525fb352bbfb4592ca3452bf6c7f9c3e65f9..fd1c953648b514c6f8d714222d22987ff783d3f5 100644
--- a/AMDiS/src/parallel/StdMpi.cc
+++ b/AMDiS/src/parallel/StdMpi.cc
@@ -2,6 +2,11 @@
 
 namespace AMDiS {
 
+  int intSizeOf(int &data)
+  {
+    return 1;
+  }
+
   int intSizeOf(std::map<const DegreeOfFreedom*, DegreeOfFreedom> &data)
   {
     return data.size() * 2;
@@ -51,6 +56,16 @@ namespace AMDiS {
     return data.size();
   }
 
+  void makeBuf(int &data, int *buf)
+  {
+    buf[0] = data;
+  }
+
+  void makeFromBuf(int &data, int *buf, int bufSize)
+  {
+    data = buf[0];
+  }
+
   void makeBuf(std::map<const DegreeOfFreedom*, DegreeOfFreedom> &data, int* buf)
   {
     int i = 0;
diff --git a/AMDiS/src/parallel/StdMpi.h b/AMDiS/src/parallel/StdMpi.h
index 0c74719f4ae126d45e529fa257f28201f3df0471..a5187cb8a3ab65d681cc96a7365dc7c81dd1c26c 100644
--- a/AMDiS/src/parallel/StdMpi.h
+++ b/AMDiS/src/parallel/StdMpi.h
@@ -29,6 +29,8 @@
 
 namespace AMDiS {
 
+  int intSizeOf(int &data);
+
   int intSizeOf(std::map<const DegreeOfFreedom*, DegreeOfFreedom> &data);
 
   int intSizeOf(std::vector<MeshStructure> &data);
@@ -47,8 +49,12 @@ namespace AMDiS {
 
   int intSizeOf(std::vector<const DegreeOfFreedom*> &data);
 
+  void makeBuf(int &data, int *buf);
+
+  void makeFromBuf(int &data, int *buf, int bufSize);
+
   void makeBuf(std::map<const DegreeOfFreedom*, DegreeOfFreedom> &data, int* buf);
-  
+
   void makeFromBuf(std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > &data, 
 		   int *buf, int bufSize);