Gets nearest wall for cells next to wall
| 269 | |
| 270 | // Gets nearest wall for cells next to wall |
| 271 | void Foam::cellDistFuncs::correctBoundaryFaceCells |
| 272 | ( |
| 273 | const labelHashSet& patchIDs, |
| 274 | scalarField& wallDistCorrected, |
| 275 | Map<label>& nearestFace |
| 276 | ) const |
| 277 | { |
| 278 | // Size neighbours array for maximum possible (= size of largest patch) |
| 279 | label maxPointNeighbours = maxPatchSize(patchIDs); |
| 280 | |
| 281 | labelList neighbours(maxPointNeighbours); |
| 282 | |
| 283 | |
| 284 | // Correct all cells with face on wall |
| 285 | const vectorField& cellCentres = mesh().cellCentres(); |
| 286 | const labelList& faceOwner = mesh().faceOwner(); |
| 287 | |
| 288 | forAll(mesh().boundaryMesh(), patchi) |
| 289 | { |
| 290 | if (patchIDs.found(patchi)) |
| 291 | { |
| 292 | const polyPatch& patch = mesh().boundaryMesh()[patchi]; |
| 293 | |
| 294 | // Check cells with face on wall |
| 295 | forAll(patch, patchFacei) |
| 296 | { |
| 297 | label nNeighbours = getPointNeighbours |
| 298 | ( |
| 299 | patch, |
| 300 | patchFacei, |
| 301 | neighbours |
| 302 | ); |
| 303 | |
| 304 | label celli = faceOwner[patch.start() + patchFacei]; |
| 305 | |
| 306 | label minFacei = -1; |
| 307 | |
| 308 | wallDistCorrected[celli] = smallestDist |
| 309 | ( |
| 310 | cellCentres[celli], |
| 311 | patch, |
| 312 | nNeighbours, |
| 313 | neighbours, |
| 314 | minFacei |
| 315 | ); |
| 316 | |
| 317 | // Store wallCell and its nearest neighbour |
| 318 | nearestFace.insert(celli, minFacei); |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | } |
| 324 | |
| 325 | |
| 326 | // Correct all cells connected to wall (via point) and not in nearestFace |