Go to the documentation of this file.
101 const labelList& faceOwner = mesh_.faceOwner();
102 const labelList& faceNeighbour = mesh_.faceNeighbour();
107 for (
label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
109 const label own = faceOwner[facei];
110 const label nei = faceNeighbour[facei];
112 if (!removedCell[own])
114 ++nCellsUsingFace[facei];
116 if (!removedCell[nei])
118 ++nCellsUsingFace[facei];
122 for (
label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); ++facei)
124 const label own = faceOwner[facei];
126 if (!removedCell[own])
128 ++nCellsUsingFace[facei];
139 mesh_.nBoundaryFaces(),
140 mesh_.nInternalFaces()
143 syncTools::syncBoundaryFaceList
164 for (
label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
166 if (nCellsUsingFace[facei] == 1)
168 exposedFaces.
append(facei);
178 label facei = pp.start();
182 const label own = faceOwner[facei];
184 if (nCellsUsingFace[facei] == 1 && !removedCell[own])
188 exposedFaces.
append(facei);
196 return exposedFaces.shrink();
202 const bitSet& removedCell,
210 if (exposedFaceLabels.
size() != exposedPatchIDs.
size())
213 <<
"Size of exposedFaceLabels " << exposedFaceLabels.
size()
214 <<
" differs from size of exposedPatchIDs "
215 << exposedPatchIDs.
size()
220 labelList newPatchID(mesh_.nFaces(), -1);
222 forAll(exposedFaceLabels, i)
224 const label facei = exposedFaceLabels[i];
225 const label patchi = exposedPatchIDs[i];
227 if (patchi < 0 || patchi >=
patches.size())
230 <<
"Invalid patch " << patchi
231 <<
" for exposed face " << facei <<
nl
232 <<
"Valid patches 0.." <<
patches.size()-1
239 <<
"Trying to put exposed face " << facei
240 <<
" into a coupled patch : " <<
patches[patchi].name()
242 <<
"This is illegal."
246 newPatchID[facei] = patchi;
251 for (
const label celli : removedCell)
263 const faceList& faces = mesh_.faces();
264 const labelList& faceOwner = mesh_.faceOwner();
265 const labelList& faceNeighbour = mesh_.faceNeighbour();
272 for (
const face&
f : faces)
274 incrCount(
f, nFacesUsingPoint);
278 for (
label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
280 const face&
f = faces[facei];
281 const label own = faceOwner[facei];
282 const label nei = faceNeighbour[facei];
284 if (removedCell[own])
286 if (removedCell[nei])
293 decrCount(
f, nFacesUsingPoint);
297 if (newPatchID[facei] == -1)
300 <<
"No patchID provided for exposed face " << facei
301 <<
" on cell " << nei <<
nl
302 <<
"Did you provide patch IDs for all exposed faces?"
309 bool zoneFlip =
false;
340 else if (removedCell[nei])
342 if (newPatchID[facei] == -1)
345 <<
"No patchID provided for exposed face " << facei
346 <<
" on cell " << own <<
nl
347 <<
"Did you provide patch IDs for all exposed faces?"
357 bool zoneFlip =
false;
387 label facei = pp.start();
391 if (newPatchID[facei] != -1)
398 bool zoneFlip =
false;
422 else if (removedCell[faceOwner[facei]])
430 decrCount(faces[facei], nFacesUsingPoint);
438 label facei = pp.start();
442 if (newPatchID[facei] != -1)
445 <<
"new patchID provided for boundary face " << facei
446 <<
" even though it is not on a coupled face."
450 if (removedCell[faceOwner[facei]])
458 decrCount(faces[facei], nFacesUsingPoint);
470 forAll(nFacesUsingPoint, pointi)
472 if (nFacesUsingPoint[pointi] == 0)
479 else if (nFacesUsingPoint[pointi] == 1)
482 <<
"point " << pointi <<
" at coordinate "
483 << mesh_.points()[pointi]
484 <<
" is only used by 1 face after removing cells."
485 <<
" This probably results in an illegal mesh."
497 bitSet removeCell(mesh_.nCells(), cellsToRemove);
499 return getExposedFaces(removeCell);
511 bitSet removedCell(mesh_.nCells(), cellsToRemove);
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Class containing data for point removal.
static constexpr const zero Zero
Global zero.
Given list of cells to remove, insert all the topology changes.
A List obtained as a section of another List.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void append(const T &val)
Append an element at the end of the list.
Class describing modification of a face.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
void setRefinement(const bitSet &removedCell, const labelUList &facesToExpose, const labelUList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
#define forAll(list, i)
Loop across all elements in list.
Class containing data for cell removal.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
removeCells(const polyMesh &mesh)
Construct from mesh. With parallel synchronization.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
const labelIOList & zoneID
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
Class containing data for face removal.
const polyBoundaryMesh & patches
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
A face is a list of labels corresponding to mesh vertices.
const boolList & flipMap() const
Return face flip map.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
labelList getExposedFaces(const bitSet &removedCell) const
Get labels of faces exposed after cells removal.