36void Foam::FECCellToFaceStencil::calcEdgeBoundaryData
38 const boolList& isValidBFace,
39 const labelList& boundaryEdges,
40 EdgeMap<labelList>& neiGlobal
43 neiGlobal.reserve(boundaryEdges.size());
47 for (
const label edgeI : boundaryEdges)
51 mesh().edges()[edgeI],
55 mesh().edgeFaces(edgeI),
71void Foam::FECCellToFaceStencil::calcFaceStencil
93 label facei =
pp.start();
98 globalNumbering().toGlobal(own[facei]);
113 allCoupledFacesPatch()().meshEdges
122 validBoundaryFaces(isValidBFace);
140 faceStencil.setSize(
mesh().nFaces());
146 label edgeI = boundaryEdges[i];
155 label facei = eFaces[j];
158 merge(-1, -1, eGlobals, faceStencil[facei]);
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()
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
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
433 calcFaceStencil(faceStencil);
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Map from edge (expressed as its endpoints) to value. Hashing (and ==) on an edge is symmetric.
FECCellToFaceStencil(const polyMesh &)
Construct from all cells and boundary faces.
void transfer(List< labelList > &list)
Base class for extended cell-to-face stencils (face values from neighbouring cells).
cellToFaceStencil(const polyMesh &)
Construct from mesh.
const polyMesh & mesh() const
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
virtual const labelList & faceOwner() const
Return face owner.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A patch is a list of labels that address the faces in the global face list.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces).
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
label nInternalFaces() const noexcept
Number of internal faces.
const labelListList & edgeFaces() const
const labelListList & faceEdges() const
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
errorManip< error > abort(error &err)
List< bool > boolList
A List of bools.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define forAll(list, i)
Loop across all elements in list.