53 void Foam::tetDecomposer::modifyFace
66 if (nei == -1 || own < nei)
97 void Foam::tetDecomposer::addFace
103 const label masterPointID,
104 const label masterEdgeID,
105 const label masterFaceID,
112 if (nei == -1 || own < nei)
151 const face& f = mesh_.faces()[facei];
152 const label fp0 = mesh_.tetBasePtIs()[facei];
162 thisTriI = f.
size()-3;
166 thisTriI = (fp-fp0-1) % (f.
size()-2);
194 cellToPoint_[celli] = meshMod.
addPoint 211 const label masterPointi = mesh_.
faces()[facei][0];
213 faceToPoint_[facei] = meshMod.
addPoint 230 forAll(faceOwnerCells_, facei)
242 forAll(faceOwnerCells_, facei)
246 faceNeighbourCells_[facei].
setSize(f.
size()-2, -1);
253 const cell& cFaces = mesh_.
cells()[celli];
259 label facei = cFaces[cFacei];
266 ? faceOwnerCells_[facei]
267 : faceNeighbourCells_[facei]
274 if (cFacei == 0 && fp == 0)
294 for (
label triI = 0; triI < f.
size()-2; triI++)
296 if (cFacei == 0 && triI == 0)
325 const labelList& addedOwn = faceOwnerCells_[facei];
326 const labelList& addedNei = faceNeighbourCells_[facei];
336 bool zoneFlip =
false;
352 triangle[1] = f[f.
fcIndex(fp)];
353 triangle[2] = faceToPoint_[facei];
391 label newNei = addedOwn[fp];
394 triangle[1] = cellToPoint_[own];
395 triangle[2] = faceToPoint_[facei];
415 label newNei = addedNei[fp];
418 triangle[1] = faceToPoint_[facei];
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;
458 triangle[0] = f[fp0];
460 triangle[2] = f[nextFp];
496 if (triI < f.
size()-3)
498 label newOwn = addedOwn[triI];
499 label newNei = addedOwn[nextTri];
501 triangle[0] = f[fp0];
502 triangle[1] = f[nextFp];
503 triangle[2] = cellToPoint_[own];
522 label newOwn = addedNei[triI];
523 label newNei = addedNei[nextTri];
525 triangle[0] = f[nextFp];
526 triangle[1] = f[fp0];
559 const cell& cFaces = mesh_.
cells()[celli];
565 label facei = cFaces[cFacei];
568 bool zoneFlip =
false;
581 const edge e(p0, p1);
584 if (edgeFnd == edgeToFace.
end())
586 edgeToFace.
insert(e, facei);
591 label otherFacei = edgeFnd();
592 const face& otherF = mesh_.
faces()[otherFacei];
603 else if (otherF.
prevLabel(otherFp) == p1)
605 otherFp = otherF.
rcIndex(otherFp);
619 triangle[2] = cellToPoint_[celli];
625 triangle[2] = cellToPoint_[celli];
629 label thisTet, otherTet;
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);
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)
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
A triangle primitive used to calculate face areas and swept volumes.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A face is a list of labels corresponding to mesh vertices.
const meshCellZones & cellZones() const
Return cell zones.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
void setRefinement(const decompositionType decomposeType, polyTopoChange &meshMod)
Insert all changes into meshMod to convert the polyMesh into.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
label nextLabel(const label i) const
Next vertex on face.
const cellList & cells() const
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
Initialise the NamedEnum HashTable from the static list of names.
label addCell(const label masterPointID, const label masterEdgeID, const label masterFaceID, const label masterCellID, const label zoneID)
Add cell. Return new cell label.
label prevLabel(const label i) const
Previous vertex on face.
bool insert(const edge &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const edge &)
Find and return an iterator set at the hashedEntry.
face reverseFace() const
Return face with reverse direction.
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.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void clear()
Clear all entries from table.
void topoChange(const polyTopoChangeMap &)
Force recalculation of locally stored data on topological change.
virtual const labelList & faceOwner() const
Return face owner.
const labelList & reversePointMap() const
Reverse point map.
label addPoint(const point &, const label masterPointID, const label zoneID, const bool inCell)
Add point. Return new point label.
virtual const faceList & faces() const
Return raw faces.
tetDecomposer(const polyMesh &)
Construct from mesh.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
Map from edge (expressed as its endpoints) to value.
defineTypeNameAndDebug(combustionModel, 0)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
const labelList & reverseCellMap() const
Reverse cell map.
const vectorField & faceCentres() const
void setSize(const label)
Reset size of List.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
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.
static const NamedEnum< decompositionType, 2 > decompositionTypeNames
A cell is defined as a list of faces with extra functionality.
const meshFaceZones & faceZones() const
Return face zones.
Direct mesh changes based on v1.3 polyTopoChange syntax.
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.