From 59f3c55871f2514e7133c802f299aa43a9e4e783 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 8 Apr 2025 11:00:11 +0200 Subject: [PATCH] STYLE: avoid implicit cast of UList to List --- .../adjointShapeOptimizationFoam.C | 7 +--- .../createFields.H | 4 +- .../pimpleFoam/overPimpleDyMFoam/correctPhi.H | 2 +- .../VoFPatchTransfer/VoFPatchTransfer.C | 2 +- .../interFoam/overInterDyMFoam/correctPhi.H | 2 +- .../fluentMeshToFoam/fluentMeshToFoam.L | 5 +-- .../foamMeshToFluent/fluentFvMesh.C | 3 +- .../mesh/conversion/gmshToFoam/gmshToFoam.C | 2 +- .../DelaunayMesh/DistributedDelaunayMesh.C | 4 +- .../DelaunayMesh/DistributedDelaunayMesh.H | 4 +- .../backgroundMeshDecomposition.C | 2 +- .../backgroundMeshDecomposition.H | 2 +- .../conformalVoronoiMeshCalcDualMesh.C | 2 +- .../pointPairs/pointPairs.C | 2 +- .../pointPairs/pointPairs.H | 2 +- .../generation/foamyMesh/foamyQuadMesh/CV2D.H | 8 ++-- .../insertSurfaceNearestPointPairs.C | 8 ++-- .../foamyQuadMesh/shortEdgeFilter2D.C | 8 ++-- .../mesh/manipulation/checkMesh/checkTools.C | 4 +- .../manipulation/polyDualMesh/meshDualiser.C | 19 ++++------ .../manipulation/polyDualMesh/meshDualiser.H | 9 ++--- .../miscellaneous/patchSummary/patchSummary.C | 4 +- .../foamDataToFluent/writeFluentScalarField.C | 2 +- .../viewFactor2AI/viewFactor2AI.C | 8 ++-- .../viewFactor2AI/viewFactor2AI.H | 8 ++-- .../viewFactor2LI/viewFactor2LI.C | 8 ++-- .../viewFactor2LI/viewFactor2LI.H | 8 ++-- .../viewFactorHottel/viewFactorHottel.C | 8 ++-- .../viewFactorHottel/viewFactorHottel.H | 8 ++-- .../viewFactorModel/viewFactorModel.H | 8 ++-- .../setAlphaField/setAlphaField.C | 10 ++--- src/OpenFOAM/containers/Lists/List/UList.H | 10 ++++- src/OpenFOAM/containers/Lists/List/UListI.H | 7 ---- .../lduMatrix/lduAddressing/lduAddressing.C | 8 ++-- .../lduCalculatedProcessorField.C | 2 +- .../cyclicGAMGInterfaceField.C | 4 +- src/OpenFOAM/meshes/lduMesh/lduMesh.C | 4 +- .../parallel/commSchedule/commSchedule.C | 2 +- .../atmNutWallFunctionFvPatchScalarField.C | 2 +- .../atmNutkWallFunctionFvPatchScalarField.C | 2 +- .../freeSurfacePointDisplacement.C | 2 +- .../interfaceTrackingFvMesh.C | 37 ++++++++++--------- .../attachDetach/attachInterface.C | 4 +- src/dynamicMesh/polyMeshAdder/polyMeshAdder.C | 12 +++--- src/dynamicMesh/polyMeshAdder/polyMeshAdder.H | 6 +-- .../hexRef8/refinementHistory.C | 2 +- .../hexRef8/refinementHistory.H | 2 +- .../enrichedPatch/enrichedPatch.H | 6 +-- .../faMesh/faMeshMapper/faPatchMapper.C | 2 +- .../faPatches/basic/coupled/coupledFaPatch.H | 2 +- .../expressions/patch/patchExprDriverFields.C | 2 +- .../calculatedProcessorFvPatchField.C | 4 +- .../constraint/cyclic/cyclicFvPatchField.C | 2 +- .../activeBaffleVelocityFvPatchVectorField.C | 4 +- ...ureForceBaffleVelocityFvPatchVectorField.C | 4 +- .../fvPatchFields/fvPatchField/fvPatchField.C | 2 +- .../faceCorrectedSnGrad/faceCorrectedSnGrad.C | 4 +- .../solvers/MULES/CMULESTemplates.C | 8 ++-- .../fvMatrices/solvers/MULES/MULESTemplates.C | 6 +-- .../interpolationPointMVC/pointMVCWeight.C | 2 +- .../interpolationPointMVC/pointMVCWeight.H | 2 +- .../schemes/linearUpwind/linearUpwind.C | 8 ++-- .../schemes/linearUpwind/linearUpwindV.C | 4 +- .../outletStabilised/outletStabilised.H | 30 ++++++--------- .../schemes/pointLinear/pointLinear.C | 4 +- .../field/fieldMinMax/fieldMinMaxTemplates.C | 2 +- src/fvOptions/cellSetOption/cellSetOption.C | 2 +- .../PairCollision/PairCollision.C | 4 +- .../PairCollision/PairCollision.H | 4 +- .../clouds/Templates/SprayCloud/SprayCloudI.H | 2 +- .../blockMesh/blockMesh/blockMeshCreate.C | 2 +- .../meshRefinement/meshRefinement.C | 6 +-- .../meshRefinement/meshRefinement.H | 6 +-- .../snappyHexMeshDriver/snappyLayerDriver.C | 8 ++-- .../snappyHexMeshDriver/snappySnapDriver.H | 8 ++-- .../snappySnapDriverFeature.C | 8 ++-- .../advancingFrontAMI/advancingFrontAMI.C | 2 +- .../advancingFrontAMI/advancingFrontAMI.H | 2 +- .../faceAreaWeightAMI/faceAreaWeightAMI.C | 6 +-- .../faceAreaWeightAMI/faceAreaWeightAMI.H | 2 +- .../cyclicACMIGAMGInterfaceField.C | 4 +- .../cyclicAMIGAMGInterfaceField.C | 4 +- .../faceAreaIntersect/faceAreaIntersect.H | 10 ++++- .../faceAreaIntersect/faceAreaIntersectI.H | 13 ------- .../adjointBoundaryCondition.C | 2 +- ...ointOutletVelocityFluxFvPatchVectorField.C | 2 +- .../linearUpwindNormal/linearUpwindNormal.C | 4 +- .../topODesignVariables/topODesignVariables.C | 6 +-- .../adjointSpalartAllmaras.C | 2 +- .../adjointkOmegaSST/adjointkOmegaSST.C | 12 +++--- .../kaqRWallFunctionFvPatchScalarField.C | 2 +- .../waWallFunctionFvPatchScalarField.C | 2 +- .../cellCellStencil/cellCellStencil.C | 2 +- .../cellCellStencilTemplates.C | 2 +- .../cellVolumeWeightCellCellStencil.C | 13 +++---- .../inverseDistanceCellCellStencil.C | 11 +++--- .../trackingInverseDistanceCellCellStencil.C | 4 +- src/overset/include/setCellMask.H | 2 +- src/overset/include/setInterpolatedCells.H | 2 +- .../oversetAdjustPhi/oversetAdjustPhi.C | 4 +- src/overset/oversetFvMesh/oversetFvMeshBase.C | 4 +- src/overset/oversetFvMesh/oversetFvMeshBase.H | 4 +- .../oversetPolyPatch/oversetFvPatchField.C | 12 +++--- .../wallBoiling/wallBoiling.C | 2 +- .../IATEsources/wallBoiling/wallBoiling.C | 2 +- .../singleLayerRegion/singleLayerRegion.C | 2 +- .../curvatureSeparation/curvatureSeparation.C | 4 +- .../patchInjection/patchInjection.C | 3 +- .../cellVolumeWeight/cellVolumeWeightMethod.C | 2 +- .../cellVolumeWeight/cellVolumeWeightMethod.H | 2 +- .../meshToMeshMethod/meshToMeshMethod.C | 2 +- .../meshToMeshMethod/meshToMeshMethod.H | 2 +- .../surface/isoSurface/isoSurfaceCell.H | 6 +-- .../isoSurface/isoSurfaceCellTemplates.C | 6 +-- .../surface/isoSurface/isoSurfacePoint.H | 6 +-- .../isoSurface/isoSurfacePointTemplates.C | 6 +-- .../radiationModels/solarLoad/solarLoad.C | 6 +-- .../isoAdvection/isoAdvection.C | 16 +++----- .../isoAdvection/isoAdvection.H | 5 +-- 119 files changed, 298 insertions(+), 336 deletions(-) diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index be66f4cc53..79a06161d1 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -60,13 +60,10 @@ template void zeroCells ( GeometricField& vf, - const labelList& cells + const labelUList& cells ) { - forAll(cells, i) - { - vf[cells[i]] = Zero; - } + UIndirectList(vf.primitiveField(), cells) = Zero; } diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H index 4d7b9d8811..3d19017f9d 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H @@ -103,8 +103,8 @@ dimensionedScalar alphaMax laminarTransport ); -const labelList& inletCells = mesh.boundary()["inlet"].faceCells(); -//const labelList& outletCells = mesh.boundary()["outlet"].faceCells(); +const labelUList& inletCells = mesh.boundary()["inlet"].faceCells(); +//const labelUList& outletCells = mesh.boundary()["outlet"].faceCells(); volScalarField alpha ( diff --git a/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H index 8c692c1378..f5304eea58 100644 --- a/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleFoam/overPimpleDyMFoam/correctPhi.H @@ -55,7 +55,7 @@ if (mesh.changing()) dimensionedScalar rAUf("rAUf", dimTime, 1.0); const cellCellStencilObject& overlap = Stencil::New(mesh); - const labelList& cellTypes = overlap.cellTypes(); + const labelUList& cellTypes = overlap.cellTypes(); const labelIOList& zoneIDs = overlap.zoneID(); while (pimple.correctNonOrthogonal()) diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFPatchTransfer/VoFPatchTransfer.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFPatchTransfer/VoFPatchTransfer.C index b0c52f0f62..e3e2d7ee5f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFPatchTransfer/VoFPatchTransfer.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/VoFPatchTransfer/VoFPatchTransfer.C @@ -210,7 +210,7 @@ void VoFPatchTransfer::correct film().toRegion(patchi, Vp); const polyPatch& pp = pbm[patchi]; - const labelList& faceCells = pp.faceCells(); + const labelUList& faceCells = pp.faceCells(); // Accumulate the total mass removed from patch scalar dMassPatch = 0; diff --git a/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H index 7df3631b04..9af4e28691 100644 --- a/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/overInterDyMFoam/correctPhi.H @@ -65,7 +65,7 @@ dimensionedScalar rAUf("rAUf", dimTime/rho.dimensions(), 1.0); const cellCellStencilObject& overlap = Stencil::New(mesh); - const labelList& cellTypes = overlap.cellTypes(); + const labelUList& cellTypes = overlap.cellTypes(); const labelIOList& zoneIDs = overlap.zoneID(); while (pimple.correctNonOrthogonal()) diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index d74f4ab01c..200a45becd 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -1674,10 +1674,9 @@ int main(int argc, char *argv[]) // Add cell zones to patch zone list forAll(bPatches, pI) { - const labelList& faceCells = bPatches[pI].faceCells(); - forAll(faceCells, fcI) + for (const label celli : bPatches[pI].faceCells()) { - if (zoneCell.test(faceCells[fcI])) + if (zoneCell.test(celli)) { boundaryZones[pI].append(name); break; diff --git a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C index f212aee72a..75ee48cccf 100644 --- a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C +++ b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C @@ -161,8 +161,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const { const faceUList& patchFaces = boundaryMesh()[patchi]; - const labelList& patchFaceCells = - boundaryMesh()[patchi].faceCells(); + const labelUList& patchFaceCells = boundaryMesh()[patchi].faceCells(); // The face group will be offset by 10 from the patch label diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 8e95e454a9..c91d9023bd 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -1506,7 +1506,7 @@ int main(int argc, char *argv[]) // Go through all the patchFaces and find corresponding face in pp. forAll(patchFaces, patchi) { - const DynamicList& pFaces = patchFaces[patchi]; + const auto& pFaces = patchFaces[patchi]; Info<< "Finding faces of patch " << patchi << endl; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C index 2c50d6c462..d0acdef622 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C @@ -42,7 +42,7 @@ template Foam::autoPtr Foam::DistributedDelaunayMesh::buildMap ( - const List