Commit 7bc84046 authored by Thomas Witkowski's avatar Thomas Witkowski

Rename some object in parallel sources.

parent a1f6ce9c
...@@ -224,7 +224,7 @@ if(ENABLE_PARALLEL_DOMAIN) ...@@ -224,7 +224,7 @@ if(ENABLE_PARALLEL_DOMAIN)
SET(PARALLEL_DOMAIN_AMDIS_SRC SET(PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/DofComm.cc ${SOURCE_DIR}/parallel/DofComm.cc
${SOURCE_DIR}/parallel/CheckerPartitioner.cc ${SOURCE_DIR}/parallel/CheckerPartitioner.cc
${SOURCE_DIR}/parallel/ElementObjectData.cc ${SOURCE_DIR}/parallel/ElementObjectDatabase.cc
${SOURCE_DIR}/parallel/MeshDistributor.cc ${SOURCE_DIR}/parallel/MeshDistributor.cc
${SOURCE_DIR}/parallel/MeshManipulation.cc ${SOURCE_DIR}/parallel/MeshManipulation.cc
${SOURCE_DIR}/parallel/MeshPartitioner.cc ${SOURCE_DIR}/parallel/MeshPartitioner.cc
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
// See also license.opensource.txt in the distribution. // See also license.opensource.txt in the distribution.
#include "ElementObjectData.h"
#include "VertexVector.h" #include "VertexVector.h"
#include "parallel/ElementObjectDatabase.h"
namespace AMDiS { namespace AMDiS {
void ElementObjects::addElement(ElInfo *elInfo) void ElementObjectDatabase::addElement(ElInfo *elInfo)
{ {
FUNCNAME("ElementObjects::addElement()"); FUNCNAME("ElementObjectDatabase::addElement()");
TEST_EXIT_DBG(mesh)("Mesh not set!\n"); TEST_EXIT_DBG(mesh)("Mesh not set!\n");
...@@ -128,9 +128,9 @@ namespace AMDiS { ...@@ -128,9 +128,9 @@ namespace AMDiS {
} }
void ElementObjects::createPeriodicData(const FiniteElemSpace *feSpace) void ElementObjectDatabase::createPeriodicData(const FiniteElemSpace *feSpace)
{ {
FUNCNAME("ElementObjects::createPeriodicData()"); FUNCNAME("ElementObjectDatabase::createPeriodicData()");
TEST_EXIT_DBG(mesh)("Mesh not set!\n"); TEST_EXIT_DBG(mesh)("Mesh not set!\n");
...@@ -317,9 +317,9 @@ namespace AMDiS { ...@@ -317,9 +317,9 @@ namespace AMDiS {
} }
BoundaryType ElementObjects::getNewBoundaryType(DOFAdmin *admin) BoundaryType ElementObjectDatabase::getNewBoundaryType(DOFAdmin *admin)
{ {
FUNCNAME("ElementObjects::getNewBoundaryType()"); FUNCNAME("ElementObjectDatabase::getNewBoundaryType()");
BoundaryType newPeriodicBoundaryType = 0; BoundaryType newPeriodicBoundaryType = 0;
for (map<BoundaryType, VertexVector*>::iterator it = mesh->getPeriodicAssociations().begin(); for (map<BoundaryType, VertexVector*>::iterator it = mesh->getPeriodicAssociations().begin();
...@@ -336,11 +336,12 @@ namespace AMDiS { ...@@ -336,11 +336,12 @@ namespace AMDiS {
} }
BoundaryType ElementObjects::provideConnectedPeriodicBoundary(DOFAdmin *admin, BoundaryType
BoundaryType b0, ElementObjectDatabase::provideConnectedPeriodicBoundary(DOFAdmin *admin,
BoundaryType b1) BoundaryType b0,
BoundaryType b1)
{ {
FUNCNAME("ElementObjects::provideConnectedPeriodicBoundary()"); FUNCNAME("ElementObjectDatabase::provideConnectedPeriodicBoundary()");
std::pair<BoundaryType, BoundaryType> bConn = std::pair<BoundaryType, BoundaryType> bConn =
(b0 <= b1 ? make_pair(b0, b1) : make_pair(b1, b0)); (b0 <= b1 ? make_pair(b0, b1) : make_pair(b1, b0));
...@@ -371,9 +372,9 @@ namespace AMDiS { ...@@ -371,9 +372,9 @@ namespace AMDiS {
} }
void ElementObjects::createRankData(map<int, int>& macroElementRankMap) void ElementObjectDatabase::createRankData(map<int, int>& macroElementRankMap)
{ {
FUNCNAME("ElementObjects::createRankData()"); FUNCNAME("ElementObjectDatabase::createRankData()");
vertexOwner.clear(); vertexOwner.clear();
vertexInRank.clear(); vertexInRank.clear();
...@@ -424,11 +425,11 @@ namespace AMDiS { ...@@ -424,11 +425,11 @@ namespace AMDiS {
} }
void ElementObjects::createReverseModeData(const FiniteElemSpace* feSpace, void ElementObjectDatabase::createReverseModeData(const FiniteElemSpace* feSpace,
map<int, Element*> &elIndexMap, map<int, Element*> &elIndexMap,
map<int, int> &elIndexTypeMap) map<int, int> &elIndexTypeMap)
{ {
FUNCNAME("ElementObjects::createReverseModeData()"); FUNCNAME("ElementObjectDatabase::createReverseModeData()");
// === In 2D, all reverse modes are always true! === // === In 2D, all reverse modes are always true! ===
...@@ -537,9 +538,9 @@ namespace AMDiS { ...@@ -537,9 +538,9 @@ namespace AMDiS {
} }
void ElementObjects::serialize(ostream &out) void ElementObjectDatabase::serialize(ostream &out)
{ {
FUNCNAME("ElementObjects::serialize()"); FUNCNAME("ElementObjectDatabase::serialize()");
int nSize = vertexElements.size(); int nSize = vertexElements.size();
SerUtil::serialize(out, nSize); SerUtil::serialize(out, nSize);
...@@ -664,9 +665,9 @@ namespace AMDiS { ...@@ -664,9 +665,9 @@ namespace AMDiS {
} }
void ElementObjects::deserialize(istream &in) void ElementObjectDatabase::deserialize(istream &in)
{ {
FUNCNAME("ElementObjects::deserialize()"); FUNCNAME("ElementObjectDatabase::deserialize()");
int nSize; int nSize;
SerUtil::deserialize(in, nSize); SerUtil::deserialize(in, nSize);
...@@ -821,7 +822,8 @@ namespace AMDiS { ...@@ -821,7 +822,8 @@ namespace AMDiS {
} }
void ElementObjects::serialize(ostream &out, vector<ElementObjectData>& elVec) void ElementObjectDatabase::serialize(ostream &out,
vector<ElementObjectData>& elVec)
{ {
int nSize = elVec.size(); int nSize = elVec.size();
SerUtil::serialize(out, nSize); SerUtil::serialize(out, nSize);
...@@ -830,7 +832,8 @@ namespace AMDiS { ...@@ -830,7 +832,8 @@ namespace AMDiS {
} }
void ElementObjects::deserialize(istream &in, vector<ElementObjectData>& elVec) void ElementObjectDatabase::deserialize(istream &in,
vector<ElementObjectData>& elVec)
{ {
int nSize; int nSize;
SerUtil::deserialize(in, nSize); SerUtil::deserialize(in, nSize);
...@@ -840,7 +843,8 @@ namespace AMDiS { ...@@ -840,7 +843,8 @@ namespace AMDiS {
} }
void ElementObjects::serialize(ostream &out, map<int, ElementObjectData>& data) void ElementObjectDatabase::serialize(ostream &out,
map<int, ElementObjectData>& data)
{ {
int nSize = data.size(); int nSize = data.size();
SerUtil::serialize(out, nSize); SerUtil::serialize(out, nSize);
...@@ -852,7 +856,8 @@ namespace AMDiS { ...@@ -852,7 +856,8 @@ namespace AMDiS {
} }
void ElementObjects::deserialize(istream &in, map<int, ElementObjectData>& data) void ElementObjectDatabase::deserialize(istream &in,
map<int, ElementObjectData>& data)
{ {
int nSize; int nSize;
SerUtil::deserialize(in, nSize); SerUtil::deserialize(in, nSize);
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
/** \file ElementObjectData.h */ /** \file ElementObjectDatabase.h */
#ifndef AMDIS_ELEMENTOBJECTDATA_H #ifndef AMDIS_ELEMENT_OBJECT_DATABASE_H
#define AMDIS_ELEMENTOBJECTDATA_H #define AMDIS_ELEMENT_OBJECT_DATABASE_H
#include <map> #include <map>
#include <vector> #include <vector>
...@@ -99,9 +99,9 @@ namespace AMDiS { ...@@ -99,9 +99,9 @@ namespace AMDiS {
* boundaries on object level. This is required, because two elements may share * boundaries on object level. This is required, because two elements may share
* a common vertex without beging neighbours in the definition of AMDiS. * a common vertex without beging neighbours in the definition of AMDiS.
*/ */
class ElementObjects { class ElementObjectDatabase {
public: public:
ElementObjects() ElementObjectDatabase()
: mesh(NULL), : mesh(NULL),
iterGeoPos(CENTER) iterGeoPos(CENTER)
{} {}
......
...@@ -156,7 +156,7 @@ namespace AMDiS { ...@@ -156,7 +156,7 @@ namespace AMDiS {
} }
} while (doNext); } while (doNext);
elObjects.setMesh(feSpaces[0]->getMesh()); elObjDb.setMesh(feSpaces[0]->getMesh());
// If the problem has been already read from a file, we need only to set // If the problem has been already read from a file, we need only to set
// isRankDofs to all matrices and rhs vector and to remove periodic // isRankDofs to all matrices and rhs vector and to remove periodic
...@@ -559,7 +559,7 @@ namespace AMDiS { ...@@ -559,7 +559,7 @@ namespace AMDiS {
while (elInfo) { while (elInfo) {
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
ElementObjectData elData(elInfo->getElement()->getIndex(), i); ElementObjectData elData(elInfo->getElement()->getIndex(), i);
allEdges.insert(elObjects.getEdgeLocalMap(elData)); allEdges.insert(elObjDb.getEdgeLocalMap(elData));
} }
rankMacroEls.insert(elInfo->getElement()->getIndex()); rankMacroEls.insert(elInfo->getElement()->getIndex());
...@@ -572,7 +572,7 @@ namespace AMDiS { ...@@ -572,7 +572,7 @@ namespace AMDiS {
bool valid3dMesh = true; bool valid3dMesh = true;
for (std::set<DofEdge>::iterator it = allEdges.begin(); it != allEdges.end(); ++it) { for (std::set<DofEdge>::iterator it = allEdges.begin(); it != allEdges.end(); ++it) {
vector<ElementObjectData>& edgeEls = elObjects.getElements(*it); vector<ElementObjectData>& edgeEls = elObjDb.getElements(*it);
TEST_EXIT_DBG(edgeEls.size() > 0) TEST_EXIT_DBG(edgeEls.size() > 0)
("No edge %d/%d in elObjDB!\n", it->first, it->second); ("No edge %d/%d in elObjDB!\n", it->first, it->second);
...@@ -1326,7 +1326,7 @@ namespace AMDiS { ...@@ -1326,7 +1326,7 @@ namespace AMDiS {
// === Remove double DOFs. === // === Remove double DOFs. ===
MeshManipulation meshManipulation(mesh); MeshManipulation meshManipulation(mesh);
meshManipulation.deleteDoubleDofs(feSpaces, newMacroEl, elObjects); meshManipulation.deleteDoubleDofs(feSpaces, newMacroEl, elObjDb);
mesh->dofCompress(); mesh->dofCompress();
partitioner->createPartitionMap(partitionMap); partitioner->createPartitionMap(partitionMap);
...@@ -1415,7 +1415,7 @@ namespace AMDiS { ...@@ -1415,7 +1415,7 @@ namespace AMDiS {
{ {
FUNCNAME("MeshDistributor::updateInteriorBoundaryInfo()"); FUNCNAME("MeshDistributor::updateInteriorBoundaryInfo()");
elObjects.createRankData(partitionMap); elObjDb.createRankData(partitionMap);
createBoundaryData(); createBoundaryData();
#if (DEBUG != 0) #if (DEBUG != 0)
...@@ -1443,22 +1443,22 @@ namespace AMDiS { ...@@ -1443,22 +1443,22 @@ namespace AMDiS {
macroElIndexMap.insert(make_pair(el->getIndex(), el)); macroElIndexMap.insert(make_pair(el->getIndex(), el));
macroElIndexTypeMap.insert(make_pair(el->getIndex(), elInfo->getType())); macroElIndexTypeMap.insert(make_pair(el->getIndex(), elInfo->getType()));
// Add all sub object of the element to the variable elObjects. // Add all sub object of the element to the variable elObjDb.
elObjects.addElement(elInfo); elObjDb.addElement(elInfo);
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} }
// Create periodic data, if there are periodic boundary conditions. // Create periodic data, if there are periodic boundary conditions.
elObjects.createPeriodicData(feSpaces[0]); elObjDb.createPeriodicData(feSpaces[0]);
// Create data about the reverse modes of neighbouring elements. // Create data about the reverse modes of neighbouring elements.
elObjects.createReverseModeData(feSpaces[0], macroElIndexMap, elObjDb.createReverseModeData(feSpaces[0], macroElIndexMap,
macroElIndexTypeMap); macroElIndexTypeMap);
// Create mesh element data for this rank. // Create mesh element data for this rank.
elObjects.createRankData(partitionMap); elObjDb.createRankData(partitionMap);
} }
...@@ -1478,12 +1478,12 @@ namespace AMDiS { ...@@ -1478,12 +1478,12 @@ namespace AMDiS {
for (int geoPos = 0; geoPos < mesh->getDim(); geoPos++) { for (int geoPos = 0; geoPos < mesh->getDim(); geoPos++) {
GeoIndex geoIndex = INDEX_OF_DIM(geoPos, mesh->getDim()); GeoIndex geoIndex = INDEX_OF_DIM(geoPos, mesh->getDim());
while (elObjects.iterate(geoIndex)) { while (elObjDb.iterate(geoIndex)) {
map<int, ElementObjectData>& objData = elObjects.getIterateData(); map<int, ElementObjectData>& objData = elObjDb.getIterateData();
if (!(objData.count(mpiRank) && objData.size() > 1)) if (!(objData.count(mpiRank) && objData.size() > 1))
continue; continue;
int owner = elObjects.getIterateOwner(); int owner = elObjDb.getIterateOwner();
ElementObjectData& rankBoundEl = objData[mpiRank]; ElementObjectData& rankBoundEl = objData[mpiRank];
AtomicBoundary bound; AtomicBoundary bound;
...@@ -1521,10 +1521,10 @@ namespace AMDiS { ...@@ -1521,10 +1521,10 @@ namespace AMDiS {
b = bound; b = bound;
if (geoIndex == EDGE) if (geoIndex == EDGE)
b.neighObj.reverseMode = b.neighObj.reverseMode =
elObjects.getEdgeReverseMode(rankBoundEl, it2->second); elObjDb.getEdgeReverseMode(rankBoundEl, it2->second);
if (geoIndex == FACE) if (geoIndex == FACE)
b.neighObj.reverseMode = b.neighObj.reverseMode =
elObjects.getFaceReverseMode(rankBoundEl, it2->second); elObjDb.getFaceReverseMode(rankBoundEl, it2->second);
} }
} else { } else {
...@@ -1545,10 +1545,10 @@ namespace AMDiS { ...@@ -1545,10 +1545,10 @@ namespace AMDiS {
b = bound; b = bound;
if (geoIndex == EDGE) if (geoIndex == EDGE)
b.rankObj.reverseMode = b.rankObj.reverseMode =
elObjects.getEdgeReverseMode(rankBoundEl, ownerBoundEl); elObjDb.getEdgeReverseMode(rankBoundEl, ownerBoundEl);
if (geoIndex == FACE) if (geoIndex == FACE)
b.rankObj.reverseMode = b.rankObj.reverseMode =
elObjects.getFaceReverseMode(rankBoundEl, ownerBoundEl); elObjDb.getFaceReverseMode(rankBoundEl, ownerBoundEl);
} }
} }
} }
...@@ -1556,16 +1556,16 @@ namespace AMDiS { ...@@ -1556,16 +1556,16 @@ namespace AMDiS {
// === Create periodic boundary data structure. === // === Create periodic boundary data structure. ===
for (PerBoundMap<DegreeOfFreedom>::iterator it = elObjects.getPeriodicVertices().begin(); for (PerBoundMap<DegreeOfFreedom>::iterator it = elObjDb.getPeriodicVertices().begin();
it != elObjects.getPeriodicVertices().end(); ++it) { it != elObjDb.getPeriodicVertices().end(); ++it) {
if (elObjects.isInRank(it->first.first, mpiRank) == false) if (elObjDb.isInRank(it->first.first, mpiRank) == false)
continue; continue;
ElementObjectData& perDofEl0 = ElementObjectData& perDofEl0 =
elObjects.getElementsInRank(it->first.first)[mpiRank]; elObjDb.getElementsInRank(it->first.first)[mpiRank];
for (map<int, ElementObjectData>::iterator elIt = elObjects.getElementsInRank(it->first.second).begin(); for (map<int, ElementObjectData>::iterator elIt = elObjDb.getElementsInRank(it->first.second).begin();
elIt != elObjects.getElementsInRank(it->first.second).end(); ++elIt) { elIt != elObjDb.getElementsInRank(it->first.second).end(); ++elIt) {
int otherElementRank = elIt->first; int otherElementRank = elIt->first;
ElementObjectData& perDofEl1 = elIt->second; ElementObjectData& perDofEl1 = elIt->second;
...@@ -1601,15 +1601,15 @@ namespace AMDiS { ...@@ -1601,15 +1601,15 @@ namespace AMDiS {
} }
for (PerBoundMap<DofEdge>::iterator it = elObjects.getPeriodicEdges().begin(); for (PerBoundMap<DofEdge>::iterator it = elObjDb.getPeriodicEdges().begin();
it != elObjects.getPeriodicEdges().end(); ++it) { it != elObjDb.getPeriodicEdges().end(); ++it) {
if (elObjects.isInRank(it->first.first, mpiRank) == false) if (elObjDb.isInRank(it->first.first, mpiRank) == false)
continue; continue;
ElementObjectData& perEdgeEl0 = elObjects.getElementsInRank(it->first.first)[mpiRank]; ElementObjectData& perEdgeEl0 = elObjDb.getElementsInRank(it->first.first)[mpiRank];
for (map<int, ElementObjectData>::iterator elIt = elObjects.getElementsInRank(it->first.second).begin(); for (map<int, ElementObjectData>::iterator elIt = elObjDb.getElementsInRank(it->first.second).begin();
elIt != elObjects.getElementsInRank(it->first.second).end(); ++elIt) { elIt != elObjDb.getElementsInRank(it->first.second).end(); ++elIt) {
int otherElementRank = elIt->first; int otherElementRank = elIt->first;
ElementObjectData& perEdgeEl1 = elIt->second; ElementObjectData& perEdgeEl1 = elIt->second;
...@@ -1633,27 +1633,29 @@ namespace AMDiS { ...@@ -1633,27 +1633,29 @@ namespace AMDiS {
b = bound; b = bound;
if (mpiRank > otherElementRank) if (mpiRank > otherElementRank)
b.neighObj.reverseMode = elObjects.getEdgeReverseMode(perEdgeEl0, perEdgeEl1); b.neighObj.reverseMode =
elObjDb.getEdgeReverseMode(perEdgeEl0, perEdgeEl1);
else else
b.rankObj.reverseMode = elObjects.getEdgeReverseMode(perEdgeEl0, perEdgeEl1); b.rankObj.reverseMode =
elObjDb.getEdgeReverseMode(perEdgeEl0, perEdgeEl1);
} }
} }
for (PerBoundMap<DofFace>::iterator it = elObjects.getPeriodicFaces().begin(); for (PerBoundMap<DofFace>::iterator it = elObjDb.getPeriodicFaces().begin();
it != elObjects.getPeriodicFaces().end(); ++it) { it != elObjDb.getPeriodicFaces().end(); ++it) {
if (elObjects.isInRank(it->first.first, mpiRank) == false) if (elObjDb.isInRank(it->first.first, mpiRank) == false)
continue; continue;
TEST_EXIT_DBG(elObjects.getElements(it->first.first).size() == 1) TEST_EXIT_DBG(elObjDb.getElements(it->first.first).size() == 1)
("Should not happen!\n"); ("Should not happen!\n");
TEST_EXIT_DBG(elObjects.getElements(it->first.second).size() == 1) TEST_EXIT_DBG(elObjDb.getElements(it->first.second).size() == 1)
("Should not happen!\n"); ("Should not happen!\n");
ElementObjectData& perFaceEl0 = elObjects.getElementsInRank(it->first.first)[mpiRank]; ElementObjectData& perFaceEl0 = elObjDb.getElementsInRank(it->first.first)[mpiRank];
for (map<int, ElementObjectData>::iterator elIt = elObjects.getElementsInRank(it->first.second).begin(); for (map<int, ElementObjectData>::iterator elIt = elObjDb.getElementsInRank(it->first.second).begin();
elIt != elObjects.getElementsInRank(it->first.second).end(); ++elIt) { elIt != elObjDb.getElementsInRank(it->first.second).end(); ++elIt) {
int otherElementRank = elIt->first; int otherElementRank = elIt->first;
ElementObjectData& perFaceEl1 = elIt->second; ElementObjectData& perFaceEl1 = elIt->second;
...@@ -1678,10 +1680,10 @@ namespace AMDiS { ...@@ -1678,10 +1680,10 @@ namespace AMDiS {
if (mpiRank > otherElementRank) if (mpiRank > otherElementRank)
b.neighObj.reverseMode = b.neighObj.reverseMode =
elObjects.getFaceReverseMode(perFaceEl0, perFaceEl1); elObjDb.getFaceReverseMode(perFaceEl0, perFaceEl1);
else else
b.rankObj.reverseMode = b.rankObj.reverseMode =
elObjects.getFaceReverseMode(perFaceEl0, perFaceEl1); elObjDb.getFaceReverseMode(perFaceEl0, perFaceEl1);
} }
} }
...@@ -2259,7 +2261,7 @@ namespace AMDiS { ...@@ -2259,7 +2261,7 @@ namespace AMDiS {
SerUtil::serialize(out, elemWeights); SerUtil::serialize(out, elemWeights);
SerUtil::serialize(out, partitionMap); SerUtil::serialize(out, partitionMap);
elObjects.serialize(out); elObjDb.serialize(out);
rankIntBoundary.serialize(out); rankIntBoundary.serialize(out);
otherIntBoundary.serialize(out); otherIntBoundary.serialize(out);
...@@ -2329,7 +2331,7 @@ namespace AMDiS { ...@@ -2329,7 +2331,7 @@ namespace AMDiS {
} }
} }
elObjects.deserialize(in); elObjDb.deserialize(in);
rankIntBoundary.deserialize(in, elIndexMap); rankIntBoundary.deserialize(in, elIndexMap);
otherIntBoundary.deserialize(in, elIndexMap); otherIntBoundary.deserialize(in, elIndexMap);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <mpi.h> #include <mpi.h>
#include "parallel/DofComm.h" #include "parallel/DofComm.h"
#include "parallel/ElementObjectData.h" #include "parallel/ElementObjectDatabase.h"
#include "parallel/ParallelTypes.h" #include "parallel/ParallelTypes.h"
#include "parallel/MeshPartitioner.h" #include "parallel/MeshPartitioner.h"
#include "parallel/InteriorBoundary.h" #include "parallel/InteriorBoundary.h"
...@@ -607,11 +607,9 @@ namespace AMDiS { ...@@ -607,11 +607,9 @@ namespace AMDiS {
/// Mesh of the problem. /// Mesh of the problem.
Mesh *mesh; Mesh *mesh;
/** \brief /// A refinement manager that should be used on the mesh. It is used to
* A refinement manager that should be used on the mesh. It is used to /// refine elements at interior boundaries in order to fit together with
* refine elements at interior boundaries in order to fit together with