42 if (meshModPtr_.
empty())
44 meshModPtr_.
reset(
new polyTopoChange(mesh_));
52 Foam::repatchPolyTopoChanger::repatchPolyTopoChanger(
polyMesh&
mesh)
66 if (meshModPtr_.valid())
70 "repatchPolyTopoChanger::changePatches(const List<polyPatch*>&)"
71 ) <<
"Cannot change patches after having changed faces. " <<
nl
72 <<
"Please call changePatches first."
76 mesh_.removeBoundary();
77 mesh_.addPatches(patches);
87 if (polyTopoChanger::debug)
92 faceID >= mesh_.faces().size()
93 || patchID >= mesh_.boundaryMesh().size()
94 || mesh_.isInternalFace(faceID)
99 "void Foam::repatchPolyTopoChanger::changePatchID\n"
101 " const label faceID,\n"
102 " const label patchID\n"
104 ) <<
"Error in definition. faceID: " << faceID
105 <<
" patchID: " << patchID <<
". "
106 <<
"Labels out of range or internal face."
111 const label zoneID = mesh_.faceZones().whichZone(faceID);
113 bool zoneFlip =
false;
117 const faceZone& fZone = mesh_.faceZones()[zoneID];
126 mesh_.faces()[faceID],
128 mesh_.faceOwner()[faceID],
147 if (polyTopoChanger::debug)
150 if (faceID > mesh_.faces().size())
154 "void Foam::repatchPolyTopoChanger::setFaceZone"
156 " const label faceID,\n"
157 " const label zoneID,\n"
160 ) <<
"Error in definition. faceID: " << faceID
170 mesh_.faces()[faceID],
172 mesh_.faceOwner()[faceID],
173 mesh_.faceNeighbour()[faceID],
175 mesh_.boundaryMesh().whichPatch(faceID),
190 if (polyTopoChanger::debug)
193 if (faceID > mesh_.faces().size())
197 "void Foam::repatchPolyTopoChanger::setFaceZone"
199 " const label faceID,\n"
200 " const label zoneID,\n"
203 ) <<
"Error in definition. faceID: " << faceID
209 const face&
f = mesh_.faces()[faceID];
211 if ((fp < 0) || (fp >= f.
size()))
215 "void Foam::repatchPolyTopoChanger::changeAnchorPoint"
217 " const label faceID,\n"
220 ) <<
"Error in definition. Face point: " << fp
221 <<
"indexes out of face " << f
225 label patchID = mesh_.boundaryMesh().whichPatch(faceID);
227 const label zoneID = mesh_.faceZones().whichZone(faceID);
229 bool zoneFlip =
false;
233 const faceZone& fZone = mesh_.faceZones()[zoneID];
247 mesh_.faceOwner()[faceID],
265 for (label i = 0; i < f.
size(); i++)
267 newFace[i] = f[fVert++];
269 if (fVert == f.
size())
282 mesh_.faceOwner()[faceID],
298 meshMod().changeMesh(mesh_,
false);