44 meshModPtr_.reset(
new polyTopoChange(mesh_));
52Foam::repatchPolyTopoChanger::repatchPolyTopoChanger(polyMesh&
mesh)
69 <<
"Cannot change patches after having changed faces. " <<
nl
70 <<
"Please call changePatches first."
73 meshModPtr_.reset(
nullptr);
74 mesh_.removeBoundary();
97 if (polyTopoChanger::debug)
102 faceID >= mesh_.faces().size()
103 ||
patchID >= mesh_.boundaryMesh().size()
104 || mesh_.isInternalFace(faceID)
108 <<
" patchID: " <<
patchID <<
". "
109 <<
"Labels out of range or internal face."
114 const label zoneID = mesh_.faceZones().whichZone(faceID);
116 bool zoneFlip =
false;
120 const faceZone& fZone = mesh_.faceZones()[zoneID];
122 zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
129 mesh_.faces()[faceID],
131 mesh_.faceOwner()[faceID],
150 if (polyTopoChanger::debug)
153 if (faceID > mesh_.faces().size())
165 mesh_.faces()[faceID],
167 mesh_.faceOwner()[faceID],
168 mesh_.faceNeighbour()[faceID],
170 mesh_.boundaryMesh().whichPatch(faceID),
185 if (polyTopoChanger::debug)
188 if (faceID > mesh_.faces().size())
196 const face&
f = mesh_.faces()[faceID];
198 if ((fp < 0) || (fp >=
f.size()))
201 <<
"Error in definition. Face point: " << fp
202 <<
"indexes out of face " <<
f
206 label
patchID = mesh_.boundaryMesh().whichPatch(faceID);
208 const label zoneID = mesh_.faceZones().whichZone(faceID);
210 bool zoneFlip =
false;
214 const faceZone& fZone = mesh_.faceZones()[zoneID];
216 zoneFlip = fZone.flipMap()[fZone.whichFace(faceID)];
228 mesh_.faceOwner()[faceID],
248 newFace[i] =
f[fVert++];
250 if (fVert ==
f.
size())
263 mesh_.faceOwner()[faceID],
279 meshMod().changeMesh(mesh_,
false);
282 meshModPtr_.reset(
nullptr);
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label n)
Older name for setAddressableSize.
A subset of mesh faces organised as a primitive patch.
label whichFace(const label meshFaceID) const
The local index of the given mesh face, -1 if not in the zone.
const boolList & flipMap() const noexcept
Return face flip map.
A face is a list of labels corresponding to mesh vertices.
Mesh consisting of general polyhedral cells.
Class describing modification of a face.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void changeAnchorPoint(const label faceID, const label fp)
Change anchor point (zero'th point of face) for a boundary face.
void changePatchID(const label faceID, const label patchID)
Change patch ID for a boundary face. Note: patchID should be in new numbering.
void changePatches(polyPatchList &patches)
Change patches.
void repatch()
Re-patch the mesh.
void setFaceZone(const label faceID, const label zoneID, const bool zoneFlip)
Set zone ID for a face.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.