36 void Foam::patchWave::setChangedFaces
39 DynamicList<label>& changedFaces,
40 DynamicList<wallPoint>& faceDist
51 const auto areaFraction(
patch.areaFraction());
53 const auto faceCentres(
patch.faceCentres());
55 forAll(faceCentres, patchFacei)
60 || (areaFraction()[patchFacei] > 0.5)
63 changedFaces.append(
patch.start() + patchFacei);
64 faceDist.append(wallPoint(faceCentres[patchFacei], 0.0));
70 for (
const label facei : sourceIDs_)
72 changedFaces.append(facei);
86 Foam::label Foam::patchWave::getValues(
const MeshWave<wallPoint>& waveInfo)
88 const List<wallPoint>& cellInfo = waveInfo.allCellInfo();
89 const List<wallPoint>& faceInfo = waveInfo.allFaceInfo();
94 distance_.setSize(cellInfo.size());
98 scalar dist = cellInfo[celli].distSqr();
100 if (cellInfo[celli].valid(waveInfo.data()))
106 distance_[celli] = dist;
113 forAll(patchDistance_, patchi)
120 patchDistance_.
set(patchi, patchDistPtr);
124 forAll(patchField, patchFacei)
126 label meshFacei =
patch.start() + patchFacei;
128 scalar dist = faceInfo[meshFacei].distSqr();
130 if (faceInfo[meshFacei].valid(waveInfo.data()))
134 patchField[patchFacei] =
Foam::sqrt(dist) + SMALL;
138 patchField[patchFacei] = dist;
154 const bool correctWalls,
160 correctWalls_(correctWalls),
162 distance_(
mesh.nCells()),
164 sourceIDs_(sourceIDs)
182 label nPatch = sumPatchSize(patchIDs_) + sourceIDs_.size();
188 setChangedFaces(patchIDs_, changedFaces, faceDist);
196 mesh().globalData().nTotalCells()+1
200 nUnset_ = getValues(waveInfo);
207 correctBoundaryFaceCells
214 correctBoundaryPointCells
const labelList patchIDs(pbm.indices(polyPatchNames, true))
virtual ~patchWave()
Destructor.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
dimensionedScalar sqrt(const dimensionedScalar &ds)
patchWave(const polyMesh &mesh, const labelHashSet &patchIDs, bool correctWalls=true, const labelList &sourceFaceIDs=labelList())
Construct from mesh and patches to initialize to 0 and flag.
#define forAll(list, i)
Loop across all elements in list.
Collection of functions used in wall distance calculation.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void correct()
Correct for mesh geom/topo changes.
const vectorField & faceCentres() const
const std::string patch
OpenFOAM patch number as a std::string.
Mesh consisting of general polyhedral cells.
const polyMesh & mesh() const
Access mesh.