ENH: rotateFace moved to face from polyTopoChange and used in cvMesh

This commit is contained in:
laurence
2012-02-15 17:51:01 +00:00
parent e061c08434
commit 48bcc6f485
6 changed files with 109 additions and 93 deletions

View File

@ -633,6 +633,27 @@ Foam::face Foam::face::reverseFace() const
}
Foam::face Foam::face::rotateFace(const label nPos) const
{
const labelList& f = *this;
labelList newList(size());
forAll(f, fp)
{
label fp1 = (fp + nPos) % f.size();
if (fp1 < 0)
{
fp1 += f.size();
}
newList[fp1] = f[fp];
}
return face(xferMove(newList));
}
Foam::label Foam::face::which(const label globalIndex) const
{
const labelList& f = *this;

View File

@ -197,6 +197,9 @@ public:
// The starting points of the original and reverse face are identical.
face reverseFace() const;
//- Rotate face by number of positions
face rotateFace(const label nPos) const;
//- Navigation through face vertices
//- Which vertex on face (face index given a global index)

View File

@ -1890,30 +1890,6 @@ void Foam::polyTopoChange::calcFaceZonePointMap
}
Foam::face Foam::polyTopoChange::rotateFace
(
const face& f,
const label nPos
)
{
face newF(f.size());
forAll(f, fp)
{
label fp1 = (fp + nPos) % f.size();
if (fp1 < 0)
{
fp1 += f.size();
}
newF[fp1] = f[fp];
}
return newF;
}
void Foam::polyTopoChange::reorderCoupledFaces
(
const bool syncParallel,
@ -2024,7 +2000,7 @@ void Foam::polyTopoChange::reorderCoupledFaces
{
if (rotation[faceI] != 0)
{
faces_[faceI] = rotateFace(faces_[faceI], rotation[faceI]);
faces_[faceI] = faces_[faceI].rotateFace(rotation[faceI]);
}
}
}

View File

@ -363,9 +363,6 @@ class polyTopoChange
// Coupling
//- Rotate face by number of positions
static face rotateFace(const face& f, const label nPos);
//- Do all coupled patch face reordering
void reorderCoupledFaces
(