Go to the documentation of this file.
66 if (nei == -1 || own < nei)
103 const label masterPointID,
104 const label masterEdgeID,
105 const label masterFaceID,
112 if (nei == -1 || own < nei)
160 else if (fp ==
f.rcIndex(fp0))
162 thisTriI =
f.size()-3;
166 thisTriI = (fp-fp0-1) % (
f.size()-2);
188 cellToPoint_.setSize(mesh_.nCells());
189 forAll(mesh_.cellCentres(), cellI)
192 label masterPointI = mesh_.faces()[mesh_.cells()[cellI][0]][0];
194 cellToPoint_[cellI] = meshMod.
addPoint
196 mesh_.cellCentres()[cellI],
205 if (decomposeType == FACE_CENTRE_TRIS)
207 faceToPoint_.setSize(mesh_.nFaces());
208 forAll(mesh_.faceCentres(), faceI)
211 const label masterPointI = mesh_.faces()[faceI][0];
213 faceToPoint_[faceI] = meshMod.
addPoint
215 mesh_.faceCentres()[faceI],
225 faceOwnerCells_.setSize(mesh_.nFaces());
226 faceNeighbourCells_.setSize(mesh_.nFaces());
228 if (decomposeType == FACE_CENTRE_TRIS)
230 forAll(faceOwnerCells_, faceI)
232 const face&
f = mesh_.faces()[faceI];
234 faceNeighbourCells_[faceI].setSize(
f.
size(), -1);
240 (void)mesh_.tetBasePtIs();
242 forAll(faceOwnerCells_, faceI)
244 const face&
f = mesh_.faces()[faceI];
246 faceNeighbourCells_[faceI].setSize(
f.
size()-2, -1);
251 forAll(mesh_.cells(), cellI)
253 const cell& cFaces = mesh_.cells()[cellI];
259 label faceI = cFaces[cFaceI];
260 const face&
f = mesh_.faces()[faceI];
265 (mesh_.faceOwner()[faceI] == cellI)
266 ? faceOwnerCells_[faceI]
267 : faceNeighbourCells_[faceI]
270 if (decomposeType == FACE_CENTRE_TRIS)
274 if (cFaceI == 0 && fp == 0)
287 mesh_.cellZones().whichZone(cellI)
294 for (
label triI = 0; triI <
f.
size()-2; triI++)
296 if (cFaceI == 0 && triI == 0)
309 mesh_.cellZones().whichZone(cellI)
322 forAll(mesh_.faces(), faceI)
324 label own = mesh_.faceOwner()[faceI];
325 const labelList& addedOwn = faceOwnerCells_[faceI];
326 const labelList& addedNei = faceNeighbourCells_[faceI];
327 const face&
f = mesh_.faces()[faceI];
330 if (faceI >= mesh_.nInternalFaces())
332 patchI = mesh_.boundaryMesh().whichPatch(faceI);
335 label zoneI = mesh_.faceZones().whichZone(faceI);
336 bool zoneFlip =
false;
339 const faceZone& fz = mesh_.faceZones()[zoneI];
344 if (decomposeType == FACE_CENTRE_TRIS)
390 label newOwn = addedOwn[
f.rcIndex(fp)];
391 label newNei = addedOwn[fp];
412 if (faceI < mesh_.nInternalFaces())
414 label newOwn = addedNei[
f.rcIndex(fp)];
415 label newNei = addedNei[fp];
419 triangle[2] = cellToPoint_[mesh_.faceNeighbour()[faceI]];
439 label fp0 =
max(mesh_.tetBasePtIs()[faceI], 0);
440 label fp =
f.fcIndex(fp0);
442 for (
label triI = 0; triI <
f.
size()-2; triI++)
444 label nextTri = triI+1;
445 if (nextTri >=
f.
size()-2)
447 nextTri -=
f.
size()-2;
449 label nextFp =
f.fcIndex(fp);
496 if (triI <
f.
size()-3)
498 label newOwn = addedOwn[triI];
499 label newNei = addedOwn[nextTri];
520 if (faceI < mesh_.nInternalFaces())
522 label newOwn = addedNei[triI];
523 label newNei = addedNei[nextTri];
528 cellToPoint_[mesh_.faceNeighbour()[faceI]];
557 forAll(mesh_.cells(), cellI)
559 const cell& cFaces = mesh_.cells()[cellI];
565 label faceI = cFaces[cFaceI];
567 label zoneI = mesh_.faceZones().whichZone(faceI);
568 bool zoneFlip =
false;
571 const faceZone& fz = mesh_.faceZones()[zoneI];
575 const face&
f = mesh_.faces()[faceI];
581 const edge e(p0, p1);
584 if (edgeFnd == edgeToFace.end())
591 label otherFaceI = edgeFnd();
592 const face& otherF = mesh_.faces()[otherFaceI];
603 else if (otherF.
prevLabel(otherFp) == p1)
605 otherFp = otherF.rcIndex(otherFp);
615 if (mesh_.faceOwner()[faceI] == cellI)
629 label thisTet, otherTet;
631 if (decomposeType == FACE_CENTRE_TRIS)
633 if (mesh_.faceOwner()[faceI] == cellI)
635 thisTet = faceOwnerCells_[faceI][fp];
639 thisTet = faceNeighbourCells_[faceI][fp];
642 if (mesh_.faceOwner()[otherFaceI] == cellI)
644 otherTet = faceOwnerCells_[otherFaceI][otherFp];
649 faceNeighbourCells_[otherFaceI][otherFp];
654 label thisTriI = triIndex(faceI, fp);
655 if (mesh_.faceOwner()[faceI] == cellI)
657 thisTet = faceOwnerCells_[faceI][thisTriI];
661 thisTet = faceNeighbourCells_[faceI][thisTriI];
664 label otherTriI = triIndex(otherFaceI, otherFp);
665 if (mesh_.faceOwner()[otherFaceI] == cellI)
667 otherTet = faceOwnerCells_[otherFaceI][otherTriI];
672 faceNeighbourCells_[otherFaceI][otherTriI];
702 forAll(faceOwnerCells_, faceI)
706 forAll(faceNeighbourCells_, faceI)
label addCell(const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID)
Add cell. Return new cell label.
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
label addFace(const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Add face to cells. Return new face label.
void modifyFace(const face &f, const label faceI, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Modify vertices or cell of face.
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
label addPoint(const point &, const label masterPointID, const label zoneID, const bool inCell)
Add point. Return new point label.
Mesh consisting of general polyhedral cells.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
A triangle primitive used to calculate face normals and swept volumes.
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.
void modifyFace(polyTopoChange &meshMod, const face &f, const label faceI, const label own, const label nei, const label patchI, const label zoneI, const bool zoneFlip) const
Modify a face.
void setRefinement(const decompositionType decomposeType, polyTopoChange &meshMod)
Insert all changes into meshMod to convert the polyMesh into.
tetDecomposer(const tetDecomposer &)
Disallow default bitwise copy construct.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
const double e
Elementary charge.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
label prevLabel(const label i) const
Previous vertex on face.
label triIndex(const label faceI, const label fp) const
Work out triangle index given the starting vertex in the face.
const labelList & reverseCellMap() const
Reverse cell map.
label nextLabel(const label i) const
Next vertex on face.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void clear()
Clear all entries from table.
const labelList & reversePointMap() const
Reverse point map.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void addFace(polyTopoChange &meshMod, const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const label patchI, const label zoneI, const bool zoneFlip) const
Add a face.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
defineTypeNameAndDebug(combustionModel, 0)
A cell is defined as a list of faces with extra functionality.
Initialise the NamedEnum HashTable from the static list of names.
static const NamedEnum< decompositionType, 2 > decompositionTypeNames