44Foam::zoneCellStencils::nonEmptyFacesPatch()
const
46 const polyBoundaryMesh&
patches = meshRef_.boundaryMesh();
50 for (
const polyPatch& pp :
patches)
52 if (!isA<emptyPolyPatch>(pp))
54 nNonEmpty += pp.size();
60 for (
const polyPatch& pp :
patches)
62 if (!isA<emptyPolyPatch>(pp))
64 label facei = pp.start();
68 nonEmptyFaces[nNonEmpty++] = facei++;
73 return autoPtr<indirectPrimitivePatch>::New
86Foam::zoneCellStencils::allCoupledFacesPatch()
const
88 const polyBoundaryMesh&
patches = meshRef_.boundaryMesh();
92 for (
const polyPatch& pp :
patches)
96 nCoupled += pp.
size();
102 for (
const polyPatch& pp :
patches)
106 label facei = pp.start();
110 coupledFaces[nCoupled++] = facei++;
127void Foam::zoneCellStencils::validBoundaryFaces(
boolList& isValidBFace)
const
129 const polyBoundaryMesh&
patches = meshRef_.boundaryMesh();
131 isValidBFace.
setSize(meshRef_.nBoundaryFaces());
135 for (
const polyPatch& pp :
patches)
137 if (pp.coupled() || isA<emptyPolyPatch>(pp))
139 label bFacei = pp.start() - meshRef_.nInternalFaces();
142 isValidBFace[bFacei++] =
false;
149void Foam::zoneCellStencils::merge
157 for (
const label celli : cCells)
159 if (celli != globalI)
165 for (
const label celli : pGlobals)
167 if (celli != globalI)
173 cCells.setSize(
set.size()+1);
175 cCells[
n++] = globalI;
177 for (
const label seti : set)
184void Foam::zoneCellStencils::insertFaceCells
186 const label exclude0,
187 const label exclude1,
193 const labelList& own = meshRef_.faceOwner();
194 const labelList& nei = meshRef_.faceNeighbour();
196 for (
const label facei : faceLabels)
198 const label globalOwn = globalNumbering().toGlobal(own[facei]);
199 if (globalOwn != exclude0 && globalOwn != exclude1)
201 globals.insert(globalOwn);
204 if (meshRef_.isInternalFace(facei))
206 const label globalNei = globalNumbering().toGlobal(nei[facei]);
207 if (globalNei != exclude0 && globalNei != exclude1)
209 globals.insert(globalNei);
214 const label bFacei = facei - meshRef_.nInternalFaces();
216 if (isValidBFace[bFacei])
218 label globalI = globalNumbering().toGlobal
224 if (globalI != exclude0 && globalI != exclude1)
226 globals.insert(globalI);
252 return globals.toc();
258Foam::zoneCellStencils::zoneCellStencils(
const fvMesh&
mesh)
263 globalNumbering_(meshRef_.nCells() + meshRef_.nBoundaryFaces())
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label newLen)
Same as resize()
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
label size() const noexcept
The number of elements in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
base class for cell stencil in a narrow band
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
List< label > labelList
A List of labels.
List< labelList > labelListList
A List of labelList.
List< bool > boolList
A List of bools.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
#define forAll(list, i)
Loop across all elements in list.