37 const scalar minOpposedness,
45 const cell& cFaces = mesh_.cells()[cellI];
52 label otherFaceI = cFaces[i];
54 if (otherFaceI != faceI && nonEmptyFace[otherFaceI])
56 if ((own[otherFaceI] == cellI) == (own[faceI] == cellI))
58 opposedness[i] = -(areas[otherFaceI] & areas[faceI]);
62 opposedness[i] = (areas[otherFaceI] & areas[faceI]);
67 label sz = opposedness.size();
69 oppositeFaces.
clear();
71 scalar myAreaSqr =
magSqr(areas[faceI]);
73 if (myAreaSqr > VSMALL)
77 opposedness[i] /= myAreaSqr;
85 for (
label i = sz-2; i >= 0; --i)
87 if (opposedness[i] < minOpposedness)
110 const scalar minOpposedness,
113 const bool stencilHasNeighbour,
120 label globalOwn = faceStencil[faceI][0];
121 label globalNei = -1;
122 if (stencilHasNeighbour && faceStencil[faceI].size() >= 2)
124 globalNei = faceStencil[faceI][1];
138 faceStencilSet.
clear();
141 const labelList& fStencil = faceStencil[oppositeFaces[i]];
145 label globalI = fStencil[j];
147 if (globalI != globalOwn && globalI != globalNei)
149 faceStencilSet.
insert(globalI);
155 if (stencilHasNeighbour)
157 transportedStencil.
setSize(faceStencilSet.
size()+2);
159 transportedStencil[
n++] = globalOwn;
160 transportedStencil[
n++] = globalNei;
164 if (iter.key() != globalOwn && iter.key() != globalNei)
166 transportedStencil[
n++] = iter.key();
169 if (
n != transportedStencil.
size())
172 <<
"problem:" << faceStencilSet
178 transportedStencil.
setSize(faceStencilSet.
size()+1);
180 transportedStencil[
n++] = globalOwn;
184 if (iter.key() != globalOwn)
186 transportedStencil[
n++] = iter.key();
189 if (
n != transportedStencil.
size())
192 <<
"problem:" << faceStencilSet
202 const scalar minOpposedness,
208 const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
209 const labelList& own = mesh_.faceOwner();
210 const labelList& nei = mesh_.faceNeighbour();
218 boolList nonEmptyFace(mesh_.nFaces(),
true);
223 if (isA<emptyPolyPatch>(pp))
228 nonEmptyFace[faceI++] =
false;
238 ownStencil.
setSize(mesh_.nFaces());
241 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
283 else if (!isA<emptyPolyPatch>(pp))
311 for (
label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
313 neiBndStencil[faceI-mesh_.nInternalFaces()] = ownStencil[faceI];
316 syncTools::syncBoundaryFaceList
332 neiStencil.
setSize(mesh_.nFaces());
335 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
364 neiBndStencil[faceI-mesh_.nInternalFaces()]
382 const bool pureUpwind,
383 const scalar minOpposedness
387 pureUpwind_(pureUpwind)
463 collectData(ownMapPtr_(), ownStencil_,
mesh.C(), stencilPoints);
466 forAll(stencilPoints, faceI)
468 const point& fc =
mesh.faceCentres()[faceI];
469 const vector& fArea =
mesh.faceAreas()[faceI];
472 const labelList& stencil = ownStencil_[faceI];
477 if (((
points[i]-fc) & fArea) < 0)
479 newStencil.
append(stencil[i]);
482 if (newStencil.size() != stencil.
size())
484 ownStencil_[faceI].transfer(newStencil);
492 collectData(neiMapPtr_(), neiStencil_,
mesh.C(), stencilPoints);
495 forAll(stencilPoints, faceI)
497 const point& fc =
mesh.faceCentres()[faceI];
498 const vector& fArea =
mesh.faceAreas()[faceI];
501 const labelList& stencil = neiStencil_[faceI];
506 if (((
points[i]-fc) & fArea) > 0)
508 newStencil.
append(stencil[i]);
511 if (newStencil.size() != stencil.
size())
513 neiStencil_[faceI].transfer(newStencil);
533 ownStencil_ = stencil;
551 collectData(ownMapPtr_(), ownStencil_,
mesh.C(), stencilPoints);
554 neiStencil_.setSize(ownStencil_.size());
556 forAll(stencilPoints, faceI)
558 const point& fc =
mesh.faceCentres()[faceI];
559 const vector& fArea =
mesh.faceAreas()[faceI];
562 const labelList& stencil = ownStencil_[faceI];
568 if (((
points[i]-fc) & fArea) > 0)
570 newNeiStencil.
append(stencil[i]);
574 newOwnStencil.
append(stencil[i]);
577 if (newNeiStencil.size() > 0)
579 ownStencil_[faceI].transfer(newOwnStencil);
580 neiStencil_[faceI].transfer(newNeiStencil);