51 label curPoint = labels[j];
52 DynamicList<label, primitiveMesh::cellsPerPoint_>& curPointCells =
56 curPointCells.append(i);
64 pointCellAddr[pointi].transfer(pc[pointi]);
87 const face& curFace = patchFaces[fI];
88 const labelList& facePoints = patchFaces[fI];
92 const labelList& facePointCells = pointCells[facePoints[pointi]];
94 forAll(facePointCells, celli)
96 faceList cellFaces = cellsFaceShapes[facePointCells[celli]];
98 forAll(cellFaces, cellFace)
103 FaceCells[fI] = facePointCells[celli];
117 <<
"face " << fI <<
" in patch " << patchID
118 <<
" does not have neighbour cell"
119 <<
" face: " << patchFaces[fI]
128 void Foam::polyMesh::setTopology
135 label& defaultPatchStart,
148 forAll(cellsFaceShapes, celli)
150 cellsFaceShapes[celli] = cellsAsShapes[celli].faces();
158 maxFaces += cellsFaceShapes[celli].
size();
162 faces_.setSize(maxFaces);
168 labelListList PointCells = cellShapePointCells(cellsAsShapes);
180 const faceList& curFaces = cellsFaceShapes[celli];
186 labelList faceOfNeiCell(curFaces.size(), -1);
188 label nNeighbours = 0;
194 if (
cells[celli][facei] >= 0)
continue;
198 const face& curFace = curFaces[facei];
208 PointCells[curPoints[pointi]];
211 forAll(curNeighbours, neiI)
213 label curNei = curNeighbours[neiI];
219 const faceList& searchFaces = cellsFaceShapes[curNei];
221 forAll(searchFaces, neiFacei)
223 if (searchFaces[neiFacei] == curFace)
229 neiCells[facei] = curNei;
230 faceOfNeiCell[facei] = neiFacei;
245 for (
label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
253 if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
256 minNei = neiCells[ncI];
263 faces_[nFaces] = curFaces[nextNei];
266 cells[celli][nextNei] = nFaces;
267 cells[neiCells[nextNei]][faceOfNeiCell[nextNei]] = nFaces;
270 neiCells[nextNei] = -1;
278 <<
"Error in internal face insertion"
286 patchSizes.setSize(boundaryFaces.size(), -1);
287 patchStarts.setSize(boundaryFaces.size(), -1);
303 label curPatchStart = nFaces;
307 const face& curFace = patchFaces[facei];
309 const label cellInside = curPatchFaceCells[facei];
312 const faceList& facesOfCellInside = cellsFaceShapes[cellInside];
316 forAll(facesOfCellInside, cellFacei)
320 if (
cells[cellInside][cellFacei] >= 0)
323 <<
"Trying to specify a boundary face " << curFace
324 <<
" on the face on cell " << cellInside
325 <<
" which is either an internal face or already "
326 <<
"belongs to some other patch. This is face "
327 << facei <<
" of patch "
329 << boundaryPatchNames[
patchi] <<
"."
336 faces_[nFaces] = facesOfCellInside[cellFacei];
338 cells[cellInside][cellFacei] = nFaces;
347 <<
"face " << facei <<
" of patch " <<
patchi
348 <<
" does not seem to belong to cell " << cellInside
349 <<
" which, according to the addressing, "
350 <<
"should be next to it."
358 patchSizes[
patchi] = nFaces - curPatchStart;
359 patchStarts[
patchi] = curPatchStart;
364 defaultPatchStart = nFaces;
370 forAll(curCellFaces, facei)
372 if (curCellFaces[facei] == -1)
374 curCellFaces[facei] = nFaces;
375 faces_[nFaces] = cellsFaceShapes[celli][facei];
383 faces_.setSize(nFaces);
395 const word& defaultBoundaryPatchName,
396 const word& defaultBoundaryPatchType,
397 const wordList& boundaryPatchPhysicalTypes,
455 clearedPrimitives_(false),
468 boundaryFaces.size() + 1
470 bounds_(points_, syncPar),
474 tetBasePtIsPtr_(nullptr),
514 globalMeshDataPtr_(nullptr),
515 curMotionTimeIndex_(-1),
516 oldPointsPtr_(nullptr),
517 oldCellCentresPtr_(nullptr),
518 storeOldCellCentres_(false),
530 label defaultPatchStart;
555 boundaryPatchTypes[
patchi],
556 boundaryPatchNames[
patchi],
566 boundaryPatchPhysicalTypes.
size()
570 boundary_[
patchi].physicalType() =
571 boundaryPatchPhysicalTypes[
patchi];
575 label nAllPatches = boundaryFaces.
size();
584 if (nDefaultFaces > 0)
589 <<
"Found " << nDefaultFaces
590 <<
" undefined faces in mesh; adding to default patch." <<
endl;
602 <<
"Default patch " << boundary_[
patchi].
name()
603 <<
" already has faces in it or is not"
608 <<
"Reusing existing patch " <<
patchi
609 <<
" for undefined faces." <<
endl;
616 boundaryPatchTypes[
patchi],
617 boundaryPatchNames[
patchi],
618 nFaces - defaultPatchStart,
632 defaultBoundaryPatchType,
633 defaultBoundaryPatchName,
634 nFaces - defaultPatchStart,
636 boundary_.
size() - 1,
646 boundary_.
setSize(nAllPatches);
657 boundary_.calcGeometry();
670 const word& defaultBoundaryPatchName,
671 const word& defaultBoundaryPatchType,
729 clearedPrimitives_(false),
742 boundaryFaces.size() + 1
744 bounds_(points_, syncPar),
748 tetBasePtIsPtr_(nullptr),
788 globalMeshDataPtr_(nullptr),
789 curMotionTimeIndex_(-1),
790 oldPointsPtr_(nullptr),
791 oldCellCentresPtr_(nullptr),
792 storeOldCellCentres_(false),
803 label defaultPatchStart;
824 patchDict.set(
"nFaces", patchSizes[
patchi]);
825 patchDict.set(
"startFace", patchStarts[
patchi]);
833 boundaryPatchNames[
patchi],
841 label nAllPatches = boundaryFaces.
size();
849 if (nDefaultFaces > 0)
854 <<
"Found " << nDefaultFaces
855 <<
" undefined faces in mesh; adding to default patch." <<
endl;
867 <<
"Default patch " << boundary_[
patchi].
name()
868 <<
" already has faces in it or is not"
873 <<
"Reusing existing patch " <<
patchi
874 <<
" for undefined faces." <<
endl;
883 nFaces - defaultPatchStart,
897 defaultBoundaryPatchType,
898 defaultBoundaryPatchName,
899 nFaces - defaultPatchStart,
901 boundary_.
size() - 1,
911 boundary_.
setSize(nAllPatches);
922 boundary_.calcGeometry();
#define forAll(list, i)
Loop across all elements in list.
label size() const
Return number of elements in table.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
const word & name() const
Return name.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Inter-processor communications stream.
label size() const
Return the number of elements in the UPtrList.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
static bool sameVertices(const face &, const face &)
Return true if the faces have the same vertices.
Registry of regIOobjects.
Motion of the mesh specified as a list of pointMeshMovers.
void topoChange()
Correct polyBoundaryMesh after topology update.
polyMesh(const IOobject &io)
Construct from IOobject.
virtual const pointField & points() const
Return raw points.
void removeFiles() const
Remove all files from mesh instance()
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
Cell-face mesh analysis engine.
const cellList & cells() const
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
#define DebugInFunction
Report an information message using Foam::Info.
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List< cell > cellList
list of cells
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
List< labelList > labelListList
A List of labelList.
List< faceList > faceListList
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.