MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / correctBoundaryPointCells

Function correctBoundaryPointCells

src/meshTools/cellDist/cellDistFuncs.C:327–379  ·  view source on GitHub ↗

Correct all cells connected to wall (via point) and not in nearestFace

Source from the content-addressed store, hash-verified

325
326// Correct all cells connected to wall (via point) and not in nearestFace
327void Foam::cellDistFuncs::correctBoundaryPointCells
328(
329 const labelHashSet& patchIDs,
330 scalarField& wallDistCorrected,
331 Map<label>& nearestFace
332) const
333{
334 // Correct all (non-visited) cells with point on wall
335
336 const vectorField& cellCentres = mesh().cellCentres();
337
338 forAll(mesh().boundaryMesh(), patchi)
339 {
340 if (patchIDs.found(patchi))
341 {
342 const polyPatch& patch = mesh().boundaryMesh()[patchi];
343
344 const labelList& meshPoints = patch.meshPoints();
345 const labelListList& pointFaces = patch.pointFaces();
346
347 forAll(meshPoints, meshPointi)
348 {
349 label vertI = meshPoints[meshPointi];
350
351 const labelList& neighbours = mesh().pointCells(vertI);
352
353 forAll(neighbours, neighbourI)
354 {
355 label celli = neighbours[neighbourI];
356
357 if (!nearestFace.found(celli))
358 {
359 const labelList& wallFaces = pointFaces[meshPointi];
360
361 label minFacei = -1;
362
363 wallDistCorrected[celli] = smallestDist
364 (
365 cellCentres[celli],
366 patch,
367 wallFaces.size(),
368 wallFaces,
369 minFacei
370 );
371
372 // Store wallCell and its nearest neighbour
373 nearestFace.insert(celli, minFacei);
374 }
375 }
376 }
377 }
378 }
379}
380
381
382// ************************************************************************* //

Callers 2

patchDataWave.CFile · 0.85
correctFunction · 0.85

Calls 5

meshFunction · 0.85
forAllFunction · 0.50
foundMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected