| 325 | |
| 326 | |
| 327 | void faceZoneSet::sync(const polyMesh& mesh) |
| 328 | { |
| 329 | // Make sure that the faceZone is consistent with the faceSet |
| 330 | { |
| 331 | const labelHashSet zoneSet(addressing_); |
| 332 | |
| 333 | // Get elements that are in zone but not faceSet |
| 334 | labelHashSet badSet(zoneSet); |
| 335 | badSet -= *this; |
| 336 | |
| 337 | // Add elements that are in faceSet but not in zone |
| 338 | labelHashSet fSet(*this); |
| 339 | fSet -= zoneSet; |
| 340 | |
| 341 | badSet += fSet; |
| 342 | |
| 343 | label nBad = returnReduce(badSet.size(), sumOp<label>()); |
| 344 | |
| 345 | if (nBad) |
| 346 | { |
| 347 | WarningInFunction << "Detected " << nBad |
| 348 | << " faces that are in the faceZone but not" |
| 349 | << " in the faceSet or vice versa." |
| 350 | << " The faceZoneSet should only be manipulated" |
| 351 | << " using " << setsToFaceZone::typeName |
| 352 | << " or " << setToFaceZone::typeName << endl; |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | |
| 357 | // Make sure that on coupled faces orientation is opposite. Pushes |
| 358 | // master orientation to slave in case of conflict. |
| 359 | |
| 360 | |
| 361 | // 0 : not in faceZone |
| 362 | // 1 : in faceZone and unflipped |
| 363 | //-1 : in faceZone and flipped |
| 364 | const label UNFLIPPED = 1; |
| 365 | const label FLIPPED = -1; |
| 366 | labelList myZoneFace(mesh.nFaces()-mesh.nInternalFaces(), 0); |
| 367 | |
| 368 | forAll(addressing_, i) |
| 369 | { |
| 370 | label bFacei = addressing_[i]-mesh.nInternalFaces(); |
| 371 | |
| 372 | if (bFacei >= 0) |
| 373 | { |
| 374 | if (flipMap_[i]) |
| 375 | { |
| 376 | myZoneFace[bFacei] = FLIPPED; |
| 377 | } |
| 378 | else |
| 379 | { |
| 380 | myZoneFace[bFacei] = UNFLIPPED; |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 |
nothing calls this directly
no test coverage detected