Commit a369387f authored by Thomas Witkowski's avatar Thomas Witkowski

Added support of reading and writing DOFVectors in arh files.

parent 0addc7a4
...@@ -51,32 +51,32 @@ build_old_libs=yes ...@@ -51,32 +51,32 @@ build_old_libs=yes
pic_mode=default pic_mode=default
# Whether or not to optimize for fast installation. # Whether or not to optimize for fast installation.
fast_install=needless fast_install=yes
# The host system. # The host system.
host_alias= host_alias=
host=x86_64-unknown-linux-gnu host=i686-redhat-linux-gnu
host_os=linux-gnu host_os=linux-gnu
# The build system. # The build system.
build_alias= build_alias=
build=x86_64-unknown-linux-gnu build=i686-redhat-linux-gnu
build_os=linux-gnu build_os=linux-gnu
# A sed program that does not truncate output. # A sed program that does not truncate output.
SED="/usr/bin/sed" SED="/bin/sed"
# Sed that helps us avoid accidentally triggering echo(1) options like -n. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="$SED -e 1s/^X//" Xsed="$SED -e 1s/^X//"
# A grep program that handles long lines. # A grep program that handles long lines.
GREP="/usr/bin/grep" GREP="/bin/grep"
# An ERE matcher. # An ERE matcher.
EGREP="/usr/bin/grep -E" EGREP="/bin/grep -E"
# A literal string matcher. # A literal string matcher.
FGREP="/usr/bin/grep -F" FGREP="/bin/grep -F"
# A BSD- or MS-compatible name lister. # A BSD- or MS-compatible name lister.
NM="/usr/bin/nm -B" NM="/usr/bin/nm -B"
...@@ -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="gcc"
# LTCC compiler flags. # LTCC compiler flags.
LTCFLAGS="-g -O2" LTCFLAGS="-g -O2"
...@@ -204,7 +204,7 @@ runpath_var=LD_RUN_PATH ...@@ -204,7 +204,7 @@ runpath_var=LD_RUN_PATH
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
# Is shlibpath searched before the hard-coded library search path? # Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=yes shlibpath_overrides_runpath=no
# Format of library name prefix. # Format of library name prefix.
libname_spec="lib\$name" libname_spec="lib\$name"
...@@ -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="/u/witkowski/local/lib /u/witkowski/local/intel/mkl/10.0.1.014/lib/32 /usr/lib/gcc/i386-redhat-linux/4.1.2 /usr/lib /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/lib/mysql /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib /usr/lib/xulrunner-1.9.2 "
# Whether dlopen is supported. # Whether dlopen is supported.
dlopen_support=unknown dlopen_support=unknown
...@@ -253,13 +253,13 @@ striplib="strip --strip-unneeded" ...@@ -253,13 +253,13 @@ striplib="strip --strip-unneeded"
# The linker used to build libraries. # The linker used to build libraries.
LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64" LD="/usr/bin/ld"
# Commands used to build an old-style archive. # Commands used to build an old-style archive.
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="gcc"
# Is the compiler the GNU compiler? # Is the compiler the GNU compiler?
with_gcc=yes with_gcc=yes
...@@ -274,7 +274,7 @@ wl="-Wl," ...@@ -274,7 +274,7 @@ wl="-Wl,"
pic_flag=" -fPIC -DPIC" pic_flag=" -fPIC -DPIC"
# Compiler flag to prevent dynamic linking. # Compiler flag to prevent dynamic linking.
link_static_flag="" link_static_flag="-static"
# Does compiler simultaneously support -c and -o options? # Does compiler simultaneously support -c and -o options?
compiler_c_o="yes" compiler_c_o="yes"
...@@ -8908,13 +8908,13 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ...@@ -8908,13 +8908,13 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
# ### BEGIN LIBTOOL TAG CONFIG: CXX # ### BEGIN LIBTOOL TAG CONFIG: CXX
# The linker used to build libraries. # The linker used to build libraries.
LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64" LD="/usr/bin/ld"
# Commands used to build an old-style archive. # Commands used to build an old-style archive.
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="g++"
# Is the compiler the GNU compiler? # Is the compiler the GNU compiler?
with_gcc=yes with_gcc=yes
...@@ -8929,7 +8929,7 @@ wl="-Wl," ...@@ -8929,7 +8929,7 @@ wl="-Wl,"
pic_flag=" -fPIC -DPIC" pic_flag=" -fPIC -DPIC"
# Compiler flag to prevent dynamic linking. # Compiler flag to prevent dynamic linking.
link_static_flag="" link_static_flag="-static"
# Does compiler simultaneously support -c and -o options? # Does compiler simultaneously support -c and -o options?
compiler_c_o="yes" compiler_c_o="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="/u/witkowski/local/lib /u/witkowski/local/intel/mkl/10.0.1.014/lib/32 /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/../../.."
# 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/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-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/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../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="-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/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/u/witkowski/local/lib -L/u/witkowski/local/intel/mkl/10.0.1.014/lib/32 -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/../../.."
# ### END LIBTOOL TAG CONFIG: CXX # ### END LIBTOOL TAG CONFIG: CXX
...@@ -3,16 +3,36 @@ ...@@ -3,16 +3,36 @@
#include "ArhReader.h" #include "ArhReader.h"
#include "Mesh.h" #include "Mesh.h"
#include "MeshStructure.h" #include "MeshStructure.h"
#include "Traverse.h"
#include "DOFVector.h"
namespace AMDiS { namespace AMDiS {
using namespace std; using namespace std;
void ArhReader::read(string filename, Mesh *mesh, bool ignoreFinerMesh)
void ArhReader::read(std::string filename, Mesh *mesh)
{
std::vector<DOFVector<double>*> vecs(0);
ArhReader::read(filename, mesh, vecs);
}
void ArhReader::read(std::string filename, Mesh *mesh, DOFVector<double>* vec)
{
std::vector<DOFVector<double>*> vecs(1);
vecs[0] = vec;
ArhReader::read(filename, mesh, vecs);
}
void ArhReader::read(string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs)
{ {
FUNCNAME("ArhReader::read()"); FUNCNAME("ArhReader::read()");
RefinementManager *refManager; RefinementManager *refManager = NULL;
switch (mesh->getDim()) { switch (mesh->getDim()) {
case 2: case 2:
refManager = new RefinementManager2d(); refManager = new RefinementManager2d();
...@@ -37,6 +57,10 @@ namespace AMDiS { ...@@ -37,6 +57,10 @@ namespace AMDiS {
file.read(reinterpret_cast<char*>(&nValueVectors), 4); file.read(reinterpret_cast<char*>(&nValueVectors), 4);
file.read(reinterpret_cast<char*>(&nAllValues), 4); file.read(reinterpret_cast<char*>(&nAllValues), 4);
TEST_EXIT(nValueVectors == vecs.size())
("File has %d vectors, but %d DOFVectors are provided!\n",
nValueVectors, vecs.size());
for (unsigned int i = 0; i < nMacroElements; i++) { for (unsigned int i = 0; i < nMacroElements; i++) {
uint32_t elIndex = 0; uint32_t elIndex = 0;
uint32_t nStructureCodes = 0; uint32_t nStructureCodes = 0;
...@@ -46,20 +70,20 @@ namespace AMDiS { ...@@ -46,20 +70,20 @@ namespace AMDiS {
file.read(reinterpret_cast<char*>(&nStructureCodes), 4); file.read(reinterpret_cast<char*>(&nStructureCodes), 4);
file.read(reinterpret_cast<char*>(&codeSize), 4); file.read(reinterpret_cast<char*>(&codeSize), 4);
vector<unsigned long int> structureCode(nStructureCodes); vector<uint64_t> structureCode(nStructureCodes);
file.read(reinterpret_cast<char*>(&(structureCode[0])), 8 * nStructureCodes); file.read(reinterpret_cast<char*>(&(structureCode[0])), 8 * nStructureCodes);
MeshStructure elementStructure; MeshStructure elementStructure;
elementStructure.init(structureCode, codeSize); elementStructure.init(structureCode, codeSize);
elementStructure.fitMeshToStructure(mesh, refManager, elementStructure.fitMeshToStructure(mesh, refManager, false, elIndex);
false, elIndex, ignoreFinerMesh);
uint32_t nValuesPerVector = 0; uint32_t nValuesPerVector = 0;
file.read(reinterpret_cast<char*>(&nValuesPerVector), 4); file.read(reinterpret_cast<char*>(&nValuesPerVector), 4);
for (unsigned int j = 0; j < nValuesPerVector * nValueVectors; j++) { for (unsigned int j = 0; j < nValueVectors; j++) {
double value = 0.0; vector<double> values(nValuesPerVector);
file.read(reinterpret_cast<char*>(&value), 8); file.read(reinterpret_cast<char*>(&(values[0])), 8 * nValuesPerVector);
setDofValues(elIndex, mesh, values, vecs[j]);
} }
} }
...@@ -67,4 +91,31 @@ namespace AMDiS { ...@@ -67,4 +91,31 @@ namespace AMDiS {
MSG("ARH file read from: %s\n", filename.c_str()); MSG("ARH file read from: %s\n", filename.c_str());
} }
void ArhReader::setDofValues(int macroElIndex, Mesh *mesh,
std::vector<double>& values, DOFVector<double>* vec)
{
FUNCNAME("ArhReader::setDofValues()");
bool macroElement = false;
int valuePos = 0;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirstOneMacro(mesh, macroElIndex, -1,
Mesh::CALL_EVERY_EL_PREORDER);
while (elInfo) {
if (!macroElement) {
Element *mEl = elInfo->getMacroElement()->getElement();
for (int i = 0; i <= mesh->getDim(); i++)
(*vec)[mEl->getDOF(i, 0)] = values[valuePos++];
macroElement = true;
}
Element *el = elInfo->getElement();
if (!el->isLeaf())
(*vec)[el->getChild(0)->getDOF(mesh->getDim(), 0)] = values[valuePos++];
elInfo = stack.traverseNext(elInfo);
}
}
} }
...@@ -29,8 +29,16 @@ namespace AMDiS { ...@@ -29,8 +29,16 @@ namespace AMDiS {
class ArhReader class ArhReader
{ {
public: public:
static void read(std::string filename, Mesh *mesh, static void read(std::string filename, Mesh *mesh);
bool ignoreFinerMesh = true);
static void read(std::string filename, Mesh *mesh, DOFVector<double>* vec);
static void read(std::string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs);
private:
static void setDofValues(int macroElIndex, Mesh *mesh,
std::vector<double>& values, DOFVector<double>* vec);
}; };
} }
......
...@@ -4,19 +4,38 @@ ...@@ -4,19 +4,38 @@
#include "Mesh.h" #include "Mesh.h"
#include "MeshStructure.h" #include "MeshStructure.h"
#include "Traverse.h" #include "Traverse.h"
#include "DOFVector.h"
namespace AMDiS { namespace AMDiS {
using namespace std; using namespace std;
void ArhWriter::write(string filename, Mesh *mesh) void ArhWriter::write(string filename, Mesh *mesh)
{
std::vector<DOFVector<double>*> vecs(0);
ArhWriter::write(filename, mesh, vecs);
}
void ArhWriter::write(std::string filename, Mesh *mesh, DOFVector<double>* vec)
{
std::vector<DOFVector<double>*> vecs(1);
vecs[0] = vec;
ArhWriter::write(filename, mesh, vecs);
}
void ArhWriter::write(std::string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs)
{ {
FUNCNAME("ArhWriter::write()"); FUNCNAME("ArhWriter::write()");
ofstream file; ofstream file;
file.open(filename.c_str(), ios::out | ios::binary | ios::trunc); file.open(filename.c_str(), ios::out | ios::binary | ios::trunc);
string typeId = "arhS"; string typeId = "arhP";
file.write(typeId.c_str(), 4); file.write(typeId.c_str(), 4);
uint32_t nMacroElements = 0; uint32_t nMacroElements = 0;
...@@ -29,13 +48,15 @@ namespace AMDiS { ...@@ -29,13 +48,15 @@ namespace AMDiS {
file.write(reinterpret_cast<char*>(&nMacroElements), 4); file.write(reinterpret_cast<char*>(&nMacroElements), 4);
uint32_t nValueVectors = 0; uint32_t nValueVectors = vecs.size();
file.write(reinterpret_cast<char*>(&nValueVectors), 4); file.write(reinterpret_cast<char*>(&nValueVectors), 4);
uint32_t nAllValues = 0; uint32_t nAllValues =
(vecs.size() > 0 ? vecs[0]->getFeSpace()->getAdmin()->getUsedDOFs() : 0);
file.write(reinterpret_cast<char*>(&nAllValues), 4); file.write(reinterpret_cast<char*>(&nAllValues), 4);
MeshStructure elementStructure; MeshStructure elementStructure;
std::vector<std::vector<double> > values(vecs.size());
int32_t macroElIndex = -1; int32_t macroElIndex = -1;
elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER); elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER);
...@@ -43,21 +64,33 @@ namespace AMDiS { ...@@ -43,21 +64,33 @@ namespace AMDiS {
if (elInfo->getLevel() == 0) { if (elInfo->getLevel() == 0) {
if (macroElIndex != -1) { if (macroElIndex != -1) {
elementStructure.commit(); elementStructure.commit();
writeMacroElement(file, elementStructure, macroElIndex); writeMacroElement(file, elementStructure, values, macroElIndex);
} }
elementStructure.clear(); elementStructure.clear();
macroElIndex = elInfo->getElement()->getIndex(); macroElIndex = elInfo->getElement()->getIndex();
for (unsigned int i = 0; i < vecs.size(); i++) {
values[i].clear();
for (int j = 0; j <= mesh->getDim(); j++)
values[i].push_back((*vecs[i])[elInfo->getElement()->getDOF(j, 0)]);
}
} }
elementStructure.insertElement(elInfo->getElement()->isLeaf()); elementStructure.insertElement(elInfo->getElement()->isLeaf());
if (!elInfo->getElement()->isLeaf()) {
for (unsigned int i = 0; i < vecs.size(); i++)
values[i].push_back((*vecs[i])[elInfo->getElement()->getChild(0)->getDOF(mesh->getDim(), 0)]);
}
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} }
// And write the last macro element to file. // And write the last macro element to file.
TEST_EXIT_DBG(macroElIndex != -1)("Should not happen!\n"); TEST_EXIT_DBG(macroElIndex != -1)("Should not happen!\n");
elementStructure.commit(); elementStructure.commit();
writeMacroElement(file, elementStructure, macroElIndex); writeMacroElement(file, elementStructure, values, macroElIndex);
file.close(); file.close();
...@@ -66,7 +99,8 @@ namespace AMDiS { ...@@ -66,7 +99,8 @@ namespace AMDiS {
void ArhWriter::writeMacroElement(std::ofstream &file, void ArhWriter::writeMacroElement(std::ofstream &file,
MeshStructure &code, MeshStructure &code,
std::vector<std::vector<double> >& values,
int32_t elIndex) int32_t elIndex)
{ {
file.write(reinterpret_cast<char*>(&elIndex), 4); file.write(reinterpret_cast<char*>(&elIndex), 4);
...@@ -77,11 +111,14 @@ namespace AMDiS { ...@@ -77,11 +111,14 @@ namespace AMDiS {
uint32_t codeSize = code.getNumElements(); uint32_t codeSize = code.getNumElements();
file.write(reinterpret_cast<char*>(&codeSize), 4); file.write(reinterpret_cast<char*>(&codeSize), 4);
file.write(reinterpret_cast<char*>(&(const_cast<vector<unsigned long int>&>(code.getCode())[0])), file.write(reinterpret_cast<char*>(&(const_cast<vector<uint64_t>&>(code.getCode())[0])),
8 * nStructureCodes); 8 * nStructureCodes);
uint32_t nValuesPerVector = 0; uint32_t nValuesPerVector = (values.size() > 0 ? values[0].size() : 0);
file.write(reinterpret_cast<char*>(&nValuesPerVector), 4); file.write(reinterpret_cast<char*>(&nValuesPerVector), 4);
for (unsigned int i = 0; i < values.size(); i++)
file.write(reinterpret_cast<char*>(&(values[i][0])), 8 * nValuesPerVector);
} }
} }
...@@ -34,9 +34,15 @@ namespace AMDiS { ...@@ -34,9 +34,15 @@ namespace AMDiS {
public: public:
static void write(std::string filename, Mesh *mesh); static void write(std::string filename, Mesh *mesh);
static void write(std::string filename, Mesh *mesh, DOFVector<double>* vec);
static void write(std::string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs);
protected: protected:
static void writeMacroElement(std::ofstream &file, static void writeMacroElement(std::ofstream &file,
MeshStructure &code, MeshStructure &code,
std::vector<std::vector<double> >& values,
int32_t elIndex); int32_t elIndex);
}; };
} }
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
namespace AMDiS { namespace AMDiS {
const int MeshStructure::unsignedLongSize = sizeof(unsigned long int) * 8; const int MeshStructure::structureSize = 64;
void MeshStructure::insertElement(bool isLeaf) void MeshStructure::insertElement(bool isLeaf)
{ {
// overflow? -> next index // overflow? -> next index
if (pos >= unsignedLongSize) { if (pos >= structureSize) {
code.push_back(currentCode); code.push_back(currentCode);
pos = 0; pos = 0;
currentCode = 0; currentCode = 0;
...@@ -23,7 +23,7 @@ namespace AMDiS { ...@@ -23,7 +23,7 @@ namespace AMDiS {
// insert element in binary code // insert element in binary code
if (!isLeaf) { if (!isLeaf) {
unsigned long int one = 1; uint64_t one = 1;
currentCode += (one << pos); currentCode += (one << pos);
} }
...@@ -160,7 +160,7 @@ namespace AMDiS { ...@@ -160,7 +160,7 @@ namespace AMDiS {
if (currentElement >= nElements) if (currentElement >= nElements)
return false; return false;
if (pos >= unsignedLongSize) { if (pos >= structureSize) {
currentIndex++; currentIndex++;
TEST_EXIT_DBG(currentIndex < static_cast<int>(code.size())) TEST_EXIT_DBG(currentIndex < static_cast<int>(code.size()))
("End of structure reached!\n"); ("End of structure reached!\n");
......
...@@ -48,7 +48,7 @@ namespace AMDiS { ...@@ -48,7 +48,7 @@ namespace AMDiS {
void init(BoundaryObject &bound); void init(BoundaryObject &bound);
void init(const std::vector<unsigned long int>& initCode, int n) void init(const std::vector<uint64_t>& initCode, int n)
{ {
code = initCode; code = initCode;
nElements = n; nElements = n;
...@@ -117,7 +117,7 @@ namespace AMDiS { ...@@ -117,7 +117,7 @@ namespace AMDiS {
void print(bool resetCode = true); void print(bool resetCode = true);
/// Returns the mesh structure code. /// Returns the mesh structure code.
inline const std::vector<unsigned long int>& getCode() inline const std::vector<uint64_t>& getCode()