From 7325e3ac7d190b4b051a660321e2ceeb6aa4b127 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 30 Oct 2018 15:09:44 +0000 Subject: [PATCH] ENH: topoSetSource::SUBTRACT enum action (#1060) - old 'DELETE' enum was easily confused with 'REMOVE', which removes the set, not the elements from the set. - provide corresponding subtractSet() method STYLE: HashSet set/unset instead of insert/erase methods in topoSetSource - simplifies switching to/from bitSet storage --- .../mesh/manipulation/setSet/setSet.C | 4 +-- .../mesh/manipulation/topoSet/topoSet.C | 6 ++-- .../badQualityToCell/badQualityToCell.C | 4 +-- .../badQualityToFace/badQualityToFace.C | 4 +-- .../sets/cellSources/boxToCell/boxToCell.C | 8 ++--- .../sets/cellSources/cellToCell/cellToCell.C | 6 ++-- .../cylinderAnnulusToCell.C | 4 +-- .../cylinderToCell/cylinderToCell.C | 4 +-- .../sets/cellSources/faceToCell/faceToCell.C | 4 +-- .../faceZoneToCell/faceZoneToCell.C | 4 +-- .../cellSources/fieldToCell/fieldToCell.C | 11 +++--- .../cellSources/labelToCell/labelToCell.C | 4 +-- .../sets/cellSources/nbrToCell/nbrToCell.C | 4 +-- .../cellSources/nearestToCell/nearestToCell.C | 4 +-- .../cellSources/pointToCell/pointToCell.C | 4 +-- .../cellSources/regionToCell/regionToCell.C | 4 +-- .../rotatedBoxToCell/rotatedBoxToCell.C | 8 ++--- .../cellSources/shapeToCell/shapeToCell.C | 4 +-- .../cellSources/sphereToCell/sphereToCell.C | 4 +-- .../cellSources/surfaceToCell/surfaceToCell.C | 4 +-- .../targetVolumeToCell/targetVolumeToCell.C | 4 +-- .../sets/cellSources/zoneToCell/zoneToCell.C | 4 +-- .../setToCellZone/setToCellZone.C | 26 +++++++------- .../boundaryToFace/boundaryToFace.C | 4 +-- .../sets/faceSources/boxToFace/boxToFace.C | 4 +-- .../sets/faceSources/cellToFace/cellToFace.C | 4 +-- .../cylinderAnnulusToFace.C | 4 +-- .../cylinderToFace/cylinderToFace.C | 4 +-- .../sets/faceSources/faceToFace/faceToFace.C | 6 ++-- .../faceSources/labelToFace/labelToFace.C | 4 +-- .../faceSources/normalToFace/normalToFace.C | 8 ++--- .../faceSources/patchToFace/patchToFace.C | 4 +-- .../faceSources/pointToFace/pointToFace.C | 4 +-- .../faceSources/regionToFace/regionToFace.C | 4 +-- .../sets/faceSources/zoneToFace/zoneToFace.C | 4 +-- .../faceZoneToFaceZone/faceZoneToFaceZone.C | 36 +++++++++---------- .../searchableSurfaceToFaceZone.C | 4 +-- .../setAndNormalToFaceZone.C | 36 +++++++++---------- .../setToFaceZone/setToFaceZone.C | 36 +++++++++---------- .../setsToFaceZone/setsToFaceZone.C | 36 +++++++++---------- .../sets/pointSources/boxToPoint/boxToPoint.C | 4 +-- .../pointSources/cellToPoint/cellToPoint.C | 4 +-- .../pointSources/faceToPoint/faceToPoint.C | 4 +-- .../pointSources/labelToPoint/labelToPoint.C | 4 +-- .../nearestToPoint/nearestToPoint.C | 4 +-- .../pointSources/pointToPoint/pointToPoint.C | 6 ++-- .../surfaceToPoint/surfaceToPoint.C | 4 +-- .../pointSources/zoneToPoint/zoneToPoint.C | 4 +-- .../setToPointZone/setToPointZone.C | 26 +++++++------- .../sets/topoSetSource/topoSetSource.C | 21 +++++------ .../sets/topoSetSource/topoSetSource.H | 29 +++++++-------- src/meshTools/sets/topoSets/cellZoneSet.C | 4 +-- src/meshTools/sets/topoSets/cellZoneSet.H | 4 +-- src/meshTools/sets/topoSets/faceSet.C | 4 +-- src/meshTools/sets/topoSets/faceZoneSet.C | 6 ++-- src/meshTools/sets/topoSets/faceZoneSet.H | 4 +-- src/meshTools/sets/topoSets/pointSet.C | 4 +-- src/meshTools/sets/topoSets/pointZoneSet.C | 4 +-- src/meshTools/sets/topoSets/pointZoneSet.H | 4 +-- src/meshTools/sets/topoSets/topoSet.C | 20 +++++++---- src/meshTools/sets/topoSets/topoSet.H | 6 +++- src/meshTools/surfaceSets/surfaceSets.C | 6 ++-- src/overset/regionsToCell/regionsToCell.C | 4 +-- .../LES/compartmentFire/system/topoSetDict | 8 +---- .../twoSimpleRotors/system/topoSetDict | 2 +- .../externalSolarLoad/system/topoSetDict | 4 +-- .../twoSimpleRotors/system/topoSetDict | 2 +- .../RAS/TJunctionFan/system/topoSetDict | 2 +- .../simpleFoam/pipeCyclic/system/topoSetDict | 2 +- .../hotBoxes/createObstacle.setSet | 8 ++--- .../hotBoxes/system/topoSetDict | 8 ++--- .../foamyHexMesh/flange/system/faceSetDict | 4 +-- .../flange/system/topoSetDict-background | 2 +- .../simple-cube1/system/topoSetDict | 4 +-- .../laminar/sphereDrop/system/topoSetDict | 2 +- .../createObstacle.setSet | 2 +- .../damBreakWithObstacle/system/topoSetDict | 2 +- .../damBreakWithObstacle/system/topoSetDict | 2 +- .../twoSimpleRotors/system/topoSetDict | 2 +- 79 files changed, 288 insertions(+), 283 deletions(-) diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index bc800b920a..fa48186c90 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -132,9 +132,9 @@ void printHelp(Ostream& os) << " clear - clears the set" << nl << " invert - inverts the set" << nl << " remove - remove the set" << nl - << " new - sets to set to the source set" << nl + << " new - use all elements from the source set" << nl << " add - adds all elements from the source set" << nl - << " delete - deletes ,," << nl + << " subtract - subtract the source set elements" << nl << " subset - combines current set with the source set" << nl << nl diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C index f08ea75169..a9cd056c58 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C +++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C @@ -247,8 +247,8 @@ int main(int argc, char *argv[]) autoPtr currentSet; if ( - (action == topoSetSource::NEW) - || (action == topoSetSource::CLEAR) + action == topoSetSource::NEW + || action == topoSetSource::CLEAR ) { currentSet = topoSet::New(setType, mesh, setName, 10000); @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) { case topoSetSource::NEW: case topoSetSource::ADD: - case topoSetSource::DELETE: + case topoSetSource::SUBTRACT: { const word sourceName(dict.get("source")); diff --git a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C index 81788a5703..1284127080 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C +++ b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C @@ -114,12 +114,12 @@ void Foam::badQualityToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding bad-quality cells" << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing bad-quality cells" << endl; combine(set, false); diff --git a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C index d98621d524..1b7ee0d2ac 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C +++ b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C @@ -110,12 +110,12 @@ void Foam::badQualityToFace::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding bad-quality faces" << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing bad-quality faces" << endl; combine(set, false); diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C index 5d4b7bcd4c..b403151a59 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C @@ -142,15 +142,15 @@ void Foam::boxToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with center within boxes " << bbs_ << endl; + Info<< " Adding cells with centre within boxes " << bbs_ << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with center within boxes " << bbs_ << endl; + Info<< " Removing cells with centre within boxes " << bbs_ << endl; combine(set, false); } diff --git a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C b/src/meshTools/sets/cellSources/cellToCell/cellToCell.C index 565ad65e34..aa23317c56 100644 --- a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C +++ b/src/meshTools/sets/cellSources/cellToCell/cellToCell.C @@ -94,7 +94,7 @@ void Foam::cellToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::ADD) || (action == topoSetSource::NEW)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all elements of cellSet " << setName_ << " ..." << endl; @@ -104,7 +104,7 @@ void Foam::cellToCell::applyToSet set.addSet(loadedSet); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing all elements of cellSet " << setName_ << " ..." << endl; @@ -112,7 +112,7 @@ void Foam::cellToCell::applyToSet // Load the set cellSet loadedSet(mesh_, setName_); - set.deleteSet(loadedSet); + set.subtractSet(loadedSet); } } diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C index 033b7602ce..4cb8e1bfed 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C @@ -158,7 +158,7 @@ void Foam::cylinderAnnulusToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells with centre within cylinder annulus," << " with p1 = " @@ -168,7 +168,7 @@ void Foam::cylinderAnnulusToCell::applyToSet combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells with centre within cylinder annulus," << " with p1 = " diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C index 910868d171..7eb50853a6 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C @@ -142,7 +142,7 @@ void Foam::cylinderToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells with centre within cylinder, with p1 = " << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ @@ -150,7 +150,7 @@ void Foam::cylinderToCell::applyToSet combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells with centre within cylinder, with p1 = " << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C index 5966d80fa2..8d7d136530 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C @@ -176,14 +176,14 @@ void Foam::faceToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells according to faceSet " << setName_ << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells according to faceSet " << setName_ << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 8079cd72d0..9d50ffa689 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -159,7 +159,7 @@ void Foam::faceZoneToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all " << faceActionNames_[option_] << " cells of face zones " @@ -167,7 +167,7 @@ void Foam::faceZoneToCell::applyToSet combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing all " << faceActionNames_[option_] << " cells of face zones " diff --git a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C index c12bbab2c4..cf57936c72 100644 --- a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C +++ b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C @@ -74,10 +74,9 @@ void Foam::fieldToCell::applyToSet topoSet& set ) const { - Info<< " Field min:" << min(field) - << " max:" << max(field) << endl; + Info<< " Field min:" << min(field) << " max:" << max(field) << endl; - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all cells with value of field " << fieldName_ << " within range " << min_ << ".." << max_ << endl; @@ -86,11 +85,11 @@ void Foam::fieldToCell::applyToSet { if (field[celli] >= min_ && field[celli] <= max_) { - set.insert(celli); + set.set(celli); } } } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing all cells with value of field " << fieldName_ << " within range " << min_ << ".." << max_ << endl; @@ -99,7 +98,7 @@ void Foam::fieldToCell::applyToSet { if (field[celli] >= min_ && field[celli] <= max_) { - set.erase(celli); + set.unset(celli); } } } diff --git a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C index a314644f5e..5828a2ba81 100644 --- a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C +++ b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C @@ -116,13 +116,13 @@ void Foam::labelToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells mentioned in dictionary" << " ..." << endl; addOrDelete(set, labels_, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells mentioned in dictionary" << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C index 7201163abc..4a62f60f72 100644 --- a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C +++ b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C @@ -151,14 +151,14 @@ void Foam::nbrToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells with only " << minNbrs_ << " or less" " neighbouring cells" << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells with only " << minNbrs_ << " or less" " neighbouring cells" << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C b/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C index 1894e5ec82..924de4ca6d 100644 --- a/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C +++ b/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C @@ -152,13 +152,13 @@ void Foam::nearestToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells nearest to " << points_ << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells nearest to " << points_ << endl; diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C index 03fa90f113..26e0a619f1 100644 --- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C @@ -159,14 +159,14 @@ void Foam::pointToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells according to pointSet " << setName_ << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells according to pointSet " << setName_ << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C index 4d5b22b4c2..10df22acf0 100644 --- a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C @@ -432,14 +432,14 @@ void Foam::regionToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all cells of connected region containing points " << insidePoints_ << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing all cells of connected region containing points " << insidePoints_ << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C index db7cde1c75..f4c8216e69 100644 --- a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C +++ b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C @@ -176,15 +176,15 @@ void Foam::rotatedBoxToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with center within rotated box " << endl; + Info<< " Adding cells with centre within rotated box " << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with center within rotated box " << endl; + Info<< " Removing cells with centre within rotated box " << endl; combine(set, false); } diff --git a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C index 5bdbe838e6..9fda5ad9ad 100644 --- a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C +++ b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C @@ -142,13 +142,13 @@ void Foam::shapeToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all cells of type " << type_ << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing all cells of type " << type_ << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C index c79625b627..0c164dc714 100644 --- a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C +++ b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C @@ -129,14 +129,14 @@ void Foam::sphereToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells within a sphere with centre = " << origin_ << " and radius = " << radius_ << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells within a sphere with centre = " << origin_ << " and radius = " << radius_ << endl; diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index 04cd8842e1..5723b9962c 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C @@ -487,14 +487,14 @@ void Foam::surfaceToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells in relation to surface " << surfName_ << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells in relation to surface " << surfName_ << " ..." << endl; diff --git a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C index bf34accc7f..12862a2ada 100644 --- a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C +++ b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C @@ -327,14 +327,14 @@ void Foam::targetVolumeToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding cells up to target volume " << vol_ << " out of total volume " << gSum(mesh_.cellVolumes()) << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing cells up to target volume " << vol_ << " out of total volume " << gSum(mesh_.cellVolumes()) << endl; diff --git a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C index 81959a589b..16003df577 100644 --- a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C +++ b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C @@ -152,14 +152,14 @@ void Foam::zoneToCell::applyToSet topoSet& set ) const { - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all cells of cell zones " << flatOutput(selectedZones_) << " ..." << endl; combine(set, true); } - else if (action == topoSetSource::DELETE) + else if (action == topoSetSource::SUBTRACT) { Info<< " Removing all cells of cell zones " << flatOutput(selectedZones_) << " ..." << endl; diff --git a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C index 0a6e6e8fe9..51c55942d2 100644 --- a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C +++ b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C @@ -96,9 +96,9 @@ void Foam::setToCellZone::applyToSet } else { - cellZoneSet& fzSet = refCast(set); + cellZoneSet& zoneSet = refCast(set); - if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if (action == topoSetSource::ADD || action == topoSetSource::NEW) { Info<< " Adding all cells from cellSet " << setName_ << " ..." << endl; @@ -107,20 +107,20 @@ void Foam::setToCellZone::applyToSet cellSet fSet(mesh_, setName_); // Start off from copy - DynamicList