Commit fe752c0c authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

And old single level code works now.

parent 2c1211fd
......@@ -399,11 +399,7 @@ namespace AMDiS {
if (it2->elIndex > vertexInRank[it->first][elementInRank].elIndex)
vertexInRank[it->first][elementInRank] = *it2;
for (int level = 0; level < nLevel; level++) {
int levelId = levelData.getLevelId(level, elementInRank);
vertexOwner[it->first][level] =
std::max(vertexOwner[it->first][level], levelId);
}
vertexOwner[it->first] = std::max(vertexOwner[it->first], elementInRank);
ranksInLevel[0].insert(elementInRank);
for (int level = 1; level < nLevel; level++)
......@@ -434,11 +430,7 @@ namespace AMDiS {
if (it2->elIndex > edgeInRank[it->first][elementInRank].elIndex)
edgeInRank[it->first][elementInRank] = *it2;
for (int level = 0; level < nLevel; level++) {
int levelId = levelData.getLevelId(level, elementInRank);
edgeOwner[it->first][level] =
std::max(edgeOwner[it->first][level], levelId);
}
edgeOwner[it->first] = std::max(edgeOwner[it->first], elementInRank);
ranksInLevel[0].insert(elementInRank);
for (int level = 1; level < nLevel; level++)
......@@ -469,11 +461,7 @@ namespace AMDiS {
if (it2->elIndex > faceInRank[it->first][elementInRank].elIndex)
faceInRank[it->first][elementInRank] = *it2;
for (int level = 0; level < nLevel; level++) {
int levelId = levelData.getLevelId(level, elementInRank);
faceOwner[it->first][level] =
std::max(faceOwner[it->first][level], levelId);
}
faceOwner[it->first] = std::max(faceOwner[it->first], elementInRank);
ranksInLevel[0].insert(elementInRank);
for (int level = 1; level < nLevel; level++)
......
......@@ -259,17 +259,17 @@ namespace AMDiS {
/// Returns the rank owner of the current iterator position.
int getIterateOwner(int level)
int getIterateOwner()
{
switch (iterGeoPos) {
case VERTEX:
return vertexOwner[vertexIter->first][level];
return vertexOwner[vertexIter->first];
break;
case EDGE:
return edgeOwner[edgeIter->first][level];
return edgeOwner[edgeIter->first];
break;
case FACE:
return faceOwner[faceIter->first][level];
return faceOwner[faceIter->first];
break;
default:
ERROR_EXIT("Should not happen!\n");
......@@ -301,21 +301,21 @@ namespace AMDiS {
}
/// Returns the rank owner of a vertex DOF.
int getOwner(DegreeOfFreedom vertex, int level)
int getOwner(DegreeOfFreedom vertex)
{
return vertexOwner[vertex][level];
return vertexOwner[vertex];
}
/// Returns the rank owner of an edge.
int getOwner(DofEdge edge, int level)
int getOwner(DofEdge edge)
{
return edgeOwner[edge][level];
return edgeOwner[edge];
}
/// Returns the rank owner of an face.
int getOwner(DofFace face, int level)
{
return faceOwner[face][level];
return faceOwner[face];
}
......@@ -562,17 +562,14 @@ namespace AMDiS {
/// Maps to an element object the corresponding face.
map<ElementObjectData, DofFace> faceLocalMap;
/// Maps from level to rank number
typedef map<int, int> LevelRank;
/// Defines for all vertex DOFs the rank that ownes this vertex DOF.
map<DegreeOfFreedom, LevelRank> vertexOwner;
map<DegreeOfFreedom, int> vertexOwner;
/// Defines for all edges the rank that ownes this edge.
map<DofEdge, LevelRank> edgeOwner;
map<DofEdge, int> edgeOwner;
/// Defines for all faces the rank that ownes this face.
map<DofFace, LevelRank> faceOwner;
map<DofFace, int> faceOwner;
map<DegreeOfFreedom, int> vertexMaxLevel;
......
......@@ -847,6 +847,8 @@ namespace AMDiS {
levelData.init(neighbours);
MSG("INIT MESH LEVEL %d\n", levelData.getLevelNumber());
bool multiLevelTest = false;
Parameters::get("parallel->multi level test", multiLevelTest);
if (multiLevelTest) {
......@@ -1590,7 +1592,7 @@ namespace AMDiS {
if (!(objData.count(mpiRank) && objData.size() > 1))
continue;
int owner = elObjDb.getIterateOwner(0);
int owner = elObjDb.getIterateOwner();
ElementObjectData& rankBoundEl = objData[mpiRank];
AtomicBoundary bound;
......
......@@ -19,6 +19,13 @@ namespace AMDiS {
using namespace std;
MeshLevelData::MeshLevelData()
{
std::set<int> neighbours;
init(neighbours);
}
void MeshLevelData::init(std::set<int> &neighbourRanks)
{
levelRanks.resize(1);
......
......@@ -37,9 +37,7 @@ namespace AMDiS {
class MeshLevelData
{
public:
MeshLevelData()
: nLevel(0)
{}
MeshLevelData();
void init(std::set<int> &neighbourRanks);
......
......@@ -266,7 +266,11 @@ namespace AMDiS {
{
FUNCNAME("SubDomainSolver::solveGlobal()");
ERROR_EXIT("BLUB!\n");
int ml = 0;
Parameters::get("parallel->multi level test", ml);
if (ml > 0)
ERROR_EXIT("BLUB!\n");
Vec tmp;
VecCreateSeq(PETSC_COMM_SELF, interiorMap->getRankDofs(level), &tmp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment