COMP: fix library linkage (#2784), silence some unused variable warnings

This commit is contained in:
Mark Olesen
2023-05-18 18:53:40 +02:00
parent a5d9ad3a5c
commit 87cb811db2
31 changed files with 139 additions and 135 deletions

View File

@ -42,7 +42,7 @@ for (label i=0; i<nPoints; i++)
labelList i1tab(nPoints), i3tab(nPoints), i8tab(nPoints), idreg(nPoints),
f(nPoints), bcl(nPoints), bcf(nPoints), bcb(nPoints);
label nBfaces = 0;
// label nBfaces = 0;
for (label i=0; i<nPoints; i++)
{
@ -65,9 +65,9 @@ for (label i=0; i<nPoints; i++)
bcf[i] = label(fbcf);
bcb[i] = label(fbcb);
if (bcl[i] > 0 && bcl[i] != 4) nBfaces++;
if (bcf[i] > 0 && bcf[i] != 4) nBfaces++;
if (bcb[i] > 0 && bcb[i] != 4) nBfaces++;
// if (bcl[i] > 0 && bcl[i] != 4) ++nBfaces;
// if (bcf[i] > 0 && bcf[i] != 4) ++nBfaces;
// if (bcb[i] > 0 && bcb[i] != 4) ++nBfaces;
}

View File

@ -170,23 +170,23 @@ template<class Triangulation>
void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
{
label nInternal = 0;
label nInternalRef = 0;
//label nInternalRef = 0;
label nUnassigned = 0;
label nUnassignedRef = 0;
//label nUnassignedRef = 0;
label nInternalNearBoundary = 0;
label nInternalNearBoundaryRef = 0;
//label nInternalNearBoundaryRef = 0;
label nInternalSurface = 0;
label nInternalSurfaceRef = 0;
//label nInternalSurfaceRef = 0;
label nInternalFeatureEdge = 0;
label nInternalFeatureEdgeRef = 0;
//label nInternalFeatureEdgeRef = 0;
label nInternalFeaturePoint = 0;
label nInternalFeaturePointRef = 0;
//label nInternalFeaturePointRef = 0;
label nExternalSurface = 0;
label nExternalSurfaceRef = 0;
//label nExternalSurfaceRef = 0;
label nExternalFeatureEdge = 0;
label nExternalFeatureEdgeRef = 0;
//label nExternalFeatureEdgeRef = 0;
label nExternalFeaturePoint = 0;
label nExternalFeaturePointRef = 0;
//label nExternalFeaturePointRef = 0;
label nFar = 0;
label nReferred = 0;
@ -202,7 +202,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nInternalRef++;
//++nInternalRef;
}
nInternal++;
@ -212,7 +212,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nUnassignedRef++;
//++nUnassignedRef;
}
nUnassigned++;
@ -222,7 +222,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nInternalNearBoundaryRef++;
//++nInternalNearBoundaryRef;
}
nInternalNearBoundary++;
@ -232,7 +232,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nInternalSurfaceRef++;
//++nInternalSurfaceRef;
}
nInternalSurface++;
@ -242,7 +242,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nInternalFeatureEdgeRef++;
//++nInternalFeatureEdgeRef;
}
nInternalFeatureEdge++;
@ -252,7 +252,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nInternalFeaturePointRef++;
//++nInternalFeaturePointRef;
}
nInternalFeaturePoint++;
@ -262,7 +262,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nExternalSurfaceRef++;
//++nExternalSurfaceRef;
}
nExternalSurface++;
@ -272,7 +272,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nExternalFeatureEdgeRef++;
//++nExternalFeatureEdgeRef;
}
nExternalFeatureEdge++;
@ -282,7 +282,7 @@ void Foam::DelaunayMesh<Triangulation>::printVertexInfo(Ostream& os) const
if (vit->referred())
{
nReferred++;
nExternalFeaturePointRef++;
//++nExternalFeaturePointRef;
}
nExternalFeaturePoint++;

View File

@ -853,7 +853,7 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
typename Triangulation::Locate_type lt;
int li, lj;
label nNotInserted = 0;
//label nNotInserted = 0;
labelPairHashSet uninserted
(
@ -979,7 +979,7 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
else
{
uninserted.insert(labelPair(vert.procIndex(), vert.index()));
nNotInserted++;
//++nNotInserted;
}
}

View File

