44 bool Foam::wallLayerCells::usesCoupledPatch(
const label celli)
const 48 const cell& cFaces =
mesh().
cells()[celli];
52 label facei = cFaces[cFacei];
81 HashTable<label> patchNameToIndex(
patches.size());
85 patchNameToIndex.insert(
patches[patchi].
name(), patchi);
96 if (patchNameToIndex.found(
name))
98 label patchi = patchNameToIndex[
name];
100 nWalls +=
patches[patchi].size();
105 List<wallNormalInfo> changedFacesInfo(nWalls);
109 label nChangedFaces = 0;
115 if (patchNameToIndex.found(
name))
117 label patchi = patchNameToIndex[
name];
123 label meshFacei =
pp.start() + patchFacei;
125 changedFaces[nChangedFaces] = meshFacei;
128 const vector& norm =
pp.faceNormals()[patchFacei];
130 changedFacesInfo[nChangedFaces] = wallNormalInfo(norm);
142 MeshWave<wallNormalInfo> regionCalc
150 regionCalc.iterate(nLayers);
157 const List<wallNormalInfo>& faceInfo = regionCalc.allFaceInfo();
163 OFstream fcStream(
"selectedFaces.obj");
169 const wallNormalInfo& info = faceInfo[facei];
171 if (info.valid(regionCalc.data()))
184 <<
"v " << mid.x() <<
' ' << mid.y() <<
' ' << mid.z()
191 <<
"v " <<
end.x() <<
' ' <<
end.y() <<
' ' <<
end.z()
195 fcStream <<
"l " << vertI <<
' ' <<vertI-1 <<
endl;
207 DynamicList<refineCell> refineCells(3*nWalls);
209 const List<wallNormalInfo>& cellInfo = regionCalc.allCellInfo();
213 const wallNormalInfo& info = cellInfo[celli];
215 if (info.valid(regionCalc.data()) && !usesCoupledPatch(celli))
217 refineCells.append(refineCell(celli, info.normal()));
wallLayerCells(const polyMesh &mesh, const List< word > &patchNames, const label nLayers)
Construct from components.
void transfer(List< refineCell > &list)
Transfer the contents of the argument List into this list and annul the argument list.
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellList & cells() const
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
wordList patchNames(nPatches)
virtual const faceList & faces() const
Return raw faces.
const polyMesh & mesh() const
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
vector point
Point is a vector.
const polyBoundaryMesh & patches
iterator end() noexcept
Return an iterator to end traversing the UList.
List< label > labelList
A List of labels.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
#define InfoInFunction
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)