From a1ccd1b7166392ee59ccff018c0efb28c7263341 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 1 May 2020 16:11:18 +0200 Subject: [PATCH] STYLE: use DebugInFunction macro --- .../laserDTRM/laserDTRM.C | 10 +- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 12 +- .../polyMesh/polyMeshCheck/polyMeshCheck.C | 32 ++---- src/OpenFOAM/meshes/polyMesh/polyMeshClear.C | 38 ++----- .../meshes/polyMesh/polyMeshFromShapeMesh.C | 16 +-- src/OpenFOAM/meshes/polyMesh/polyMeshIO.C | 13 +-- .../meshes/polyMesh/polyMeshInitMesh.C | 12 +- src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C | 9 +- .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 11 +- .../meshes/polyMesh/zones/faceZone/faceZone.C | 17 +-- .../meshes/polyMesh/zones/zone/zone.C | 12 +- .../primitiveMeshCheck/primitiveMeshCheck.C | 87 +++------------ .../faMesh/faMeshDemandDrivenData.C | 6 +- src/finiteArea/faMesh/faMeshUpdate.C | 19 +--- .../cfdTools/general/fvOptions/fvOptions.C | 11 +- .../turbulentDFSEMInletFvPatchVectorField.C | 11 +- .../fvPatchField/fvPatchFieldNew.C | 26 ++--- .../LeastSquaresGrad/LeastSquaresVectors.C | 13 +-- .../invDistLeastSquaresVectors.C | 12 +- .../leastSquaresGrad/leastSquaresVectors.C | 12 +- .../unweightedLeastSquaresVectors.C | 13 +-- .../CentredFitSnGrad/CentredFitSnGradData.C | 13 +-- .../fvMatrices/fvMatrix/fvMatrix.C | 42 ++----- src/finiteVolume/fvMesh/fvMesh.C | 105 +++++------------- src/finiteVolume/fvMesh/fvMeshGeometry.C | 38 ++----- .../schemes/CentredFitScheme/CentredFitData.C | 11 +- .../schemes/UpwindFitScheme/UpwindFitData.C | 11 +- .../skewCorrected/skewCorrectionVectors.C | 11 +- .../surfaceInterpolationScheme.C | 3 +- .../AMIInterpolationParallelOps.C | 15 +-- .../cyclicPeriodicAMIPolyPatch.C | 71 +++++------- src/meshTools/regionSplit/regionSplit.C | 14 +-- .../searchablePlate/searchablePlate.C | 25 ++--- .../pointToPointPlanarInterpolation.C | 26 ++--- .../distributedTriSurfaceMesh.C | 32 +++--- .../reactingOneDim/reactingOneDim.C | 17 +-- .../kinematicSingleLayer.C | 60 +++------- .../thermoSingleLayer/thermoSingleLayer.C | 44 ++------ .../thermalBaffle/thermalBaffle.C | 6 +- .../meshToMeshMethod/meshToMeshMethodNew.C | 7 +- .../meshToMesh/meshToMeshParallelOps.C | 25 ++--- .../calculateMeshToMesh0Addressing.C | 32 ++---- src/sampling/probes/patchProbes.C | 2 +- .../sampledSet/patchCloud/patchCloudSet.C | 12 +- .../sampledSet/patchSeed/patchSeedSet.C | 10 +- .../sampledSet/sampledSet/sampledSet.C | 25 ++--- .../readers/ensight/ensightSurfaceReader.C | 12 +- .../ensight/ensightSurfaceReaderTemplates.C | 20 +--- .../sampledPlane/sampledPlane.C | 14 +-- .../radiationModels/viewFactor/viewFactor.C | 28 ++--- .../solarCalculator/solarCalculator.C | 22 ++-- .../psiuReactionThermo/heheuPsiThermo.C | 13 +-- .../solidThermo/solidThermo/heSolidThermo.C | 12 +- .../liquidProperties/liquidProperties.C | 12 +- .../mixerFvMesh/mixerFvMesh.C | 14 +-- .../potentialFoam/cylinder/system/controlDict | 4 +- 56 files changed, 360 insertions(+), 840 deletions(-) diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C index 0da121430a..db0cebfc4f 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -175,11 +175,9 @@ void Foam::radiation::laserDTRM::initialise() const vector lPosition = focalLaserPosition_->value(t); const vector lDir = normalised(laserDirection_->value(t)); - if (debug) - { - Info << "Laser position : " << lPosition << endl; - Info << "Laser direction : " << lDir << endl; - } + DebugInfo + << "Laser position : " << lPosition << nl + << "Laser direction : " << lDir << endl; // Find a vector on the area plane. Normal to laser direction vector rArea = Zero; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 1be83502c8..4e1d725c89 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1091,8 +1091,7 @@ const Foam::pointField& Foam::polyMesh::oldPoints() const { if (debug) { - WarningInFunction - << endl; + WarningInFunction << endl; } oldPointsPtr_.reset(new pointField(points_)); @@ -1108,12 +1107,9 @@ Foam::tmp Foam::polyMesh::movePoints const pointField& newPoints ) { - if (debug) - { - InfoInFunction - << "Moving points for time " << time().value() - << " index " << time().timeIndex() << endl; - } + DebugInFunction + << "Moving points for time " << time().value() + << " index " << time().timeIndex() << endl; if (newPoints.size() != points_.size()) { diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C index 377a969df8..db054a267f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,10 +42,7 @@ bool Foam::polyMesh::checkFaceOrthogonality labelHashSet* setPtr ) const { - if (debug) - { - InfoInFunction << "Checking mesh non-orthogonality" << endl; - } + DebugInFunction << "Checking mesh non-orthogonality" << endl; const labelList& own = faceOwner(); const labelList& nei = faceNeighbour(); @@ -179,10 +176,7 @@ bool Foam::polyMesh::checkFaceSkewness labelHashSet* setPtr ) const { - if (debug) - { - InfoInFunction << "Checking face skewness" << endl; - } + DebugInFunction << "Checking face skewness" << endl; const labelList& own = faceOwner(); const labelList& nei = faceNeighbour(); @@ -283,10 +277,7 @@ bool Foam::polyMesh::checkEdgeAlignment // Empty direction info is passed in as a vector of labels (synchronised) // which are 1 if the direction is non-empty, 0 if it is. - if (debug) - { - InfoInFunction << "Checking edge alignment" << endl; - } + DebugInFunction << "Checking edge alignment" << endl; label nDirs = 0; for (direction cmpt=0; cmpt tcellDeterminant = primitiveMeshTools::cellDeterminant ( @@ -491,10 +479,7 @@ bool Foam::polyMesh::checkFaceWeight labelHashSet* setPtr ) const { - if (debug) - { - InfoInFunction << "Checking for low face interpolation weights" << endl; - } + DebugInFunction << "Checking for low face interpolation weights" << endl; tmp tfaceWght = polyMeshTools::faceWeights ( @@ -580,10 +565,7 @@ bool Foam::polyMesh::checkVolRatio labelHashSet* setPtr ) const { - if (debug) - { - InfoInFunction << "Checking for volume ratio < " << minRatio << endl; - } + DebugInFunction << "Checking for volume ratio < " << minRatio << endl; tmp tvolRatio = polyMeshTools::volRatio(*this, cellVols); scalarField& volRatio = tvolRatio.ref(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C index 6c247e03c4..123a95741a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,10 +38,7 @@ License void Foam::polyMesh::removeBoundary() { - if (debug) - { - InfoInFunction << "Removing boundary patches." << endl; - } + DebugInFunction << "Removing boundary patches." << endl; // Remove the point zones boundary_.clear(); @@ -54,10 +52,7 @@ void Foam::polyMesh::removeBoundary() void Foam::polyMesh::clearGeom() { - if (debug) - { - InfoInFunction << "Clearing geometric data" << endl; - } + DebugInFunction << "Clearing geometric data" << endl; // Clear all geometric mesh objects meshObject::clear(*this); @@ -82,12 +77,10 @@ void Foam::polyMesh::updateGeom autoPtr& newTetBasePtIsPtr ) { - if (debug) - { - InfoInFunction << "Updating geometric data with newPoints:" - << newPoints.size() << " newTetBasePtIs:" - << newTetBasePtIsPtr.valid() << endl; - } + DebugInFunction + << "Updating geometric data with newPoints:" + << newPoints.size() << " newTetBasePtIs:" + << newTetBasePtIsPtr.valid() << endl; if (points_.size() != 0 && points_.size() != newPoints.size()) { @@ -158,11 +151,8 @@ void Foam::polyMesh::updateGeom void Foam::polyMesh::clearAddressing(const bool isMeshUpdate) { - if (debug) - { - InfoInFunction - << "Clearing topology isMeshUpdate:" << isMeshUpdate << endl; - } + DebugInFunction + << "Clearing topology isMeshUpdate:" << isMeshUpdate << endl; if (isMeshUpdate) { @@ -238,10 +228,7 @@ void Foam::polyMesh::clearOut() void Foam::polyMesh::clearTetBasePtIs() { - if (debug) - { - InfoInFunction << "Clearing tet base points" << endl; - } + DebugInFunction << "Clearing tet base points" << endl; tetBasePtIsPtr_.clear(); } @@ -249,10 +236,7 @@ void Foam::polyMesh::clearTetBasePtIs() void Foam::polyMesh::clearCellTree() { - if (debug) - { - InfoInFunction << "Clearing cell tree" << endl; - } + DebugInFunction << "Clearing cell tree" << endl; cellTreePtr_.clear(); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C index 6a037d8e38..178aa18718 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -526,10 +526,8 @@ Foam::polyMesh::polyMesh curMotionTimeIndex_(time().timeIndex()), oldPointsPtr_(nullptr) { - if (debug) - { - Info<<"Constructing polyMesh from cell and boundary shapes." << endl; - } + DebugInfo + << "Constructing polyMesh from cell and boundary shapes." << endl; // Calculate faces and cells labelList patchSizes; @@ -808,10 +806,8 @@ Foam::polyMesh::polyMesh curMotionTimeIndex_(time().timeIndex()), oldPointsPtr_(nullptr) { - if (debug) - { - Info<<"Constructing polyMesh from cell and boundary shapes." << endl; - } + DebugInfo + << "Constructing polyMesh from cell and boundary shapes." << endl; // Calculate faces and cells labelList patchSizes; @@ -940,7 +936,7 @@ Foam::polyMesh::polyMesh { if (checkMesh()) { - Info << "Mesh OK" << endl; + Info<< "Mesh OK" << endl; } } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C index cf26d49c0a..0789ee7acc 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,7 @@ License #include "polyMesh.H" #include "Time.H" #include "cellIOList.H" + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::polyMesh::setInstance @@ -37,10 +38,7 @@ void Foam::polyMesh::setInstance const IOobject::writeOption wOpt ) { - if (debug) - { - InfoInFunction << "Resetting file instance to " << inst << endl; - } + DebugInFunction << "Resetting file instance to " << inst << endl; points_.writeOpt() = wOpt; points_.instance() = inst; @@ -76,10 +74,7 @@ void Foam::polyMesh::setInstance Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate() { - if (debug) - { - InfoInFunction << "Updating mesh based on saved data." << endl; - } + DebugInFunction << "Updating mesh based on saved data." << endl; // Find the point and cell instance fileName pointsInst(time().findInstance(meshDir(), "points")); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C index 714042f976..ab17596977 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,10 +32,7 @@ License void Foam::polyMesh::initMesh() { - if (debug) - { - InfoInFunction << "initialising primitiveMesh" << endl; - } + DebugInFunction << "initialising primitiveMesh" << endl; // For backward compatibility check if the neighbour array is the same // length as the owner and shrink to remove the -1s padding @@ -111,10 +108,7 @@ void Foam::polyMesh::initMesh() void Foam::polyMesh::initMesh(cellList& c) { - if (debug) - { - InfoInFunction << "Calculating owner-neighbour arrays" << endl; - } + DebugInFunction << "Calculating owner-neighbour arrays" << endl; owner_.setSize(faces_.size(), -1); neighbour_.setSize(faces_.size(), -1); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C index a890621338..80232d4498 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,12 +41,8 @@ Description void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm) { - if (debug) - { - InfoInFunction - << "Updating addressing and (optional) pointMesh/pointFields" - << endl; - } + DebugInFunction + << "Updating addressing and (optional) pointMesh/pointFields" << endl; // Update boundaryMesh (note that patches themselves already ok) boundary_.updateMesh(); diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C index 2dd4a94f66..9cd0fce6d9 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -493,12 +493,9 @@ Foam::label Foam::ZoneMesh::findZoneID } // Zone not found - if (debug) - { - InfoInFunction - << "Zone named " << zoneName << " not found. " - << "List of available zone names: " << names() << endl; - } + DebugInFunction + << "Zone named " << zoneName << " not found. " + << "List of available zone names: " << names() << endl; if (disallowGenericZones != 0) { diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C index 497c96cc2a..a155d66278 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2018 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -69,10 +69,7 @@ void Foam::faceZone::setFlipMap(const bool val) void Foam::faceZone::calcFaceZonePatch() const { - if (debug) - { - InfoInFunction << "Calculating primitive patch" << endl; - } + DebugInFunction << "Calculating primitive patch" << endl; if (patchPtr_) { @@ -107,19 +104,13 @@ void Foam::faceZone::calcFaceZonePatch() const } } - if (debug) - { - InfoInFunction << "Finished calculating primitive patch" << endl; - } + DebugInfo << "Finished calculating primitive patch" << endl; } void Foam::faceZone::calcCellLayers() const { - if (debug) - { - InfoInFunction << "Calculating master cells" << endl; - } + DebugInFunction << "Calculating master cells" << endl; // It is an error to attempt to recalculate edgeCells // if the pointer is already set diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C index 93d6f6befe..20167b5983 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,10 +54,7 @@ const Foam::Map& Foam::zone::lookupMap() const void Foam::zone::calcLookupMap() const { - if (debug) - { - InfoInFunction << "Calculating lookup map" << endl; - } + DebugInFunction << "Calculating lookup map" << endl; if (lookupMapPtr_) { @@ -76,10 +73,7 @@ void Foam::zone::calcLookupMap() const lm.insert(addr[i], i); } - if (debug) - { - InfoInFunction << "Finished calculating lookup map" << endl; - } + DebugInfo << "Finished calculating lookup map" << endl; } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 4f4a1445f3..96f7e48bda 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,11 +52,7 @@ bool Foam::primitiveMesh::checkClosedBoundary const bitSet& internalOrCoupledFaces ) const { - if (debug) - { - InfoInFunction - << "Checking whether the boundary is closed" << endl; - } + DebugInFunction << "Checking if boundary is closed" << endl; // Loop through all boundary faces and sum up the face area vectors. // For a closed boundary, this should be zero in all vector components @@ -110,11 +106,7 @@ bool Foam::primitiveMesh::checkClosedCells const Vector