@ -104,7 +104,7 @@ Foam::scalar Foam::cellShapeControl::cellSize(const point& pt) const
}
else if (shapeControlMesh_.is_infinite(ch))
{
// if (nFarPoints != 0)
// if (nFarPoints)
// {
// for (label pI = 0; pI < 4; ++pI)
// {
@ -136,11 +136,11 @@ Foam::scalar Foam::cellShapeControl::cellSize(const point& pt) const
{
if (ch->vertex(pI)->farPoint())
{
nFarPoints++;
++nFarPoints;
}
}
if (nFarPoints != 0)
if (nFarPoints)
{
for (label pI = 0; pI < 4; ++pI)
{
@ -179,16 +179,16 @@ Foam::tensor Foam::cellShapeControl::cellAlignment(const point& pt) const
}
else
{
label nFarPoints = 0;
for (label pI = 0; pI < 4; ++pI)
{
if (ch->vertex(pI)->farPoint())
{
nFarPoints++;
}
}
// label nFarPoints = 0;
// for (label pI = 0; pI < 4; ++pI)
// {
// if (ch->vertex(pI)->farPoint())
// {
// ++nFarPoints;
// }
// }
// if (nFarPoints != 0)
// if (nFarPoints)
// {
// for (label pI = 0; pI < 4; ++pI)
// {
@ -259,11 +259,11 @@ void Foam::cellShapeControl::cellSizeAndAlignment
{
if (ch->vertex(pI)->farPoint())
{
nFarPoints++;
++nFarPoints;
}
}
if (nFarPoints != 0)
if (nFarPoints)
{
for (label pI = 0; pI < 4; ++pI)
{

View File

@ -82,11 +82,11 @@ bool Foam::controlMeshRefinement::detectEdge
Foam::point midPoint = (a + b)/2.0;
label nIterations = 0;
//label nIterations = 0;
while (true)
{
nIterations++;
//++nIterations;
if
(

View File

@ -74,7 +74,7 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint
return false;
}
label nVert = foamyHexMesh_.number_of_vertices();
//label nVert = foamyHexMesh_.number_of_vertices();
const label initialNumOfPoints = pts.size();
@ -267,7 +267,7 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint
// Remove points that have just been added before returning
pts.pop_back(2);
nVert -= 2;
//nVert -= 2;
return false;
}
@ -503,7 +503,7 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint
return false;
}
label nVert = foamyHexMesh_.number_of_vertices();
//label nVert = foamyHexMesh_.number_of_vertices();
const label initialNumOfPoints = pts.size();
@ -700,7 +700,7 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint
// Remove points that have just been added before returning
pts.pop_back(2);
nVert -= 2;
//nVert -= 2;
return false;
}

View File

@ -81,7 +81,7 @@ if (doFiniteArea)
labelList patchIds
(
areaMesh.mesh().boundaryMesh().patchID(areaMesh.faceLabels())
pbm.patchID(areaMesh.faceLabels())
);
writer.writeCellData("patchID", patchIds);

View File

@ -1408,7 +1408,7 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
label nIntOrExt = 0;
label nFlat = 0;
label nOpen = 0;
label nMultiple = 0;
// label nMultiple = 0;
forAll(edgeNormals, eI)
{
@ -1432,10 +1432,10 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
nIntOrExt++;
}
}
else if (nEdNorms > 2)
{
nMultiple++;
}
// else if (nEdNorms > 2)
// {
// ++nMultiple;
// }
}
if (action == booleanSurface::UNION)

View File

@ -775,7 +775,7 @@ label collapseBase
{
label nTotalSplit = 0;
label iter = 0;
// label iter = 0;
while (true)
{
@ -980,7 +980,7 @@ label collapseBase
// surf.write(fName);
//}
iter++;
// ++iter;
}
// Remove any unused vertices

View File

@ -697,7 +697,8 @@ void Foam::fileFormats::STARCDMeshReader::readBoundary
// keep empty patch region in reserve
++nPatches;
Info<< "Number of patches = " << nPatches
<< " (including extra for missing)" << endl;
<< " (including extra for missing) with "
<< nFaces << " faces" << endl;
// resize
origRegion.setSize(nPatches);

View File

@ -756,7 +756,7 @@ void Foam::vtk::vtuSizing::populateArrays
const label nInputCells = shapes.size();
label nIgnored = 0;
// label nIgnored = 0;
for
(
@ -852,7 +852,7 @@ void Foam::vtk::vtuSizing::populateArrays
// Silent here.
// - already complained (and skipped) during initial sizing
--cellIndex;
++nIgnored;
// ++nIgnored;
}
}

View File

@ -75,14 +75,14 @@ void Foam::MRFZone::setMRFFaces()
}
label nZoneFaces = 0;
// label nZoneFaces = 0;
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
if (zoneCell[own[facei]] || zoneCell[nei[facei]])
{
faceType[facei] = 1;
nZoneFaces++;
// ++nZoneFaces;
}
}
@ -102,7 +102,7 @@ void Foam::MRFZone::setMRFFaces()
if (zoneCell[own[facei]])
{
faceType[facei] = 2;
nZoneFaces++;
// ++nZoneFaces;
}
}
}
@ -115,7 +115,7 @@ void Foam::MRFZone::setMRFFaces()
if (zoneCell[own[facei]])
{
faceType[facei] = 1;
nZoneFaces++;
// ++nZoneFaces;
}
}
}

