mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rotateFace moved to face from polyTopoChange and used in cvMesh
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user