41 List<DynamicList<label, primitiveMesh::cellsPerPoint_>>
53 label curPoint = labels[j];
54 DynamicList<label, primitiveMesh::cellsPerPoint_>& curPointCells =
58 curPointCells.append(i);
66 pointCellAddr[pointi].transfer(pc[pointi]);
89 const face& curFace = patchFaces[fI];
90 const labelList& facePoints = patchFaces[fI];
94 const labelList& facePointCells = pointCells[facePoints[pointi]];
96 forAll(facePointCells, celli)
98 faceList cellFaces = cellsFaceShapes[facePointCells[celli]];
100 forAll(cellFaces, cellFace)
105 FaceCells[fI] = facePointCells[celli];
119 <<
"face " << fI <<
" in patch " << patchID
120 <<
" does not have neighbour cell"
121 <<
" face: " << patchFaces[fI]
130 void Foam::polyMesh::setTopology
137 label& defaultPatchStart,
150 forAll(cellsFaceShapes, celli)
152 cellsFaceShapes[celli] = cellsAsShapes[celli].faces();
160 maxFaces += cellsFaceShapes[celli].
size();
164 faces_.setSize(maxFaces);
170 labelListList PointCells = cellShapePointCells(cellsAsShapes);
182 const faceList& curFaces = cellsFaceShapes[celli];
188 labelList faceOfNeiCell(curFaces.size(), -1);
190 label nNeighbours = 0;
196 if (
cells[celli][facei] >= 0)
continue;
200 const face& curFace = curFaces[facei];
210 PointCells[curPoints[pointi]];
213 forAll(curNeighbours, neiI)
215 label curNei = curNeighbours[neiI];
221 const faceList& searchFaces = cellsFaceShapes[curNei];
223 forAll(searchFaces, neiFacei)
225 if (searchFaces[neiFacei] == curFace)
231 neiCells[facei] = curNei;
232 faceOfNeiCell[facei] = neiFacei;
247 for (
label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
255 if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
258 minNei = neiCells[ncI];
265 faces_[nFaces] = curFaces[nextNei];
268 cells[celli][nextNei] = nFaces;
269 cells[neiCells[nextNei]][faceOfNeiCell[nextNei]] = nFaces;
272 neiCells[nextNei] = -1;
280 <<
"Error in internal face insertion"
288 patchSizes.setSize(boundaryFaces.size(), -1);
289 patchStarts.setSize(boundaryFaces.size(), -1);
305 label curPatchStart = nFaces;
309 const face& curFace = patchFaces[facei];
311 const label cellInside = curPatchFaceCells[facei];
314 const faceList& facesOfCellInside = cellsFaceShapes[cellInside];
318 forAll(facesOfCellInside, cellFacei)
322 if (
cells[cellInside][cellFacei] >= 0)
325 <<
"Trying to specify a boundary face " << curFace
326 <<
" on the face on cell " << cellInside
327 <<
" which is either an internal face or already "
328 <<
"belongs to some other patch. This is face "
329 << facei <<
" of patch "
331 << boundaryPatchNames[
patchi] <<
"."
338 faces_[nFaces] = facesOfCellInside[cellFacei];
340 cells[cellInside][cellFacei] = nFaces;
349 <<
"face " << facei <<
" of patch " <<
patchi
350 <<
" does not seem to belong to cell " << cellInside
351 <<
" which, according to the addressing, "
352 <<
"should be next to it."
360 patchSizes[
patchi] = nFaces - curPatchStart;
361 patchStarts[
patchi] = curPatchStart;
366 defaultPatchStart = nFaces;
372 forAll(curCellFaces, facei)
374 if (curCellFaces[facei] == -1)
376 curCellFaces[facei] = nFaces;
377 faces_[nFaces] = cellsFaceShapes[celli][facei];
385 faces_.setSize(nFaces);
397 const word& defaultBoundaryPatchName,
398 const word& defaultBoundaryPatchType,
399 const wordList& boundaryPatchPhysicalTypes,
457 clearedPrimitives_(false),
470 boundaryFaces.size() + 1
472 bounds_(points_, syncPar),
476 tetBasePtIsPtr_(nullptr),
477 cellTreePtr_(nullptr),
517 globalMeshDataPtr_(nullptr),
518 curMotionTimeIndex_(-1),
519 oldPointsPtr_(nullptr),
520 oldCellCentresPtr_(nullptr),
521 storeOldCellCentres_(false),
527 Info<<
"Constructing polyMesh from cell and boundary shapes." <<
endl;
536 label defaultPatchStart;
561 boundaryPatchTypes[
patchi],
562 boundaryPatchNames[
patchi],
572 boundaryPatchPhysicalTypes.
size()
576 boundary_[
patchi].physicalType() =
577 boundaryPatchPhysicalTypes[
patchi];
581 label nAllPatches = boundaryFaces.
size();
590 if (nDefaultFaces > 0)
595 <<
"Found " << nDefaultFaces
596 <<
" undefined faces in mesh; adding to default patch." <<
endl;
608 <<
"Default patch " << boundary_[
patchi].
name()
609 <<
" already has faces in it or is not"
614 <<
"Reusing existing patch " <<
patchi
615 <<
" for undefined faces." <<
endl;
622 boundaryPatchTypes[
patchi],
623 boundaryPatchNames[
patchi],
624 nFaces - defaultPatchStart,
638 defaultBoundaryPatchType,
639 defaultBoundaryPatchName,
640 nFaces - defaultPatchStart,
642 boundary_.
size() - 1,
652 boundary_.
setSize(nAllPatches);
663 boundary_.calcGeometry();
676 const word& defaultBoundaryPatchName,
677 const word& defaultBoundaryPatchType,
735 clearedPrimitives_(false),
748 boundaryFaces.size() + 1
750 bounds_(points_, syncPar),
754 tetBasePtIsPtr_(nullptr),
755 cellTreePtr_(nullptr),
795 globalMeshDataPtr_(nullptr),
796 curMotionTimeIndex_(-1),
797 oldPointsPtr_(nullptr),
798 oldCellCentresPtr_(nullptr),
799 storeOldCellCentres_(false),
804 Info<<
"Constructing polyMesh from cell and boundary shapes." <<
endl;
813 label defaultPatchStart;
834 patchDict.
set(
"nFaces", patchSizes[
patchi]);
835 patchDict.
set(
"startFace", patchStarts[
patchi]);
843 boundaryPatchNames[
patchi],
851 label nAllPatches = boundaryFaces.
size();
859 if (nDefaultFaces > 0)
864 <<
"Found " << nDefaultFaces
865 <<
" undefined faces in mesh; adding to default patch." <<
endl;
877 <<
"Default patch " << boundary_[
patchi].
name()
878 <<
" already has faces in it or is not"
883 <<
"Reusing existing patch " <<
patchi
884 <<
" for undefined faces." <<
endl;
893 nFaces - defaultPatchStart,
907 defaultBoundaryPatchType,
908 defaultBoundaryPatchName,
909 nFaces - defaultPatchStart,
911 boundary_.
size() - 1,
921 boundary_.
setSize(nAllPatches);
932 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 keyword definitions, which are a keyword followed by any number of values (e....
void set(entry *)
Assign a new entry, overwrite any existing entry.
static bool sameVertices(const face &, const face &)
Return true if the faces have the same vertices.
Registry of regIOobjects.
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.
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.