| 174 | |
| 175 | |
| 176 | void faceZoneSet::subset(const topoSet& set) |
| 177 | { |
| 178 | label nConflict = 0; |
| 179 | |
| 180 | DynamicList<label> newAddressing(addressing_.size()); |
| 181 | DynamicList<bool> newFlipMap(flipMap_.size()); |
| 182 | |
| 183 | Map<label> faceToIndex(addressing_.size()); |
| 184 | forAll(addressing_, i) |
| 185 | { |
| 186 | faceToIndex.insert(addressing_[i], i); |
| 187 | } |
| 188 | |
| 189 | const faceZoneSet& fSet = refCast<const faceZoneSet>(set); |
| 190 | |
| 191 | forAll(fSet.addressing(), i) |
| 192 | { |
| 193 | label facei = fSet.addressing()[i]; |
| 194 | |
| 195 | Map<label>::const_iterator iter = faceToIndex.find(facei); |
| 196 | |
| 197 | if (iter != faceToIndex.end()) |
| 198 | { |
| 199 | label index = iter(); |
| 200 | |
| 201 | if (fSet.flipMap()[i] != flipMap_[index]) |
| 202 | { |
| 203 | nConflict++; |
| 204 | } |
| 205 | newAddressing.append(facei); |
| 206 | newFlipMap.append(flipMap_[index]); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | if (nConflict > 0) |
| 211 | { |
| 212 | WarningInFunction |
| 213 | << "subset : there are " << nConflict |
| 214 | << " faces with different orientation in faceZonesSets " |
| 215 | << name() << " and " << set.name() << endl; |
| 216 | } |
| 217 | |
| 218 | addressing_.transfer(newAddressing); |
| 219 | flipMap_.transfer(newFlipMap); |
| 220 | updateSet(); |
| 221 | } |
| 222 | |
| 223 | |
| 224 | void faceZoneSet::addSet(const topoSet& set) |