diff --git a/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C b/src/dynamicMesh/motionSmoother/badQualityToCell/badQualityToCell.C index 1284127080..062322da57 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 1b7ee0d2ac..c68d0b7351 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 b403151a59..9cb921f3dd 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 aa23317c56..f061205c8a 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 4cb8e1bfed..6421182264 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 7eb50853a6..9eda86e0f4 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 8d7d136530..508b187dc8 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 9d50ffa689..c4d453e308 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 cf57936c72..2ec9e8045d 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 5828a2ba81..43f2281067 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 4a62f60f72..eee88d9a4f 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 924de4ca6d..9f18e91cc4 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 26e0a619f1..8aa5b11704 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 10df22acf0..670dd99527 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 f4c8216e69..6bd0acdf3f 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 9fda5ad9ad..352e884ee2 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 0c164dc714..8c47d75418 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 5723b9962c..39a31e2c46 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