| 68 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 69 | |
| 70 | void Foam::pointToFace::combine(topoSet& set, const bool add) const |
| 71 | { |
| 72 | // Load the set |
| 73 | pointSet loadedSet(mesh_, setName_); |
| 74 | |
| 75 | if (option_ == ANY) |
| 76 | { |
| 77 | // Add faces with any point in loadedSet |
| 78 | forAllConstIter(pointSet, loadedSet, iter) |
| 79 | { |
| 80 | const label pointi = iter.key(); |
| 81 | const labelList& pFaces = mesh_.pointFaces()[pointi]; |
| 82 | |
| 83 | forAll(pFaces, pFacei) |
| 84 | { |
| 85 | addOrDelete(set, pFaces[pFacei], add); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | else if (option_ == ALL) |
| 90 | { |
| 91 | // Add all faces whose points are all in set. |
| 92 | |
| 93 | // Count number of points using face. |
| 94 | Map<label> numPoints(loadedSet.size()); |
| 95 | |
| 96 | forAllConstIter(pointSet, loadedSet, iter) |
| 97 | { |
| 98 | const label pointi = iter.key(); |
| 99 | const labelList& pFaces = mesh_.pointFaces()[pointi]; |
| 100 | |
| 101 | forAll(pFaces, pFacei) |
| 102 | { |
| 103 | const label facei = pFaces[pFacei]; |
| 104 | |
| 105 | Map<label>::iterator fndFace = numPoints.find(facei); |
| 106 | |
| 107 | if (fndFace == numPoints.end()) |
| 108 | { |
| 109 | numPoints.insert(facei, 1); |
| 110 | } |
| 111 | else |
| 112 | { |
| 113 | fndFace()++; |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | |
| 119 | // Include faces that are referenced as many times as there are points |
| 120 | // in face -> all points of face |
| 121 | forAllConstIter(Map<label>, numPoints, iter) |
| 122 | { |
| 123 | const label facei = iter.key(); |
| 124 | |
| 125 | if (iter() == mesh_.faces()[facei].size()) |
| 126 | { |
| 127 | addOrDelete(set, facei, add); |
no test coverage detected