| 43 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 44 | |
| 45 | void Foam::MRFZone::setMRFFaces() |
| 46 | { |
| 47 | const polyBoundaryMesh& patches = mesh_.boundaryMesh(); |
| 48 | |
| 49 | // Type per face: |
| 50 | // 0:not in zone |
| 51 | // 1:moving with frame |
| 52 | // 2:other |
| 53 | labelList faceType(mesh_.nFaces(), 0); |
| 54 | |
| 55 | // Determine faces in cell zone |
| 56 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 57 | // (without constructing cells) |
| 58 | |
| 59 | const labelList& own = mesh_.faceOwner(); |
| 60 | const labelList& nei = mesh_.faceNeighbour(); |
| 61 | |
| 62 | // Cells in zone |
| 63 | boolList zoneCell(mesh_.nCells(), false); |
| 64 | |
| 65 | if (cellZoneID_ != -1) |
| 66 | { |
| 67 | const labelList& cellLabels = mesh_.cellZones()[cellZoneID_]; |
| 68 | forAll(cellLabels, i) |
| 69 | { |
| 70 | zoneCell[cellLabels[i]] = true; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | |
| 75 | label nZoneFaces = 0; |
| 76 | |
| 77 | for (label facei = 0; facei < mesh_.nInternalFaces(); facei++) |
| 78 | { |
| 79 | if (zoneCell[own[facei]] || zoneCell[nei[facei]]) |
| 80 | { |
| 81 | faceType[facei] = 1; |
| 82 | nZoneFaces++; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | |
| 87 | labelHashSet excludedPatches(excludedPatchLabels_); |
| 88 | |
| 89 | forAll(patches, patchi) |
| 90 | { |
| 91 | const polyPatch& pp = patches[patchi]; |
| 92 | |
| 93 | if (pp.coupled() || excludedPatches.found(patchi)) |
| 94 | { |
| 95 | forAll(pp, i) |
| 96 | { |
| 97 | label facei = pp.start()+i; |
| 98 | |
| 99 | if (zoneCell[own[facei]]) |
| 100 | { |
| 101 | faceType[facei] = 2; |
| 102 | nZoneFaces++; |