36 void Foam::FECCellToFaceStencil::calcEdgeBoundaryData
40 EdgeMap<labelList>& neiGlobal
43 neiGlobal.reserve(boundaryEdges.size());
47 for (
const label edgeI : boundaryEdges)
51 mesh().edges()[edgeI],
55 mesh().edgeFaces(edgeI),
71 void Foam::FECCellToFaceStencil::calcFaceStencil
93 label facei =
pp.start();
98 globalNumbering().toGlobal(own[facei]);
113 allCoupledFacesPatch()().meshEdges
122 validBoundaryFaces(isValidBFace);
127 EdgeMap<labelList> neiGlobal;
140 faceStencil.setSize(
mesh().nFaces());
146 label edgeI = boundaryEdges[i];
155 label facei = eFaces[j];
158 merge(-1, -1, eGlobals, faceStencil[facei]);
167 DynamicList<label> fEdgesSet;
168 DynamicList<label> eFacesSet;
173 label globalOwn = globalNumbering().toGlobal(own[facei]);
174 label globalNei = globalNumbering().toGlobal(nei[facei]);
179 faceStencilSet.
clear();
182 forAll(faceStencil[facei], i)
184 label globalI = faceStencil[facei][i];
185 if (globalI != globalOwn && globalI != globalNei)
187 faceStencilSet.insert(globalI);
190 faceStencil[facei].clear();
197 label edgeI = fEdges[i];
204 mesh().edgeFaces(edgeI, eFacesSet),
210 faceStencil[facei].setSize(faceStencilSet.size()+2);
212 faceStencil[facei][
n++] = globalOwn;
213 faceStencil[facei][
n++] = globalNei;
214 for (
const label stencili : faceStencilSet)
216 if (stencili == globalOwn || stencili == globalNei)
219 <<
"problem:" << faceStencilSet
222 faceStencil[facei][
n++] = stencili;
228 label facei =
pp.start();
234 label globalOwn = globalNumbering().toGlobal(own[facei]);
240 faceStencilSet.clear();
243 forAll(faceStencil[facei], i)
245 label globalI = faceStencil[facei][i];
246 if (globalI != globalOwn && globalI != globalNei)
248 faceStencilSet.insert(globalI);
251 faceStencil[facei].clear();
258 label edgeI = fEdges[i];
265 mesh().edgeFaces(edgeI, eFacesSet),
271 faceStencil[facei].setSize(faceStencilSet.size()+2);
273 faceStencil[facei][
n++] = globalOwn;
274 faceStencil[facei][
n++] = globalNei;
275 for (
const label stencili : faceStencilSet)
277 if (stencili == globalOwn || stencili == globalNei)
280 <<
"problem:" << faceStencilSet
283 faceStencil[facei][
n++] = stencili;
286 if (
n != faceStencil[facei].size())
289 <<
" size:" << faceStencil[facei].size()
296 else if (!isA<emptyPolyPatch>(
pp))
300 label globalOwn = globalNumbering().toGlobal(own[facei]);
305 faceStencilSet.clear();
308 forAll(faceStencil[facei], i)
310 label globalI = faceStencil[facei][i];
311 if (globalI != globalOwn)
313 faceStencilSet.insert(globalI);
316 faceStencil[facei].clear();
323 label edgeI = fEdges[i];
330 mesh().edgeFaces(edgeI, eFacesSet),
336 faceStencil[facei].setSize(faceStencilSet.size()+1);
338 faceStencil[facei][
n++] = globalOwn;
339 for (
const label stencili : faceStencilSet)
341 if (stencili == globalOwn)
344 <<
"problem:" << faceStencilSet
347 faceStencil[facei][
n++] = stencili;
358 label globalOwn = globalNumbering().toGlobal(own[facei]);
359 if (faceStencil[facei][0] != globalOwn)
362 <<
"problem:" << faceStencil[facei]
363 <<
" globalOwn:" << globalOwn
366 label globalNei = globalNumbering().toGlobal(nei[facei]);
367 if (faceStencil[facei][1] != globalNei)
370 <<
"problem:" << faceStencil[facei]
371 <<
" globalNei:" << globalNei
385 label facei =
pp.start()+i;
387 label globalOwn = globalNumbering().toGlobal(own[facei]);
388 if (faceStencil[facei][0] != globalOwn)
391 <<
"problem:" << faceStencil[facei]
392 <<
" globalOwn:" << globalOwn
396 if (faceStencil[facei][1] != globalNei)
399 <<
"problem:" << faceStencil[facei]
400 <<
" globalNei:" << globalNei
405 else if (!isA<emptyPolyPatch>(
pp))
409 label facei =
pp.start()+i;
411 label globalOwn = globalNumbering().toGlobal(own[facei]);
412 if (faceStencil[facei][0] != globalOwn)
415 <<
"problem:" << faceStencil[facei]
416 <<
" globalOwn:" << globalOwn
429 cellToFaceStencil(
mesh)
433 calcFaceStencil(faceStencil);
void transfer(List< labelList > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const labelListList & faceEdges() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
void clear()
Remove all entries from table.
virtual const labelList & faceOwner() const
Return face owner.
label nInternalFaces() const noexcept
Number of internal faces.
errorManip< error > abort(error &err)
const polyMesh & mesh() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const polyBoundaryMesh & patches
List< label > labelList
A List of labels.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
FECCellToFaceStencil(const polyMesh &)
Construct from all cells and boundary faces.
List< bool > boolList
A List of bools.
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
const labelListList & edgeFaces() const
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())