50 for (label& val : list)
67 label& nCellsCorrected
74 auto& newCells = tnewCells.ref();
76 DynamicList<label> removed;
81 const auto& oldCFaces = oldCells[celli];
82 auto& newCFaces = newCells[celli];
88 const label facei = oldCFaces[cFacei];
89 const label masteri = newCFaces[cFacei];
95 const label facej = oldCFaces[cFacej];
96 const label masterj = newCFaces[cFacej];
110 if (masteri < masterj)
113 removed.append(masterj);
115 else if (masterj < masteri)
118 removed.append(masteri);
129 for (
const label facei : oldCFaces)
131 if (!removed.found(facei))
133 newCFaces[newi++] = facei;
136 newCFaces.resize(newi);
142 if (nCellsCorrected == 0)
167 Foam::manifoldCellsMeshObject::manifoldCellsMeshObject(
const polyMesh&
mesh)
169 MeshObject_type(
mesh),
181 cellsPtr_ = filter(
mesh(), nCorrected_);
184 return (nCorrected_ > 0);
192 cellsPtr_ = filter(
mesh(), nCorrected_);
195 return (cellsPtr_ ? cellsPtr_.cref() :
mesh().
cells());
201 cellsPtr_.reset(
nullptr);
static refPtr< T > New(Args &&... args)
Construct refPtr with forwarding arguments.
const cellList & cells() const
A class for managing references or pointers (no reference counting)
#define forAll(list, i)
Loop across all elements in list.
defineTypeName(manifoldCellsMeshObject)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
const polyMesh & mesh() const noexcept
Reference to the mesh.
virtual void updateMesh(const mapPolyMesh &)
Mesh changes.
virtual const faceList & faces() const
Return raw faces.
bool manifold() const
True if any manifold cells detected (globally) Triggers demand-driven filtering if required...
Mesh consisting of general polyhedral cells.
static bool sameVertices(const face &a, const face &b)
True if the faces have all the same vertices.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
const cellList & cells() const
Return the (optionally compacted) cell list Triggers demand-driven filtering if required.
static void replaceAll(const label oldVal, const label newVal, labelUList &list)