Skip to content
Snippets Groups Projects
Commit d5e4c931 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Added some small features to ArhReader and ArhWriter.

parent 5f9656c6
No related branches found
No related tags found
No related merge requests found
......@@ -82,13 +82,13 @@ AR="ar"
AR_FLAGS="cru"
# A C compiler.
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
LTCC="gcc"
# LTCC compiler flags.
LTCFLAGS="-g -O2"
# A language-specific compiler.
CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
CC="gcc"
# Is the compiler the GNU C compiler?
with_gcc=yes
......@@ -171,7 +171,7 @@ dlopen_self=unknown
dlopen_self_static=unknown
# Compiler flag to prevent dynamic linking.
link_static_flag=""
link_static_flag="-static"
# Compiler flag to turn off builtin functions.
no_builtin_flag=" -fno-builtin"
......@@ -6798,13 +6798,13 @@ AR="ar"
AR_FLAGS="cru"
# A C compiler.
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
LTCC="gcc"
# LTCC compiler flags.
LTCFLAGS="-g -O2"
# A language-specific compiler.
CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicxx"
CC="g++"
# Is the compiler the GNU C compiler?
with_gcc=yes
......@@ -6887,7 +6887,7 @@ dlopen_self=unknown
dlopen_self_static=unknown
# Compiler flag to prevent dynamic linking.
link_static_flag=""
link_static_flag="-static"
# Compiler flag to turn off builtin functions.
no_builtin_flag=" -fno-builtin"
......@@ -6954,11 +6954,11 @@ predeps=""
# Dependencies to place after the objects being linked to create a
# shared library.
postdeps="-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -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
# a shared library.
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/../../.."
compiler_lib_search_path="-L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.."
# Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all"
......@@ -7103,7 +7103,7 @@ AR="ar"
AR_FLAGS="cru"
# A C compiler.
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
LTCC="gcc"
# LTCC compiler flags.
LTCFLAGS="-g -O2"
......
......@@ -24,27 +24,35 @@ namespace AMDiS {
using namespace std;
void ArhReader::read(std::string filename, Mesh *mesh)
void ArhReader::read(string filename, Mesh *mesh,
DOFVector<double>* vec0,
DOFVector<double>* vec1,
DOFVector<double>* vec2)
{
std::vector<DOFVector<double>*> vecs(0);
ArhReader::read(filename, mesh, vecs);
}
vector<DOFVector<double>*> vecs(0);
if (vec0 != NULL)
vecs.push_back(vec0);
if (vec1 != NULL)
vecs.push_back(vec1);
if (vec2 != NULL)
vecs.push_back(vec2);
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)
vector<DOFVector<double>*> vecs)
{
FUNCNAME("ArhReader::read()");
// === Get set of all macro elements in mesh. ===
std::set<int> macroInMesh;
for (std::deque<MacroElement*>::iterator it = mesh->getMacroElements().begin();
it != mesh->getMacroElements().end(); ++it)
macroInMesh.insert((*it)->getIndex());
RefinementManager *refManager = NULL;
switch (mesh->getDim()) {
case 2:
......@@ -88,7 +96,8 @@ namespace AMDiS {
MeshStructure elementStructure;
elementStructure.init(structureCode, codeSize);
elementStructure.fitMeshToStructure(mesh, refManager, false, elIndex);
if (macroInMesh.count(elIndex) == 1)
elementStructure.fitMeshToStructure(mesh, refManager, false, elIndex);
uint32_t nValuesPerVector = 0;
file.read(reinterpret_cast<char*>(&nValuesPerVector), 4);
......@@ -96,7 +105,8 @@ namespace AMDiS {
for (unsigned int j = 0; j < nValueVectors; j++) {
vector<double> values(nValuesPerVector);
file.read(reinterpret_cast<char*>(&(values[0])), 8 * nValuesPerVector);
setDofValues(elIndex, mesh, values, vecs[j]);
if (macroInMesh.count(elIndex) == 1)
setDofValues(elIndex, mesh, values, vecs[j]);
}
}
......@@ -107,7 +117,7 @@ namespace AMDiS {
void ArhReader::setDofValues(int macroElIndex, Mesh *mesh,
std::vector<double>& values, DOFVector<double>* vec)
vector<double>& values, DOFVector<double>* vec)
{
FUNCNAME("ArhReader::setDofValues()");
......
......@@ -30,9 +30,10 @@ namespace AMDiS {
class ArhReader
{
public:
static void read(std::string filename, Mesh *mesh);
static void read(std::string filename, Mesh *mesh, DOFVector<double>* vec);
static void read(std::string filename, Mesh *mesh,
DOFVector<double>* vec0 = NULL,
DOFVector<double>* vec1 = NULL,
DOFVector<double>* vec2 = NULL);
static void read(std::string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs);
......
......@@ -24,24 +24,25 @@ namespace AMDiS {
using namespace std;
void ArhWriter::write(string filename, Mesh *mesh)
void ArhWriter::write(string filename, Mesh *mesh,
DOFVector<double>* vec0,
DOFVector<double>* vec1,
DOFVector<double>* vec2)
{
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;
vector<DOFVector<double>*> vecs(0);
if (vec0 != NULL)
vecs.push_back(vec0);
if (vec1 != NULL)
vecs.push_back(vec1);
if (vec2 != NULL)
vecs.push_back(vec2);
ArhWriter::write(filename, mesh, vecs);
}
void ArhWriter::write(std::string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs)
void ArhWriter::write(string filename, Mesh *mesh,
vector<DOFVector<double>*> vecs)
{
FUNCNAME("ArhWriter::write()");
......@@ -69,7 +70,7 @@ namespace AMDiS {
file.write(reinterpret_cast<char*>(&nAllValues), 4);
MeshStructure elementStructure;
std::vector<std::vector<double> > values(vecs.size());
vector<vector<double> > values(vecs.size());
int32_t macroElIndex = -1;
elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER);
......@@ -111,9 +112,9 @@ namespace AMDiS {
}
void ArhWriter::writeMacroElement(std::ofstream &file,
void ArhWriter::writeMacroElement(ofstream &file,
MeshStructure &code,
std::vector<std::vector<double> >& values,
vector<vector<double> >& values,
int32_t elIndex)
{
file.write(reinterpret_cast<char*>(&elIndex), 4);
......
......@@ -33,9 +33,10 @@ namespace AMDiS {
class ArhWriter
{
public:
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,
DOFVector<double>* vec0 = NULL,
DOFVector<double>* vec1 = NULL,
DOFVector<double>* vec2 = NULL);
static void write(std::string filename, Mesh *mesh,
std::vector<DOFVector<double>*> vecs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment