Commit 30c3b864 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Some code refactoring and fixed some small problems in mesh repartitioning.

parent 8a79f686
...@@ -85,7 +85,7 @@ NM="/usr/bin/nm -B" ...@@ -85,7 +85,7 @@ NM="/usr/bin/nm -B"
LN_S="ln -s" LN_S="ln -s"
# What is the maximum length of a command? # What is the maximum length of a command?
max_cmd_len=1572864 max_cmd_len=98304
# Object file suffix (normally "o"). # Object file suffix (normally "o").
objext=o objext=o
...@@ -128,7 +128,7 @@ old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" ...@@ -128,7 +128,7 @@ old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
old_postuninstall_cmds="" old_postuninstall_cmds=""
# A C compiler. # A C compiler.
LTCC="/usr/lib64/mpi/gcc/openmpi//bin/mpicc" LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
# LTCC compiler flags. # LTCC compiler flags.
LTCFLAGS="-g -O2" LTCFLAGS="-g -O2"
...@@ -233,10 +233,10 @@ finish_eval="" ...@@ -233,10 +233,10 @@ finish_eval=""
hardcode_into_libs=yes hardcode_into_libs=yes
# Compile-time system search path for libraries. # Compile-time system search path for libraries.
sys_lib_search_path_spec="/usr/lib64/gcc/x86_64-suse-linux/4.5 /usr/lib64 /lib64 /usr/x86_64-suse-linux/lib" sys_lib_search_path_spec="/usr/lib64/gcc/x86_64-suse-linux/4.1.2 /usr/lib64 /lib64 /fastfs/wir/local/lib /usr/x86_64-suse-linux/lib"
# Run-time system search path for libraries. # Run-time system search path for libraries.
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 " 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 "
# Whether dlopen is supported. # Whether dlopen is supported.
dlopen_support=unknown dlopen_support=unknown
...@@ -259,7 +259,7 @@ LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64" ...@@ -259,7 +259,7 @@ LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
# A language specific compiler. # A language specific compiler.
CC="/usr/lib64/mpi/gcc/openmpi//bin/mpicc" CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
# Is the compiler the GNU compiler? # Is the compiler the GNU compiler?
with_gcc=yes with_gcc=yes
...@@ -8914,7 +8914,7 @@ LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64" ...@@ -8914,7 +8914,7 @@ LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64"
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
# A language specific compiler. # A language specific compiler.
CC="/usr/lib64/mpi/gcc/openmpi//bin/mpicxx" CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicxx"
# Is the compiler the GNU compiler? # Is the compiler the GNU compiler?
with_gcc=yes with_gcc=yes
...@@ -9039,17 +9039,17 @@ file_list_spec="" ...@@ -9039,17 +9039,17 @@ file_list_spec=""
hardcode_action=immediate hardcode_action=immediate
# The directories searched by this compiler when creating a shared library. # The directories searched by this compiler when creating a shared library.
compiler_lib_search_dirs="/usr/lib64/mpi/gcc/openmpi/lib64 /usr/lib64/gcc/x86_64-suse-linux/4.5 /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../lib64 /lib/../lib64 /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/../../.." compiler_lib_search_dirs="/usr/lib64 /licsoft/libraries/openmpi/1.2.6/64bit/lib /usr/lib64/gcc/x86_64-suse-linux/4.1.2 /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 /lib/../lib64 /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/../../.."
# Dependencies to place before and after the objects being linked to # Dependencies to place before and after the objects being linked to
# create a shared library. # create a shared library.
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" 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"
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" 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"
predeps="" predeps=""
postdeps="-lmpi_cxx -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -ldl -lstdc++ -lm -lgcc_s -lpthread -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 # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path="-L/usr/lib64/mpi/gcc/openmpi/lib64 -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/../../.." 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/../../.."
# ### END LIBTOOL TAG CONFIG: CXX # ### END LIBTOOL TAG CONFIG: CXX
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
#include "io/MacroWriter.h" #include "io/MacroWriter.h"
#include "io/PngWriter.h" #include "io/PngWriter.h"
#include "io/PovrayWriter.h" #include "io/PovrayWriter.h"
#include "io/ValueReader.h"
#include "io/ValueWriter.h" #include "io/ValueWriter.h"
#include "io/VtkWriter.h" #include "io/VtkWriter.h"
......
...@@ -258,7 +258,7 @@ namespace AMDiS { ...@@ -258,7 +258,7 @@ namespace AMDiS {
} }
void DOFAdmin::compress(std::vector<DegreeOfFreedom> &new_dof) void DOFAdmin::compress(std::vector<DegreeOfFreedom> &newDofIndex)
{ {
FUNCNAME("DOFAdmin::compress()"); FUNCNAME("DOFAdmin::compress()");
...@@ -268,17 +268,17 @@ namespace AMDiS { ...@@ -268,17 +268,17 @@ namespace AMDiS {
// vector to mark used dofs // vector to mark used dofs
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
new_dof[i] = -1; newDofIndex[i] = -1;
// mark used dofs // mark used dofs
DOFIteratorBase it(this, USED_DOFS); DOFIteratorBase it(this, USED_DOFS);
for (it.reset(); !it.end(); ++it) for (it.reset(); !it.end(); ++it)
new_dof[it.getDOFIndex()] = 1; newDofIndex[it.getDOFIndex()] = 1;
int n = 0, last = 0; int n = 0, last = 0;
for (int i = 0; i < size; i++) { /* create a MONOTONE compress */ for (int i = 0; i < size; i++) { /* create a MONOTONE compress */
if (new_dof[i] == 1) { if (newDofIndex[i] == 1) {
new_dof[i] = n++; newDofIndex[i] = n++;
last = i; last = i;
} }
} }
...@@ -300,21 +300,19 @@ namespace AMDiS { ...@@ -300,21 +300,19 @@ namespace AMDiS {
// get index of first changed dof // get index of first changed dof
int first = last; int first = last;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
if (new_dof[i] < i && new_dof[i] >= 0) { if (newDofIndex[i] < i && newDofIndex[i] >= 0) {
first = i; first = i;
break; break;
} }
} }
for (std::list<DOFIndexedBase*>::iterator di = dofIndexedList.begin();
di != dofIndexedList.end(); ++di)
(*di)->compressDOFIndexed(first, last, newDofIndex);
std::list<DOFIndexedBase*>::iterator di; for (std::list<DOFContainer*>::iterator dc = dofContainerList.begin();
std::list<DOFIndexedBase*>::iterator end = dofIndexedList.end(); dc != dofContainerList.end(); ++dc)
for (di = dofIndexedList.begin(); di != end; ++di) (*dc)->compressDofContainer(n, newDofIndex);
(*di)->compressDOFIndexed(first, last, new_dof);
std::list<DOFContainer*>::iterator dc;
std::list<DOFContainer*>::iterator endc = dofContainerList.end();
for (dc = dofContainerList.begin(); dc != endc; ++dc)
(*dc)->compressDofContainer(n, new_dof);
} }
......
...@@ -102,7 +102,7 @@ namespace AMDiS { ...@@ -102,7 +102,7 @@ namespace AMDiS {
* compression. This method is usually called after mesh adaption involving * compression. This method is usually called after mesh adaption involving
* higher order elements or coarsening. * higher order elements or coarsening.
*/ */
void compress(std::vector<DegreeOfFreedom> &new_dof); void compress(std::vector<DegreeOfFreedom> &newDofIndex);
/// Returns an iterator to the begin of \ref dofIndexedList /// Returns an iterator to the begin of \ref dofIndexedList
std::list<DOFIndexedBase*>::iterator beginDOFIndexed() std::list<DOFIndexedBase*>::iterator beginDOFIndexed()
......
...@@ -56,10 +56,11 @@ namespace AMDiS { ...@@ -56,10 +56,11 @@ namespace AMDiS {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
int j = newDOF[operator[](i)]; int j = newDOF[operator[](i)];
if (j >= 0)
operator[](i) = j; TEST_EXIT_DBG(j >= 0)
else ("Invalid DOF %d in DOF container! (%d %d)\n", j, i, operator[](i));
ERROR_EXIT("Invalid DOF %d in DOF container! (%d %d)\n", j, i, operator[](i));
operator[](i) = j;
} }
} }
......
...@@ -198,7 +198,7 @@ namespace AMDiS { ...@@ -198,7 +198,7 @@ namespace AMDiS {
/* should be used only at the end of dof_compress()!!!!! */ /* should be used only at the end of dof_compress()!!!!! */
/****************************************************************************/ /****************************************************************************/
void Element::newDofFct1(const DOFAdmin* admin) void Element::newDofFct1(const DOFAdmin* admin, std::vector<int>& newDofIndex)
{ {
int n0, nd, nd0; int n0, nd, nd0;
...@@ -207,7 +207,7 @@ namespace AMDiS { ...@@ -207,7 +207,7 @@ namespace AMDiS {
nd0 = admin->getNumberOfPreDOFs(VERTEX); nd0 = admin->getNumberOfPreDOFs(VERTEX);
n0 = admin->getMesh()->getNode(VERTEX); n0 = admin->getMesh()->getNode(VERTEX);
for (int i = 0; i < vertices; i++) for (int i = 0; i < vertices; i++)
changeDofs1(admin, n0, nd0, nd, i); changeDofs1(admin, newDofIndex, n0, nd0, nd, i);
} }
if (mesh->getDim() > 1) { if (mesh->getDim() > 1) {
...@@ -216,7 +216,7 @@ namespace AMDiS { ...@@ -216,7 +216,7 @@ namespace AMDiS {
nd0 = admin->getNumberOfPreDOFs(EDGE); nd0 = admin->getNumberOfPreDOFs(EDGE);
n0 = admin->getMesh()->getNode(EDGE); n0 = admin->getMesh()->getNode(EDGE);
for (int i = 0; i < edges; i++) for (int i = 0; i < edges; i++)
changeDofs1(admin, n0, nd0, nd, i); changeDofs1(admin, newDofIndex, n0, nd0, nd, i);
} }
} }
...@@ -226,14 +226,14 @@ namespace AMDiS { ...@@ -226,14 +226,14 @@ namespace AMDiS {
nd0 = admin->getNumberOfPreDOFs(FACE); nd0 = admin->getNumberOfPreDOFs(FACE);
n0 = admin->getMesh()->getNode(FACE); n0 = admin->getMesh()->getNode(FACE);
for (int i = 0; i < faces; i++) for (int i = 0; i < faces; i++)
changeDofs1(admin, n0, nd0, nd, i); changeDofs1(admin, newDofIndex, n0, nd0, nd, i);
} }
} }
if ((nd = admin->getNumberOfDofs(CENTER))) { if ((nd = admin->getNumberOfDofs(CENTER))) {
nd0 = admin->getNumberOfPreDOFs(CENTER); nd0 = admin->getNumberOfPreDOFs(CENTER);
n0 = admin->getMesh()->getNode(CENTER); n0 = admin->getMesh()->getNode(CENTER);
changeDofs1(admin, n0, nd0, nd, 0); changeDofs1(admin, newDofIndex, n0, nd0, nd, 0);
} }
} }
...@@ -283,13 +283,14 @@ namespace AMDiS { ...@@ -283,13 +283,14 @@ namespace AMDiS {
} }
void Element::changeDofs1(const DOFAdmin* admin, int n0, int nd0, int nd, int pos) void Element::changeDofs1(const DOFAdmin* admin, std::vector<int>& newDofIndex,
int n0, int nd0, int nd, int pos)
{ {
DegreeOfFreedom *ldof = dof[n0 + pos] + nd0; DegreeOfFreedom *ldof = dof[n0 + pos] + nd0;
for (int j = 0; j < nd; j++) { for (int j = 0; j < nd; j++) {
int k = ldof[j]; int k = ldof[j];
if (k >= 0) if (k >= 0)
ldof[j] = -admin->getMesh()->newDOF[k] - 1; ldof[j] = -newDofIndex[k] - 1;
} }
} }
......
...@@ -521,13 +521,14 @@ namespace AMDiS { ...@@ -521,13 +521,14 @@ namespace AMDiS {
} }
/// Used by friend class Mesh while dofCompress /// Used by friend class Mesh while dofCompress
void newDofFct1(const DOFAdmin*); void newDofFct1(const DOFAdmin*, std::vector<int>&);
/// Used by friend class Mesh while dofCompress /// Used by friend class Mesh while dofCompress
void newDofFct2(const DOFAdmin*); void newDofFct2(const DOFAdmin*);
/// Changes old dofs to negative new dofs /// Changes old dofs to negative new dofs
void changeDofs1(const DOFAdmin* admin, int n0, int nd0, int nd, int pos); void changeDofs1(const DOFAdmin* admin, std::vector<int>& newDofIndex,
int n0, int nd0, int nd, int pos);
/// Changes negative new dofs to positive /// Changes negative new dofs to positive
void changeDofs2(int n0, int nd0, int nd, int pos); void changeDofs2(int n0, int nd0, int nd, int pos);
......
...@@ -160,7 +160,6 @@ namespace AMDiS { ...@@ -160,7 +160,6 @@ namespace AMDiS {
nDof = m.nDof; nDof = m.nDof;
nNodeEl = m.nNodeEl; nNodeEl = m.nNodeEl;
node = m.node; node = m.node;
newDOF = m.newDOF;
elementIndex = m.elementIndex; elementIndex = m.elementIndex;
initialized = m.initialized; initialized = m.initialized;
final_lambda = m.final_lambda; final_lambda = m.final_lambda;
...@@ -271,7 +270,8 @@ namespace AMDiS { ...@@ -271,7 +270,8 @@ namespace AMDiS {
TEST_EXIT(admin.size() == 1)("Not yet implemented for multiple admins!\n"); TEST_EXIT(admin.size() == 1)("Not yet implemented for multiple admins!\n");
TEST_EXIT(admin[0])("There is something wrong!\n"); TEST_EXIT(admin[0])("There is something wrong!\n");
// === Determine to all dofs the macro elements where the dof is part of. === // === Determine to all DOFs in mesh the macro elements where the DOF ===
// === is part of. ===
// Map that stores for each dof pointer (which may have a list of dofs) // Map that stores for each dof pointer (which may have a list of dofs)
// all macro element indices that own this dof. // all macro element indices that own this dof.
...@@ -463,9 +463,8 @@ namespace AMDiS { ...@@ -463,9 +463,8 @@ namespace AMDiS {
compressAdmin->getHoleCount() < 1) compressAdmin->getHoleCount() < 1)
continue; continue;
newDOF.resize(size); std::vector<int> newDofIndex(size);
compressAdmin->compress(newDofIndex);
compressAdmin->compress(newDOF);
Flag fill_flag = (preserveCoarseDOFs ? Flag fill_flag = (preserveCoarseDOFs ?
Mesh::CALL_EVERY_EL_PREORDER | Mesh::FILL_NOTHING : Mesh::CALL_EVERY_EL_PREORDER | Mesh::FILL_NOTHING :
...@@ -473,7 +472,7 @@ namespace AMDiS { ...@@ -473,7 +472,7 @@ namespace AMDiS {
TraverseStack stack; TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(this, -1, fill_flag); ElInfo *elInfo = stack.traverseFirst(this, -1, fill_flag);
while (elInfo) { while (elInfo) {
elInfo->getElement()->newDofFct1(compressAdmin); elInfo->getElement()->newDofFct1(compressAdmin, newDofIndex);
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} }
...@@ -482,8 +481,6 @@ namespace AMDiS { ...@@ -482,8 +481,6 @@ namespace AMDiS {
elInfo->getElement()->newDofFct2(compressAdmin); elInfo->getElement()->newDofFct2(compressAdmin);
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} }
newDOF.resize(0);
} }
} }
......
...@@ -808,9 +808,6 @@ namespace AMDiS { ...@@ -808,9 +808,6 @@ namespace AMDiS {
/// List of all MacroElements of this Mesh /// List of all MacroElements of this Mesh
std::deque<MacroElement*> macroElements; std::deque<MacroElement*> macroElements;
/// Needed during DOF compression (\ref DOFAdmin::compress).
std::vector<DegreeOfFreedom> newDOF;
/// Used by check functions /// Used by check functions
static std::vector<DegreeOfFreedom> dof_used; static std::vector<DegreeOfFreedom> dof_used;
...@@ -880,9 +877,6 @@ namespace AMDiS { ...@@ -880,9 +877,6 @@ namespace AMDiS {
friend class MacroWriter; friend class MacroWriter;
friend class MacroElement; friend class MacroElement;
friend class Element; friend class Element;
friend void Element::newDofFct1(const DOFAdmin*);
friend void Element::newDofFct2(const DOFAdmin*);
friend void Element::changeDofs1(const DOFAdmin*, int, int, int, int);
}; };
} }
......
...@@ -56,8 +56,7 @@ namespace AMDiS { ...@@ -56,8 +56,7 @@ namespace AMDiS {
deserialized(false), deserialized(false),
writeSerializationFile(false), writeSerializationFile(false),
repartitioningAllowed(false), repartitioningAllowed(false),
lastMeshChangeIndex(0), lastMeshChangeIndex(0)
macroElementStructureConsisten(false)
{ {
FUNCNAME("MeshDistributor::ParalleDomainBase()"); FUNCNAME("MeshDistributor::ParalleDomainBase()");
...@@ -139,36 +138,38 @@ namespace AMDiS { ...@@ -139,36 +138,38 @@ namespace AMDiS {
#endif #endif
// === Create new global and local DOF numbering. ===
// createLocalGlobalNumbering();
// === Remove all macro elements that are not part of the rank partition. === // === Remove all macro elements that are not part of the rank partition. ===
removeMacroElements(); removeMacroElements();
macroElementStructureConsisten = true;
updateLocalGlobalNumbering(true); // === Create new global and local DOF numbering. ===
// === Reset all DOFAdmins of the mesh. === // We have to remove the VertexVectors, which contain periodic assoiciations,
// because they are not valid anymore after some macro elements have been removed
// and the corresponding DOFs were deleted.
for (std::map<BoundaryType, VertexVector*>::iterator it = mesh->getPeriodicAssociations().begin();
it != mesh->getPeriodicAssociations().end(); ++it)
const_cast<DOFAdmin&>(mesh->getDofAdmin(0)).removeDOFContainer(dynamic_cast<DOFContainer*>(it->second));
updateDofAdmins(); updateLocalGlobalNumbering();
// === If in debug mode, make some tests. === // === If in debug mode, make some tests. ===
#if (DEBUG != 0) #if (DEBUG != 0)
MSG("AMDiS runs in debug mode, so make some test ...\n"); MSG("AMDiS runs in debug mode, so make some test ...\n");
ParallelDebug::testAllElements(*this); ParallelDebug::testAllElements(*this);
debug::testSortedDofs(mesh, elMap); debug::testSortedDofs(mesh, elMap);
ParallelDebug::testInteriorBoundary(*this); ParallelDebug::testInteriorBoundary(*this);
ParallelDebug::testCommonDofs(*this, true); ParallelDebug::testCommonDofs(*this, true);
ParallelDebug::testGlobalIndexByCoords(*this); ParallelDebug::testGlobalIndexByCoords(*this);
MSG("Debug mode tests finished!\n");
debug::writeMesh(feSpace, -1, "macro_mesh"); debug::writeMesh(feSpace, -1, "macro_mesh");
MSG("Debug mode tests finished!\n");
#endif #endif
...@@ -188,8 +189,7 @@ namespace AMDiS { ...@@ -188,8 +189,7 @@ namespace AMDiS {
debug::writeMesh(feSpace, -1, "gr_mesh"); debug::writeMesh(feSpace, -1, "gr_mesh");
#endif #endif
mesh->dofCompress(); updateLocalGlobalNumbering();
updateLocalGlobalNumbering(false);
// === Update periodic mapping, if there are periodic boundaries. === // === Update periodic mapping, if there are periodic boundaries. ===
...@@ -305,30 +305,6 @@ namespace AMDiS { ...@@ -305,30 +305,6 @@ namespace AMDiS {
{} {}
void MeshDistributor::updateDofAdmins()
{
FUNCNAME("MeshDistributor::updateDofAdmins()");
for (int i = 0; i < mesh->getNumberOfDOFAdmin(); i++) {
DOFAdmin& admin = const_cast<DOFAdmin&>(mesh->getDofAdmin(i));
// There must be always more allocated DOFs than used DOFs in DOFAdmin. Otherwise,
// it is not possible to define a first DOF hole.
if (static_cast<unsigned int>(admin.getSize()) == mapLocalGlobalDofs.size())
admin.enlargeDOFLists();
for (int j = 0; j < admin.getSize(); j++)
admin.setDOFFree(j, true);
for (unsigned int j = 0; j < mapLocalGlobalDofs.size(); j++)
admin.setDOFFree(j, false);
admin.setUsedSize(mapLocalGlobalDofs.size());
admin.setUsedCount(mapLocalGlobalDofs.size());
admin.setFirstHole(mapLocalGlobalDofs.size());
}
}
void MeshDistributor::testForMacroMesh() void MeshDistributor::testForMacroMesh()
{ {
FUNCNAME("MeshDistributor::testForMacroMesh()"); FUNCNAME("MeshDistributor::testForMacroMesh()");
...@@ -475,9 +451,6 @@ namespace AMDiS { ...@@ -475,9 +451,6 @@ namespace AMDiS {
} }
// Remove periodic vertex associations // Remove periodic vertex associations
for (std::map<BoundaryType, VertexVector*>::iterator it = mesh->getPeriodicAssociations().begin();
it != mesh->getPeriodicAssociations().end(); ++it)
const_cast<DOFAdmin&>(mesh->getDofAdmin(0)).removeDOFContainer(dynamic_cast<DOFContainer*>(it->second));
mesh->getPeriodicAssociations().clear(); mesh->getPeriodicAssociations().clear();
} }
...@@ -564,8 +537,8 @@ namespace AMDiS { ...@@ -564,8 +537,8 @@ namespace AMDiS {
// === Because the mesh has been changed, update the DOF numbering and mappings. === // === Because the mesh has been changed, update the DOF numbering and mappings. ===
mesh->dofCompress(); updateLocalGlobalNumbering();
updateLocalGlobalNumbering(false);