35 void Foam::patchWave::setChangedFaces
39 List<wallPoint>& faceDist
44 label nChangedFaces = 0;
54 label meshFacei =
patch.start() + patchFacei;
56 changedFaces[nChangedFaces] = meshFacei;
58 faceDist[nChangedFaces] =
61 patch.faceCentres()[patchFacei],
72 Foam::label Foam::patchWave::getValues(
const MeshWave<wallPoint>& waveInfo)
74 const List<wallPoint>& cellInfo = waveInfo.allCellInfo();
75 const List<wallPoint>& faceInfo = waveInfo.allFaceInfo();
80 distance_.setSize(cellInfo.size());
84 scalar dist = cellInfo[celli].distSqr();
86 if (cellInfo[celli].valid(waveInfo.data()))
92 distance_[celli] = dist;
99 forAll(patchDistance_, patchi)
106 patchDistance_.
set(patchi, patchDistPtr);
110 forAll(patchField, patchFacei)
112 label meshFacei =
patch.start() + patchFacei;
114 scalar dist = faceInfo[meshFacei].distSqr();
116 if (faceInfo[meshFacei].valid(waveInfo.data()))
120 patchField[patchFacei] =
Foam::sqrt(dist) + SMALL;
124 patchField[patchFacei] = dist;
140 const bool correctWalls
145 correctWalls_(correctWalls),
147 distance_(
mesh.nCells()),
166 label nPatch = sumPatchSize(patchIDs_);
172 setChangedFaces(patchIDs_, changedFaces, faceDist);
180 mesh().globalData().nTotalCells()+1
184 nUnset_ = getValues(waveInfo);
191 correctBoundaryFaceCells
198 correctBoundaryPointCells
const labelList patchIDs(pbm.patchSet(polyPatchNames, false, true).sortedToc())
virtual ~patchWave()
Destructor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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)
#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.
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 std::string patch
OpenFOAM patch number as a std::string.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
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.