Skip to content
Snippets Groups Projects
Commit a4909c94 authored by mattijs's avatar mattijs
Browse files

BUG: extrude2DMesh: upper-triangular reordering

parent b6fbff52
Branches
Tags
No related merge requests found
...@@ -97,34 +97,35 @@ void Foam::patchToPoly2DMesh::createNeighbours() ...@@ -97,34 +97,35 @@ void Foam::patchToPoly2DMesh::createNeighbours()
Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder() Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
{ {
const labelListList& cellFaces = patch_.faceEdges(); const labelListList& faceEdges = patch_.faceEdges();
labelList oldToNew(owner_.size(), -1); labelList oldToNew(owner_.size(), -1);
label newFaceI = 0; label newFaceI = 0;
forAll(cellFaces, cellI) forAll(faceEdges, faceI)
{ {
const labelList& cFaces = cellFaces[cellI]; const labelList& fEdges = faceEdges[faceI];
// Neighbouring cells // Neighbouring faces
SortableList<label> nbr(cFaces.size(), -1); SortableList<label> nbr(fEdges.size(), -1);
forAll(cFaces, cfI) forAll(fEdges, feI)
{ {
if (cFaces[cfI] < neighbour_.size()) if (fEdges[feI] < neighbour_.size())
{ {
label nbrFaceI = neighbour_[cFaces[cfI]]; // Internal edge. Get the face on other side.
// Internal face. Get cell on other side. label nbrFaceI = neighbour_[fEdges[feI]];
if (nbrFaceI == cellI)
if (nbrFaceI == faceI)
{ {
nbrFaceI = owner_[cellI]; nbrFaceI = owner_[fEdges[feI]];
} }
if (cellI < nbrFaceI) if (faceI < nbrFaceI)
{ {
// CellI is master // faceI is master
nbr[cfI] = nbrFaceI; nbr[feI] = nbrFaceI;
} }
} }
} }
...@@ -135,7 +136,7 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder() ...@@ -135,7 +136,7 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
{ {
if (nbr[i] != -1) if (nbr[i] != -1)
{ {
oldToNew[cFaces[nbr.indices()[i]]] = newFaceI++; oldToNew[fEdges[nbr.indices()[i]]] = newFaceI++;
} }
} }
} }
......
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