Commit a71670c0 authored by Thomas Witkowski's avatar Thomas Witkowski

Fixed bug when coarsening periodic DOFs.

parent 5ee37e42
#! /bin/bash
#! /bin/sh
# libtoolT - Provide generalized library-building support services.
# Generated automatically by (GNU AMDiS 0.1)
......@@ -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,10 +44,10 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host laptop:
# Libtool was configured on host linux-dxyz.site:
# Shell to use when invoking shell scripts.
SHELL="/bin/bash"
SHELL="/bin/sh"
# Whether or not to build shared libraries.
build_libtool_libs=yes
......@@ -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.
......@@ -97,7 +97,7 @@ with_gcc=yes
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"
......@@ -325,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=" =./i486-linux-gnu/4.4.3/ ./../lib/ /opt/petsc/lib/i486-linux-gnu/4.4.3/ /opt/petsc/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/ /lib/i486-linux-gnu/4.4.3/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.4.3/ /usr/lib/../lib/ /usr/lib/i486-linux-gnu/i486-linux-gnu/4.4.3/ /usr/lib/i486-linux-gnu/../lib/ ./ /opt/petsc/lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../ /lib/ /usr/lib/ /usr/lib/i486-linux-gnu/"
sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64/ /lib/x86_64-suse-linux/4.5/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.5/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../ /lib/ /usr/lib/"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/nvidia-current /usr/lib/atlas /opt/cuda/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /opt/kde3/lib/ /usr/lib/alsa-lib /usr/local/lib "
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/lib64/Xaw3d /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/x86_64-suse-linux/lib /usr/local/lib /opt/kde3/lib /lib64 /lib /usr/lib64 /usr/lib /usr/local/lib64 /opt/kde3/lib64 /usr/lib64/graphviz /usr/lib64/graphviz/sharp /usr/lib64/graphviz/java /usr/lib64/graphviz/perl /usr/lib64/graphviz/php /usr/lib64/graphviz/ocaml /usr/lib64/graphviz/python /usr/lib64/graphviz/lua /usr/lib64/graphviz/tcl /usr/lib64/graphviz/guile /usr/lib64/graphviz/ruby /usr/lib64/octave-3.2.4 "
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
......@@ -7263,10 +7263,10 @@ disable_libs=static
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host laptop:
# Libtool was configured on host linux-dxyz.site:
# Shell to use when invoking shell scripts.
SHELL="/bin/bash"
SHELL="/bin/sh"
# Whether or not to build shared libraries.
build_libtool_libs=yes
......@@ -7285,12 +7285,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.
......@@ -7316,7 +7316,7 @@ with_gcc=yes
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"
......@@ -7445,11 +7445,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a
# shared library.
predep_objects="/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbeginS.o"
predep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.5/crtbeginS.o"
# Dependencies to place after the objects being linked to create a
# shared library.
postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.4.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crtn.o"
postdep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.5/crtendS.o /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64/crtn.o"
# Dependencies to place before the objects being linked to create a
# shared library.
......@@ -7461,7 +7461,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path="-L/opt/petsc/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L. -L/opt/petsc/lib -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../.. -L/usr/lib/i486-linux-gnu"
compiler_lib_search_path="-L/usr/lib64/gcc/x86_64-suse-linux/4.5 -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.5/../../.."
# Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all"
......@@ -7541,10 +7541,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=" =./i486-linux-gnu/4.4.3/ ./../lib/ /opt/petsc/lib/i486-linux-gnu/4.4.3/ /opt/petsc/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/ /lib/i486-linux-gnu/4.4.3/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.4.3/ /usr/lib/../lib/ /usr/lib/i486-linux-gnu/i486-linux-gnu/4.4.3/ /usr/lib/i486-linux-gnu/../lib/ ./ /opt/petsc/lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../ /lib/ /usr/lib/ /usr/lib/i486-linux-gnu/"
sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64/ /lib/x86_64-suse-linux/4.5/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.5/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../ /lib/ /usr/lib/"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/nvidia-current /usr/lib/atlas /opt/cuda/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /opt/kde3/lib/ /usr/lib/alsa-lib /usr/local/lib "
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/lib64/Xaw3d /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/x86_64-suse-linux/lib /usr/local/lib /opt/kde3/lib /lib64 /lib /usr/lib64 /usr/lib /usr/local/lib64 /opt/kde3/lib64 /usr/lib64/graphviz /usr/lib64/graphviz/sharp /usr/lib64/graphviz/java /usr/lib64/graphviz/perl /usr/lib64/graphviz/php /usr/lib64/graphviz/ocaml /usr/lib64/graphviz/python /usr/lib64/graphviz/lua /usr/lib64/graphviz/tcl /usr/lib64/graphviz/guile /usr/lib64/graphviz/ruby /usr/lib64/octave-3.2.4 "
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
......@@ -7568,10 +7568,10 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host laptop:
# Libtool was configured on host linux-dxyz.site:
# Shell to use when invoking shell scripts.
SHELL="/bin/bash"
SHELL="/bin/sh"
# Whether or not to build shared libraries.
build_libtool_libs=yes
......@@ -7590,12 +7590,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.
......@@ -7612,7 +7612,7 @@ LTCC="gcc"
LTCFLAGS="-g -O2"
# A language-specific compiler.
CC="f95"
CC="gfortran"
# Is the compiler the GNU C compiler?
with_gcc=yes
......@@ -7621,7 +7621,7 @@ with_gcc=yes
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"
......@@ -7849,10 +7849,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=" =./i486-linux-gnu/4.4.3/ ./../lib/ /opt/petsc/lib/i486-linux-gnu/4.4.3/ /opt/petsc/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/../lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../i486-linux-gnu/4.4.3/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/ /lib/i486-linux-gnu/4.4.3/ /lib/../lib/ /usr/lib/i486-linux-gnu/4.4.3/ /usr/lib/../lib/ /usr/lib/i486-linux-gnu/i486-linux-gnu/4.4.3/ /usr/lib/i486-linux-gnu/../lib/ ./ /opt/petsc/lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/ /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../ /lib/ /usr/lib/ /usr/lib/i486-linux-gnu/"
sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../x86_64-suse-linux/4.5/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64/ /lib/x86_64-suse-linux/4.5/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.5/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../ /lib/ /usr/lib/"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/nvidia-current /usr/lib/atlas /opt/cuda/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /opt/kde3/lib/ /usr/lib/alsa-lib /usr/local/lib "
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/lib64/Xaw3d /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/lib/Xaw3d /usr/x86_64-suse-linux/lib /usr/local/lib /opt/kde3/lib /lib64 /lib /usr/lib64 /usr/lib /usr/local/lib64 /opt/kde3/lib64 /usr/lib64/graphviz /usr/lib64/graphviz/sharp /usr/lib64/graphviz/java /usr/lib64/graphviz/perl /usr/lib64/graphviz/php /usr/lib64/graphviz/ocaml /usr/lib64/graphviz/python /usr/lib64/graphviz/lua /usr/lib64/graphviz/tcl /usr/lib64/graphviz/guile /usr/lib64/graphviz/ruby /usr/lib64/octave-3.2.4 "
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
......
......@@ -102,13 +102,13 @@ namespace AMDiS {
if (mesh->getNumberOfDOFs(VERTEX)) /*--- midpoint of parent ---*/
{
mesh->freeDOF(const_cast<int*>( child[1]->getDOF(mesh->getNode(VERTEX))), VERTEX);
mesh->freeDof(const_cast<int*>( child[1]->getDOF(mesh->getNode(VERTEX))), VERTEX);
}
if (mesh->getNumberOfDOFs(CENTER)) /*--- center of the children ---*/
{
mesh->freeDOF(const_cast<int*>( child[0]->getDOF(mesh->getNode(CENTER))), CENTER);
mesh->freeDOF(const_cast<int*>( child[1]->getDOF(mesh->getNode(CENTER))), CENTER);
mesh->freeDof(const_cast<int*>( child[0]->getDOF(mesh->getNode(CENTER))), CENTER);
mesh->freeDof(const_cast<int*>( child[1]->getDOF(mesh->getNode(CENTER))), CENTER);
}
parent->coarsenElementData(child[0], child[1]);
......
......@@ -31,14 +31,14 @@ namespace AMDiS {
// remove dof from common edge of child[0] and child[1]
if (mesh->getNumberOfDOFs(EDGE))
mesh->freeDOF(const_cast<int*>(child[0]->getDOF(4)), EDGE);
mesh->freeDof(const_cast<int*>(child[0]->getDOF(4)), EDGE);
// remove dof from the barycenters of child[0] and child[1]
if (mesh->getNumberOfDOFs(CENTER)) {
int node = mesh->getNode(CENTER);
mesh->freeDOF(const_cast<int*>(child[0]->getDOF(node)), CENTER);
mesh->freeDOF(const_cast<int*>(child[1]->getDOF(node)), CENTER);
mesh->freeDof(const_cast<int*>(child[0]->getDOF(node)), CENTER);
mesh->freeDof(const_cast<int*>(child[1]->getDOF(node)), CENTER);
}
el->coarsenElementData(child[0], child[1]);
......@@ -110,16 +110,17 @@ namespace AMDiS {
// now, remove those dofs in the coarcening edge
mesh->freeDOF(dof[0], VERTEX);
mesh->freeDof(dof[0], VERTEX);
if (mesh->getNumberOfDOFs(EDGE)) {
mesh->freeDOF(dof[1], EDGE);
mesh->freeDOF(dof[2], EDGE);
mesh->freeDof(dof[1], EDGE);
mesh->freeDof(dof[2], EDGE);
}
mesh->incrementNumberOfVertices(-1);
mesh->incrementNumberOfEdges(-1);
}
int CoarseningManager2d::coarsenFunction(ElInfo *el_info)
{
Triangle *el = dynamic_cast<Triangle*>(const_cast<Element*>(el_info->getElement()));
......
......@@ -12,7 +12,7 @@ namespace AMDiS {
int CoarseningManager3d::coarsenFunction(ElInfo *el_info)
{
Tetrahedron *el = dynamic_cast<Tetrahedron*>(const_cast<Element*>( el_info->getElement()));
Tetrahedron *el = dynamic_cast<Tetrahedron*>(const_cast<Element*>(el_info->getElement()));
DegreeOfFreedom *edge[2];
int n_neigh, bound = 0;
ElInfo *elinfo = el_info;
......@@ -77,9 +77,7 @@ namespace AMDiS {
if (coarsenList->doCoarsePatch(n_neigh)) {
int n_neigh_periodic;
DegreeOfFreedom *next_edge[2];
RCNeighbourList *periodicList;
while (edge[0] != NULL) {
......@@ -110,14 +108,15 @@ namespace AMDiS {
/*****************************************************************************/
void CoarseningManager3d::coarsenTetrahedron(RCNeighbourList *coarsenList,
int index)
int index)
{
Tetrahedron *el = dynamic_cast<Tetrahedron*>(const_cast<Element*>( coarsenList->getElement(index))), *child[2];
Tetrahedron *el = dynamic_cast<Tetrahedron*>(const_cast<Element*>(coarsenList->getElement(index)));
Tetrahedron *child[2];
Tetrahedron *neigh;
int dir, el_type, i, node, opp_v;
int dir, el_type, i, node, opp_v;
child[0] = dynamic_cast<Tetrahedron*>(const_cast<Element*>( el->getChild(0)));
child[1] = dynamic_cast<Tetrahedron*>(const_cast<Element*>( el->getChild(1)));
child[0] = dynamic_cast<Tetrahedron*>(const_cast<Element*>(el->getChild(0)));
child[1] = dynamic_cast<Tetrahedron*>(const_cast<Element*>(el->getChild(1)));
el_type = coarsenList->getType(index);
/****************************************************************************/
......@@ -136,15 +135,14 @@ namespace AMDiS {
if (mesh->getNumberOfDOFs(EDGE)) {
node = mesh->getNode(EDGE) + Tetrahedron::nChildEdge[el_type][0][dir];
mesh->freeDOF(const_cast<int*>( child[0]->getDOF(node)), EDGE);
mesh->freeDof(const_cast<int*>( child[0]->getDOF(node)), EDGE);
}
if (mesh->getNumberOfDOFs(FACE)) {
node = mesh->getNode(FACE) + Tetrahedron::nChildFace[el_type][0][dir];
mesh->freeDof(const_cast<int*>( child[0]->getDOF(node)), FACE);
node = mesh->getNode(FACE) + Tetrahedron::nChildFace[el_type][1][dir];
mesh->freeDof(const_cast<int*>( child[1]->getDOF(node)), FACE);
}
if (mesh->getNumberOfDOFs(FACE))
{
node = mesh->getNode(FACE) + Tetrahedron::nChildFace[el_type][0][dir];
mesh->freeDOF(const_cast<int*>( child[0]->getDOF(node)), FACE);
node = mesh->getNode(FACE) + Tetrahedron::nChildFace[el_type][1][dir];
mesh->freeDOF(const_cast<int*>( child[1]->getDOF(node)), FACE);
}
}
}
......@@ -155,14 +153,14 @@ namespace AMDiS {
if (mesh->getNumberOfDOFs(FACE)) {
node = mesh->getNode(FACE);
mesh->freeDOF(const_cast<int*>( child[0]->getDOF(node)), FACE);
mesh->freeDof(const_cast<int*>( child[0]->getDOF(node)), FACE);
}
if (mesh->getNumberOfDOFs(CENTER)) {
node = mesh->getNode(CENTER);
for (i = 0; i < 2; i++)
mesh->freeDOF(const_cast<int*>( child[i]->getDOF(node)), CENTER);
mesh->freeDof(const_cast<int*>( child[i]->getDOF(node)), CENTER);
}
/****************************************************************************/
......@@ -181,8 +179,6 @@ namespace AMDiS {
mesh->incrementNumberOfLeaves(-1);
mesh->incrementNumberOfElements(-2);
return;
}
/****************************************************************************/
......@@ -201,16 +197,16 @@ namespace AMDiS {
/* the starting element before we return */
/****************************************************************************/
bool CoarseningManager3d::getCoarsenPatch(ElInfo *el_info,
bool CoarseningManager3d::getCoarsenPatch(ElInfo *el_info,
DegreeOfFreedom *edge[2],
int dir,
int dir,
RCNeighbourList *coarsenList,
int *n_neigh)
int *n_neigh)
{
FUNCNAME("CoarseningManager3d::getCoarsenPatch");
ElInfo *neigh_info;
Tetrahedron *el, *neigh;
int i, j, k, opp_v, edge_no;
int i, j, k, opp_v, edge_no;
static unsigned char next_el[6][2] = {{3,2},
{1,3},
......@@ -246,7 +242,7 @@ namespace AMDiS {
for (k = 0; k < n_vertices; k++)
if (neigh->getDOF(k) == edge[1]) break;
if(j > 3 || k > 3) {
if (j > 3 || k > 3) {
for (j = 0; j < n_vertices; j++)
if (mesh->associated(neigh->getDOF(j, 0), edge[0][0])) break;
for (k = 0; k < n_vertices; k++)
......@@ -315,11 +311,11 @@ namespace AMDiS {
/****************************************************************************/
void CoarseningManager3d::coarsenPatch(RCNeighbourList *coarsenList,
int n_neigh,
int bound)
int n_neigh,
int bound)
{
Tetrahedron *el = dynamic_cast<Tetrahedron*>(const_cast<Element*>( coarsenList->getElement(0)));
int i, node;
int i, node;
DegreeOfFreedom *dof;
if (mesh->getNumberOfDOFs(EDGE)) {
......@@ -329,28 +325,28 @@ namespace AMDiS {
node = mesh->getNode(EDGE);
if (!(dof = const_cast<int*>( el->getDOF(node))))
dof = mesh->getDOF(EDGE);
} else
} else {
dof = NULL;
}
if (mesh->getNumberOfDOFs(EDGE) ||
mesh->getNumberOfDOFs(FACE) ||
mesh->getNumberOfDOFs(CENTER))
{
for (i = 0; i < n_neigh; i++)
coarsenList->addDOFParent(i, dof);
}
mesh->getNumberOfDOFs(CENTER)) {
for (i = 0; i < n_neigh; i++)
coarsenList->addDOFParent(i, dof);
}
/****************************************************************************/
/* restrict dof vectors to the parents on the patch */
/****************************************************************************/
int iadmin;
int nrAdmin = mesh->getNumberOfDOFAdmin();
for(iadmin = 0; iadmin < nrAdmin; iadmin++) {
for (int iadmin = 0; iadmin < nrAdmin; iadmin++) {
std::list<DOFIndexedBase*>::iterator it;
DOFAdmin* admin = const_cast<DOFAdmin*>(&mesh->getDOFAdmin(iadmin));
std::list<DOFIndexedBase*>::iterator end = admin->endDOFIndexed();
for(it = admin->beginDOFIndexed(); it != end; ++it)
for (it = admin->beginDOFIndexed(); it != end; ++it)
(*it)->coarseRestrict(*coarsenList, n_neigh);
}
......@@ -360,25 +356,22 @@ namespace AMDiS {
/* remove dof's of the coarsening edge */
/****************************************************************************/
mesh->freeDOF(const_cast<int*>( el->getChild(0)->getDOF(3)), VERTEX);
mesh->freeDof(const_cast<int*>( el->getChild(0)->getDOF(3)), VERTEX);
mesh->incrementNumberOfVertices(-1);
if (mesh->getNumberOfDOFs(EDGE))
{
node = mesh->getNode(EDGE)+2;
mesh->freeDOF(const_cast<int*>( el->getChild(0)->getDOF(node)), EDGE);
mesh->freeDOF(const_cast<int*>( el->getChild(1)->getDOF(node)), EDGE);
}
if (coarsenList->getElement(0)->isNewCoordSet()) {
coarsenList->getElement(0)->eraseNewCoord();
if (mesh->getNumberOfDOFs(EDGE)) {
node = mesh->getNode(EDGE) + 2;
mesh->freeDof(const_cast<int*>( el->getChild(0)->getDOF(node)), EDGE);
mesh->freeDof(const_cast<int*>( el->getChild(1)->getDOF(node)), EDGE);
}
for (i = 0; i < n_neigh; i++)
{
coarsenList->getElement(i)->setNewCoord(NULL);
coarsenTetrahedron(coarsenList, i);
}
if (coarsenList->getElement(0)->isNewCoordSet())
coarsenList->getElement(0)->eraseNewCoord();
for (i = 0; i < n_neigh; i++) {
coarsenList->getElement(i)->setNewCoord(NULL);
coarsenTetrahedron(coarsenList, i);
}
/****************************************************************************/
/* if the coarsening edge is an interior edge there are n_neigh + 1 edges */
......@@ -393,8 +386,6 @@ namespace AMDiS {
mesh->incrementNumberOfEdges(-(n_neigh + 1));
mesh->incrementNumberOfFaces(-(2*n_neigh));
}
return;
}
}
......@@ -97,7 +97,7 @@ namespace AMDiS {
FUNCNAME("DOFAdmin::freeDofIndex()");
TEST_EXIT_DBG(usedCount > 0)("no dofs in use\n");
TEST_EXIT_DBG((dof >= 0) && (dof < size))("invalid dof index %d\n",dof);
TEST_EXIT_DBG(dof >= 0 && dof < size)("invalid dof index %d\n",dof);
std::list<DOFIndexedBase*>::iterator di;
std::list<DOFIndexedBase*>::iterator end = dofIndexedList.end();
......@@ -273,7 +273,7 @@ namespace AMDiS {
// mark used dofs
DOFIteratorBase it(this, USED_DOFS);
for (it.reset(); !it.end(); ++it)
new_dof[it.getDOFIndex()] = 1;
new_dof[it.getDOFIndex()] = 1;
int n = 0, last = 0;
for (int i = 0; i < size; i++) { /* create a MONOTONE compress */
......@@ -315,7 +315,7 @@ namespace AMDiS {
std::list<DOFContainer*>::iterator dc;
std::list<DOFContainer*>::iterator endc = dofContainerList.end();
for (dc = dofContainerList.begin(); dc != endc; ++dc)
(*dc)->compressDofContainer(n, new_dof);
(*dc)->compressDofContainer(n, new_dof);
}
......
......@@ -170,7 +170,7 @@ namespace AMDiS {
// change periodic vertex dofs
for (int i = 0; i < mesh->getNumberOfVertices(); i++) {
if (periodicMap.getEntry(i) != -1) {
mesh->freeDOF(dof[i], VERTEX);
mesh->freeDof(dof[i], VERTEX);
dof[i] = dof[periodicMap.getEntry(i)];
std::map<BoundaryType, VertexVector*>::iterator assoc;
......
......@@ -352,7 +352,7 @@ namespace AMDiS {
}
if (deleteDof)
freeDOF(const_cast<DegreeOfFreedom*>(dofsIt->first),
freeDof(const_cast<DegreeOfFreedom*>(dofsIt->first),
dofsPosIndex[dofsIt->first]);
else
nRemainDofs++;
......@@ -518,7 +518,7 @@ namespace AMDiS {
{
FUNCNAME("Mesh::freeDOFPtrs()");
TEST_EXIT_DBG(ptrs)("ptrs=NULL\n");
TEST_EXIT_DBG(ptrs)("ptrs is NULL!\n");
if (nNodeEl <= 0)
return;
......@@ -559,9 +559,9 @@ namespace AMDiS {
}
void Mesh::freeDOF(DegreeOfFreedom* dof, GeoIndex position)
void Mesh::freeDof(DegreeOfFreedom* dof, GeoIndex position)
{
FUNCNAME("Mesh::freeDOF()");
FUNCNAME("Mesh::freeDof()");
TEST_EXIT_DBG(position >= CENTER && position <= FACE)
("unknown position %d\n", position);
......@@ -587,10 +587,11 @@ namespace AMDiS {
int n = localAdmin->getNumberOfDOFs(position);
int n0 = localAdmin->getNumberOfPreDOFs(position);
TEST_EXIT_DBG(n + n0 <= ndof)("n=%d, n0=%d too large: ndof=%d\n", n, n0, ndof);
TEST_EXIT_DBG(n + n0 <= ndof)
("n = %d, n0 = %d too large: ndof = %d\n", n, n0, ndof);
for (int j = 0; j < n; j++)
localAdmin->freeDofIndex(dof[n0 + j]);
localAdmin->freeDofIndex(dof[n0 + j]);
}
delete [] dof;
......
......@@ -375,7 +375,7 @@ namespace AMDiS {
ElInfo* createNewElInfo();
/// Frees DOFs at the given position pointed by dof
void freeDOF(DegreeOfFreedom* dof, GeoIndex position);
void freeDof(DegreeOfFreedom* dof, GeoIndex position);
/// Frees memory for the given element el
void freeElement(Element* el);
......
......@@ -253,7 +253,7 @@ namespace AMDiS {
if (mesh->getNumberOfDOFs(CENTER)) {
int node = mesh->getNode(CENTER);
for (int i = 0; i < n_neigh; i++) {
mesh->freeDOF(const_cast<int*>(rclist[i]->el->getDOF(node)), CENTER);
mesh->freeDof(const_cast<int*>(rclist[i]->el->getDOF(node)), CENTER);
rclist[i]->el->setDOF(node, NULL);
}
}
......@@ -280,12 +280,12 @@ namespace AMDiS {
// face 2
if (!neigh || neigh > rclist[index])
mesh->freeDOF(const_cast<int*>(el->getDOF(node + 2)), FACE);
mesh->freeDof(const_cast<int*>(el->getDOF(node + 2)), FACE);
neigh = rclist[index]->neigh[1];
// face 3
if (!neigh || neigh > rclist[index])
mesh->freeDOF(const_cast<int*>(el->getDOF(node + 3)), FACE);
mesh->freeDof(const_cast<int*>(el->getDOF(node + 3)), FACE);
for (int j = 0; j < faces; j++)
el->setDOF(node + j, NULL);
......@@ -293,7 +293,7 @@ namespace AMDiS {
if (mesh->getNumberOfDOFs(CENTER)) {
int node = mesh->getNode(CENTER);
mesh->freeDOF(const_cast<int*>(el->getDOF(node)), CENTER);
mesh->freeDof(const_cast<int*>(el->getDOF(node)), CENTER);
el->setDOF(node, NULL);
}
}
......
......@@ -90,7 +90,7 @@ namespace AMDiS {
}
if (!mesh->queryCoarseDOFs() && mesh->getNumberOfDOFs(CENTER)) {
mesh->freeDOF(const_cast<int*>( el->getDOF(mesh->getNode(CENTER))), CENTER);
mesh->freeDof(const_cast<int*>( el->getDOF(mesh->getNode(CENTER))), CENTER);
el->setDOF(mesh->getNode(CENTER), NULL);
}
}
......
......@@ -220,7 +220,7 @@ namespace AMDiS {
// === The only DOF that can be freed is that in the refinement edge; all ===
// === other DOFs are handed on the children. ===
mesh->freeDOF(const_cast<int*>(el->getDOF(node+2)), EDGE);
mesh->freeDof(const_cast<int*>(el->getDOF(node+2)), EDGE);
}
if (mesh->getNumberOfDOFs(EDGE) || mesh->getNumberOfDOFs(CENTER))
refineList->removeDOFParents(n_neigh);
......
......@@ -351,7 +351,7 @@ namespace AMDiS {
/****************************************************************************/
el = dynamic_cast<Tetrahedron*>(const_cast<Element*>(refineList->getElement(0)));
mesh->freeDOF(const_cast<int*>(el->getDOF(mesh->getNode(EDGE))), EDGE);
mesh->freeDof(const_cast<int*>(el->getDOF(mesh->getNode(EDGE))), EDGE);
}
if (mesh->getNumberOfDOFs(EDGE) ||
......
......@@ -21,6 +21,15 @@ namespace AMDiS {
~VertexVector();
void freeDofIndex(DegreeOfFreedom dof)
{
FUNCNAME("VertexVector::freeDofIndex()");
TEST_EXIT_DBG(dof < static_cast<int>(vec.size()))("Should not happen!\n");
vec[dof] = dof;
}
const DOFAdmin *getAdmin()
{
return admin;
......