Determine faces cut by surface and use to divide cells into types. See cellInfo. All cells reachable from outsidePts are considered to be of type 'outside'
| 245 | // cellInfo. All cells reachable from outsidePts are considered to be of type |
| 246 | // 'outside' |
| 247 | void Foam::cellClassification::markCells |
| 248 | ( |
| 249 | const meshSearch& queryMesh, |
| 250 | const boolList& piercedFace, |
| 251 | const pointField& outsidePts |
| 252 | ) |
| 253 | { |
| 254 | // Use meshwave to partition mesh, starting from outsidePt |
| 255 | |
| 256 | |
| 257 | // Construct null; sets type to NOTSET |
| 258 | List<cellInfo> cellInfoList(mesh_.nCells()); |
| 259 | |
| 260 | // Mark cut cells first |
| 261 | forAll(piercedFace, facei) |
| 262 | { |
| 263 | if (piercedFace[facei]) |
| 264 | { |
| 265 | cellInfoList[mesh_.faceOwner()[facei]] = |
| 266 | cellInfo(cellClassification::CUT); |
| 267 | |
| 268 | if (mesh_.isInternalFace(facei)) |
| 269 | { |
| 270 | cellInfoList[mesh_.faceNeighbour()[facei]] = |
| 271 | cellInfo(cellClassification::CUT); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | // |
| 277 | // Mark cells containing outside points as being outside |
| 278 | // |
| 279 | |
| 280 | // Coarse guess number of faces |
| 281 | labelHashSet outsideFacesMap(outsidePts.size() * 6 * 2); |
| 282 | |
| 283 | forAll(outsidePts, outsidePtI) |
| 284 | { |
| 285 | // Use linear search for points. |
| 286 | label celli = queryMesh.findCell(outsidePts[outsidePtI], -1, false); |
| 287 | |
| 288 | if (returnReduce(celli, maxOp<label>()) == -1) |
| 289 | { |
| 290 | FatalErrorInFunction |
| 291 | << "outsidePoint " << outsidePts[outsidePtI] |
| 292 | << " is not inside any cell" |
| 293 | << nl << "It might be on a face or outside the geometry" |
| 294 | << exit(FatalError); |
| 295 | } |
| 296 | |
| 297 | if (celli >= 0) |
| 298 | { |
| 299 | cellInfoList[celli] = cellInfo(cellClassification::OUTSIDE); |
| 300 | |
| 301 | // Mark faces of celli |
| 302 | const labelList& myFaces = mesh_.cells()[celli]; |
| 303 | forAll(myFaces, myFacei) |
| 304 | { |
no test coverage detected