Physically remove a set
| 355 | |
| 356 | // Physically remove a set |
| 357 | void removeSet |
| 358 | ( |
| 359 | const polyMesh& mesh, |
| 360 | const word& setType, |
| 361 | const word& setName |
| 362 | ) |
| 363 | { |
| 364 | // Remove the file |
| 365 | IOobjectList objects |
| 366 | ( |
| 367 | mesh, |
| 368 | mesh.time().findInstance |
| 369 | ( |
| 370 | polyMesh::meshSubDir/"sets", |
| 371 | word::null, |
| 372 | IOobject::READ_IF_PRESENT, |
| 373 | mesh.facesInstance() |
| 374 | ), |
| 375 | polyMesh::meshSubDir/"sets" |
| 376 | ); |
| 377 | |
| 378 | if (objects.found(setName)) |
| 379 | { |
| 380 | // Remove file |
| 381 | fileName object = objects[setName]->objectPath(); |
| 382 | Info<< "Removing file " << object << endl; |
| 383 | rm(object); |
| 384 | } |
| 385 | |
| 386 | // See if zone |
| 387 | if (setType == cellZoneSet::typeName) |
| 388 | { |
| 389 | removeZone |
| 390 | ( |
| 391 | const_cast<cellZoneMesh&>(mesh.cellZones()), |
| 392 | setName |
| 393 | ); |
| 394 | } |
| 395 | else if (setType == faceZoneSet::typeName) |
| 396 | { |
| 397 | removeZone |
| 398 | ( |
| 399 | const_cast<faceZoneMesh&>(mesh.faceZones()), |
| 400 | setName |
| 401 | ); |
| 402 | } |
| 403 | else if (setType == pointZoneSet::typeName) |
| 404 | { |
| 405 | removeZone |
| 406 | ( |
| 407 | const_cast<pointZoneMesh&>(mesh.pointZones()), |
| 408 | setName |
| 409 | ); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | |
| 414 | // Read command and execute. Return true if ok, false otherwise. |