33 void Foam::FECCellToFaceStencil::calcEdgeBoundaryData
37 EdgeMap<labelList>& neiGlobal
40 neiGlobal.resize(2*boundaryEdges.size());
46 label edgeI = boundaryEdges[i];
50 mesh().edges()[edgeI],
54 mesh().edgeFaces(edgeI),
64 void Foam::FECCellToFaceStencil::calcFaceStencil
82 const polyPatch& pp = patches[
patchi];
86 label facei = pp.start();
120 EdgeMap<labelList> neiGlobal;
133 faceStencil.setSize(
mesh().nFaces());
139 label edgeI = boundaryEdges[i];
148 label facei = eFaces[j];
151 merge(-1, -1, eGlobals, faceStencil[facei]);
160 DynamicList<label> fEdgesSet;
161 DynamicList<label> eFacesSet;
172 faceStencilSet.clear();
175 forAll(faceStencil[facei], i)
177 label globalI = faceStencil[facei][i];
178 if (globalI != globalOwn && globalI != globalNei)
180 faceStencilSet.insert(globalI);
183 faceStencil[facei].clear();
190 label edgeI = fEdges[i];
197 mesh().edgeFaces(edgeI, eFacesSet),
203 faceStencil[facei].setSize(faceStencilSet.size()+2);
205 faceStencil[facei][n++] = globalOwn;
206 faceStencil[facei][n++] = globalNei;
209 if (iter.key() == globalOwn || iter.key() == globalNei)
212 <<
"problem:" << faceStencilSet
215 faceStencil[facei][n++] = iter.key();
220 const polyPatch& pp = patches[
patchi];
221 label facei = pp.start();
233 faceStencilSet.clear();
236 forAll(faceStencil[facei], i)
238 label globalI = faceStencil[facei][i];
239 if (globalI != globalOwn && globalI != globalNei)
241 faceStencilSet.insert(globalI);
244 faceStencil[facei].clear();
251 label edgeI = fEdges[i];
258 mesh().edgeFaces(edgeI, eFacesSet),
264 faceStencil[facei].setSize(faceStencilSet.size()+2);
266 faceStencil[facei][n++] = globalOwn;
267 faceStencil[facei][n++] = globalNei;
270 if (iter.key() == globalOwn || iter.key() == globalNei)
273 <<
"problem:" << faceStencilSet
276 faceStencil[facei][n++] = iter.key();
279 if (n != faceStencil[facei].
size())
282 <<
" size:" << faceStencil[facei].size()
289 else if (!isA<emptyPolyPatch>(pp))
298 faceStencilSet.clear();
301 forAll(faceStencil[facei], i)
303 label globalI = faceStencil[facei][i];
304 if (globalI != globalOwn)
306 faceStencilSet.insert(globalI);
309 faceStencil[facei].clear();
316 label edgeI = fEdges[i];
323 mesh().edgeFaces(edgeI, eFacesSet),
329 faceStencil[facei].setSize(faceStencilSet.size()+1);
331 faceStencil[facei][n++] = globalOwn;
334 if (iter.key() == globalOwn)
337 <<
"problem:" << faceStencilSet
340 faceStencil[facei][n++] = iter.key();
352 if (faceStencil[facei][0] != globalOwn)
355 <<
"problem:" << faceStencil[facei]
356 <<
" globalOwn:" << globalOwn
360 if (faceStencil[facei][1] != globalNei)
363 <<
"problem:" << faceStencil[facei]
364 <<
" globalNei:" << globalNei
372 const polyPatch& pp = patches[
patchi];
378 label facei = pp.start()+i;
381 if (faceStencil[facei][0] != globalOwn)
384 <<
"problem:" << faceStencil[facei]
385 <<
" globalOwn:" << globalOwn
389 if (faceStencil[facei][1] != globalNei)
392 <<
"problem:" << faceStencil[facei]
393 <<
" globalNei:" << globalNei
398 else if (!isA<emptyPolyPatch>(pp))
402 label facei = pp.start()+i;
405 if (faceStencil[facei][0] != globalOwn)
408 <<
"problem:" << faceStencil[facei]
409 <<
" globalOwn:" << globalOwn
426 calcFaceStencil(faceStencil);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
void insertFaceCells(const label exclude0, const label exclude1, const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const labelListList & faceEdges() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
Base class for extended cell-to-face stencils (face values from neighbouring cells) ...
const globalIndex & globalNumbering() const
Global numbering for cells and boundary faces.
List< bool > boolList
Bool container classes.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
virtual const labelList & faceOwner() const
Return face owner.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
const polyMesh & mesh() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
label toGlobal(const label i) const
From local to global.
Mesh consisting of general polyhedral cells.
void validBoundaryFaces(boolList &isValidBFace) const
Valid boundary faces (not empty and not coupled)
FECCellToFaceStencil(const polyMesh &)
Construct from all cells and boundary faces.
label size() const
Return the number of elements in the UList.
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
static void merge(const label global0, const label global1, const labelList &listA, labelList &listB)
Merge two lists.
const labelListList & edgeFaces() const
autoPtr< indirectPrimitivePatch > allCoupledFacesPatch() const
Return patch of all coupled faces.