From 87cb811db29c4d01a0dbd5ef5af0859ee3ca35d2 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 18 May 2023 18:53:40 +0200 Subject: [PATCH] COMP: fix library linkage (#2784), silence some unused variable warnings --- .../mesh/conversion/kivaToFoam/readKivaGrid.H | 8 ++--- .../DelaunayMesh/DelaunayMeshIO.C | 36 +++++++++---------- .../DelaunayMesh/DistributedDelaunayMesh.C | 4 +-- .../cellShapeControl/cellShapeControl.C | 28 +++++++-------- .../controlMeshRefinement.C | 4 +-- .../featurePointConformerSpecialisations.C | 8 ++--- .../foamToVTK/convertAreaFields.H | 2 +- .../surfaceBooleanFeatures.C | 10 +++--- .../surface/surfaceClean/collapseBase.C | 4 +-- src/conversion/starcd/STARCDMeshReader.C | 3 +- src/fileFormats/vtk/part/foamVtuSizingImpl.C | 4 +-- .../cfdTools/general/MRF/MRFZone.C | 8 ++--- .../regionSizeDistribution.C | 6 ++-- .../utilities/vtkWrite/vtkWriteImpl.C | 2 -- .../MGridGenGamgAgglomeration/Make/options | 7 ++++ .../pairPatchAgglomeration/Make/options | 12 ++++--- .../pairPatchAgglomeration.H | 4 +-- .../displacementMotionSolverMeshMover.C | 4 +-- .../meshRefinement/meshRefinementBaffles.C | 10 +++--- .../meshRefinementProblemCells.C | 28 +++++++-------- .../refinementSurfaces/refinementSurfaces.C | 4 +-- .../extendedEdgeMesh/extendedEdgeMesh.C | 8 ++--- src/meshTools/regionSplit/localPointRegion.C | 4 +-- .../cellSources/regionToCell/regionToCell.C | 9 +++-- .../inverseDistanceCellCellStencil.C | 4 +-- .../oversetAdjustPhi/oversetAdjustPhi.C | 4 +++ src/overset/oversetFvMesh/oversetFvMeshBase.C | 21 ++++------- .../oversetFvMeshBaseTemplates.C | 4 +-- src/overset/regionsToCell/regionsToCell.C | 10 +++--- .../distributedTriSurfaceMesh.C | 10 +++--- .../exact/exactPatchDistMethod.C | 4 +-- 31 files changed, 139 insertions(+), 135 deletions(-) diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index ca08396837..3aabf9614a 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -42,7 +42,7 @@ for (label i=0; 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; } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C index 2dc3f59928..4f73231286 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C @@ -170,23 +170,23 @@ template void Foam::DelaunayMesh::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::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalRef++; + //++nInternalRef; } nInternal++; @@ -212,7 +212,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nUnassignedRef++; + //++nUnassignedRef; } nUnassigned++; @@ -222,7 +222,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalNearBoundaryRef++; + //++nInternalNearBoundaryRef; } nInternalNearBoundary++; @@ -232,7 +232,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalSurfaceRef++; + //++nInternalSurfaceRef; } nInternalSurface++; @@ -242,7 +242,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalFeatureEdgeRef++; + //++nInternalFeatureEdgeRef; } nInternalFeatureEdge++; @@ -252,7 +252,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalFeaturePointRef++; + //++nInternalFeaturePointRef; } nInternalFeaturePoint++; @@ -262,7 +262,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nExternalSurfaceRef++; + //++nExternalSurfaceRef; } nExternalSurface++; @@ -272,7 +272,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nExternalFeatureEdgeRef++; + //++nExternalFeatureEdgeRef; } nExternalFeatureEdge++; @@ -282,7 +282,7 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nExternalFeaturePointRef++; + //++nExternalFeaturePointRef; } nExternalFeaturePoint++; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C index 01c14c7060..2c50d6c462 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C @@ -853,7 +853,7 @@ Foam::DistributedDelaunayMesh::rangeInsertReferredWithInfo typename Triangulation::Locate_type lt; int li, lj; - label nNotInserted = 0; + //label nNotInserted = 0; labelPairHashSet uninserted ( @@ -979,7 +979,7 @@ Foam::DistributedDelaunayMesh::rangeInsertReferredWithInfo else { uninserted.insert(labelPair(vert.procIndex(), vert.index())); - nNotInserted++; + //++nNotInserted; } } diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C index 8b5d394e19..cb7a6208c6 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C @@ -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) { diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/controlMeshRefinement/controlMeshRefinement.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/controlMeshRefinement/controlMeshRefinement.C index 313a039a7b..3aee2b3433 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/controlMeshRefinement/controlMeshRefinement.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/controlMeshRefinement/controlMeshRefinement.C @@ -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 ( diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformerSpecialisations.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformerSpecialisations.C index bd274824f3..3f8d6f104a 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformerSpecialisations.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformerSpecialisations.C @@ -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; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/convertAreaFields.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/convertAreaFields.H index bdfe96ceb5..7d8f467ab7 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/convertAreaFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/convertAreaFields.H @@ -81,7 +81,7 @@ if (doFiniteArea) labelList patchIds ( - areaMesh.mesh().boundaryMesh().patchID(areaMesh.faceLabels()) + pbm.patchID(areaMesh.faceLabels()) ); writer.writeCellData("patchID", patchIds); diff --git a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C index 5cc5d909e5..b7f2715b25 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C +++ b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C @@ -1408,7 +1408,7 @@ autoPtr createEdgeMesh label nIntOrExt = 0; label nFlat = 0; label nOpen = 0; - label nMultiple = 0; + // label nMultiple = 0; forAll(edgeNormals, eI) { @@ -1432,10 +1432,10 @@ autoPtr createEdgeMesh nIntOrExt++; } } - else if (nEdNorms > 2) - { - nMultiple++; - } + // else if (nEdNorms > 2) + // { + // ++nMultiple; + // } } if (action == booleanSurface::UNION) diff --git a/applications/utilities/surface/surfaceClean/collapseBase.C b/applications/utilities/surface/surfaceClean/collapseBase.C index 5c5572c23b..7ba52a0010 100644 --- a/applications/utilities/surface/surfaceClean/collapseBase.C +++ b/applications/utilities/surface/surfaceClean/collapseBase.C @@ -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 diff --git a/src/conversion/starcd/STARCDMeshReader.C b/src/conversion/starcd/STARCDMeshReader.C index b17252ac7d..d69fcdc46a 100644 --- a/src/conversion/starcd/STARCDMeshReader.C +++ b/src/conversion/starcd/STARCDMeshReader.C @@ -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); diff --git a/src/fileFormats/vtk/part/foamVtuSizingImpl.C b/src/fileFormats/vtk/part/foamVtuSizingImpl.C index ea83469251..b1d763d2c4 100644 --- a/src/fileFormats/vtk/part/foamVtuSizingImpl.C +++ b/src/fileFormats/vtk/part/foamVtuSizingImpl.C @@ -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; } } diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index 90e91ede07..4244ee7f79 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -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; } } } diff --git a/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C b/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C index 3b55fda4d5..ebdf67cf78 100644 --- a/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C +++ b/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C @@ -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; } } } diff --git a/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C b/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C index 450cd6fcef..66400af4be 100644 --- a/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C +++ b/src/functionObjects/utilities/vtkWrite/vtkWriteImpl.C @@ -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) diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options index 7fd6b0ae76..a64d63749e 100644 --- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options +++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options @@ -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 diff --git a/src/fvAgglomerationMethods/pairPatchAgglomeration/Make/options b/src/fvAgglomerationMethods/pairPatchAgglomeration/Make/options index 7063a63df5..440b98532e 100644 --- a/src/fvAgglomerationMethods/pairPatchAgglomeration/Make/options +++ b/src/fvAgglomerationMethods/pairPatchAgglomeration/Make/options @@ -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 diff --git a/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.H b/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.H index ac564b2b91..9733c48f8f 100644 --- a/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.H +++ b/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.H @@ -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" diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMotionSolverMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMotionSolverMeshMover.C index 070d73e2c7..89d08776ed 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMotionSolverMeshMover.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/displacementMotionSolverMeshMover.C @@ -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]; } diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C index c36580ced6..781dd60d09 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C @@ -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