primitiveMeshEdges: Added support for edges with duplicate vertices

Patch contributed by Mattijs Janssens
Resolves bug-report http://bugs.openfoam.org/view.php?id=2301
This commit is contained in:
Henry Weller
2016-10-21 12:08:18 +01:00
parent bfaa9da93c
commit eed875e1fa

View File

@ -56,7 +56,14 @@ Foam::label Foam::primitiveMesh::getEdge
// Make new edge.
label edgeI = es.size();
pe[pointi].append(edgeI);
pe[nextPointi].append(edgeI);
if (nextPointi != pointi)
{
// Very occasionally (e.g. blockMesh) a face can have duplicate
// vertices. Make sure we register pointEdges only once.
pe[nextPointi].append(edgeI);
}
if (pointi < nextPointi)
{
es.append(edge(pointi, nextPointi));