View File

@ -474,7 +474,7 @@ bool Foam::functionObjects::regionSizeDistribution::write()
// Determine blocked faces
boolList blockedFace(mesh_.nFaces(), false);
label nBlocked = 0;
// label nBlocked = 0;
{
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
@ -489,7 +489,7 @@ bool Foam::functionObjects::regionSizeDistribution::write()
)
{
blockedFace[facei] = true;
nBlocked++;
// ++nBlocked;
}
}
@ -518,7 +518,7 @@ bool Foam::functionObjects::regionSizeDistribution::write()
)
{
blockedFace[start+i] = true;
nBlocked++;
// ++nBlocked;
}
}
}

View File

@ -58,12 +58,10 @@ Foam::label Foam::functionObjects::vtkWrite::writeVolFieldsImpl
}
// Boundary
label writeri = 0;
for (vtk::patchWriter& writer : patchWriters)
{
ok = true;
writer.write(field);
++writeri;
}
if (ok)

View File

@ -1,6 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(MGRIDGEN_INC_DIR)
LIB_LIBS = \
-lfileFormats \
-lsurfMesh \
-lmeshTools \
-lfiniteVolume \
-L$(MGRIDGEN_LIB_DIR) -lmgrid

View File

@ -1,9 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lOpenFOAM \
-lfiniteVolume \
-lmeshTools
-lfileFormats \
-lsurfMesh \
-lmeshTools \
-lfiniteVolume

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef pairPatchAgglomeration_H
#define pairPatchAgglomeration_H
#ifndef Foam_pairPatchAgglomeration_H
#define Foam_pairPatchAgglomeration_H
#include "mathematicalConstants.H"
#include "indirectPrimitivePatch.H"

View File

@ -275,13 +275,13 @@ bool Foam::displacementMotionSolverMeshMover::move
);
scalar resid = 0;
// scalar resid = 0;
forAll(displacement, patchPointI)
{
const label pointI(adaptPatchPtr_().meshPoints()[patchPointI]);
resid += mag(pointDisplacement()[pointI]-displacement[patchPointI]);
// resid += mag(pointDisplacement()[pointI]-displacement[patchPointI]);
pointDisplacement()[pointI] = displacement[patchPointI];
}

View File

