| 242 | |
| 243 | |
| 244 | void Foam::fvMeshSubset::subsetZones() |
| 245 | { |
| 246 | // Keep all zones, even if zero size. |
| 247 | |
| 248 | const pointZoneMesh& pointZones = baseMesh().pointZones(); |
| 249 | |
| 250 | // PointZones |
| 251 | List<pointZone*> pZonePtrs(pointZones.size()); |
| 252 | |
| 253 | forAll(pointZones, i) |
| 254 | { |
| 255 | const pointZone& pz = pointZones[i]; |
| 256 | |
| 257 | pZonePtrs[i] = new pointZone |
| 258 | ( |
| 259 | pz.name(), |
| 260 | subset(baseMesh().nPoints(), pz, pointMap()), |
| 261 | i, |
| 262 | fvMeshSubsetPtr_().pointZones() |
| 263 | ); |
| 264 | } |
| 265 | |
| 266 | |
| 267 | // FaceZones |
| 268 | |
| 269 | const faceZoneMesh& faceZones = baseMesh().faceZones(); |
| 270 | |
| 271 | |
| 272 | // Do we need to remove zones where the side we're interested in |
| 273 | // no longer exists? Guess not. |
| 274 | List<faceZone*> fZonePtrs(faceZones.size()); |
| 275 | |
| 276 | forAll(faceZones, i) |
| 277 | { |
| 278 | const faceZone& fz = faceZones[i]; |
| 279 | |
| 280 | // Expand faceZone to full mesh |
| 281 | // +1 : part of faceZone, flipped |
| 282 | // -1 : ,, , unflipped |
| 283 | // 0 : not part of faceZone |
| 284 | labelList zone(baseMesh().nFaces(), 0); |
| 285 | forAll(fz, j) |
| 286 | { |
| 287 | if (fz.flipMap()[j]) |
| 288 | { |
| 289 | zone[fz[j]] = 1; |
| 290 | } |
| 291 | else |
| 292 | { |
| 293 | zone[fz[j]] = -1; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | // Select faces |
| 298 | label nSub = 0; |
| 299 | forAll(faceMap(), j) |
| 300 | { |
| 301 | if (zone[faceMap()[j]] != 0) |