44bool 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()))
173 const face&
f =
mesh.faces()[facei];
179 mid +=
mesh.points()[
f[fp]];
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()));
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.
void append(const T &val)
Copy append an element to the end of this list.
A HashTable similar to std::unordered_map.
bool found(const Key &key) const
Same as contains().
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< refineCell > &list)
label iterate(const label maxIter)
Iterate until no changes or maxIter reached.
const TrackingData & data() const noexcept
Additional data to be passed into container.
const List< Type > & allFaceInfo() const noexcept
Get allFaceInfo.
const List< Type > & allCellInfo() const noexcept
Get allCellInfo.
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
const polyMesh & mesh() const
A face is a list of labels corresponding to mesh vertices.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const cellList & cells() const
Container with cells to refine. Refinement given as single direction.
After construction is a list of <refineCell> of cells within a certain distance to the wall and with ...
wallLayerCells(const polyMesh &mesh, const List< word > &patchNames, const label nLayers)
Construct from components.
Holds information regarding nearest wall point. Used in wall refinement.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
const vector & normal() const
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
#define InfoInFunction
Report an information message using Foam::Info.
Namespace for handling debugging switches.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
wordList patchNames(nPatches)
#define forAll(list, i)
Loop across all elements in list.