Commit a1ccd1b7 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: use DebugInFunction macro

parent a3c226a1
......@@ -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;
......
......@@ -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::scalarField> 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())
{
......
......@@ -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<vector::nComponents; cmpt++)
......@@ -413,10 +404,7 @@ bool Foam::polyMesh::checkCellDeterminant
{
const scalar warnDet = 1e-3;
if (debug)
{
InfoInFunction << "Checking for under-determined cells" << endl;
}
DebugInFunction << "Checking for under-determined cells" << endl;
tmp<scalarField> 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<scalarField> 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<scalarField> tvolRatio = polyMeshTools::volRatio(*this, cellVols);
scalarField& volRatio = tvolRatio.ref();
......
......@@ -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<pointMesh, GeometricMeshObject>(*this);
......@@ -82,12 +77,10 @@ void Foam::polyMesh::updateGeom
autoPtr<labelIOList>& 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();
}
......
......@@ -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;
}
}
}
......
......@@ -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"));
......
......@@ -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);
......
......@@ -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();
......
......@@ -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<ZoneType, MeshType>::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)
{
......
......@@ -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
......
......@@ -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::label>& 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;
}
......
......@@ -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<label>& meshD
) const
{
if (debug)
{
InfoInFunction
<< "Checking whether cells are closed" << endl;
}
DebugInFunction << "Checking if cells are closed" << endl;
// Check that all cells labels are valid
const cellList& c = cells();
......@@ -240,10 +232,7 @@ bool Foam::primitiveMesh::checkFaceAreas
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking face area magnitudes" << endl;
}
DebugInFunction << "Checking face area magnitudes" << endl;
const scalarField magFaceAreas(mag(faceAreas));
......@@ -316,10 +305,7 @@ bool Foam::primitiveMesh::checkCellVolumes
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking cell volumes" << endl;
}
DebugInFunction << "Checking cell volumes" << endl;
scalar minVolume = GREAT;
scalar maxVolume = -GREAT;
......@@ -384,11 +370,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking mesh non-orthogonality" << endl;
}
DebugInFunction << "Checking mesh non-orthogonality" << endl;
tmp<scalarField> tortho = primitiveMeshTools::faceOrthogonality
(
......@@ -494,10 +476,7 @@ bool Foam::primitiveMesh::checkFacePyramids
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking face orientation" << endl;
}
DebugInFunction << "Checking face orientation" << endl;
const labelList& own = faceOwner();
const labelList& nei = faceNeighbour();
......@@ -594,10 +573,7 @@ bool Foam::primitiveMesh::checkFaceSkewness
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking face skewness" << endl;
}
DebugInFunction << "Checking face skewness" << endl;
// Warn if the skew correction vector is more than skewWarning times
// larger than the face area vector
......@@ -664,10 +640,7 @@ bool Foam::primitiveMesh::checkFaceAngles
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking face angles" << endl;
}
DebugInFunction << "Checking face angles" << endl;
if (maxDeg < -SMALL || maxDeg > 180+SMALL)
{
......@@ -743,15 +716,12 @@ bool Foam::primitiveMesh::checkFaceFlatness
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking face flatness" << endl;
}
DebugInFunction << "Checking face flatness" << endl;
if (warnFlatness < 0 || warnFlatness > 1)
{
FatalErrorInFunction
<< "warnFlatness should be [0..1] but is now " << warnFlatness
<< "warnFlatness should be [0..1] but is " << warnFlatness
<< exit(FatalError);
}
......@@ -844,10 +814,7 @@ bool Foam::primitiveMesh::checkConcaveCells
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking for concave cells" << endl;
}
DebugInFunction << "Checking for concave cells" << endl;
const cellList& c = cells();
const labelList& fOwner = faceOwner();
......@@ -951,10 +918,7 @@ bool Foam::primitiveMesh::checkUpperTriangular
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking face ordering" << endl;
}
DebugInFunction << "Checking face ordering" << endl;
// Check whether internal faces are ordered in the upper triangular order
const labelList& own = faceOwner();
......@@ -1112,10 +1076,7 @@ bool Foam::primitiveMesh::checkCellsZipUp
labelHashSet* setPtr
) const
{
if (debug)
{
InfoInFunction << "Checking topological cell openness" << endl;
}
DebugInFunction << "Checking topological cell openness" << endl;