@ -3941,14 +3941,14 @@ Foam::label Foam::meshRefinement::markPatchZones
// Protect all non-manifold edges
{
label nProtected = 0;
// label nProtected = 0;
forAll(nMasterFacesPerEdge, edgeI)
{
if (nMasterFacesPerEdge[edgeI] > 2)
{
allEdgeInfo[edgeI] = edgeTopoDistanceData<label>(0, -2);
nProtected++;
// ++nProtected;
}
}
//Info<< "Protected from visiting "
@ -4097,7 +4097,7 @@ void Foam::meshRefinement::consistentOrientation
// - slaves of coupled faces
// - non-manifold edges
{
label nProtected = 0;
// label nProtected = 0;
forAll(patch.addressing(), faceI)
{
@ -4113,7 +4113,7 @@ void Foam::meshRefinement::consistentOrientation
{
// Slave side. Mark so doesn't get visited.
allFaceInfo[faceI] = orientedSurface::NOFLIP;
nProtected++;
// ++nProtected;
}
}
//Info<< "Protected from visiting "
@ -4128,7 +4128,7 @@ void Foam::meshRefinement::consistentOrientation
if (nMasterFacesPerEdge[edgeI] > 2)
{
allEdgeInfo[edgeI] = orientedSurface::NOFLIP;
nProtected++;
++nProtected;
}
}

View File

@ -655,7 +655,7 @@ void Foam::meshRefinement::markFacesOnProblemCells
// Get number of anchor points (pointLevel <= cellLevel)
label nBoundaryAnchors = 0;
label nNonAnchorBoundary = 0;
// label nNonAnchorBoundary = 0;
label nonBoundaryAnchor = -1;
for (const label pointi : cPoints)
@ -673,10 +673,10 @@ void Foam::meshRefinement::markFacesOnProblemCells
nonBoundaryAnchor = pointi;
}
}
else if (isBoundaryPoint[pointi])
{
nNonAnchorBoundary++;
}
// else if (isBoundaryPoint[pointi])
// {
// ++nNonAnchorBoundary;
// }
}
if (nBoundaryAnchors == 8)
@ -684,15 +684,15 @@ void Foam::meshRefinement::markFacesOnProblemCells
const cell& cFaces = mesh_.cells()[celli];
// Count boundary faces.
label nBfaces = 0;
forAll(cFaces, cFacei)
{
if (isBoundaryFace[cFaces[cFacei]])
{
nBfaces++;
}
}
// label nBfaces = 0;
//
// forAll(cFaces, cFacei)
// {
// if (isBoundaryFace[cFaces[cFacei]])
// {
// ++nBfaces;
// }
// }
// If nBfaces > 1 make all non-boundary non-baffle faces baffles.
// We assume that this situation is where there is a single

View File

@ -64,13 +64,13 @@ Foam::labelList Foam::refinementSurfaces::findHigherLevel
// 3. uncached : use region 0 value
DynamicList<label> retestSet;
label nHits = 0;
// label nHits = 0;
forAll(intersectionInfo, i)
{
if (intersectionInfo[i].hit())
{
nHits++;
// ++nHits;
// Check if minLevelField for this surface.
if (minLevelField.size())

View File

@ -2109,7 +2109,7 @@ void Foam::extendedEdgeMesh::sortedOrder
label nConvex = 0;
label nConcave = 0;
label nMixed = 0;
label nNonFeat = 0;
// label nNonFeat = 0;
forAll(pointStat, pointI)
{
@ -2128,7 +2128,7 @@ void Foam::extendedEdgeMesh::sortedOrder
break;
case extendedEdgeMesh::NONFEATURE:
nNonFeat++;
// ++nNonFeat;
break;
default:
@ -2179,7 +2179,7 @@ void Foam::extendedEdgeMesh::sortedOrder
label nInternal = 0;
label nFlat = 0;
label nOpen = 0;
label nMultiple = 0;
// label nMultiple = 0;
forAll(edgeStat, edgeI)
{
@ -2202,7 +2202,7 @@ void Foam::extendedEdgeMesh::sortedOrder
break;
case extendedEdgeMesh::MULTIPLE:
nMultiple++;
// ++nMultiple;
break;
case extendedEdgeMesh::NONE:

View File

@ -554,7 +554,7 @@ Foam::labelList Foam::localPointRegion::findDuplicateFaces
);
labelList duplicateFace(allPatch.size(), -1);
label nDuplicateFaces = 0;
// label nDuplicateFaces = 0;
// Find all duplicate faces.
forAll(allPatch, bFacei)
@ -611,7 +611,7 @@ Foam::labelList Foam::localPointRegion::findDuplicateFaces
duplicateFace[bFacei] = otherFacei;
duplicateFace[otherFacei] = bFacei;
nDuplicateFaces++;
// ++nDuplicateFaces;
}
}
}

View File

@ -232,14 +232,13 @@ void Foam::regionToCell::shrinkRegions
if (selectedCell[celli])
{
selectedCell[celli] = false;
nChanged++;
++nChanged;
}
}
}
}
Info<< " Eroded "
<< returnReduce(nChanged, sumOp<label>())
<< " cells." << endl;
<< returnReduce(nChanged, sumOp<label>()) << " cells." << endl;
}
@ -308,7 +307,7 @@ void Foam::regionToCell::erode
// Select all cells using these points
label nChanged = 0;
// label nChanged = 0;
forAll(boundaryPoint, pointi)
{
if (boundaryPoint[pointi])
@ -320,7 +319,7 @@ void Foam::regionToCell::erode
if (!removeCell[celli])
{
removeCell[celli] = true;
nChanged++;
// ++nChanged;
}
}
}

View File

@ -1166,14 +1166,14 @@ void Foam::cellCellStencils::inverseDistance::findHoles
// See which regions have not been visited (regionType == 1)
label count = 0;
// label count = 0;
forAll(cellRegion, cellI)
{
label type = regionType[cellRegion[cellI]];
if (type == 1 && cellTypes[cellI] != HOLE)
{
cellTypes[cellI] = HOLE;
count++;
// ++count;
}
}
}

View File

@ -244,6 +244,7 @@ bool Foam::oversetAdjustPhi
// Check correction
#ifdef FULLDEBUG
if (fv::debug)
{
scalar massOutCheck = 0;
@ -287,7 +288,10 @@ bool Foam::oversetAdjustPhi
}
}
}
Info<< "mass in:" << massInCheck << " out:" << massOutCheck << nl;
}
#endif /* FULLDEBUG */
return true;
}

View File

@ -372,8 +372,7 @@ Foam::scalar Foam::oversetFvMeshBase::cellAverage
const cell& cFaces = mesh_.cells()[celli];
scalar avg = 0.0;
label n = 0;
label nFront = 0;
label nTotal = 0;
for (const label facei : cFaces)
{
if (mesh_.isInternalFace(facei))
@ -382,38 +381,32 @@ Foam::scalar Foam::oversetFvMeshBase::cellAverage
if (norm[nbrCelli] == -GREAT)
{
// Invalid neighbour. Add to front
if (isFront.set(facei))
{
nFront++;
}
isFront.set(facei);
}
else
{
// Valid neighbour. Add to average
avg += norm[nbrCelli];
n++;
++nTotal;
}
}
else
{
if (nbrNorm[facei-mesh_.nInternalFaces()] == -GREAT)
{
if (isFront.set(facei))
{
nFront++;
}
isFront.set(facei);
}
else
{
avg += nbrNorm[facei-mesh_.nInternalFaces()];
n++;
++nTotal;
}
}
}
if (n > 0)
if (nTotal)
{
return avg/n;
return avg/nTotal;
}
else
{

View File

@ -165,14 +165,14 @@ Foam::tmp<Foam::scalarField> Foam::oversetFvMeshBase::normalisation
const cellCellStencilObject& overlap = Stencil::New(mesh_);
const labelUList& types = overlap.cellTypes();
label nHoles = 0;
// label nHoles = 0;
scalarField extrapolatedNorm(norm);
forAll(types, celli)
{
if (types[celli] == cellCellStencil::HOLE)
{
extrapolatedNorm[celli] = -GREAT;
nHoles++;
// ++nHoles;
}
}

View File

@ -261,13 +261,13 @@ void Foam::regionsToCell::shrinkRegions
if (selectedCell[cellI])
{
selectedCell[cellI] = false;
nChanged++;
++nChanged;
}
}
}
}
Info<< " Eroded " << returnReduce(nChanged, sumOp<label>())
<< " cells." << endl;
Info<< " Eroded "
<< returnReduce(nChanged, sumOp<label>()) << " cells." << endl;
}
@ -338,7 +338,7 @@ void Foam::regionsToCell::erode
// Select all cells using these points
label nChanged = 0;
// label nChanged = 0;
forAll(boundaryPoint, pointI)
{
if (boundaryPoint[pointI])
@ -350,7 +350,7 @@ void Foam::regionsToCell::erode
if (!removeCell[cellI])
{
removeCell[cellI] = true;
nChanged++;
// ++nChanged;
}
}
}

View File

@ -3297,7 +3297,7 @@ void Foam::distributedTriSurfaceMesh::findNearest
// Work array - whether processor bb overlaps the bounding sphere.
boolList procBbOverlaps(Pstream::nProcs());
label nFound = 0;
// label nFound = 0;
forAll(nearestInfo, samplei)
{
@ -3305,10 +3305,10 @@ void Foam::distributedTriSurfaceMesh::findNearest
const nearestAndDist& ni = nearestInfo[samplei];
const pointIndexHit& info = ni.first();
if (info.hit())
{
nFound++;
}
// if (info.hit())
// {
// nFound++;
// }
scalar d2 =
(

View File

@ -170,14 +170,14 @@ bool Foam::patchDistMethods::exact::correct
);
// Take over hits
label nHits = 0;
// label nHits = 0;
forAll(info, celli)
{
if (info[celli].hit())
{
const point& cc = mesh_.cellCentres()[celli];
y[celli] = info[celli].point().dist(cc);
nHits++;
// ++nHits;
}
//else
//{