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

Implemented 2D periodic boundaries for FETI-DP method.

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