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

Function calcPointRegions

src/meshTools/regionSplit/localPointRegion.C:242–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240
241
242void Foam::localPointRegion::calcPointRegions
243(
244 const polyMesh& mesh,
245 boolList& candidatePoint
246)
247{
248 label nBnd = mesh.nFaces()-mesh.nInternalFaces();
249 const labelList& faceOwner = mesh.faceOwner();
250 const labelList& faceNeighbour = mesh.faceNeighbour();
251
252
253 syncTools::syncPointList
254 (
255 mesh,
256 candidatePoint,
257 orEqOp<bool>(),
258 false // nullValue
259 );
260
261
262 // Mark any face/boundaryFace/cell with a point on a candidate point.
263 // - candidateFace does not necessary have to be a baffle!
264 // - candidateFace is synchronised (since candidatePoint is)
265 Map<label> candidateFace(2*nBnd);
266 label candidateFacei = 0;
267
268 Map<label> candidateCell(nBnd);
269 label candidateCelli = 0;
270
271 forAll(mesh.faces(), facei)
272 {
273 const face& f = mesh.faces()[facei];
274
275 forAll(f, fp)
276 {
277 if (candidatePoint[f[fp]])
278 {
279 // Mark face
280 if (candidateFace.insert(facei, candidateFacei))
281 {
282 candidateFacei++;
283 }
284
285 // Mark cells
286 if (candidateCell.insert(faceOwner[facei], candidateCelli))
287 {
288 candidateCelli++;
289 }
290
291 if (mesh.isInternalFace(facei))
292 {
293 label nei = faceNeighbour[facei];
294 if (candidateCell.insert(nei, candidateCelli))
295 {
296 candidateCelli++;
297 }
298 }
299

Callers 2

localPointRegion.CFile · 0.70
mainFunction · 0.50

Calls 15

minFunction · 0.85
returnReduceFunction · 0.85
dummyTransformClass · 0.85
countPointRegionsFunction · 0.85
isInternalFaceMethod · 0.80
toGlobalMethod · 0.80
forAllFunction · 0.50
forAllConstIterFunction · 0.50
nFacesMethod · 0.45
nInternalFacesMethod · 0.45
facesMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected