From 20c7c7c21a77b9cdb39e0a31e2446d02fb0202fb Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 3 Jan 2023 10:11:16 +0000 Subject: [PATCH] Resolve warning messages generated by Clang-15 --- .../compressibleMultiphaseMixture.C | 5 +- .../multiphaseMixture/multiphaseMixture.C | 5 +- .../mesh/conversion/kivaToFoam/readKivaGrid.H | 6 -- .../conversion/writeMeshObj/writeMeshObj.C | 5 +- .../DelaunayMesh/DelaunayMeshIO.C | 20 +--- .../DelaunayMesh/DistributedDelaunayMesh.C | 5 +- .../cellShapeControl/cellShapeControl.C | 49 ++-------- .../controlMeshRefinement.C | 11 +-- .../featurePointConformerSpecialisations.C | 8 +- .../insertSurfaceNearestPointPairs.C | 4 +- .../USERD_get_gold_part_build_info.H | 2 +- .../steadyParticleTracksTemplates.C | 6 +- .../surfaceBooleanFeatures.C | 4 +- .../surface/surfaceClean/collapseBase.C | 14 +-- .../GAMGAgglomerateLduAddressing.C | 10 +- .../polyMesh/globalMeshData/globalMeshData.C | 14 +-- .../meshReader/starcd/STARCDMeshReader.C | 5 +- .../fvMeshDistribute/fvMeshDistribute.C | 6 +- .../cfdTools/general/MRF/MRFZone.C | 6 +- src/finiteVolume/finiteVolume/fvc/fvcDdt.C | 22 ++--- .../regionSizeDistribution.C | 5 +- .../meshRefinement/meshRefinementBaffles.C | 8 +- .../meshRefinementProblemCells.C | 91 +++++++------------ src/meshTools/regionSplit/localPointRegion.C | 4 +- .../cellSources/regionToCell/regionToCell.C | 4 +- 25 files changed, 79 insertions(+), 240 deletions(-) diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseMixture/compressibleMultiphaseMixture.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseMixture/compressibleMultiphaseMixture.C index de7d4c5558..1e19d42632 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseMixture/compressibleMultiphaseMixture.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseMixture/compressibleMultiphaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -463,9 +463,6 @@ void Foam::compressibleMultiphaseMixture::solveAlphas const scalar cAlpha ) { - static label nSolves=-1; - nSolves++; - word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index d31a95c29d..a474c9cbf3 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -441,9 +441,6 @@ void Foam::multiphaseMixture::solveAlphas const scalar cAlpha ) { - static label nSolves=-1; - nSolves++; - word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 0f9eea28c1..b276a70269 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -42,8 +42,6 @@ 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++; } diff --git a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C index 31c18444dc..060427ee46 100644 --- a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C +++ b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,8 +61,6 @@ void writeOBJ(const point& pt, Ostream& os) // All edges of mesh void writePoints(const polyMesh& mesh, const fileName& timeName) { - label vertI = 0; - fileName pointFile(mesh.time().path()/"meshPoints_" + timeName + ".obj"); Info<< "Writing mesh points and edges to " << pointFile << endl; @@ -72,7 +70,6 @@ void writePoints(const polyMesh& mesh, const fileName& timeName) forAll(mesh.points(), pointi) { writeOBJ(mesh.points()[pointi], pointStream); - vertI++; } forAll(mesh.edges(), edgeI) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C index d2c8da17c3..9d8e2b0595 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -169,23 +169,14 @@ template void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const { label nInternal = 0; - label nInternalRef = 0; label nUnassigned = 0; - label nUnassignedRef = 0; label nInternalNearBoundary = 0; - label nInternalNearBoundaryRef = 0; label nInternalSurface = 0; - label nInternalSurfaceRef = 0; label nInternalFeatureEdge = 0; - label nInternalFeatureEdgeRef = 0; label nInternalFeaturePoint = 0; - label nInternalFeaturePointRef = 0; label nExternalSurface = 0; - label nExternalSurfaceRef = 0; label nExternalFeatureEdge = 0; - label nExternalFeatureEdgeRef = 0; label nExternalFeaturePoint = 0; - label nExternalFeaturePointRef = 0; label nFar = 0; label nReferred = 0; @@ -201,7 +192,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalRef++; } nInternal++; @@ -211,7 +201,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nUnassignedRef++; } nUnassigned++; @@ -221,7 +210,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalNearBoundaryRef++; } nInternalNearBoundary++; @@ -231,7 +219,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalSurfaceRef++; } nInternalSurface++; @@ -241,7 +228,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalFeatureEdgeRef++; } nInternalFeatureEdge++; @@ -251,7 +237,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nInternalFeaturePointRef++; } nInternalFeaturePoint++; @@ -261,7 +246,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nExternalSurfaceRef++; } nExternalSurface++; @@ -271,7 +255,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - nExternalFeatureEdgeRef++; } nExternalFeatureEdge++; @@ -281,7 +264,6 @@ void Foam::DelaunayMesh::printVertexInfo(Ostream& os) const if (vit->referred()) { nReferred++; - 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 fa6cb3efae..b2a6f5c3fe 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -911,8 +911,6 @@ Foam::DistributedDelaunayMesh::rangeInsertReferredWithInfo typename Triangulation::Locate_type lt; int li, lj; - label nNotInserted = 0; - labelPairHashSet uninserted ( Triangulation::number_of_vertices() @@ -1037,7 +1035,6 @@ Foam::DistributedDelaunayMesh::rangeInsertReferredWithInfo else { uninserted.insert(labelPair(vert.procIndex(), vert.index())); - 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 8e5c8e4f22..f5d7f9c7f9 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -183,52 +183,21 @@ Foam::tensor Foam::cellShapeControl::cellAlignment(const point& pt) const } else { - label nFarPoints = 0; + triad tri; + for (label pI = 0; pI < 4; ++pI) { - if (ch->vertex(pI)->farPoint()) + if (bary[pI] > small) { - nFarPoints++; + tri += triad(bary[pI]*ch->vertex(pI)->alignment()); } } -// if (nFarPoints != 0) -// { -// for (label pI = 0; pI < 4; ++pI) -// { -// if (!ch->vertex(pI)->farPoint()) -// { -// alignment = ch->vertex(pI)->alignment(); -// } -// } -// } -// else - { - triad tri; + tri.normalise(); + tri.orthogonalise(); + tri = tri.sortxyz(); - for (label pI = 0; pI < 4; ++pI) - { - if (bary[pI] > small) - { - tri += triad(bary[pI]*ch->vertex(pI)->alignment()); - } - } - - tri.normalise(); - tri.orthogonalise(); - tri = tri.sortxyz(); - - alignment = tri; - } - -// cellShapeControlMesh::Vertex_handle nearV = -// shapeControlMesh_.nearest_vertex_in_cell -// ( -// toPoint(pt), -// ch -// ); -// -// alignment = nearV->alignment(); + alignment = tri; } return alignment; 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 95ab7de879..7223bcf2b5 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/controlMeshRefinement/controlMeshRefinement.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/controlMeshRefinement/controlMeshRefinement.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,16 +79,9 @@ bool Foam::controlMeshRefinement::detectEdge Foam::point midPoint = (a + b)/2.0; - label nIterations = 0; - while (true) { - nIterations++; - - if - ( - magSqr(a - b) < tolSqr - ) + if (magSqr(a - b) < tolSqr) { pointFound.setPoint(midPoint); pointFound.setHit(); 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 2bcd38dc93..c0cf5d6902 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformerSpecialisations.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformerSpecialisations.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,8 +72,6 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint return false; } - label nVert = foamyHexMesh_.number_of_vertices(); - const label initialNumOfPoints = pts.size(); const scalar ppDist = foamyHexMesh_.pointPairDistance(featPt); @@ -267,7 +265,6 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint for (label i = 0; i < 2; ++i) { pts.remove(); - nVert--; } return false; @@ -504,8 +501,6 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint return false; } - label nVert = foamyHexMesh_.number_of_vertices(); - const label initialNumOfPoints = pts.size(); const scalar ppDist = foamyHexMesh_.pointPairDistance(featPt); @@ -703,7 +698,6 @@ bool Foam::featurePointConformer::createSpecialisedFeaturePoint for (label i = 0; i < 2; ++i) { pts.remove(); - nVert--; } return false; diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/insertSurfaceNearestPointPairs.C b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/insertSurfaceNearestPointPairs.C index 48d9ed8703..4bf3c6c0ff 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/insertSurfaceNearestPointPairs.C +++ b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/insertSurfaceNearestPointPairs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,12 +122,10 @@ void Foam::CV2D::insertPointPairs if (meshControls().objOutput()) { OFstream str(fName); - label vertI = 0; forAll(surfacePoints, ppi) { meshTools::writeOBJ(str, toPoint3D(surfacePoints[ppi])); - vertI++; } Info<< "insertPointPairs: Written " << surfacePoints.size() diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_part_build_info.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_part_build_info.H index 299ec5a67d..b936574cb1 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_part_build_info.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_part_build_info.H @@ -8,7 +8,7 @@ int USERD_get_gold_part_build_info char *part_descriptions[Z_BUFL], int *number_of_nodes, int *number_of_elements[Z_MAXTYPE], - int *ijk_dimensions[3], + int *ijk_dimensions[9], int *iblanking_options[6] ) { diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C index a207a55c3b..80717313f1 100644 --- a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C +++ b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,9 +114,10 @@ void Foam::writeVTKFields forAll(values, fieldi) { Info<< " writing field " << fieldNames[fieldi] << endl; + os << nl << fieldNames[fieldi] << ' ' << pTraits::nComponents << ' ' << values[fieldi].size() << " float" << nl; - label offset = 0; + forAll(addr, trackI) { const List