| 240 | |
| 241 | |
| 242 | void 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 |
no test coverage detected