33 void Foam::patchWave::setChangedFaces
37 List<wallPoint>& faceDist
42 label nChangedFaces = 0;
46 if (patchIDs.found(
patchi))
48 const polyPatch& patch = mesh.boundaryMesh()[
patchi];
50 forAll(patch.faceCentres(), patchFacei)
52 label meshFacei = patch.start() + patchFacei;
54 changedFaces[nChangedFaces] = meshFacei;
56 faceDist[nChangedFaces] =
59 patch.faceCentres()[patchFacei],
70 Foam::label Foam::patchWave::getValues(
const MeshWave<wallPoint>& waveInfo)
72 const List<wallPoint>& cellInfo = waveInfo.allCellInfo();
73 const List<wallPoint>& faceInfo = waveInfo.allFaceInfo();
78 distance_.
setSize(cellInfo.size());
82 scalar dist = cellInfo[celli].distSqr();
84 if (cellInfo[celli].valid(waveInfo.data()))
90 distance_[celli] = dist;
104 patchDistance_.set(
patchi, patchDistPtr);
108 forAll(patchField, patchFacei)
110 label meshFacei = patch.start() + patchFacei;
112 scalar dist = faceInfo[meshFacei].distSqr();
114 if (faceInfo[meshFacei].valid(waveInfo.data()))
118 patchField[patchFacei] =
Foam::sqrt(dist) + small;
122 patchField[patchFacei] = dist;
138 const bool correctWalls
143 correctWalls_(correctWalls),
170 setChangedFaces(patchIDs_, changedFaces, faceDist);
178 mesh().globalData().nTotalCells()+1
182 nUnset_ = getValues(waveInfo);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
label sumPatchSize(const labelHashSet &patchIDs) const
Sum of patch sizes (out of supplied subset of patches).
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual ~patchWave()
Destructor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
void correctBoundaryFaceCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to boundary (via face). Sets values in.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
cellDistFuncs(const polyMesh &mesh)
Construct from mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void correctBoundaryPointCells(const labelHashSet &patchIDs, scalarField &wallDistCorrected, Map< label > &nearestFace) const
Correct all cells connected to wall (via point). Sets values in.
List< label > labelList
A List of labels.
virtual void correct()
Correct for mesh geom/topo changes.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
Mesh consisting of general polyhedral cells.
const polyMesh & mesh() const
Access mesh.
patchWave(const polyMesh &mesh, const labelHashSet &patchIDs, bool correctWalls=true)
Construct from mesh and patches to initialize to 0 and flag.