diff --git a/AMDiS/src/parallel/ElementObjectData.cc b/AMDiS/src/parallel/ElementObjectData.cc index 18c072be4de528ba44ab5fc1e57cdc51c00cfc68..3e22eaa18b969f02cdbc71f849b58005512bb2b2 100644 --- a/AMDiS/src/parallel/ElementObjectData.cc +++ b/AMDiS/src/parallel/ElementObjectData.cc @@ -152,6 +152,9 @@ namespace AMDiS { serialize(out, it->second); } + SerUtil::serialize(out, periodicVertices); + SerUtil::serialize(out, periodicEdges); + SerUtil::serialize(out, periodicFaces); } @@ -257,6 +260,10 @@ namespace AMDiS { deserialize(in, data); faceInRank[face] = data; } + + SerUtil::deserialize(in, periodicVertices); + SerUtil::deserialize(in, periodicEdges); + SerUtil::deserialize(in, periodicFaces); } diff --git a/AMDiS/src/parallel/ElementObjectData.h b/AMDiS/src/parallel/ElementObjectData.h index 317b9de8116be9348daa93ad11367fa7128ccb44..6c900bff56210e1c7bced53e91bcbcb9d3e40cce 100644 --- a/AMDiS/src/parallel/ElementObjectData.h +++ b/AMDiS/src/parallel/ElementObjectData.h @@ -34,6 +34,15 @@ namespace AMDiS { + using namespace std; + + template + struct PerBoundMap + { + typedef map, BoundaryType> type; + typedef typename type::iterator iterator; + }; + struct ElementObjectData { ElementObjectData(int a = -1, int b = 0, BoundaryType c = INTERIOR) : elIndex(a), @@ -48,7 +57,7 @@ namespace AMDiS { BoundaryType boundaryType; - void serialize(std::ostream &out) const + void serialize(ostream &out) const { SerUtil::serialize(out, elIndex); SerUtil::serialize(out, ithObject); @@ -56,7 +65,7 @@ namespace AMDiS { } - void deserialize(std::istream &in) + void deserialize(istream &in) { SerUtil::deserialize(in, elIndex); SerUtil::deserialize(in, ithObject); @@ -90,7 +99,6 @@ namespace AMDiS { void addVertex(Element *el, int ith, BoundaryType bound = INTERIOR) { - // DegreeOfFreedom vertex = el->getObject(ith); DegreeOfFreedom vertex = el->getDof(ith, 0); int elIndex = el->getIndex(); ElementObjectData elObj(elIndex, ith, bound); @@ -102,7 +110,6 @@ namespace AMDiS { void addEdge(Element *el, int ith, BoundaryType bound = INTERIOR) { - // DofEdge edge = el->getObject(ith); DofEdge edge = el->getEdge(ith); int elIndex = el->getIndex(); ElementObjectData elObj(elIndex, ith, bound); @@ -114,7 +121,6 @@ namespace AMDiS { void addFace(Element *el, int ith, BoundaryType bound = INTERIOR) { - // DofFace face = el->getObject(ith); DofFace face = el->getFace(ith); int elIndex = el->getIndex(); ElementObjectData elObj(elIndex, ith, bound); @@ -136,8 +142,23 @@ namespace AMDiS { addFace(el, i); } + void addPeriodicVertex(pair perVertex, + BoundaryType bType) + { + periodicVertices[perVertex] = bType; + } + + void addPeriodicEdge(pair perEdge, BoundaryType bType) + { + periodicEdges[perEdge] = bType; + } + + void addPeriodicFace(pair perFace, BoundaryType bType) + { + periodicFaces[perFace] = bType; + } - void createRankData(std::map& macroElementRankMap); + void createRankData(map& macroElementRankMap); bool iterate(GeoIndex pos) @@ -200,7 +221,7 @@ namespace AMDiS { } - std::map& getIterateData() + map& getIterateData() { switch (iterGeoPos) { case VERTEX: @@ -274,33 +295,33 @@ namespace AMDiS { } - std::vector& getElements(DegreeOfFreedom vertex) + vector& getElements(DegreeOfFreedom vertex) { return vertexElements[vertex]; } - std::vector& getElements(DofEdge edge) + vector& getElements(DofEdge edge) { return edgeElements[edge]; } - std::vector& getElements(DofFace face) + vector& getElements(DofFace face) { return faceElements[face]; } - std::map& getElementsInRank(DegreeOfFreedom vertex) + map& getElementsInRank(DegreeOfFreedom vertex) { return vertexInRank[vertex]; } - std::map& getElementsInRank(DofEdge edge) + map& getElementsInRank(DofEdge edge) { return edgeInRank[edge]; } - std::map& getElementsInRank(DofFace face) + map& getElementsInRank(DofFace face) { return faceInRank[face]; } @@ -320,45 +341,50 @@ namespace AMDiS { return faceLocalMap[data]; } - void serialize(std::ostream &out); + void serialize(ostream &out); - void deserialize(std::istream &in); + void deserialize(istream &in); private: - void serialize(std::ostream &out, std::vector& elVec); + void serialize(ostream &out, vector& elVec); - void deserialize(std::istream &in, std::vector& elVec); + void deserialize(istream &in, vector& elVec); - void serialize(std::ostream &out, std::map& data); + void serialize(ostream &out, map& data); - void deserialize(std::istream &in, std::map& data); + void deserialize(istream &in, map& data); private: - std::map > vertexElements; - std::map > edgeElements; - std::map > faceElements; + map > vertexElements; + map > edgeElements; + map > faceElements; - std::map vertexLocalMap; - std::map edgeLocalMap; - std::map faceLocalMap; + map vertexLocalMap; + map edgeLocalMap; + map faceLocalMap; - std::map vertexOwner; - std::map edgeOwner; - std::map faceOwner; + map vertexOwner; + map edgeOwner; + map faceOwner; - std::map > vertexInRank; - std::map > edgeInRank; - std::map > faceInRank; + map > vertexInRank; + map > edgeInRank; + map > faceInRank; - - std::map >::iterator vertexIter; - std::map >::iterator edgeIter; - std::map >::iterator faceIter; + map >::iterator vertexIter; + map >::iterator edgeIter; + map >::iterator faceIter; GeoIndex iterGeoPos; + + public: + // The following three data structures store periodic DOFs, edges and faces. + PerBoundMap::type periodicVertices; + PerBoundMap::type periodicEdges; + PerBoundMap::type periodicFaces; }; } diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index e21545ae6213ebfb98cc07f770441afba4f5be5e..4e234d5a415b3f7caaececf3f5c586bbb02d080b 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -1323,13 +1323,11 @@ namespace AMDiS { DofEdge edge2 = neigh->getEdge(elInfo->getOppVertex(i)); BoundaryType boundaryType = elInfo->getBoundary(EDGE, i); - periodicEdges[std::make_pair(edge1, edge2)] = boundaryType; - + elObjects.addPeriodicEdge(std::make_pair(edge1, edge2), boundaryType); periodicEdgeAssoc[edge1].insert(edge2); - periodicVertices[std::make_pair(edge1.first, edge2.first)] = boundaryType; - periodicVertices[std::make_pair(edge1.second, edge2.second)] = boundaryType; - + elObjects.addPeriodicVertex(std::make_pair(edge1.first, edge2.first), boundaryType); + elObjects.addPeriodicVertex(std::make_pair(edge1.second, edge2.second), boundaryType); periodicDofAssoc[edge1.first].insert(boundaryType); periodicDofAssoc[edge1.second].insert(boundaryType); @@ -1348,11 +1346,11 @@ namespace AMDiS { DofFace face2 = neigh->getFace(elInfo->getOppVertex(i)); BoundaryType boundaryType = elInfo->getBoundary(FACE, i); - periodicFaces[std::make_pair(face1, face2)] = elInfo->getBoundary(i); + elObjects.addPeriodicFace(std::make_pair(face1, face2), elInfo->getBoundary(i)); - periodicVertices[std::make_pair(face1.get<0>(), face2.get<0>())] = boundaryType; - periodicVertices[std::make_pair(face1.get<1>(), face2.get<1>())] = boundaryType; - periodicVertices[std::make_pair(face1.get<2>(), face2.get<2>())] = boundaryType; + elObjects.addPeriodicVertex(std::make_pair(face1.get<0>(), face2.get<0>()), boundaryType); + elObjects.addPeriodicVertex(std::make_pair(face1.get<1>(), face2.get<1>()), boundaryType); + elObjects.addPeriodicVertex(std::make_pair(face1.get<2>(), face2.get<2>()), boundaryType); periodicDofAssoc[face1.get<0>()].insert(boundaryType); periodicDofAssoc[face1.get<1>()].insert(boundaryType); @@ -1371,9 +1369,10 @@ namespace AMDiS { DofEdge neighEdge2 = std::make_pair(face2.get<0>(), face2.get<2>()); DofEdge neighEdge3 = std::make_pair(face2.get<1>(), face2.get<2>()); - periodicEdges[std::make_pair(elEdge1, neighEdge1)] = boundaryType; - periodicEdges[std::make_pair(elEdge2, neighEdge2)] = boundaryType; - periodicEdges[std::make_pair(elEdge3, neighEdge3)] = boundaryType; + + elObjects.addPeriodicEdge(std::make_pair(elEdge1, neighEdge1), boundaryType); + elObjects.addPeriodicEdge(std::make_pair(elEdge2, neighEdge2), boundaryType); + elObjects.addPeriodicEdge(std::make_pair(elEdge3, neighEdge3), boundaryType); periodicEdgeAssoc[elEdge1].insert(neighEdge1); periodicEdgeAssoc[elEdge2].insert(neighEdge2); @@ -1394,7 +1393,7 @@ namespace AMDiS { // === Search for interectly connected vertices in periodic boundaries. === - if (periodicVertices.size() > 0) { + if (elObjects.periodicVertices.size() > 0) { // === Search for an unsed boundary index. === @@ -1412,42 +1411,100 @@ namespace AMDiS { // === Get all vertex DOFs that have multiple periodic associations. === - std::map > multiplePeriodicDof; + std::vector multPeriodicDof2, multPeriodicDof3; for (std::map >::iterator it = periodicDofAssoc.begin(); it != periodicDofAssoc.end(); ++it) { TEST_EXIT_DBG((mesh->getDim() == 2 && it->second.size() <= 2) || (mesh->getDim() == 3 && it->second.size() <= 3)) ("Should not happen!\n"); - multiplePeriodicDof[it->second.size()].push_back(it->first); + if (it->second.size() == 2) + multPeriodicDof2.push_back(it->first); + if (it->second.size() == 3) + multPeriodicDof3.push_back(it->first); + } + + + if (mesh->getDim() == 2) { + TEST_EXIT_DBG(multPeriodicDof2.size() == 0 || + multPeriodicDof2.size() == 4) + ("Should not happen (%d)!\n", multPeriodicDof2.size()); + TEST_EXIT_DBG(multPeriodicDof3.size() == 0)("Should not happen!\n"); + } + if (mesh->getDim() == 3) { + TEST_EXIT_DBG(multPeriodicDof3.size() == 0 || + multPeriodicDof3.size() == 8) + ("Should not happen (%d)!\n", multPeriodicDof3.size()); } - if (mesh->getDim() == 2) - TEST_EXIT_DBG(multiplePeriodicDof[2].size() == 0 || - multiplePeriodicDof[2].size() == 4) - ("Should not happen (%d)!\n", multiplePeriodicDof[2].size()); - if (mesh->getDim() == 3) - TEST_EXIT_DBG(multiplePeriodicDof[3].size() == 0 || - multiplePeriodicDof[3].size() == 8) - ("Should not happen (%d)!\n", multiplePeriodicDof[3].size()); + if (multPeriodicDof2.size() > 0) { + for (unsigned int i = 0; i < multPeriodicDof2.size(); i++) { + DegreeOfFreedom dof0 = multPeriodicDof2[i]; + if (dof0 == -1) + continue; + + DegreeOfFreedom dof1 = -1; + DegreeOfFreedom dof2 = -1; + BoundaryType type0 = *(periodicDofAssoc[dof0].begin()); + BoundaryType type1 = *(++(periodicDofAssoc[dof0].begin())); + + for (PerBoundMap::iterator it = elObjects.periodicVertices.begin(); + it != elObjects.periodicVertices.end(); ++it) { + if (it->first.first == dof0 && it->second == type0) + dof1 = it->first.second; + if (it->first.first == dof0 && it->second == type1) + dof2 = it->first.second; + + if (dof1 != -1 && dof2 != -1) + break; + } + + TEST_EXIT_DBG(dof1 != -1 && dof2 != -1)("Should not happen!\n"); + + DegreeOfFreedom dof3 = -1; + for (PerBoundMap::iterator it = elObjects.periodicVertices.begin(); + it != elObjects.periodicVertices.end(); ++it) { + if (it->first.first == dof1 && it->second == type1) { + dof3 = it->first.second; + TEST_EXIT_DBG(elObjects.periodicVertices[std::make_pair(dof2, dof3)] == type0) + ("Should not happen!\n"); - for (int k = 2; k <= 3; k++) { - int nMultiplePeriodicDofs = multiplePeriodicDof[k].size(); - for (int i = 0; i < nMultiplePeriodicDofs; i++) { - for (int j = i + 1; j < nMultiplePeriodicDofs; j++) { + break; + } + } + + TEST_EXIT_DBG(dof3 != -1)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicVertices.count(std::make_pair(dof0, dof3)) == 0) + ("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicVertices.count(std::make_pair(dof3, dof0)) == 0) + ("Should not happen!\n"); + + elObjects.periodicVertices[std::make_pair(dof0, dof3)] = newPeriodicBoundaryType; + elObjects.periodicVertices[std::make_pair(dof3, dof0)] = newPeriodicBoundaryType; + + for (unsigned int j = i + 1; j < multPeriodicDof2.size(); j++) + if (multPeriodicDof2[j] == dof3) + multPeriodicDof2[j] = -1; + } + } + + if (multPeriodicDof3.size() > 0) { + int nMultPeriodicDofs = multPeriodicDof3.size(); + for (int i = 0; i < nMultPeriodicDofs; i++) { + for (int j = i + 1; j < nMultPeriodicDofs; j++) { std::pair perDofs0 = - std::make_pair(multiplePeriodicDof[k][i], multiplePeriodicDof[k][j]); + std::make_pair(multPeriodicDof3[i], multPeriodicDof3[j]); std::pair perDofs1 = - std::make_pair(multiplePeriodicDof[k][j], multiplePeriodicDof[k][i]); + std::make_pair(multPeriodicDof3[j], multPeriodicDof3[i]); - if (periodicVertices.count(perDofs0) == 0) { - TEST_EXIT_DBG(periodicVertices.count(perDofs1) == 0) + if (elObjects.periodicVertices.count(perDofs0) == 0) { + TEST_EXIT_DBG(elObjects.periodicVertices.count(perDofs1) == 0) ("Should not happen!\n"); - periodicVertices[perDofs0] = newPeriodicBoundaryType; - periodicVertices[perDofs1] = newPeriodicBoundaryType; + elObjects.periodicVertices[perDofs0] = newPeriodicBoundaryType; + elObjects.periodicVertices[perDofs1] = newPeriodicBoundaryType; newPeriodicBoundaryType--; mesh->getPeriodicAssociations()[newPeriodicBoundaryType] = new VertexVector(feSpace->getAdmin(), ""); @@ -1470,8 +1527,8 @@ namespace AMDiS { std::pair perEdge1 = std::make_pair(perEdge0.second, perEdge0.first); - periodicEdges[perEdge0] = newPeriodicBoundaryType; - periodicEdges[perEdge1] = newPeriodicBoundaryType; + elObjects.periodicEdges[perEdge0] = newPeriodicBoundaryType; + elObjects.periodicEdges[perEdge1] = newPeriodicBoundaryType; newPeriodicBoundaryType--; mesh->getPeriodicAssociations()[newPeriodicBoundaryType] = new VertexVector(feSpace->getAdmin(), ""); @@ -1484,31 +1541,31 @@ namespace AMDiS { // === there must be a mapping B -> A with the same boundary type. === #if (DEBUG != 0) - for (std::map, BoundaryType>::iterator it = periodicVertices.begin(); - it != periodicVertices.end(); ++it) { + for (PerBoundMap::iterator it = elObjects.periodicVertices.begin(); + it != elObjects.periodicVertices.end(); ++it) { std::pair testVertex = std::make_pair(it->first.second, it->first.first); - TEST_EXIT_DBG(periodicVertices.count(testVertex) == 1)("Should not happen!\n"); - TEST_EXIT_DBG(periodicVertices[testVertex] == it->second)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicVertices.count(testVertex) == 1)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicVertices[testVertex] == it->second)("Should not happen!\n"); } - for (std::map, BoundaryType>::iterator it = periodicEdges.begin(); - it != periodicEdges.end(); ++it) { + for (PerBoundMap::iterator it = elObjects.periodicEdges.begin(); + it != elObjects.periodicEdges.end(); ++it) { std::pair testEdge = std::make_pair(it->first.second, it->first.first); - TEST_EXIT_DBG(periodicEdges.count(testEdge) == 1)("Should not happen!\n"); - TEST_EXIT_DBG(periodicEdges[testEdge] == it->second)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicEdges.count(testEdge) == 1)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicEdges[testEdge] == it->second)("Should not happen!\n"); } - for (std::map, BoundaryType>::iterator it = periodicFaces.begin(); - it != periodicFaces.end(); ++it) { + for (PerBoundMap::iterator it = elObjects.periodicFaces.begin(); + it != elObjects.periodicFaces.end(); ++it) { std::pair testFace = std::make_pair(it->first.second, it->first.first); - TEST_EXIT_DBG(periodicFaces.count(testFace) == 1)("Should not happen!\n"); - TEST_EXIT_DBG(periodicFaces[testFace] == it->second)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicFaces.count(testFace) == 1)("Should not happen!\n"); + TEST_EXIT_DBG(elObjects.periodicFaces[testFace] == it->second)("Should not happen!\n"); } #endif @@ -1613,8 +1670,8 @@ namespace AMDiS { // === Create periodic boundary data structure. === - for (std::map, BoundaryType>::iterator it = periodicVertices.begin(); - it != periodicVertices.end(); ++it) { + for (PerBoundMap::iterator it = elObjects.periodicVertices.begin(); + it != elObjects.periodicVertices.end(); ++it) { if (elObjects.isInRank(it->first.first, mpiRank) == false) continue; @@ -1622,10 +1679,10 @@ namespace AMDiS { mesh->getDofIndexCoords(it->first.first, feSpace, c0); mesh->getDofIndexCoords(it->first.second, feSpace, c1); - MSG("CREATE BOUNDARY FOR DOF MAP: %d (%.3f %.3f %.3f)<-> %d (%.3f %.3f %.3f)\n", it->first.first, - c0[0], c0[1], c0[2], it->first.second, c1[0], c1[1], c1[2]); +// MSG("CREATE BOUNDARY FOR DOF MAP: %d (%.3f %.3f %.3f)<-> %d (%.3f %.3f %.3f)\n", it->first.first, +// c0[0], c0[1], c0[2], it->first.second, c1[0], c1[1], c1[2]); ElementObjectData& perDofEl0 = elObjects.getElementsInRank(it->first.first)[mpiRank]; - MSG("DATA: %d %d %d\n", perDofEl0.elIndex, VERTEX, perDofEl0.ithObject); +// MSG("DATA: %d %d %d\n", perDofEl0.elIndex, VERTEX, perDofEl0.ithObject); for (std::map::iterator elIt = elObjects.getElementsInRank(it->first.second).begin(); elIt != elObjects.getElementsInRank(it->first.second).end(); ++elIt) { @@ -1654,8 +1711,8 @@ namespace AMDiS { } - for (std::map, BoundaryType>::iterator it = periodicEdges.begin(); - it != periodicEdges.end(); ++it) { + for (PerBoundMap::iterator it = elObjects.periodicEdges.begin(); + it != elObjects.periodicEdges.end(); ++it) { if (elObjects.isInRank(it->first.first, mpiRank) == false) continue; @@ -1693,8 +1750,8 @@ namespace AMDiS { } - for (std::map, BoundaryType>::iterator it = periodicFaces.begin(); - it != periodicFaces.end(); ++it) { + for (PerBoundMap::iterator it = elObjects.periodicFaces.begin(); + it != elObjects.periodicFaces.end(); ++it) { if (elObjects.isInRank(it->first.first, mpiRank) == false) continue; @@ -2191,8 +2248,7 @@ namespace AMDiS { WorldVector c; mesh->getDofIndexCoords(it->first, feSpace, c); int nAssoc = it->second.size(); - TEST_EXIT_DBG(nAssoc == 1 || nAssoc == 3 || - (mesh->getDim() == 3 && (nAssoc == 7 || nAssoc == 11))) + TEST_EXIT_DBG(nAssoc == 1 || nAssoc == 3 || (mesh->getDim() == 3 && nAssoc == 7)) ("Should not happen! DOF %d (%e %e %e) has %d periodic associations!\n", it->first, c[0], c[1], (mesh->getDim() == 2 ? 0.0 : c[2]), nAssoc); } @@ -2247,10 +2303,6 @@ namespace AMDiS { elObjects.serialize(out); - SerUtil::serialize(out, periodicVertices); - SerUtil::serialize(out, periodicEdges); - SerUtil::serialize(out, periodicFaces); - myIntBoundary.serialize(out); otherIntBoundary.serialize(out); periodicBoundary.serialize(out); @@ -2311,10 +2363,6 @@ namespace AMDiS { elObjects.deserialize(in); - SerUtil::deserialize(in, periodicVertices); - SerUtil::deserialize(in, periodicEdges); - SerUtil::deserialize(in, periodicFaces); - myIntBoundary.deserialize(in, elIndexMap); otherIntBoundary.deserialize(in, elIndexMap); periodicBoundary.deserialize(in, elIndexMap); diff --git a/AMDiS/src/parallel/MeshDistributor.h b/AMDiS/src/parallel/MeshDistributor.h index 7a05fd1648a5b6c198504162265721e2fb0a04c4..406dad0d4fe884ed6a86100f700a3db4b1fdeaf7 100644 --- a/AMDiS/src/parallel/MeshDistributor.h +++ b/AMDiS/src/parallel/MeshDistributor.h @@ -40,6 +40,8 @@ #include "AMDiS_fwd.h" namespace AMDiS { + + using namespace std; class ParMetisPartitioner; @@ -47,36 +49,36 @@ namespace AMDiS { { protected: /// Defines a mapping type from DOFs to rank numbers. - typedef std::map DofToRank; + typedef map DofToRank; /// Defines a mapping type from DOFs to a set of rank numbers. - typedef std::map > DofToPartitions; + typedef map > DofToPartitions; /// Defines a mapping type from rank numbers to sets of DOFs. - typedef std::map RankToDofContainer; + typedef map RankToDofContainer; /// Defines a mapping type from DOF indices to DOF indices. - typedef std::map DofMapping; + typedef map DofMapping; /// Defines a mapping type from DOFs to boolean values. - typedef std::map DofToBool; + typedef map DofToBool; /// Defines a mapping type from DOF indices to boolean values. - typedef std::map DofIndexToBool; + typedef map DofIndexToBool; /// Forward type (it maps rank numbers to the interior boundary objects). typedef InteriorBoundary::RankToBoundMap RankToBoundMap; - typedef std::map DofIndexMap; + typedef map DofIndexMap; /// Mapps a boundar type, i.e., a boundary identifier index, to a periodic /// dof mapping. - typedef std::map PeriodicDofMap; - - typedef std::vector MeshCodeVec; + typedef map PeriodicDofMap; + + typedef vector MeshCodeVec; public: - MeshDistributor(std::string str); + MeshDistributor(string str); virtual ~MeshDistributor() {} @@ -106,7 +108,7 @@ namespace AMDiS { /// Set for each element on the partitioning level the number of leaf elements. void setInitialElementWeights(); - inline virtual std::string getName() + inline virtual string getName() { return name; } @@ -208,10 +210,10 @@ namespace AMDiS { } // Writes all data of this object to an output stream. - void serialize(std::ostream &out); + void serialize(ostream &out); // Reads the object data from an input stream. - void deserialize(std::istream &in); + void deserialize(istream &in); /** \brief * This function must be used if the values of a DOFVector must be synchronised @@ -288,7 +290,7 @@ namespace AMDiS { * are colored by the partition they are part of. This function can be used for * debugging. */ - void writePartitioningMesh(std::string filename); + void writePartitioningMesh(string filename); /// Sets \ref isRankDof to all matrices and rhs vectors in all stationary problems. void setRankDofs(); @@ -345,38 +347,38 @@ namespace AMDiS { bool reverseMode); /// Writes a vector of dof pointers to an output stream. - void serialize(std::ostream &out, DofContainer &data); + void serialize(ostream &out, DofContainer &data); /// Reads a vector of dof pointers from an input stream. - void deserialize(std::istream &in, DofContainer &data, - std::map &dofMap); + void deserialize(istream &in, DofContainer &data, + map &dofMap); /// Writes a \ref RankToDofContainer to an output stream. - void serialize(std::ostream &out, RankToDofContainer &data); + void serialize(ostream &out, RankToDofContainer &data); /// Reads a \ref RankToDofContainer from an input stream. - void deserialize(std::istream &in, RankToDofContainer &data, - std::map &dofMap); + void deserialize(istream &in, RankToDofContainer &data, + map &dofMap); /// Writes a periodic dof mapping to an output stream. - void serialize(std::ostream &out, PeriodicDofMap &data); + void serialize(ostream &out, PeriodicDofMap &data); - void serialize(std::ostream &out, std::map >& data); + void serialize(ostream &out, map >& data); /// Reads a periodic dof mapping from an input stream. - void deserialize(std::istream &in, PeriodicDofMap &data); + void deserialize(istream &in, PeriodicDofMap &data); - void deserialize(std::istream &in, std::map >& data); + void deserialize(istream &in, map >& data); /// Writes a mapping from dof pointers to some values to an output stream. template - void serialize(std::ostream &out, std::map &data) + void serialize(ostream &out, map &data) { FUNCNAME("ParallelDomainBase::serialize()"); int mapSize = data.size(); SerUtil::serialize(out, mapSize); - for (typename std::map::iterator it = data.begin(); + for (typename map::iterator it = data.begin(); it != data.end(); ++it) { int v1 = (*(it->first)); T v2 = it->second; @@ -387,8 +389,8 @@ namespace AMDiS { /// Reads a mapping from dof pointer to some values from an input stream. template - void deserialize(std::istream &in, std::map &data, - std::map &dofMap) + void deserialize(istream &in, map &data, + map &dofMap) { FUNCNAME("ParallelDomainBase::deserialize()"); @@ -407,11 +409,11 @@ namespace AMDiS { } public: - std::vector* > testVec; + vector* > testVec; protected: /// - std::vector probStat; + vector probStat; /// The rank of the current process. int mpiRank; @@ -427,7 +429,7 @@ namespace AMDiS { MPI::Intracomm mpiComm; /// Name of the problem (as used in the init files) - std::string name; + string name; /// Finite element space of the problem. FiniteElemSpace *feSpace; @@ -449,19 +451,19 @@ namespace AMDiS { ParMetisPartitioner *partitioner; /// Weights for the elements, i.e., the number of leaf elements within this element. - std::map elemWeights; + map elemWeights; /** \brief * Stores to every macro element index the number of the rank that owns this * macro element. */ - std::map partitionVec; + map partitionVec; /** \brief * Stores an old partitioning of elements. To every macro element index the * number of the rank it corresponds to is stored. */ - std::map oldPartitionVec; + map oldPartitionVec; /// Number of DOFs in the rank mesh. int nRankDofs; @@ -473,15 +475,10 @@ namespace AMDiS { ElementObjects elObjects; // Maps to each macro element index a pointer to the corresponding element. - std::map macroElIndexMap; + map macroElIndexMap; // Maps to each macro element index the type of this element. - std::map macroElIndexTypeMap; - - // The following three data structures store periodic DOFs, edges and faces. - std::map, BoundaryType> periodicVertices; - std::map, BoundaryType> periodicEdges; - std::map, BoundaryType> periodicFaces; + map macroElIndexTypeMap; /** \brief * Defines the interior boundaries of the domain that result from partitioning @@ -545,7 +542,7 @@ namespace AMDiS { * DOFs are only on one periodic boundary. Only, e.g., in a box with all boundaries * being periodic, the for corners are associated by two different boundaries. */ - std::map > periodicDofAssociations; + map > periodicDofAssociations; /// Is the index of the first row of the linear system, which is owned by the rank. int rstart; @@ -571,7 +568,7 @@ namespace AMDiS { int repartCounter; /// Directory name where all debug output files should be written to. - std::string debugOutputDir; + string debugOutputDir; /** \brief * Stores the mesh change index. This is used to recognize changes in the mesh @@ -579,11 +576,11 @@ namespace AMDiS { */ long lastMeshChangeIndex; - std::map > macroElementNeighbours; + map > macroElementNeighbours; /// Store all macro elements of the overall mesh, i.e., before the macro mesh is /// redistributed for the first time. - std::vector allMacroElements; + vector allMacroElements; friend class ParallelDebug; };