diff --git a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C index 1284127080656d0d129a9309d3f27323f63883b5..062322da571169aff69591176e47f63b24c9a9d2 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C +++ b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C @@ -116,12 +116,20 @@ void Foam::badQualityToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding bad-quality cells" << endl; + if (verbose_) + { + Info<< " Adding bad-quality cells" << endl; + } + combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing bad-quality cells" << endl; + if (verbose_) + { + 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 1b7ee0d2ac671a068c24ac0c7a80e83880dc854f..c68d0b7351a060ddbae82d83a0847face00ff07d 100644 --- a/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C +++ b/src/dynamicMesh/motionSmoother/badQualityToFace/badQualityToFace.C @@ -112,12 +112,20 @@ void Foam::badQualityToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding bad-quality faces" << endl; + if (verbose_) + { + Info<< " Adding bad-quality faces" << endl; + } + combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing bad-quality faces" << endl; + if (verbose_) + { + 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 b403151a5905c233346fd213ec95b2235566fa89..9cb921f3dd872630aa789b998e7b87ef5f43177a 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C @@ -144,13 +144,21 @@ void Foam::boxToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with centre within boxes " << bbs_ << endl; + if (verbose_) + { + Info<< " Adding cells with centre within boxes " + << bbs_ << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with centre within boxes " << bbs_ << endl; + if (verbose_) + { + 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 aa23317c567fc4a2d4f7987889d654f3dc47c5e6..f061205c8a35a5954330c976f90433c2b5fd62d2 100644 --- a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C +++ b/src/meshTools/sets/cellSources/cellToCell/cellToCell.C @@ -96,8 +96,11 @@ void Foam::cellToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all elements of cellSet " << setName_ << " ..." - << endl; + if (verbose_) + { + Info<< " Adding all elements of cellSet " << setName_ + << " ..." << endl; + } // Load the set cellSet loadedSet(mesh_, setName_); @@ -106,8 +109,11 @@ void Foam::cellToCell::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all elements of cellSet " << setName_ << " ..." - << endl; + if (verbose_) + { + Info<< " Removing all elements of cellSet " << setName_ + << " ..." << endl; + } // Load the set cellSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C index 4cb8e1bfed3b8fe177c8c4a0f4fbe56629d490f7..6421182264f048fe57cf39ff7b8c1a872aa10726 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C @@ -160,21 +160,27 @@ void Foam::cylinderAnnulusToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with centre within cylinder annulus," - << " with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << outerRadius_ - << ", inner radius = " << innerRadius_ - << endl; + if (verbose_) + { + Info<< " Adding cells with centre within cylinder annulus," + << " with p1 = " << point1_ << ", p2 = " << point2_ + << ", radius = " << outerRadius_ + << ", inner radius = " << innerRadius_ + << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with centre within cylinder annulus," - << " with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << outerRadius_ - << ", inner radius = " << innerRadius_ - << endl; + if (verbose_) + { + Info<< " Removing cells with centre within cylinder annulus," + << " with p1 = " << point1_ << ", p2 = " << point2_ + << ", radius = " << outerRadius_ + << ", inner radius = " << innerRadius_ + << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C index 7eb50853a6cae3a92ca277392774fcb9984cf36b..9eda86e0f433fd26cc2f1bceb230808bae1214e2 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C @@ -144,17 +144,23 @@ void Foam::cylinderToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with centre within cylinder, with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ - << endl; + if (verbose_) + { + Info<< " Adding cells with centre within cylinder, with p1 = " + << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ + << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with centre within cylinder, with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ - << endl; + if (verbose_) + { + Info<< " Removing cells with centre within cylinder, with p1 = " + << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ + << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C index 8d7d136530782a2150bc3788d35a4894088def2b..508b187dc8908b028e05764293d2d087639c7bca 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C @@ -178,15 +178,21 @@ void Foam::faceToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells according to faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding cells according to faceSet " << setName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells according to faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing cells according to faceSet " << setName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 9d50ffa689bfddc623ceb684eaa3bb037d9c00a2..c4d453e308d4a83c37ebb32858c61732b9d6a6ca 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -78,9 +78,12 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const : zone.slaveCells() ); - Info<< " Found matching zone " << zone.name() - << " with " << cellLabels.size() << " cells on " - << faceActionNames_[option_] << " side" << endl; + if (verbose_) + { + Info<< " Found matching zone " << zone.name() + << " with " << cellLabels.size() << " cells on " + << faceActionNames_[option_] << " side" << endl; + } for (const label celli : cellLabels) { @@ -161,17 +164,23 @@ void Foam::faceZoneToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all " << faceActionNames_[option_] - << " cells of face zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Adding all " << faceActionNames_[option_] + << " cells of face zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all " << faceActionNames_[option_] - << " cells of face zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Removing all " << faceActionNames_[option_] + << " cells of face zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C index cf57936c72842b5b0eb1bcde21f4029d072e53a2..2ec9e8045dc7e67b4e5d77ca7e1f487e83dfc87c 100644 --- a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C +++ b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C @@ -74,12 +74,18 @@ void Foam::fieldToCell::applyToSet topoSet& set ) const { - Info<< " Field min:" << min(field) << " max:" << max(field) << endl; + if (verbose_) + { + Info << " Field min:" << min(field) << " max:" << max(field) << nl; + } if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all cells with value of field " << fieldName_ - << " within range " << min_ << ".." << max_ << endl; + if (verbose_) + { + Info<< " Adding all cells with value of field " << fieldName_ + << " within range " << min_ << ".." << max_ << endl; + } forAll(field, celli) { @@ -91,8 +97,11 @@ void Foam::fieldToCell::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells with value of field " << fieldName_ - << " within range " << min_ << ".." << max_ << endl; + if (verbose_) + { + Info<< " Removing all cells with value of field " << fieldName_ + << " within range " << min_ << ".." << max_ << endl; + } forAll(field, celli) { diff --git a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C index 5828a2ba81324289c55de87b565093ba7e110033..43f2281067fc5959234b0a8db8df3c0e0b23fa44 100644 --- a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C +++ b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C @@ -118,13 +118,21 @@ void Foam::labelToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells mentioned in dictionary" << " ..." << endl; + if (verbose_) + { + Info<< " Adding cells mentioned in dictionary" + << " ..." << endl; + } addOrDelete(set, labels_, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells mentioned in dictionary" << " ..." << endl; + if (verbose_) + { + Info<< " Removing cells mentioned in dictionary" + << " ..." << endl; + } addOrDelete(set, labels_, false); } diff --git a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C index 4a62f60f723849981ee2911db3301a4ab189a2db..eee88d9a4f193e63710735a0391f5c049d2421de 100644 --- a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C +++ b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C @@ -153,15 +153,21 @@ void Foam::nbrToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with only " << minNbrs_ << " or less" - " neighbouring cells" << " ..." << endl; + if (verbose_) + { + Info<< " Adding cells with only " << minNbrs_ + << " or fewer neighbouring cells" << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with only " << minNbrs_ << " or less" - " neighbouring cells" << " ..." << endl; + if (verbose_) + { + Info<< " Removing cells with only " << minNbrs_ + << " or fewer neighbouring cells" << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C b/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C index 924de4ca6dda0fdb0b4e8d91b225b067d1c748e8..9f18e91cc4a87ce4d25b7404cb04c814ba1a9317 100644 --- a/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C +++ b/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C @@ -154,13 +154,19 @@ void Foam::nearestToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells nearest to " << points_ << endl; + if (verbose_) + { + Info<< " Adding cells nearest to " << points_ << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells nearest to " << points_ << endl; + if (verbose_) + { + Info<< " Removing cells nearest to " << points_ << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C index 26e0a619f14c1d85cb5bf736475d19f3a94a9070..8aa5b11704cc3aac9a1624a2c046b8fb7b4f448c 100644 --- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C @@ -161,15 +161,21 @@ void Foam::pointToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells according to pointSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding cells according to pointSet " << setName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells according to pointSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing cells according to pointSet " << setName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C index 10df22acf0f70282a0a5a0cf0f188d98c083fed5..670dd99527ede81c726f48fdfc4a388b62d669fb 100644 --- a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C @@ -157,7 +157,7 @@ void Foam::regionToCell::unselectOutsideRegions regionSplit cellRegion(mesh_, blockedFace); // Determine regions containing insidePoints_ - boolList keepRegion(findRegions(true, cellRegion)); + boolList keepRegion(findRegions(verbose_, cellRegion)); // Go back to bool per cell forAll(cellRegion, celli) @@ -268,7 +268,7 @@ void Foam::regionToCell::erode regionSplit cellRegion(mesh_, blockedFace); // Determine regions containing insidePoints - boolList keepRegion(findRegions(true, cellRegion)); + boolList keepRegion(findRegions(verbose_, cellRegion)); // Extract cells in regions that are not to be kept. @@ -434,15 +434,23 @@ void Foam::regionToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all cells of connected region containing points " - << insidePoints_ << " ..." << endl; + if (verbose_) + { + Info<< " Adding all cells of connected region " + << "containing points " + << insidePoints_ << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells of connected region containing points " - << insidePoints_ << " ..." << endl; + if (verbose_) + { + Info<< " Removing all cells of connected region " + << "containing points " + << insidePoints_ << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C index f4c8216e691323051c017f05f2f44fbdfb1a94d6..6bd0acdf3ffbbbf75417c4f1b0b1dcc22f3ef57a 100644 --- a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C +++ b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C @@ -178,13 +178,21 @@ void Foam::rotatedBoxToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells with centre within rotated box " << endl; + if (verbose_) + { + Info<< " Adding cells with centre within rotated box" + << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells with centre within rotated box " << endl; + if (verbose_) + { + 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 9fda5ad9adadda964890ce90058ca93af801e0f3..352e884ee2e5a4f191f8eb83af9dc44705fefb82 100644 --- a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C +++ b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C @@ -144,13 +144,21 @@ void Foam::shapeToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all cells of type " << type_ << " ..." << endl; + if (verbose_) + { + Info<< " Adding all cells of type " << type_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells of type " << type_ << " ..." << endl; + if (verbose_) + { + Info<< " Removing all cells of type " << type_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C index 0c164dc714a62a998d9aa89887604f85a1d47c6b..8c47d754182c430586274d72782b371cf542724a 100644 --- a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C +++ b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C @@ -131,15 +131,21 @@ void Foam::sphereToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells within a sphere with centre = " - << origin_ << " and radius = " << radius_ << endl; + if (verbose_) + { + Info<< " Adding cells within a sphere with centre = " + << origin_ << " and radius = " << radius_ << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells within a sphere with centre = " - << origin_ << " and radius = " << radius_ << endl; + if (verbose_) + { + Info<< " Removing cells within a sphere with centre = " + << origin_ << " and radius = " << radius_ << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index 5723b9962c7689aa54b08bf5c50528b9b56e42c4..39a31e2c468b4dd299d27e01ae8ce882c4c57ca3 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C @@ -154,8 +154,11 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const //- Calculate for each searchPoint inside/outside status. boolList isInside(querySurf().calcInside(mesh_.cellCentres())); - Info<< " Marked inside/outside using surface orientation in = " - << timer.cpuTimeIncrement() << " s" << endl << endl; + if (verbose_) + { + Info<< " Marked inside/outside using surface orientation in = " + << timer.cpuTimeIncrement() << " s" << nl << endl; + } forAll(isInside, celli) { @@ -206,8 +209,11 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const ); - Info<< " Marked inside/outside using surface intersection in = " - << timer.cpuTimeIncrement() << " s" << endl << endl; + if (verbose_) + { + Info<< " Marked inside/outside using surface intersection in = " + << timer.cpuTimeIncrement() << " s" << nl << endl; + } //- Add/remove cells using set forAll(cellType, celli) @@ -250,8 +256,11 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const if (curvature_ < -1) { - Info<< " Selecting cells with cellCentre closer than " - << nearDist_ << " to surface" << endl; + if (verbose_) + { + Info<< " Selecting cells with cellCentre closer than " + << nearDist_ << " to surface" << endl; + } // No need to test curvature. Insert near cells into set. @@ -267,17 +276,22 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const } } - Info<< " Determined nearest surface point in = " - << timer.cpuTimeIncrement() << " s" << endl << endl; - + if (verbose_) + { + Info<< " Determined nearest surface point in = " + << timer.cpuTimeIncrement() << " s" << nl << endl; + } } else { // Test near cells for curvature - Info<< " Selecting cells with cellCentre closer than " - << nearDist_ << " to surface and curvature factor" - << " less than " << curvature_ << endl; + if (verbose_) + { + Info<< " Selecting cells with cellCentre closer than " + << nearDist_ << " to surface and curvature factor" + << " less than " << curvature_ << endl; + } // Cache for nearest surface triangle for a point Map<label> pointToNearest(mesh_.nCells()/10); @@ -307,8 +321,11 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const } } - Info<< " Determined nearest surface point in = " - << timer.cpuTimeIncrement() << " s" << endl << endl; + if (verbose_) + { + Info<< " Determined nearest surface point in = " + << timer.cpuTimeIncrement() << " s" << nl << endl; + } } } } @@ -489,15 +506,21 @@ void Foam::surfaceToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells in relation to surface " << surfName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding cells in relation to surface " << surfName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells in relation to surface " << surfName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing cells in relation to surface " << surfName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C index 12862a2adaf605ff59d2320aa6c3a37e944d0cb4..51f15800d5d6e0316b687361a6b67ca114d5d728 100644 --- a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C +++ b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C @@ -124,8 +124,11 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const if (maskSetName_.size()) { // Read cellSet - Info<< " Operating on subset defined by cellSet " << maskSetName_ - << endl; + if (verbose_) + { + Info<< " Operating on subset defined by cellSet " + << maskSetName_ << endl; + } maskSet = false; cellSet subset(mesh_, maskSetName_); @@ -262,9 +265,11 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const } - Info<< " Selected " << nSelected << " with actual volume " - << selectedVol << endl; - + if (verbose_) + { + Info<< " Selected " << nSelected << " with actual volume " + << selectedVol << endl; + } // Loop over selected cells only for (const label celli : selected) @@ -329,15 +334,23 @@ void Foam::targetVolumeToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding cells up to target volume " << vol_ - << " out of total volume " << gSum(mesh_.cellVolumes()) << endl; + if (verbose_) + { + Info<< " Adding cells up to target volume " << vol_ + << " out of total volume " + << gSum(mesh_.cellVolumes()) << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing cells up to target volume " << vol_ - << " out of total volume " << gSum(mesh_.cellVolumes()) << endl; + if (verbose_) + { + Info<< " Removing cells up to target volume " << vol_ + << " out of total volume " + << gSum(mesh_.cellVolumes()) << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C index 16003df577e43ca156f7ae74c1dcebf6d7277438..558622336a515811bff1925781099c31090ac342 100644 --- a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C +++ b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C @@ -76,8 +76,11 @@ void Foam::zoneToCell::combine(topoSet& set, const bool add) const const labelList& cellLabels = zone; - Info<< " Found matching zone " << zone.name() - << " with " << cellLabels.size() << " cells." << endl; + if (verbose_) + { + Info<< " Found matching zone " << zone.name() + << " with " << cellLabels.size() << " cells." << endl; + } for (const label celli : cellLabels) { @@ -154,15 +157,21 @@ void Foam::zoneToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all cells of cell zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Adding all cells of cell zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells of cell zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Removing all cells of cell zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C index 51c55942d2d817793040a4faaf1be2cb2c254084..55eca622f0e575cbe141c739301a0de7d708edc5 100644 --- a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C +++ b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C @@ -100,8 +100,11 @@ void Foam::setToCellZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all cells from cellSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding all cells from cellSet " << setName_ + << " ..." << endl; + } // Load the sets cellSet fSet(mesh_, setName_); @@ -122,8 +125,11 @@ void Foam::setToCellZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells from cellSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing all cells from cellSet " << setName_ + << " ..." << endl; + } // Load the set cellSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C b/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C index c788a3aeee51283eebfb438192cf83f963067e74..1875b9c9c88c9b282d8ede59bb93b2015017ee4f 100644 --- a/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C +++ b/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C @@ -115,13 +115,19 @@ void Foam::boundaryToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all boundary faces ..." << endl; + if (verbose_) + { + Info<< " Adding all boundary faces ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all boundary faces ..." << endl; + if (verbose_) + { + Info<< " Removing all boundary faces ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/boxToFace/boxToFace.C b/src/meshTools/sets/faceSources/boxToFace/boxToFace.C index 1a8bbd1d122c3686bc11302526ba6d53425766c6..3eef661de9632b2d38dfc538f625655075f8d7f5 100644 --- a/src/meshTools/sets/faceSources/boxToFace/boxToFace.C +++ b/src/meshTools/sets/faceSources/boxToFace/boxToFace.C @@ -144,13 +144,21 @@ void Foam::boxToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces with centre within boxes " << bbs_ << endl; + if (verbose_) + { + Info<< " Adding faces with centre within boxes " + << bbs_ << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces with centre within boxes " << bbs_ << endl; + if (verbose_) + { + Info<< " Removing faces with centre within boxes " + << bbs_ << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C index 4147aece2ca44fbd981d19dcb3a1ef14b0549d14..a5368ef03a81f4170b371657bdc7be531274220f 100644 --- a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C +++ b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C @@ -198,15 +198,21 @@ void Foam::cellToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces according to cellSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding faces according to cellSet " << setName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces according to cellSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing faces according to cellSet " << setName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C b/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C index 89db47312e323dd7c7f280d02995cbd6a853326f..b3f7ea64de68aff012c958bb376a4a7fba581f3b 100644 --- a/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C +++ b/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C @@ -160,21 +160,29 @@ void Foam::cylinderAnnulusToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces with centre within cylinder annulus," - << " with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << outerRadius_ - << ", inner radius = " << innerRadius_ - << endl; + if (verbose_) + { + Info<< " Adding faces with centre within cylinder annulus," + << " with p1 = " + << point1_ << ", p2 = " << point2_ + << ", radius = " << outerRadius_ + << ", inner radius = " << innerRadius_ + << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces with centre within cylinder annulus," - << " with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << outerRadius_ - << ", inner radius = " << innerRadius_ - << endl; + if (verbose_) + { + Info<< " Removing faces with centre within cylinder annulus," + << " with p1 = " + << point1_ << ", p2 = " << point2_ + << ", radius = " << outerRadius_ + << ", inner radius = " << innerRadius_ + << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C b/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C index ec993610b0588c09f5c75f38c0ecc7b01a128df5..a4806d99f701912d0eeaf931ac3a64f58420312b 100644 --- a/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C +++ b/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C @@ -144,17 +144,23 @@ void Foam::cylinderToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces with centre within cylinder, with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ - << endl; + if (verbose_) + { + Info<< " Adding faces with centre within cylinder, with p1 = " + << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ + << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces with centre within cylinder, with p1 = " - << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ - << endl; + if (verbose_) + { + Info<< " Removing faces with centre within cylinder, with p1 = " + << point1_ << ", p2 = " << point2_ << ", radius = " << radius_ + << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/faceToFace/faceToFace.C b/src/meshTools/sets/faceSources/faceToFace/faceToFace.C index 1bfa44e824d9a4c2805a0308004e2186219a845f..c94a4be4da2efb30a51e94309a5eb985ec089507 100644 --- a/src/meshTools/sets/faceSources/faceToFace/faceToFace.C +++ b/src/meshTools/sets/faceSources/faceToFace/faceToFace.C @@ -96,8 +96,11 @@ void Foam::faceToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces from faceSet " << setName_ << " ..." - << endl; + if (verbose_) + { + Info<< " Adding all faces from faceSet " << setName_ + << " ..." << endl; + } // Load the set faceSet loadedSet(mesh_, setName_); @@ -106,8 +109,11 @@ void Foam::faceToFace::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces from faceSet " << setName_ << " ..." - << endl; + if (verbose_) + { + Info<< " Removing all faces from faceSet " << setName_ + << " ..." << endl; + } // Load the set faceSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/faceSources/labelToFace/labelToFace.C b/src/meshTools/sets/faceSources/labelToFace/labelToFace.C index 0a6147550b90d0398a3b53e4de6418281ace57c9..16899058b0943e3a655f85a6c1abe1b173723cb2 100644 --- a/src/meshTools/sets/faceSources/labelToFace/labelToFace.C +++ b/src/meshTools/sets/faceSources/labelToFace/labelToFace.C @@ -122,13 +122,21 @@ void Foam::labelToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces mentioned in dictionary" << " ..." << endl; + if (verbose_) + { + Info<< " Adding faces mentioned in dictionary" + << " ..." << endl; + } addOrDelete(set, labels_, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces mentioned dictionary" << " ..." << endl; + if (verbose_) + { + Info<< " Removing faces mentioned dictionary" + << " ..." << endl; + } addOrDelete(set, labels_, false); } diff --git a/src/meshTools/sets/faceSources/normalToFace/normalToFace.C b/src/meshTools/sets/faceSources/normalToFace/normalToFace.C index 2bf77f2971002af19c64244c82daa48da7cce9e3..162bdf15ecb82fd9bf48350e20664aa2b3353d60 100644 --- a/src/meshTools/sets/faceSources/normalToFace/normalToFace.C +++ b/src/meshTools/sets/faceSources/normalToFace/normalToFace.C @@ -69,8 +69,6 @@ void Foam::normalToFace::setNormal() { normal_.normalise(); - Info<< " normalToFace : Normalized vector to " << normal_ << endl; - if (tol_ < -1 || tol_ > 1) { FatalErrorInFunction @@ -130,8 +128,11 @@ void Foam::normalToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces according to normal being aligned with " - << normal_ << " (to within " << tol_ << ") ..." << endl; + if (verbose_) + { + Info<< " Adding faces according to normal being aligned with " + << normal_ << " (to within " << tol_ << ") ..." << endl; + } forAll(mesh_.faceAreas(), facei) { @@ -145,8 +146,11 @@ void Foam::normalToFace::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces according to normal being aligned with " - << normal_ << " (to within " << tol_ << ") ..." << endl; + if (verbose_) + { + Info<< " Removing faces according to normal being aligned with " + << normal_ << " (to within " << tol_ << ") ..." << endl; + } DynamicList<label> toBeRemoved(set.size()/10); diff --git a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C index 46da30cbe9ae811c2b39920e81f97ecf85dac308..b2529bf378f82b85ad82c1c678514b103932652c 100644 --- a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C +++ b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C @@ -76,8 +76,11 @@ void Foam::patchToFace::combine(topoSet& set, const bool add) const { const polyPatch& pp = mesh_.boundaryMesh()[patchi]; - Info<< " Found matching patch " << pp.name() - << " with " << pp.size() << " faces." << endl; + if (verbose_) + { + Info<< " Found matching patch " << pp.name() + << " with " << pp.size() << " faces." << endl; + } for ( @@ -154,15 +157,21 @@ void Foam::patchToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces of patches " - << flatOutput(selectedPatches_) << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces of patches " + << flatOutput(selectedPatches_) << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces of patches " - << flatOutput(selectedPatches_) << " ..." << endl; + if (verbose_) + { + Info<< " Removing all faces of patches " + << flatOutput(selectedPatches_) << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C index 8b6d9168b911308a89c8d18a6f4327afb044b53a..ba32284bdec457854cb8e78c4362a98f4e552ae4 100644 --- a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C +++ b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C @@ -206,15 +206,21 @@ void Foam::pointToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding faces according to pointSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding faces according to pointSet " << setName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing faces according to pointSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing faces according to pointSet " << setName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/regionToFace/regionToFace.C b/src/meshTools/sets/faceSources/regionToFace/regionToFace.C index a5ebb929e785c04207bfa018c3328954ddb6e086..0bc632224002dff555066699f515bcb96db96684 100644 --- a/src/meshTools/sets/faceSources/regionToFace/regionToFace.C +++ b/src/meshTools/sets/faceSources/regionToFace/regionToFace.C @@ -124,8 +124,11 @@ void Foam::regionToFace::markZone void Foam::regionToFace::combine(topoSet& set, const bool add) const { - Info<< " Loading subset " << setName_ - << " to delimit search region." << endl; + if (verbose_) + { + Info<< " Loading subset " << setName_ + << " to delimit search region." << endl; + } faceSet subSet(mesh_, setName_); @@ -162,10 +165,13 @@ void Foam::regionToFace::combine(topoSet& set, const bool add) const // Globally reduce combineReduce(ni, mappedPatchBase::nearestEqOp()); - Info<< " Found nearest face at " << ni.first().rawPoint() - << " on processor " << ni.second().second() - << " face " << ni.first().index() - << " distance " << Foam::sqrt(ni.second().first()) << endl; + if (verbose_) + { + Info<< " Found nearest face at " << ni.first().rawPoint() + << " on processor " << ni.second().second() + << " face " << ni.first().index() + << " distance " << Foam::sqrt(ni.second().first()) << endl; + } labelList faceRegion(patch.size(), -1); markZone @@ -236,19 +242,23 @@ void Foam::regionToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces of connected region of set " - << setName_ - << " starting from point " - << nearPoint_ << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces of connected region of set " + << setName_ << " starting from point " << nearPoint_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells of connected region of set " - << setName_ - << " starting from point " - << nearPoint_ << " ..." << endl; + if (verbose_) + { + Info<< " Removing all cells of connected region of set " + << setName_ << " starting from point " << nearPoint_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C index becbcb66dc2c78caf56757b8f5ef9a44dab71537..dc392765001e9f1e5d8fe5ac053e1eaa9f9e56c4 100644 --- a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C +++ b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C @@ -76,8 +76,11 @@ void Foam::zoneToFace::combine(topoSet& set, const bool add) const const labelList& faceLabels = zone; - Info<< " Found matching zone " << zone.name() - << " with " << faceLabels.size() << " faces." << endl; + if (verbose_) + { + Info<< " Found matching zone " << zone.name() + << " with " << faceLabels.size() << " faces." << endl; + } for (const label facei : faceLabels) { @@ -154,15 +157,21 @@ void Foam::zoneToFace::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces of face zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces of face zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces of face zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Removing all faces of face zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C index db90f92d511b384cbc34c3b52ffeabe5a80cc411..d589d3d8c4606a2c85a869ca9b3f14372cab050b 100644 --- a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C @@ -100,8 +100,11 @@ void Foam::faceZoneToFaceZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces from faceZone " << setName_ << " ..." - << endl; + if (verbose_) + { + Info<< " Adding all faces from faceZone " << setName_ + << " ..." << endl; + } // Load the set faceZoneSet loadedSet(mesh_, setName_); @@ -123,8 +126,11 @@ void Foam::faceZoneToFaceZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces from faceZone " << setName_ << " ..." - << endl; + if (verbose_) + { + Info<< " Removing all faces from faceZone " << setName_ + << " ..." << endl; + } // Load the set faceZoneSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C index 90472163020a43d55fa08522a4ad1b2a9006a9c0..23121c3eb7ded68afe1336bc901cbafe5968c932 100644 --- a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C @@ -164,8 +164,11 @@ void Foam::searchableSurfaceToFaceZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces from surface " - << surfacePtr_().name() << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces from surface " + << surfacePtr_().name() << " ..." << endl; + } DynamicList<label> newAddressing(fzSet.addressing()); DynamicList<bool> newFlipMap(fzSet.flipMap()); @@ -186,8 +189,11 @@ void Foam::searchableSurfaceToFaceZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces from surface " - << surfacePtr_().name() << " ..." << endl; + if (verbose_) + { + Info<< " Removing all faces from surface " + << surfacePtr_().name() << " ..." << endl; + } // Start off empty DynamicList<label> newAddressing(fzSet.addressing().size()); diff --git a/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C b/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C index bd34ad6cf9349e211c4719dfe5f8f72c7e34e70b..1470d91960c305a53f4e553398bcd885f964ec34 100644 --- a/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C @@ -104,8 +104,11 @@ void Foam::setAndNormalToFaceZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces from faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces from faceSet " << setName_ + << " ..." << endl; + } // Load the sets faceSet loadedSet(mesh_, setName_); @@ -142,8 +145,11 @@ void Foam::setAndNormalToFaceZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces from faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing all faces from faceSet " << setName_ + << " ..." << endl; + } // Load the set faceSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C index 411512705af331f916177815934a4b55478b1cda..04228b9f439849901240979f957e77d55b34330b 100644 --- a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C @@ -101,8 +101,11 @@ void Foam::setToFaceZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces from faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces from faceSet " << setName_ + << " ..." << endl; + } // Load the sets faceSet loadedSet(mesh_, setName_); @@ -127,8 +130,11 @@ void Foam::setToFaceZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces from faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing all faces from faceSet " << setName_ + << " ..." << endl; + } // Load the set faceSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C index 776f0b06c97b9b4e161f35cd763b266805180582..0942e4474bc1a454c4b999753c5063218579af52 100644 --- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C @@ -110,8 +110,11 @@ void Foam::setsToFaceZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all faces from faceSet " << faceSetName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding all faces from faceSet " << faceSetName_ + << " ..." << endl; + } // Load the sets faceSet fSet(mesh_, faceSetName_); @@ -182,8 +185,11 @@ void Foam::setsToFaceZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all faces from faceSet " << faceSetName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing all faces from faceSet " << faceSetName_ + << " ..." << endl; + } // Load the set faceZoneSet loadedSet(mesh_, faceSetName_); diff --git a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C index add0cf7f4c0e861266a8ef6310fc1233450741b0..a76ea3aed61eaf993ba2c27957490e975210bf9d 100644 --- a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C +++ b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C @@ -144,15 +144,21 @@ void Foam::boxToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding points that are within boxes " << bbs_ << " ..." - << endl; + if (verbose_) + { + Info<< " Adding points that are within boxes " << bbs_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing points that are within boxes " << bbs_ << " ..." - << endl; + if (verbose_) + { + Info<< " Removing points that are within boxes " << bbs_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C index c18b5d37d2fdac786001d647b9af60af7dc72e81..3bc3ff3a719a7baa8fef586b60e86e5bd7ab88bc 100644 --- a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C +++ b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C @@ -135,13 +135,21 @@ void Foam::cellToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding from " << setName_ << " ..." << endl; + if (verbose_) + { + Info<< " Adding from " << setName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing from " << setName_ << " ..." << endl; + if (verbose_) + { + Info<< " Removing from " << setName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C index f2d50b750a71583ba7b794d705dad4c1921f10d9..3351a14ad6616401b6bb99a9597114513e596dcb 100644 --- a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C +++ b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C @@ -129,15 +129,21 @@ void Foam::faceToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding points from face in faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding points from face in faceSet " << setName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing points from face in faceSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing points from face in faceSet " << setName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C b/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C index 0e6455d7f6393c56c9d0ec9881dc5c45dc16a661..705c85c1fcfca6ac86188a07ea1e799b88f6499b 100644 --- a/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C +++ b/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C @@ -118,13 +118,21 @@ void Foam::labelToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding points mentioned in dictionary" << " ..." << endl; + if (verbose_) + { + Info<< " Adding points mentioned in dictionary" + << " ..." << endl; + } addOrDelete(set, labels_, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing points mentioned in dictionary" << " ..." << endl; + if (verbose_) + { + Info<< " Removing points mentioned in dictionary" + << " ..." << endl; + } addOrDelete(set, labels_, false); } diff --git a/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C b/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C index 240509ca457102f53342d38ea7a9c37898162b3a..8b48b2e7c5e8cb7296e1d44a073e61d22e2d2f51 100644 --- a/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C +++ b/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C @@ -169,13 +169,19 @@ void Foam::nearestToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding points nearest to " << points_ << endl; + if (verbose_) + { + Info<< " Adding points nearest to " << points_ << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing points nearest to " << points_ << endl; + if (verbose_) + { + Info<< " Removing points nearest to " << points_ << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C b/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C index ebab5698dcfd489179045bd0c4d66e7ad0e1316a..5ede16171a831044789b67b962823196f6ae0f97 100644 --- a/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C +++ b/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C @@ -92,7 +92,11 @@ void Foam::pointToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all from pointSet " << setName_ << " ..." << endl; + if (verbose_) + { + Info<< " Adding all from pointSet " << setName_ + << " ..." << endl; + } // Load the set pointSet loadedSet(mesh_, setName_); @@ -101,7 +105,11 @@ void Foam::pointToPoint::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all from pointSet " << setName_ << " ..." << endl; + if (verbose_) + { + Info<< " Removing all from pointSet " << setName_ + << " ..." << endl; + } // Load the set pointSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C b/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C index d44b69e3a1029b1e5557e8275742f487e533de97..df45bddc992dbfff58f9cad40a20480540489e04 100644 --- a/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C +++ b/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C @@ -63,8 +63,11 @@ void Foam::surfaceToPoint::combine(topoSet& set, const bool add) const triSurface surf(surfName_, scale_); - Info<< " Read surface from " << surfName_ - << " in = "<< timer.cpuTimeIncrement() << " s" << endl << endl; + if (verbose_) + { + Info<< " Read surface from " << surfName_ + << " in = "<< timer.cpuTimeIncrement() << " s" << nl << endl; + } // Construct search engine on surface triSurfaceSearch querySurf(surf); @@ -190,15 +193,21 @@ void Foam::surfaceToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding points in relation to surface " << surfName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding points in relation to surface " << surfName_ + << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing points in relation to surface " << surfName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing points in relation to surface " << surfName_ + << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C index 3781ff5ccb939aa8977afea9056a207178f9c761..42ae6637948811180fcbd5cb2882ff4c886052ea 100644 --- a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C +++ b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C @@ -76,8 +76,11 @@ void Foam::zoneToPoint::combine(topoSet& set, const bool add) const const labelList& pointLabels = zone; - Info<< " Found matching zone " << zone.name() - << " with " << pointLabels.size() << " points." << endl; + if (verbose_) + { + Info<< " Found matching zone " << zone.name() + << " with " << pointLabels.size() << " points." << endl; + } for (const label pointi : pointLabels) { @@ -154,15 +157,21 @@ void Foam::zoneToPoint::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all points of point zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Adding all points of point zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all points of point zones " - << flatOutput(selectedZones_) << " ..." << endl; + if (verbose_) + { + Info<< " Removing all points of point zones " + << flatOutput(selectedZones_) << " ..." << endl; + } combine(set, false); } diff --git a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C index c9b58da462dd4dea66f98b8c9ff8f74d4896854f..de2f8e58f2dbe0b2ea074e478344f086c80b82e0 100644 --- a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C +++ b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C @@ -100,8 +100,11 @@ void Foam::setToPointZone::applyToSet if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all points from pointSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Adding all points from pointSet " << setName_ + << " ..." << endl; + } // Load the sets pointSet loadedSet(mesh_, setName_); @@ -123,8 +126,11 @@ void Foam::setToPointZone::applyToSet } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all points from pointSet " << setName_ - << " ..." << endl; + if (verbose_) + { + Info<< " Removing all points from pointSet " << setName_ + << " ..." << endl; + } // Load the set pointSet loadedSet(mesh_, setName_); diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.C b/src/meshTools/sets/topoSetSource/topoSetSource.C index e31efe15c4ddfcdfdc5d240ed1ea6f71b33f1936..63370dd82a6723ac8c857f99b47fae4e1463e0ae 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.C +++ b/src/meshTools/sets/topoSetSource/topoSetSource.C @@ -201,7 +201,8 @@ void Foam::topoSetSource::addOrDelete Foam::topoSetSource::topoSetSource(const polyMesh& mesh) : - mesh_(mesh) + mesh_(mesh), + verbose_(true) {} diff --git a/src/meshTools/sets/topoSetSource/topoSetSource.H b/src/meshTools/sets/topoSetSource/topoSetSource.H index 67511f048e71a0de7fdea573eccd9b35f3715058..aed7e6557a7859a2603735f0f3d9bc43bd98ab8e 100644 --- a/src/meshTools/sets/topoSetSource/topoSetSource.H +++ b/src/meshTools/sets/topoSetSource/topoSetSource.H @@ -126,11 +126,14 @@ protected: }; - // Protected data + // Protected Data //- Reference to the mesh const polyMesh& mesh_; + //- Verbosity (default: true) + bool verbose_; + // Protected Member Functions @@ -289,6 +292,18 @@ public: return mesh_; } + //- Return the current verbosity + bool verbose() const + { + return verbose_; + } + + //- Set the current verbosity + void verbose(bool on) + { + verbose_ = on; + } + // Member Functions @@ -296,7 +311,11 @@ public: virtual sourceType setType() const = 0; //- Apply specified action to the topoSet - virtual void applyToSet(const setAction action, topoSet& set) const = 0; + virtual void applyToSet + ( + const setAction action, + topoSet& set + ) const = 0; }; diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index 3b92d5c2a3462c6fdd2d9dee06a657a225af2527..a7ddabcb7b95c7460aafb1aa61d456f4f516e24b 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -491,6 +491,30 @@ Foam::topoSet::topoSet(const IOobject& io, labelHashSet&& labels) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +bool Foam::topoSet::set(const label id) +{ + return static_cast<labelHashSet&>(*this).set(id); +} + + +bool Foam::topoSet::unset(const label id) +{ + return static_cast<labelHashSet&>(*this).unset(id); +} + + +void Foam::topoSet::set(const labelUList& labels) +{ + static_cast<labelHashSet&>(*this).set(labels); +} + + +void Foam::topoSet::unset(const labelUList& labels) +{ + static_cast<labelHashSet&>(*this).unset(labels); +} + + void Foam::topoSet::invert(const label maxLen) { // Retain a copy of the original (current) set. diff --git a/src/meshTools/sets/topoSets/topoSet.H b/src/meshTools/sets/topoSets/topoSet.H index 5d5794dac5cdfd96d31c725b13d894edd98ead58..7f4e1e958962a4e22c344a35d75683590a74b272 100644 --- a/src/meshTools/sets/topoSets/topoSet.H +++ b/src/meshTools/sets/topoSets/topoSet.H @@ -66,7 +66,6 @@ class topoSet public regIOobject, public labelHashSet { - protected: // Protected Member Functions @@ -312,7 +311,19 @@ public: virtual ~topoSet() = default; - // Member functions + // Member Functions + + //- Set an index + virtual bool set(const label id); + + //- Unset an index + virtual bool unset(const label id); + + //- Set multiple indices + virtual void set(const labelUList& labels); + + //- Unset multiple indices + virtual void unset(const labelUList& labels); //- Invert contents. // Insert all members [0,maxLen) which were not in set. diff --git a/src/overset/regionsToCell/regionsToCell.C b/src/overset/regionsToCell/regionsToCell.C index 500140f00ae60b1efc4e080742afa5ff814110de..24d29c5aebead5fbaaea35197e0595c82992ac36 100644 --- a/src/overset/regionsToCell/regionsToCell.C +++ b/src/overset/regionsToCell/regionsToCell.C @@ -189,7 +189,7 @@ void Foam::regionsToCell::unselectOutsideRegions regionSplit cellRegion(mesh_, blockedFace); // Determine regions containing insidePoints_ - boolList keepRegion(findRegions(true, selectedCell, cellRegion)); + boolList keepRegion(findRegions(verbose_, selectedCell, cellRegion)); // Go back to bool per cell forAll(cellRegion, cellI) @@ -298,7 +298,7 @@ void Foam::regionsToCell::erode regionSplit cellRegion(mesh_, blockedFace); // Determine regions containing insidePoints - boolList keepRegion(findRegions(true, shrunkSelectedCell, cellRegion)); + boolList keepRegion(findRegions(verbose_, shrunkSelectedCell, cellRegion)); // Extract cells in regions that are not to be kept. @@ -465,15 +465,23 @@ void Foam::regionsToCell::applyToSet { if (action == topoSetSource::ADD || action == topoSetSource::NEW) { - Info<< " Adding all cells of connected region containing points " - << insidePoints_ << " ..." << endl; + if (verbose_) + { + Info<< " Adding all cells of connected region " + << "containing points " + << insidePoints_ << " ..." << endl; + } combine(set, true); } else if (action == topoSetSource::SUBTRACT) { - Info<< " Removing all cells of connected region containing points " - << insidePoints_ << " ..." << endl; + if (verbose_) + { + Info<< " Removing all cells of connected region " + << "containing points " + << insidePoints_ << " ..." << endl; + } combine(set, false); }