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