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

Fixed serialization-deserialization problem for periodic boundaries.

parent 8ed65a89
No related branches found
No related tags found
No related merge requests found
......@@ -973,13 +973,17 @@ namespace AMDiS {
node.serialize(out);
// write admins
// === Write admins. ===
int size = static_cast<int>(admin.size());
SerUtil::serialize(out, size);
for (int i = 0; i < size; i++)
admin[i]->serialize(out);
// write macroElements
// === Write macroElements. ===
size = static_cast<int>(macroElements.size());
SerUtil::serialize(out, size);
for (int i = 0; i < size; i++)
......@@ -988,6 +992,30 @@ namespace AMDiS {
SerUtil::serialize(out, elementIndex);
SerUtil::serialize(out, initialized);
// === Write periodic associations. ===
int mapSize = periodicAssociations.size();
SerUtil::serialize(out, mapSize);
for (std::map<BoundaryType, VertexVector*>::iterator it = periodicAssociations.begin();
it != periodicAssociations.end(); ++it) {
BoundaryType b = it->first;
// Check which DOFAdmin is used for the current VertexVector we want to serialize.
int ithAdmin = -1;
for (int i = 0; i < static_cast<int>(admin.size()); i++) {
if (admin[i] == it->second->getAdmin()) {
ithAdmin = i;
break;
}
}
TEST_EXIT(ithAdmin >= 0)
("No DOFAdmin found for serialization of periodic associations!\n");
SerUtil::serialize(out, b);
SerUtil::serialize(out, ithAdmin);
it->second->serialize(out);
}
serializedDOFs.clear();
}
......@@ -1027,7 +1055,9 @@ namespace AMDiS {
node.deserialize(in);
// read admins
// === Read admins. ===
int size;
SerUtil::deserialize(in, size);
admin.resize(size, NULL);
......@@ -1092,6 +1122,22 @@ namespace AMDiS {
}
serializedDOFs.clear();
/// === Read periodic assoications. ===
int mapSize = 0;
SerUtil::deserialize(in, mapSize);
for (int i = 0; i < mapSize; i++) {
BoundaryType b = 0;
int ithAdmin = 0;
SerUtil::deserialize(in, b);
SerUtil::deserialize(in, ithAdmin);
VertexVector *tmpvec = new VertexVector(admin[ithAdmin], "");
tmpvec->deserialize(in);
periodicAssociations[b] = tmpvec;
}
}
void Mesh::initialize()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment