Commit e378e1c0 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Some performance improvements for 3d mesh traverse.

parent e6cccbb4
...@@ -140,6 +140,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ ...@@ -140,6 +140,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PETSC_DIR = @PETSC_DIR@ PETSC_DIR = @PETSC_DIR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
......
...@@ -1578,10 +1578,27 @@ linux*) ...@@ -1578,10 +1578,27 @@ linux*)
# before this can be enabled. # before this can be enabled.
hardcode_into_libs=yes 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 # Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then if test -f /etc/ld.so.conf; then
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' ' '` 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 /usr/lib $lt_ld_extra" sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
fi fi
# We used to test for /lib/ld.so.1 and disable shared libraries on # We used to test for /lib/ld.so.1 and disable shared libraries on
...@@ -4288,6 +4305,9 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) ...@@ -4288,6 +4305,9 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
# Is the compiler the GNU C compiler? # Is the compiler the GNU C compiler?
with_gcc=$_LT_AC_TAGVAR(GCC, $1) with_gcc=$_LT_AC_TAGVAR(GCC, $1)
gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
gcc_ver=\`gcc -dumpversion\`
# An ERE matcher. # An ERE matcher.
EGREP=$lt_EGREP EGREP=$lt_EGREP
...@@ -4421,11 +4441,11 @@ striplib=$lt_striplib ...@@ -4421,11 +4441,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
# Dependencies to place after the objects being linked to create a # Dependencies to place after the objects being linked to create a
# shared library. # shared library.
postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
...@@ -4437,7 +4457,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) ...@@ -4437,7 +4457,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
# The library search path used internally by the compiler when linking # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) 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"\`
# Method to check whether dependent libraries are shared objects. # Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method deplibs_check_method=$lt_deplibs_check_method
...@@ -4517,7 +4537,7 @@ variables_saved_for_relink="$variables_saved_for_relink" ...@@ -4517,7 +4537,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
# Compile-time system search path for libraries # Compile-time system search path for libraries
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec 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"\`
# Run-time system search path for libraries # Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
...@@ -6353,6 +6373,7 @@ do ...@@ -6353,6 +6373,7 @@ do
done done
done done
done done
IFS=$as_save_IFS
lt_ac_max=0 lt_ac_max=0
lt_ac_count=0 lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris # Add /usr/xpg4/bin/sed as it is typically found on Solaris
...@@ -6385,6 +6406,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do ...@@ -6385,6 +6406,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
done done
]) ])
SED=$lt_cv_path_SED SED=$lt_cv_path_SED
AC_SUBST([SED])
AC_MSG_RESULT([$SED]) AC_MSG_RESULT([$SED])
]) ])
......
...@@ -414,6 +414,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ ...@@ -414,6 +414,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PETSC_DIR = @PETSC_DIR@ PETSC_DIR = @PETSC_DIR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@ SHELL = @SHELL@
STRIP = @STRIP@ STRIP = @STRIP@
......
This diff is collapsed.
...@@ -93,6 +93,9 @@ CC="gcc" ...@@ -93,6 +93,9 @@ CC="gcc"
# Is the compiler the GNU C compiler? # Is the compiler the GNU C compiler?
with_gcc=yes with_gcc=yes
gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
gcc_ver=`gcc -dumpversion`
# An ERE matcher. # An ERE matcher.
EGREP="grep -E" EGREP="grep -E"
...@@ -229,11 +232,11 @@ striplib="strip --strip-unneeded" ...@@ -229,11 +232,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
predep_objects="" predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
# Dependencies to place after the objects being linked to create a # Dependencies to place after the objects being linked to create a
# shared library. # shared library.
postdep_objects="" postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
...@@ -245,7 +248,7 @@ postdeps="" ...@@ -245,7 +248,7 @@ postdeps=""
# The library search path used internally by the compiler when linking # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path="" compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
# Method to check whether dependent libraries are shared objects. # Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all" deplibs_check_method="pass_all"
...@@ -325,7 +328,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM ...@@ -325,7 +328,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs=unknown link_all_deplibs=unknown
# Compile-time system search path for libraries # Compile-time system search path for libraries
sys_lib_search_path_spec=" /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/" 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"`
# Run-time system search path for libraries # 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/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
...@@ -6809,6 +6812,9 @@ CC="g++" ...@@ -6809,6 +6812,9 @@ CC="g++"
# Is the compiler the GNU C compiler? # Is the compiler the GNU C compiler?
with_gcc=yes with_gcc=yes
gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
gcc_ver=`gcc -dumpversion`
# An ERE matcher. # An ERE matcher.
EGREP="grep -E" EGREP="grep -E"
...@@ -6942,11 +6948,11 @@ striplib="strip --strip-unneeded" ...@@ -6942,11 +6948,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
predep_objects="/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbeginS.o" 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"`
# Dependencies to place after the objects being linked to create a # Dependencies to place after the objects being linked to create a
# shared library. # shared library.
postdep_objects="/usr/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o" 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"`
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
...@@ -6958,7 +6964,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" ...@@ -6958,7 +6964,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
# The library search path used internally by the compiler when linking # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path="-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/../../.." 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"`
# Method to check whether dependent libraries are shared objects. # Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all" deplibs_check_method="pass_all"
...@@ -7038,7 +7044,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM ...@@ -7038,7 +7044,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs=unknown link_all_deplibs=unknown
# Compile-time system search path for libraries # Compile-time system search path for libraries
sys_lib_search_path_spec=" /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/" 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"`
# Run-time system search path for libraries # 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/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
...@@ -7114,6 +7120,9 @@ CC="g77" ...@@ -7114,6 +7120,9 @@ CC="g77"
# Is the compiler the GNU C compiler? # Is the compiler the GNU C compiler?
with_gcc=yes with_gcc=yes
gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'`
gcc_ver=`gcc -dumpversion`
# An ERE matcher. # An ERE matcher.
EGREP="grep -E" EGREP="grep -E"
...@@ -7250,11 +7259,11 @@ striplib="strip --strip-unneeded" ...@@ -7250,11 +7259,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
predep_objects="" predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
# Dependencies to place after the objects being linked to create a # Dependencies to place after the objects being linked to create a
# shared library. # shared library.
postdep_objects="" postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
# Dependencies to place before the objects being linked to create a # Dependencies to place before the objects being linked to create a
# shared library. # shared library.
...@@ -7266,7 +7275,7 @@ postdeps="" ...@@ -7266,7 +7275,7 @@ postdeps=""
# The library search path used internally by the compiler when linking # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path="" compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"`
# Method to check whether dependent libraries are shared objects. # Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all" deplibs_check_method="pass_all"
...@@ -7346,7 +7355,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM ...@@ -7346,7 +7355,7 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs=unknown link_all_deplibs=unknown
# Compile-time system search path for libraries # Compile-time system search path for libraries
sys_lib_search_path_spec=" /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/" 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"`
# Run-time system search path for libraries # 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/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib "
......
...@@ -131,28 +131,24 @@ namespace AMDiS { ...@@ -131,28 +131,24 @@ namespace AMDiS {
TEST_EXIT_DBG(dimOfWorld == 3) TEST_EXIT_DBG(dimOfWorld == 3)
("dim != dim_of_world ! use parametric elements!\n"); ("dim != dim_of_world ! use parametric elements!\n");
WorldVector<double> *e1 = &tmpWorldVecs[0]; std::vector<double> &e1 = tmpWorldVecs[0];
WorldVector<double> *e2 = &tmpWorldVecs[1]; std::vector<double> &e2 = tmpWorldVecs[1];
WorldVector<double> *e3 = &tmpWorldVecs[2]; std::vector<double> &e3 = tmpWorldVecs[2];
WorldVector<double> *v0 = &tmpWorldVecs[3];
double det, adet;
double a11, a12, a13, a21, a22, a23, a31, a32, a33;
testFlag(Mesh::FILL_COORDS); testFlag(Mesh::FILL_COORDS);
*v0 = coord[0];
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
(*e1)[i] = coord[1][i] - (*v0)[i]; e1[i] = coord[1][i] - coord[0][i];
(*e2)[i] = coord[2][i] - (*v0)[i]; e2[i] = coord[2][i] - coord[0][i];
(*e3)[i] = coord[3][i] - (*v0)[i]; e3[i] = coord[3][i] - coord[0][i];
} }
det = (*e1)[0] * ((*e2)[1] * (*e3)[2] - (*e2)[2] * (*e3)[1]) double det =
- (*e1)[1] * ((*e2)[0] * (*e3)[2] - (*e2)[2] * (*e3)[0]) e1[0] * (e2[1] * e3[2] - e2[2] * e3[1]) -
+ (*e1)[2] * ((*e2)[0] * (*e3)[1] - (*e2)[1] * (*e3)[0]); e1[1] * (e2[0] * e3[2] - e2[2] * e3[0]) +
e1[2] * (e2[0] * e3[1] - e2[1] * e3[0]);
adet = abs(det); double adet = abs(det);
if (adet < 1.0E-25) { if (adet < 1.0E-25) {
MSG("abs(det) = %f\n",adet); MSG("abs(det) = %f\n",adet);
...@@ -161,25 +157,17 @@ namespace AMDiS { ...@@ -161,25 +157,17 @@ namespace AMDiS {
grd_lam[i][j] = 0.0; grd_lam[i][j] = 0.0;
} else { } else {
det = 1.0 / det; det = 1.0 / det;
a11 = ((*e2)[1] * (*e3)[2] - (*e2)[2] * (*e3)[1]) * det; /* (a_ij) = A^{-T} */ /* (a_ij) = A^{-T} */
a12 = ((*e2)[2] * (*e3)[0] - (*e2)[0] * (*e3)[2]) * det;
a13 = ((*e2)[0] * (*e3)[1] - (*e2)[1] * (*e3)[0]) * det; grd_lam[1][0] = (e2[1] * e3[2] - e2[2] * e3[1]) * det;
a21 = ((*e1)[2] * (*e3)[1] - (*e1)[1] * (*e3)[2]) * det; grd_lam[1][1] = (e2[2] * e3[0] - e2[0] * e3[2]) * det;
a22 = ((*e1)[0] * (*e3)[2] - (*e1)[2] * (*e3)[0]) * det; grd_lam[1][2] = (e2[0] * e3[1] - e2[1] * e3[0]) * det;
a23 = ((*e1)[1] * (*e3)[0] - (*e1)[0] * (*e3)[1]) * det; grd_lam[2][0] = (e1[2] * e3[1] - e1[1] * e3[2]) * det;
a31 = ((*e1)[1] * (*e2)[2] - (*e1)[2] * (*e2)[1]) * det; grd_lam[2][1] = (e1[0] * e3[2] - e1[2] * e3[0]) * det;
a32 = ((*e1)[2] * (*e2)[0] - (*e1)[0] * (*e2)[2]) * det; grd_lam[2][2] = (e1[1] * e3[0] - e1[0] * e3[1]) * det;
a33 = ((*e1)[0] * (*e2)[1] - (*e1)[1] * (*e2)[0]) * det; grd_lam[3][0] = (e1[1] * e2[2] - e1[2] * e2[1]) * det;
grd_lam[3][1] = (e1[2] * e2[0] - e1[0] * e2[2]) * det;
grd_lam[1][0] = a11; grd_lam[3][2] = (e1[0] * e2[1] - e1[1] * e2[0]) * det;
grd_lam[1][1] = a12;
grd_lam[1][2] = a13;
grd_lam[2][0] = a21;
grd_lam[2][1] = a22;
grd_lam[2][2] = a23;
grd_lam[3][0] = a31;
grd_lam[3][1] = a32;
grd_lam[3][2] = a33;
grd_lam[0][0] = -grd_lam[1][0] - grd_lam[2][0] - grd_lam[3][0]; grd_lam[0][0] = -grd_lam[1][0] - grd_lam[2][0] - grd_lam[3][0];
grd_lam[0][1] = -grd_lam[1][1] - grd_lam[2][1] - grd_lam[3][1]; grd_lam[0][1] = -grd_lam[1][1] - grd_lam[2][1] - grd_lam[3][1];
...@@ -329,9 +317,7 @@ namespace AMDiS { ...@@ -329,9 +317,7 @@ namespace AMDiS {
double det = 0.0; double det = 0.0;
WorldVector<double> *e0 = &tmpWorldVecs[0]; WorldVector<double> e0, e1, e2;
WorldVector<double> *e1 = &tmpWorldVecs[1];
WorldVector<double> *e2 = &tmpWorldVecs[2];
if (dimOfWorld == 3) { if (dimOfWorld == 3) {
int i0 = (face + 1) % 4; int i0 = (face + 1) % 4;
...@@ -339,14 +325,14 @@ namespace AMDiS { ...@@ -339,14 +325,14 @@ namespace AMDiS {
int i2 = (face + 3) % 4; int i2 = (face + 3) % 4;
for (int i = 0; i < dimOfWorld; i++) { for (int i = 0; i < dimOfWorld; i++) {
(*e0)[i] = coord[i1][i] - coord[i0][i]; e0[i] = coord[i1][i] - coord[i0][i];
(*e1)[i] = coord[i2][i] - coord[i0][i]; e1[i] = coord[i2][i] - coord[i0][i];
(*e2)[i] = coord[face][i] - coord[i0][i]; e2[i] = coord[face][i] - coord[i0][i];
} }
vectorProduct(*e0, *e1, normal); vectorProduct(e0, e1, normal);
if ((*e2 * normal) < 0.0) if ((e2 * normal) < 0.0)
for (int i = 0; i < dimOfWorld; i++) for (int i = 0; i < dimOfWorld; i++)
normal[i] = -normal[i]; normal[i] = -normal[i];
...@@ -360,7 +346,7 @@ namespace AMDiS { ...@@ -360,7 +346,7 @@ namespace AMDiS {
MSG("not implemented for DIM_OF_WORLD = %d in 3d\n", dimOfWorld); MSG("not implemented for DIM_OF_WORLD = %d in 3d\n", dimOfWorld);
} }
return(det); return det;
} }
......
...@@ -38,7 +38,9 @@ namespace AMDiS { ...@@ -38,7 +38,9 @@ namespace AMDiS {
ElInfo3d(Mesh* aMesh) ElInfo3d(Mesh* aMesh)
: ElInfo(aMesh) : ElInfo(aMesh)
{ {
tmpWorldVecs.resize(4); tmpWorldVecs.resize(3);
for (int i = 0; i < 3; i++)
tmpWorldVecs[i].resize(3);
} }
/// Assignment operator /// Assignment operator
...@@ -92,7 +94,7 @@ namespace AMDiS { ...@@ -92,7 +94,7 @@ namespace AMDiS {
signed char orientation; signed char orientation;
/// Tmp vectors used for calculations in calcGrdLambda and getNormal(). /// Tmp vectors used for calculations in calcGrdLambda and getNormal().
std::vector< WorldVector<double> > tmpWorldVecs; std::vector< std::vector<double> > tmpWorldVecs;
static double mat_d1_left_val[4][4]; static double mat_d1_left_val[4][4];
static mtl::dense2D<double> mat_d1_left; static mtl::dense2D<double> mat_d1_left;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment