Commit 520a6e23 authored by Thomas Witkowski's avatar Thomas Witkowski

Implemented 2D periodic boundaries for FETI-DP method.

parent 709dcdda
......@@ -98,22 +98,41 @@ namespace AMDiS {
DofEdge edge0 = el->getEdge(i);
DofEdge edge1 = neigh->getEdge(elInfo->getOppVertex(i));
BoundaryType boundaryType = elInfo->getBoundary(EDGE, i);
// Add the periodic edge.
periodicEdges[make_pair(edge0, edge1)] = boundaryType;
periodicEdgeAssoc[edge0].insert(edge1);
// Add both vertices of the edge to be periodic.
periodicVertices[make_pair(edge0.first, edge1.first)] = boundaryType;
periodicVertices[make_pair(edge0.second, edge1.second)] = boundaryType;
periodicDofAssoc[edge0.first].insert(boundaryType);
periodicDofAssoc[edge0.second].insert(boundaryType);
TEST_EXIT_DBG(edge0.first ==
mesh->getPeriodicAssociations(boundaryType)[edge1.first] &&
edge0.second ==
mesh->getPeriodicAssociations(boundaryType)[edge1.second])
("Should not happen!\n");
if (removePeriodicBoundary) {
ElementObjectData elObjEdge(el->getIndex(), i);
edgeElements[edge1].push_back(elObjEdge);
edgeLocalMap[elObjEdge] = edge1;
#if 0
ElementObjectData elObjVertex0(el->getIndex(),
el->getVertexOfEdge(i, 0));
vertexElements[edge1.first].push_back(elObjVertex0);
vertexLocalMap[elObjVertex0] = edge1.first;
ElementObjectData elObjVertex1(el->getIndex(),
el->getVertexOfEdge(i, 1));
vertexElements[edge1.second].push_back(elObjVertex1);
vertexLocalMap[elObjVertex1] = edge1.first;
#endif
} else {
// Add the periodic edge.
periodicEdges[make_pair(edge0, edge1)] = boundaryType;
periodicEdgeAssoc[edge0].insert(edge1);
// Add both vertices of the edge to be periodic.
periodicVertices[make_pair(edge0.first, edge1.first)] = boundaryType;
periodicVertices[make_pair(edge0.second, edge1.second)] = boundaryType;
periodicDofAssoc[edge0.first].insert(boundaryType);
periodicDofAssoc[edge0.second].insert(boundaryType);
TEST_EXIT_DBG(edge0.first ==
mesh->getPeriodicAssociations(boundaryType)[edge1.first] &&
edge0.second ==
mesh->getPeriodicAssociations(boundaryType)[edge1.second])
("Should not happen!\n");
}
}
}
break;
......@@ -128,6 +147,9 @@ namespace AMDiS {
DofFace face0 = el->getFace(i);
DofFace face1 = neigh->getFace(elInfo->getOppVertex(i));
BoundaryType boundaryType = elInfo->getBoundary(FACE, i);
TEST_EXIT(removePeriodicBoundary == false)
("Not yet implemented for 3D!\n");
// Add the periodic face.
periodicFaces[make_pair(face0, face1)] = elInfo->getBoundary(i);
......
......@@ -107,8 +107,11 @@ namespace AMDiS {
mesh(NULL),
iterGeoPos(CENTER),
macroElementRankMap(NULL),
levelData(NULL)
{}
levelData(NULL),
removePeriodicBoundary(false)
{
Parameters::get("parallel->remove periodic boundary", removePeriodicBoundary);
}
void setFeSpace(const FiniteElemSpace *fe)
{
......@@ -575,6 +578,12 @@ namespace AMDiS {
map<int, int> macroElIndexTypeMap;
MeshLevelData* levelData;
/// If this variable is set to true, the mesh distributor removes all
/// periodic boundary conditions. The element neighbourhood relation is
/// not changed. Thus, when using some domain decomposition method, this is
/// a natural way to deal with periodic boundary conditions.
bool removePeriodicBoundary;
};
}
......
......@@ -185,13 +185,13 @@ namespace AMDiS {
}
// Test, if the mesh is the macro mesh only! Paritioning of the mesh is supported
// only for macro meshes, so it will not work yet if the mesh is already refined
// in some way.
// Test, if the mesh is the macro mesh only! Paritioning of the mesh is
// supported only for macro meshes, so it will not work yet if the mesh is
// already refined in some way.
testForMacroMesh();
// For later mesh repartitioning, we need to store some information about the
// macro mesh.
// For later mesh repartitioning, we need to store some information about
// the macro mesh.
createMacroElementInfo();
// create an initial partitioning of the mesh
......@@ -741,7 +741,7 @@ namespace AMDiS {
// Remove periodic boundaries on elements in mesh.
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER);
ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER);
while (elInfo) {
elInfo->getElement()->deleteElementData(PERIODIC);
elInfo = stack.traverseNext(elInfo);
......
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