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
69 const polyBoundaryMesh&
patches = mesh().boundaryMesh();
70 const label nBnd = mesh().nFaces()-mesh().nInternalFaces();
71 const labelList& own = mesh().faceOwner();
72 const labelList& nei = mesh().faceNeighbour();
86 label facei = pp.start();
90 neiGlobalCell[facei-mesh().nInternalFaces()] =
91 globalNumbering().toGlobal(own[facei]);
106 allCoupledFacesPatch()().meshEdges
115 validBoundaryFaces(isValidBFace);
120 EdgeMap<labelList> neiGlobal;
133 faceStencil.setSize(mesh().nFaces());
139 label edgeI = boundaryEdges[i];
141 const labelList& eGlobals = neiGlobal[mesh().edges()[edgeI]];
144 const labelList& eFaces = mesh().edgeFaces(edgeI);
148 label facei = eFaces[j];
151 merge(-1, -1, eGlobals, faceStencil[facei]);
160 DynamicList<label> fEdgesSet;
161 DynamicList<label> eFacesSet;
164 for (
label facei = 0; facei < mesh().nInternalFaces(); facei++)
166 label globalOwn = globalNumbering().toGlobal(own[facei]);
167 label globalNei = globalNumbering().toGlobal(nei[facei]);
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();
186 const labelList& fEdges = mesh().faceEdges(facei, fEdgesSet);
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();
221 label facei = pp.start();
227 label globalOwn = globalNumbering().toGlobal(own[facei]);
228 label globalNei = neiGlobalCell[facei-mesh().nInternalFaces()];
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();
247 const labelList& fEdges = mesh().faceEdges(facei, fEdgesSet);
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))
293 label globalOwn = globalNumbering().toGlobal(own[facei]);
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();
312 const labelList& fEdges = mesh().faceEdges(facei, fEdgesSet);
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();
349 for (
label facei = 0; facei < mesh().nInternalFaces(); facei++)
351 label globalOwn = globalNumbering().toGlobal(own[facei]);
352 if (faceStencil[facei][0] != globalOwn)
355 <<
"problem:" << faceStencil[facei]
356 <<
" globalOwn:" << globalOwn
359 label globalNei = globalNumbering().toGlobal(nei[facei]);
360 if (faceStencil[facei][1] != globalNei)
363 <<
"problem:" << faceStencil[facei]
364 <<
" globalNei:" << globalNei
378 label facei = pp.start()+i;
380 label globalOwn = globalNumbering().toGlobal(own[facei]);
381 if (faceStencil[facei][0] != globalOwn)
384 <<
"problem:" << faceStencil[facei]
385 <<
" globalOwn:" << globalOwn
388 label globalNei = neiGlobalCell[facei-mesh().nInternalFaces()];
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;
404 label globalOwn = globalNumbering().toGlobal(own[facei]);
405 if (faceStencil[facei][0] != globalOwn)
408 <<
"problem:" << faceStencil[facei]
409 <<
" globalOwn:" << globalOwn
426 calcFaceStencil(faceStencil);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
FECCellToFaceStencil(const polyMesh &)
Construct from all cells and boundary faces.
void transfer(List< labelList > &)
Transfer the contents of the argument List into this list.
Base class for extended cell-to-face stencils (face values from neighbouring cells)
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
const polyMesh & mesh() const
Mesh consisting of general polyhedral cells.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
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.
errorManip< error > abort(error &err)
List< bool > boolList
Bool container classes.
List< labelList > labelListList
A List of labelList.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.