43 void Foam::meshReader::createPolyCells()
51 cellPolys_.
setSize(cFaces.size());
57 cellPolys_[celli].
setSize(cFaces[celli].size(), -1);
59 maxFaces += cFaces[celli].size();
62 Info<<
"Maximum possible number of faces in mesh: " << maxFaces <<
endl;
71 forAll(baffleIds_, baffleI)
73 baffleIds_[baffleI].setSize(2);
89 label baffleOffset = cFaces.size();
92 label celli = -(baffleOffset + baffleI);
100 const labelList& curNeighbours = ptCells[curPoints[0]];
102 label nNeighbours = 0;
105 forAll(curNeighbours, neiI)
107 label curNei = curNeighbours[neiI];
110 const faceList& searchFaces = cFaces[curNei];
112 forAll(searchFaces, neiFacei)
128 #ifdef DEBUG_FACE_ORDERING 129 Info<<
"cmp " << cmp <<
" matched " << curFace
130 <<
" with " << searchFaces[neiFacei]
134 Info<<
"match " << baffleI
135 <<
" (" <<
origCellId_[baffleOffset+baffleI] <<
")" 137 <<
" against cell " << curNei
138 <<
" face " << neiFacei
139 <<
" curFace " << curFace[1]
140 <<
" neiFace " << searchFaces[neiFacei][1]
144 if (baffleIds_[baffleI][side].notUsed())
146 baffleIds_[baffleI][side] = cellFaceIdentifier
156 Info<<
"multiple matches for side " << side
157 <<
" of baffle " << baffleI
158 <<
" (original cell " 165 if (nNeighbours >= 2)
break;
168 if (nNeighbours == 2)
170 for (label side = 0; side < nNeighbours; ++side)
172 label neiCell = baffleIds_[baffleI][side].cellId();
173 label neiFace = baffleIds_[baffleI][side].faceId();
175 if (baffleIds_[baffleI][side].
used())
177 cellPolys_[neiCell][neiFace] = celli;
183 Info<<
"drop baffle " << baffleI
184 <<
" (original cell " 186 <<
" with " << nNeighbours <<
" neighbours" <<
endl;
189 baffleIds_[baffleI].clear();
193 #ifdef DEBUG_CELLPOLY 194 Info<<
"cellPolys_" << cellPolys_ <<
endl;
196 Info<<
"baffleIds_" << baffleIds_ <<
endl;
211 const faceList& curFaces = cFaces[celli];
217 labelList faceOfNeiCell(curFaces.size(), -1);
219 label nNeighbours = 0;
225 if (cellPolys_[celli][facei] != -1)
continue;
229 const face& curFace = curFaces[facei];
238 const labelList& curNeighbours = ptCells[curPoints[pointi]];
241 forAll(curNeighbours, neiI)
243 label curNei = curNeighbours[neiI];
250 const faceList& searchFaces = cFaces[curNei];
252 forAll(searchFaces, neiFacei)
254 if (searchFaces[neiFacei] == curFace)
257 neiCells[facei] = curNei;
258 faceOfNeiCell[facei] = neiFacei;
260 #ifdef DEBUG_FACE_ORDERING 261 Info<<
" cell " << celli
263 <<
" point " << pointi
265 <<
" neiFace " << neiFacei
281 for (label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
285 label minNei = cellPolys_.
size();
289 if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
292 minNei = neiCells[ncI];
305 cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
309 neiCells[nextNei] = -1;
317 <<
"Error in internal face insertion" 323 #ifdef DEBUG_CELLPOLY 324 Info<<
"cellPolys = " << cellPolys_ <<
endl;
List< faceList > faceListList
List of faceList.
void size(const label n)
Older name for setAddressableSize.
labelHashSet used(const bitSet &select)
Convert a bitset to a labelHashSet of the indices used.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
labelList origCellId_
Lookup original Cell number for a given cell.
void setSize(const label n)
Alias for resize()
void clear()
Clear the list, i.e. set size to zero.
errorManip< error > abort(error &err)
faceList meshFaces_
Global face list for polyMesh.
faceList baffleFaces_
List of each baffle face.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static int compare(const face &a, const face &b)
Compare faces.
List< label > labelList
A List of labels.
label nInternalFaces_
Number of internal faces for polyMesh.