From 909e6b27e4d6988ce8cdc6df52fb649a125488ca Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@Germany> Date: Mon, 30 Nov 2009 08:55:03 +0100 Subject: [PATCH] Apply coding style recommendations: - space between keyword and bracket in 'for(..)', 'if(..)', 'while(..)' --- .../BCs/U/maxwellSlipUFvPatchVectorField.C | 4 +- .../incompressible/channelFoam/createGradP.H | 2 +- .../incompressible/channelFoam/writeGradP.H | 2 +- .../incompressible/pimpleDyMFoam/correctPhi.H | 4 +- .../solvers/multiphase/bubbleFoam/kEpsilon.H | 2 +- .../solvers/multiphase/bubbleFoam/pEqn.H | 2 +- .../compressibleInterDyMFoam/correctPhi.H | 2 +- .../multiphase/compressibleInterFoam/pEqn.H | 2 +- .../multiphase/interDyMFoam/correctPhi.H | 2 +- .../solvers/multiphase/interDyMFoam/pEqn.H | 2 +- .../solvers/multiphase/interFoam/correctPhi.H | 2 +- .../solvers/multiphase/interFoam/pEqn.H | 2 +- .../interPhaseChangeFoam/correctPhi.H | 2 +- .../multiphase/interPhaseChangeFoam/pEqn.H | 2 +- .../multiphaseMixture/multiphaseMixture.C | 10 ++-- .../multiphase/multiphaseInterFoam/pEqn.H | 2 +- .../solvers/multiphase/settlingFoam/pEqn.H | 2 +- .../multiphase/twoLiquidMixingFoam/pEqn.H | 2 +- .../GidaspowErgunWenYu/GidaspowErgunWenYu.C | 4 +- .../GidaspowSchillerNaumann.C | 2 +- .../SchillerNaumann/SchillerNaumann.C | 2 +- .../dragModels/WenYu/WenYu.C | 2 +- .../multiphase/twoPhaseEulerFoam/pEqn.H | 2 +- .../test/PackedList2/PackedListTest2.C | 2 +- .../extendedStencil/testExtendedStencil.C | 16 ++--- applications/test/router/processorRouter.C | 6 +- applications/test/router/router.C | 8 +-- .../mesh/conversion/ansysToFoam/ansysToFoam.L | 2 +- .../fluent3DMeshToFoam/fluent3DMeshToFoam.L | 4 +- .../fluentMeshToFoam/fluentMeshToFoam.L | 60 ++++++++++--------- .../conversion/gambitToFoam/gambitToFoam.L | 2 +- .../mesh/conversion/gmshToFoam/gmshToFoam.C | 4 +- .../ideasUnvToFoam/ideasUnvToFoam.C | 2 +- .../mesh/conversion/kivaToFoam/readKivaGrid.H | 10 ++-- .../conversion/polyDualMesh/meshDualiser.C | 2 +- .../starToFoam/createCoupleMatches.C | 4 +- .../manipulation/checkMesh/printMeshStats.C | 2 +- .../foamToFieldview9/writeFunctions.C | 2 +- .../foamToFieldview9/write_binary_uns.c | 10 ++-- .../dataConversion/foamToGMV/foamToGMV.C | 2 +- .../dataConversion/foamToGMV/gmvOutput.H | 2 +- .../foamToGMV/gmvOutputHeader.H | 14 ++--- .../dataConversion/foamToGMV/itoa.C | 2 +- .../USERD_get_gold_part_build_info.H | 4 +- .../ensightFoamReader/USERD_get_nfaced_conn.H | 8 +-- .../USERD_get_nfaced_nodes_per_face.H | 4 +- .../ensightFoamReader/USERD_get_nsided_conn.H | 2 +- .../USERD_get_part_elements_by_type.H | 4 +- .../fieldview9Reader/fieldview9Reader.C | 4 +- .../surface/surfaceCheck/surfaceCheck.C | 2 +- .../surface/surfaceCoarsen/surfaceCoarsen.C | 10 ++-- .../surfacePointMerge/surfacePointMerge.C | 2 +- .../surface/surfaceSmooth/surfaceSmooth.C | 2 +- doc/codingStyleGuide.org | 11 ++-- src/OSspecific/POSIX/printStack.C | 2 +- .../algorithms/MeshWave/FaceCellWave.C | 30 +++++----- .../FieldField/FieldFieldFunctions.C | 6 +- .../matrices/scalarMatrices/SVD/SVD.C | 4 +- .../matrices/scalarMatrices/SVD/SVDI.H | 2 +- .../matrices/scalarMatrices/scalarMatrices.C | 20 +++---- .../meshShapes/cellMatcher/cellMatcher.C | 2 +- .../meshShapes/cellMatcher/tetWedgeMatcher.C | 2 +- .../meshShapes/cellMatcher/wedgeMatcher.C | 2 +- src/OpenFOAM/meshes/meshShapes/face/face.C | 2 +- .../primitiveMeshCheck/primitiveMeshCheck.C | 6 +- .../meshes/primitiveMesh/primitiveMeshEdges.C | 2 +- .../primitiveMesh/primitivePatch/patchZones.C | 2 +- src/OpenFOAM/primitives/hashes/SHA1/SHA1.C | 2 +- src/dynamicMesh/boundaryMesh/boundaryMesh.C | 2 +- .../motionSmoother/motionSmoother.C | 4 +- .../motionSmoother/motionSmootherTemplates.C | 10 ++-- .../polyMeshAdder/faceCoupleInfo.C | 2 +- .../polyTopoChange/addPatchCellLayer.C | 4 +- .../polyTopoChange/edgeCollapser.C | 2 +- .../polyTopoChange/polyTopoChange/hexRef8.C | 2 +- .../slidingInterface/slidingInterface.C | 16 ++--- .../cfdTools/general/adjustPhi/adjustPhi.C | 2 +- .../derived/fan/fanFvPatchFields.C | 2 +- .../cellLimitedGrad/cellLimitedGrad.H | 2 +- .../cellMDLimitedGrad/cellMDLimitedGrad.H | 2 +- .../quadraticFitSnGradData.C | 12 ++-- .../fvMatrices/fvMatrix/fvMatrix.C | 2 +- .../fvMatrices/fvMatrix/fvMatrixSolve.C | 2 +- .../fvMatrices/solvers/MULES/MULESTemplates.C | 2 +- .../fvMesh/fvMeshSubset/fvMeshSubset.C | 2 +- .../findCellPointFaceTriangle.H | 8 +-- .../schemes/CentredFitScheme/CentredFitData.C | 2 +- .../schemes/FitData/FitData.C | 12 ++-- .../schemes/UpwindFitScheme/UpwindFitData.C | 4 +- .../pointPatchInterpolation.C | 8 +-- src/lagrangian/basic/Particle/Particle.C | 2 +- src/lagrangian/dieselSpray/parcel/parcel.C | 14 ++--- .../dieselSpray/parcel/setRelaxationTimes.C | 18 +++--- .../dieselSpray/spray/sprayFunctions.C | 10 ++-- .../dieselSpray/spray/sprayInject.C | 8 +-- .../atomizationModel/LISA/LISA.C | 2 +- .../gradientDispersionRAS.C | 2 +- .../stochasticDispersionRAS.C | 2 +- .../RutlandFlashBoil/RutlandFlashBoil.C | 4 +- .../clouds/Templates/DsmcCloud/DsmcCloud.C | 6 +- .../correlationFunction/correlationFunction.C | 2 +- .../interactionLists/interactionLists.C | 2 +- .../referredCell/referredCell.C | 2 +- .../molecule/mdTools/averageMDFields.H | 6 +- .../mdTools/meanMomentumEnergyAndNMols.H | 4 +- .../molecule/molecule/moleculeI.H | 4 +- .../molecule/moleculeCloud/moleculeCloud.C | 2 +- .../molecule/moleculeCloud/moleculeCloudI.H | 4 +- .../pairPotentialList/pairPotentialList.C | 2 +- .../potential/potential/potential.C | 10 ++-- .../autoHexMeshDriver/autoLayerDriverShrink.C | 2 +- .../trackedParticle/ExactParticle.C | 2 +- src/meshTools/PointEdgeWave/PointEdgeWave.C | 2 +- .../cellClassification/cellClassification.C | 6 +- src/meshTools/cellDist/cellDistFuncs.C | 2 +- src/meshTools/meshSearch/meshSearch.C | 4 +- .../polyMeshZipUpCells/polyMeshZipUpCells.C | 4 +- src/meshTools/regionSplit/regionSplit.C | 2 +- .../setsToFaceZone/setsToFaceZone.C | 12 ++-- .../intersectedSurface/edgeSurface.C | 2 +- .../intersectedSurface/intersectedSurface.C | 2 +- .../surfaceIntersection/surfaceIntersection.C | 2 +- .../surfaceIntersectionFuncs.C | 4 +- .../orientedSurface/orientedSurface.C | 2 +- .../triSurfaceTools/triSurfaceTools.C | 2 +- src/sampling/include/mapPatch.H | 6 +- src/sampling/sampledSet/curve/curveSet.C | 10 ++-- src/sampling/sampledSet/face/faceOnlySet.C | 6 +- .../sampledSet/midPoint/midPointSet.C | 2 +- .../midPointAndFace/midPointAndFaceSet.C | 2 +- src/sampling/sampledSet/uniform/uniformSet.C | 8 +-- .../writers/raw/rawSurfaceWriter.C | 2 +- .../ODEChemistryModel/ODEChemistryModel.C | 2 +- .../pdfs/RosinRammler/RosinRammler.C | 2 +- .../pdfs/exponential/exponential.C | 2 +- .../pdfs/general/general.C | 2 +- .../radiationModel/fvDOM/fvDOM/fvDOM.C | 2 +- .../chemkinReader/chemkinReader.C | 4 +- .../chemkinReader/chemkinReader.H | 2 +- .../triSurface/interfaces/OBJ/readOBJ.C | 2 +- .../triSurface/interfaces/STL/readSTLASCII.L | 2 +- .../triSurface/interfaces/TRI/readTRI.C | 2 +- src/triSurface/triSurface/triSurface.C | 2 +- .../triSurface/triSurfaceAddressing.C | 2 +- .../nutURoughWallFunctionFvPatchScalarField.C | 2 +- .../nutUWallFunctionFvPatchScalarField.C | 2 +- .../biconic25-55Run35/datToFoam/datToFoam.C | 4 +- .../MRFInterFoam/MRFInterFoam/pEqn.H | 2 +- 148 files changed, 343 insertions(+), 342 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index ec8f777542b..3b69386ed6b 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -155,7 +155,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() refValue() = Uwall_; - if(thermalCreep_) + if (thermalCreep_) { const volScalarField& vsfT = this->db().objectRegistry::lookupObject<volScalarField>("T"); @@ -167,7 +167,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() refValue() -= 3.0*pnu/(4.0*pT)*transform(I - n*n, gradpT); } - if(curvature_) + if (curvature_) { const fvPatchTensorField& ptauMC = patch().lookupPatchField<volTensorField, tensor>("tauMC"); diff --git a/applications/solvers/incompressible/channelFoam/createGradP.H b/applications/solvers/incompressible/channelFoam/createGradP.H index 9bb9bb0ba28..643509c46f9 100644 --- a/applications/solvers/incompressible/channelFoam/createGradP.H +++ b/applications/solvers/incompressible/channelFoam/createGradP.H @@ -11,7 +11,7 @@ runTime.path()/runTime.timeName()/"uniform"/"gradP.raw" ); - if(gradPFile.good()) + if (gradPFile.good()) { gradPFile >> gradP; Info<< "Reading average pressure gradient" <<endl diff --git a/applications/solvers/incompressible/channelFoam/writeGradP.H b/applications/solvers/incompressible/channelFoam/writeGradP.H index c82dd534740..afbca9e61d0 100644 --- a/applications/solvers/incompressible/channelFoam/writeGradP.H +++ b/applications/solvers/incompressible/channelFoam/writeGradP.H @@ -5,7 +5,7 @@ runTime.path()/runTime.timeName()/"uniform"/"gradP.raw" ); - if(gradPFile.good()) + if (gradPFile.good()) { gradPFile << gradP << endl; } diff --git a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H index 394b1cbd3eb..f1651d8df39 100644 --- a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H @@ -29,7 +29,7 @@ for (label i=0; i<p.boundaryField().size(); i++) { - if(p.boundaryField()[i].fixesValue()) + if (p.boundaryField()[i].fixesValue()) { pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; } @@ -50,7 +50,7 @@ pcorrTypes ); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pcorrEqn ( diff --git a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H index 576e3253abf..84dadd7acb5 100644 --- a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H +++ b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H @@ -1,4 +1,4 @@ -if(turbulence) +if (turbulence) { if (mesh.changing()) { diff --git a/applications/solvers/multiphase/bubbleFoam/pEqn.H b/applications/solvers/multiphase/bubbleFoam/pEqn.H index 35813dd935e..3e550efc65e 100644 --- a/applications/solvers/multiphase/bubbleFoam/pEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/pEqn.H @@ -34,7 +34,7 @@ surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H index f681ba65940..e4bef5a60fe 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H @@ -42,7 +42,7 @@ adjustPhi(phi, U, pcorr); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pcorrEqn ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 9d2dc23916b..e6ff7134291 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -30,7 +30,7 @@ + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqnIncomp ( diff --git a/applications/solvers/multiphase/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interDyMFoam/correctPhi.H index 43b13c2b898..72550e621c0 100644 --- a/applications/solvers/multiphase/interDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interDyMFoam/correctPhi.H @@ -42,7 +42,7 @@ adjustPhi(phi, U, pcorr); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pcorrEqn ( diff --git a/applications/solvers/multiphase/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interDyMFoam/pEqn.H index 2af289a76f3..afefb0a5f09 100644 --- a/applications/solvers/multiphase/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interDyMFoam/pEqn.H @@ -18,7 +18,7 @@ + fvc::interpolate(rho)*(g & mesh.Sf()) )*rAUf; - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/interFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/correctPhi.H index 0274b7e9ed8..a41332ce9bd 100644 --- a/applications/solvers/multiphase/interFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/correctPhi.H @@ -34,7 +34,7 @@ adjustPhi(phi, U, pcorr); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pcorrEqn ( diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 7aa172b8584..7473848c62d 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -19,7 +19,7 @@ + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H index 17377302f0e..2547dac9663 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H @@ -34,7 +34,7 @@ adjustPhi(phi, U, pcorr); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pcorrEqn ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 3c164cc5743..519a0b9f653 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -23,7 +23,7 @@ const volScalarField& vDotcP = vDotP[0](); const volScalarField& vDotvP = vDotP[1](); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 6d32abd9c72..0e1252bea79 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -125,7 +125,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::rho() const tmp<volScalarField> trho = iter()*iter().rho(); - for(++iter; iter != phases_.end(); ++iter) + for (++iter; iter != phases_.end(); ++iter) { trho() += iter()*iter().rho(); } @@ -140,7 +140,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::mu() const tmp<volScalarField> tmu = iter()*iter().rho()*iter().nu(); - for(++iter; iter != phases_.end(); ++iter) + for (++iter; iter != phases_.end(); ++iter) { tmu() += iter()*iter().rho()*iter().nu(); } @@ -156,7 +156,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::muf() const tmp<surfaceScalarField> tmuf = fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); - for(++iter; iter != phases_.end(); ++iter) + for (++iter; iter != phases_.end(); ++iter) { tmuf() += fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); @@ -210,7 +210,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const PtrDictionary<phase>::const_iterator iter2 = iter1; ++iter2; - for(; iter2 != phases_.end(); ++iter2) + for (; iter2 != phases_.end(); ++iter2) { const phase& alpha2 = iter2(); @@ -489,7 +489,7 @@ void Foam::multiphaseMixture::solveAlphas if (cycleAlpha) { PtrDictionary<phase>::iterator refPhaseIter = phases_.begin(); - for(label i=0; i<nSolves%phases_.size(); i++) + for (label i=0; i<nSolves%phases_.size(); i++) { ++refPhaseIter; } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H index 4bec77f950d..7e9f30c01c0 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H @@ -18,7 +18,7 @@ + fvc::interpolate(rho)*(g & mesh.Sf()) )*rUAf; - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index b4fc05b32ab..77bb0f45924 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -17,7 +17,7 @@ phi = surfaceScalarField phiU("phiU", phi); phi += fvc::interpolate(rho)*(g & mesh.Sf())*rUAf; -for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index 7ba3cdba8a6..f1e07558cb3 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -13,7 +13,7 @@ phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rUAf; - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index 0576f4694e5..7d6e41bf4cb 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -78,12 +78,12 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowErgunWenYu::K forAll(Re, celli) { - if(Re[celli] > 1000.0) + if (Re[celli] > 1000.0) { Cds[celli] = 0.44; } } - + // Wen and Yu (1966) tmp<volScalarField> tKWenYu = 0.75*Cds*phaseb_.rho()*Ur*bp/phasea_.d(); volScalarField& KWenYu = tKWenYu(); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C index 256d0861c03..1be08abd3a6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -77,7 +77,7 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowSchillerNaumann::K forAll(Re, celli) { - if(Re[celli] > 1000.0) + if (Re[celli] > 1000.0) { Cds[celli] = 0.44; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C index 707c269c24d..59e7bed10e0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::SchillerNaumann::K forAll(Re, celli) { - if(Re[celli] > 1000.0) + if (Re[celli] > 1000.0) { Cds[celli] = 0.44; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index 76465069333..febe1d11f09 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -77,7 +77,7 @@ Foam::tmp<Foam::volScalarField> Foam::WenYu::K forAll(Re, celli) { - if(Re[celli] > 1000.0) + if (Re[celli] > 1000.0) { Cds[celli] = 0.44; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index ad48745519b..57a25a299d3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -47,7 +47,7 @@ surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( diff --git a/applications/test/PackedList2/PackedListTest2.C b/applications/test/PackedList2/PackedListTest2.C index d6e8c93bc26..bb61f6e308a 100644 --- a/applications/test/PackedList2/PackedListTest2.C +++ b/applications/test/PackedList2/PackedListTest2.C @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) sum = 0; for (label iter = 0; iter < nIters; ++iter) { - for(unsigned int i = 0; i < stlVector.size(); i++) + for (unsigned int i = 0; i < stlVector.size(); i++) { sum += stlVector[i]; } diff --git a/applications/test/extendedStencil/testExtendedStencil.C b/applications/test/extendedStencil/testExtendedStencil.C index 876576b29ea..e8cde9051bc 100644 --- a/applications/test/extendedStencil/testExtendedStencil.C +++ b/applications/test/extendedStencil/testExtendedStencil.C @@ -188,11 +188,11 @@ int main(int argc, char *argv[]) // ( // mesh // ); -// +// // Info<< "cellFaceCell:" << endl; // writeStencilStats(addressing.stencil()); -// -// +// +// // //// Do some interpolation. // //{ // // const labelListList& stencil = addressing.stencil(); @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) // mesh.C(), // stencilPoints // ); -// +// // forAll(stencilPoints, faceI) // { // if (stencilPoints[faceI].size() >= 15) @@ -443,10 +443,10 @@ int main(int argc, char *argv[]) ( mesh ); - + Info<< "cellFaceCell:" << endl; writeStencilStats(addressing.stencil()); - + // Collect stencil face centres List<List<point> > stencilPoints(mesh.nCells()); addressing.collectData @@ -454,7 +454,7 @@ int main(int argc, char *argv[]) mesh.Cf(), stencilPoints ); - + forAll(stencilPoints, cellI) { writeStencilOBJ @@ -477,7 +477,7 @@ int main(int argc, char *argv[]) // vf, // stencilData // ); -// for(label faci = 0; faci < mesh.nInternalFaces(); faci++) +// for (label faci = 0; faci < mesh.nInternalFaces(); faci++) // { // const scalarList& stData = stencilData[faceI]; // const scalarList& stWeight = fit[faceI]; diff --git a/applications/test/router/processorRouter.C b/applications/test/router/processorRouter.C index e94025ff2b6..5f68822cf30 100644 --- a/applications/test/router/processorRouter.C +++ b/applications/test/router/processorRouter.C @@ -71,7 +71,7 @@ labelList procNeighbours(const polyMesh& mesh) { const polyPatch& patch = mesh.boundaryMesh()[patchI]; - const processorPolyPatch& procPatch = + const processorPolyPatch& procPatch = refCast<const processorPolyPatch>(patch); label procId = procPatch.neighbProcNo() - Pstream::firstSlave() + 1; @@ -96,7 +96,7 @@ point meshCentre(const polyMesh& mesh) int main(int argc, char *argv[]) { -# include "setRootCase.H" +# include "setRootCase.H" # include "createTime.H" # include "createMesh.H" @@ -230,7 +230,7 @@ int main(int argc, char *argv[]) // Dump route as lines. labelList route(cellRouter.getRoute(-(pathI + 1))); - for(label elemI = 1; elemI < route.size(); elemI++) + for (label elemI = 1; elemI < route.size(); elemI++) { objFile << "l " << route[elemI-1]+1 << ' ' diff --git a/applications/test/router/router.C b/applications/test/router/router.C index 1af001a81f9..a4747396964 100644 --- a/applications/test/router/router.C +++ b/applications/test/router/router.C @@ -38,7 +38,7 @@ Foam::label Foam::router::count(const label weight) const { cnt += weights_[nodeI]; } - + return cnt; } @@ -315,7 +315,7 @@ bool Foam::router::route(const labelList& path, const label pathValue) setWeights(0, path[0]); // Check if all endPoints can be reached - for(label leafI = 1; leafI < path.size(); leafI++) + for (label leafI = 1; leafI < path.size(); leafI++) { if (weights_[path[leafI]] == labelMax) { @@ -329,7 +329,7 @@ bool Foam::router::route(const labelList& path, const label pathValue) } // Search back from all endpoints to start and fix weights - for(label leafI = 1; leafI < path.size(); leafI++) + for (label leafI = 1; leafI < path.size(); leafI++) { fixWeights ( @@ -370,7 +370,7 @@ bool Foam::router::route(const labelList& path, const label pathValue) { weights_[nodeI] = 0; } - } + } return true; } diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index c985d3ab4f4..bcdf44f265f 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -264,7 +264,7 @@ int main(int argc, char *argv[]) } yyFlexLexer lexer(&ansysStream); - while(lexer.yylex() != 0) + while (lexer.yylex() != 0) {} Info<< "Creating points" << endl; diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 6ccb2697f4f..cf46939eaeb 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -813,7 +813,7 @@ int main(int argc, char *argv[]) yyFlexLexer lexer(&fluentStream.stdStream()); - while(lexer.yylex() != 0) + while (lexer.yylex() != 0) {} Info<< "\nFINISHED LEXING\n\n"; @@ -973,7 +973,7 @@ int main(int argc, char *argv[]) // Set the owner of these faces to -1 so that they do not get // added to the mesh - for(label facei = start; facei <= end; facei++) + for (label facei = start; facei <= end; facei++) { owner[facei] = -1; } diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index bcba234fe14..3460a213e87 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -898,7 +898,7 @@ int main(int argc, char *argv[]) } yyFlexLexer lexer(&fluentStream); - while(lexer.yylex() != 0) + while (lexer.yylex() != 0) {} Info<< "\n\nFINISHED LEXING\n\n\n"; @@ -1388,7 +1388,7 @@ int main(int argc, char *argv[]) meshFaces[j] = cMeshFace; pFaceSet.insert(cMeshFace); } - if(writeSets) + if (writeSets) { Info<< "Writing patch " << patchNames[patchI] << " of size " << sz << " to faceSet." << endl; @@ -1404,7 +1404,11 @@ int main(int argc, char *argv[]) //it will be put in a default wall boundary //internal boundaries are simply ignored - if(patchTypes[patchI] != "internal" && !pShapeMesh.isInternalFace(meshFaces[0])) + if + ( + patchTypes[patchI] != "internal" + && !pShapeMesh.isInternalFace(meshFaces[0]) + ) { //first face is external and has valid non-internal type @@ -1423,7 +1427,7 @@ int main(int argc, char *argv[]) << exit(FatalError); } - if(facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1) + if (facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1) { FatalErrorIn(args.executable()) << "Face " << faceI << " on new patch " @@ -1475,7 +1479,7 @@ int main(int argc, char *argv[]) DynamicList<label> defaultBoundaryFaces(facePatchID.size()); forAll(facePatchID, idI) { - if(facePatchID[idI] == -1) + if (facePatchID[idI] == -1) { defaultBoundaryFaces.append(idI); facePatchID[idI] = nBoundaries; @@ -1575,50 +1579,50 @@ int main(int argc, char *argv[]) boundaryZones[pI].append(bPatches[pI].name()); } - label cnt=0; - SLList<label>::iterator cg = cellGroupZoneID.begin(); - SLList<label>::iterator start = cellGroupStartIndex.begin(); - SLList<label>::iterator end = cellGroupEndIndex.begin(); + label cnt=0; + SLList<label>::iterator cg = cellGroupZoneID.begin(); + SLList<label>::iterator start = cellGroupStartIndex.begin(); + SLList<label>::iterator end = cellGroupEndIndex.begin(); - for (; cg != cellGroupZoneID.end(); ++cg, ++start, ++end) - { - const word& name = patchNameIDs[cg()]; - const word& type = patchTypeIDs[cg()]; + for (; cg != cellGroupZoneID.end(); ++cg, ++start, ++end) + { + const word& name = patchNameIDs[cg()]; + const word& type = patchTypeIDs[cg()]; - Info<< "Writing cell zone: " << name + Info<< "Writing cell zone: " << name << " of type " << type << " starting at " << start() - 1 << " ending at " << end() - 1 << " to cellSet." << endl; - labelList cls(end() - start() + 1); + labelList cls(end() - start() + 1); // Mark zone cells, used for finding faces boolList zoneCell(pShapeMesh.nCells(), false); - // shift cell indizes by 1 - label nr=0; - for (label celli = (start() - 1); celli < end(); celli++) + // shift cell indizes by 1 + label nr=0; + for (label celli = (start() - 1); celli < end(); celli++) { cls[nr]=celli; zoneCell[celli] = true; nr++; - } + } - cz[cnt] = new cellZone - ( + cz[cnt] = new cellZone + ( name, cls, cnt, pShapeMesh.cellZones() - ); + ); DynamicList<label> zoneFaces(pShapeMesh.nFaces()); forAll(pShapeMesh.faceNeighbour(), faceI) { label nei = pShapeMesh.faceNeighbour()[faceI]; label own = pShapeMesh.faceOwner()[faceI]; - if(nei != -1) + if (nei != -1) { - if(zoneCell[nei] && zoneCell[own]) + if (zoneCell[nei] && zoneCell[own]) { zoneFaces.append(faceI); } @@ -1641,7 +1645,7 @@ int main(int argc, char *argv[]) const labelList& faceCells = bPatches[pI].faceCells(); forAll(faceCells, fcI) { - if(zoneCell[faceCells[fcI] ]) + if (zoneCell[faceCells[fcI] ]) { boundaryZones[pI].append(name); break; @@ -1649,8 +1653,8 @@ int main(int argc, char *argv[]) } } - cnt++; - } + cnt++; + } pShapeMesh.addZones(pz, fz, cz); @@ -1715,7 +1719,7 @@ int main(int argc, char *argv[]) cellSet internal(pShapeMesh, name, end() - start()); // shift cell indizes by 1 - for(label celli=start() - 1; celli<=end() - 1; celli++) + for (label celli = start() - 1; celli <= end() - 1; celli++) { internal.insert(celli); } diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L index 4f8708710d1..bc88b46c1e0 100644 --- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L +++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L @@ -665,7 +665,7 @@ int main(int argc, char *argv[]) } yyFlexLexer lexer(&gambitStream); - while(lexer.yylex() != 0) + while (lexer.yylex() != 0) {} Info<< "Finished lexing" << endl; diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 2365f418d79..16977b92c67 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -314,14 +314,14 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames) IStringStream lineStr(line); label nSpaces = lineStr.str().count(' '); - if(nSpaces == 1) + if (nSpaces == 1) { lineStr >> regionI >> regionName; Info<< " " << regionI << '\t' << string::validate<word>(regionName) << endl; } - else if(nSpaces == 2) + else if (nSpaces == 2) { // >= Gmsh2.4 physical types has tag in front. label physType; diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 3192f610ad2..f289e8bb389 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -412,7 +412,7 @@ void readPatches Sout<< "Starting reading patches at line " << is.lineNumber() << '.' << endl; - while(true) + while (true) { string line; is.getLine(line); diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index ba2b615df18..92c7b7c355f 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -20,7 +20,7 @@ pointField points(nPoints); label i4; labelList idface(nPoints), fv(nPoints); -for(label i=0; i<nPoints; i++) +for (label i=0; i<nPoints; i++) { scalar ffv; kivaFile @@ -44,7 +44,7 @@ labelList i1tab(nPoints), i3tab(nPoints), i8tab(nPoints), idreg(nPoints), label nBfaces = 0; -for(label i=0; i<nPoints; i++) +for (label i=0; i<nPoints; i++) { label i1, i3, i8; scalar ff, fbcl, fbcf, fbcb; @@ -85,7 +85,7 @@ if (mTable == 0) labelList imtab(nPoints), jmtab(nPoints), kmtab(nPoints); -for(label i=0; i<nPoints; i++) +for (label i=0; i<nPoints; i++) { label im, jm, km; kivaFile >> i4 >> im >> jm >> km; @@ -115,7 +115,7 @@ forAll (pointMap, i) } // Initialise all cells to hex and search and set map for collocated points -for(label i=0; i<nPoints; i++) +for (label i=0; i<nPoints; i++) { if (f[i] > 0.0) { @@ -237,7 +237,7 @@ List<SLList<face> > pFaces[nBCs]; face quadFace(4); face triFace(3); -for(label i=0; i<nPoints; i++) +for (label i=0; i<nPoints; i++) { if (f[i] > 0) { diff --git a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C index dfc1fbb20e6..52898444ae4 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C @@ -1410,7 +1410,7 @@ void Foam::meshDualiser::setRefinement meshMod ); } - while(fp != 0); + while (fp != 0); } } diff --git a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C index f2fcc8c7c8a..d1a074c391b 100644 --- a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C @@ -545,7 +545,7 @@ void starMesh::createCoupleMatches() points_[masterEdges[masterEdgeI].start()]; // loop until the next label to add is -1 - for(;;) + for (;;) { label nextPointLabel = -1; label usedI = -1; @@ -739,7 +739,7 @@ void starMesh::createCoupleMatches() points_[slaveEdges[slaveEdgeI].start()]; // loop until the next label to add is -1 - for(;;) + for (;;) { label nextPointLabel = -1; label usedI = -1; diff --git a/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C b/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C index 269656594c5..462d1531f8d 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C +++ b/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C @@ -96,7 +96,7 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology) label nTetWedge = 0; label nUnknown = 0; - for(label cellI = 0; cellI < mesh.nCells(); cellI++) + for (label cellI = 0; cellI < mesh.nCells(); cellI++) { if (hex.isA(mesh, cellI)) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C index f44d4499013..d4dcdbbcf15 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/writeFunctions.C @@ -75,7 +75,7 @@ void writeBytes(char* start, int nBytes) cout<< start << " : "; - for(int i = 0; i < nBytes; i++) + for (int i = 0; i < nBytes; i++) { cout<< " " << start[i]; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/write_binary_uns.c b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/write_binary_uns.c index 105d042792f..6cd3eb6620b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/write_binary_uns.c +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/write_binary_uns.c @@ -423,7 +423,7 @@ int main() fwrite(ibuf, sizeof(int), 3, outfp); - for(i = 0; i < num_faces_trim_cell; ++i) /* loop over the faces */ + for (i = 0; i < num_faces_trim_cell; ++i) /* loop over the faces */ fwrite(trim_cell_face[i], sizeof(int), trim_cell_face[i][0] + 1, outfp); @@ -433,7 +433,7 @@ int main() fwrite(ibuf, sizeof(int), 3, outfp); - for(i = 0; i < num_faces_hang_cell; ++i) /* loop over the faces */ + for (i = 0; i < num_faces_hang_cell; ++i) /* loop over the faces */ fwrite(hang_cell_face[i], sizeof(int), hang_cell_face[i][0] + 1, outfp); @@ -519,7 +519,7 @@ int main() ibuf[0] = A_WALL; /* wall value */ ibuf[1] = 0; /* number of hanging nodes */ - for(i = 0; i < num_faces_trim_cell; ++i) /* write out face info */ + for (i = 0; i < num_faces_trim_cell; ++i) /* write out face info */ { fwrite(ibuf, sizeof(int), 1, outfp); /* write wall value */ fwrite(trim_cell_face[i], sizeof(int), trim_cell_face[i][0] + 1, @@ -541,7 +541,7 @@ int main() ibuf[2] = 1; /* number of hanging nodes for face 3 */ ibuf[3] = 31; /* the node number for the hanging node on face 3*/ - for(i = 0; i < 2; ++i) /* write out face info for first 2 faces */ + for (i = 0; i < 2; ++i) /* write out face info for first 2 faces */ { fwrite(ibuf, sizeof(int), 1, outfp); /* write wall value */ fwrite(hang_cell_face[i], sizeof(int), hang_cell_face[i][0] + 1, @@ -555,7 +555,7 @@ int main() fwrite(&ibuf[2], sizeof(int), 2, outfp); /* write out face info for last 3 faces */ - for(i = 3; i < num_faces_hang_cell; ++i) + for (i = 3; i < num_faces_hang_cell; ++i) { fwrite(ibuf, sizeof(int), 1, outfp); /* write wall value */ fwrite(hang_cell_face[i], sizeof(int), hang_cell_face[i][0] + 1, diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C b/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C index 40179616fc4..d9b807e316d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) Info<< TimeList << endl; label nTimes = TimeList.size(); - for(label n=1; n < nTimes; n++) + for (label n=1; n < nTimes; n++) { if (TimeList[n].value() > startTime) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H b/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H index 03523ed2de7..124bab14119 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H @@ -24,7 +24,7 @@ for (label i=0; i < nTypes; i++) { volScalarField gmvScalarField(fieldObject, mesh); gmvFile << fieldName << " 0" << nl; - for(label indx=0;indx<mesh.nCells();indx++) + for (label indx=0;indx<mesh.nCells();indx++) { gmvFile << gmvScalarField[indx] << " "; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutputHeader.H b/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutputHeader.H index ff904f9a709..46fa702ea1c 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutputHeader.H +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutputHeader.H @@ -4,29 +4,29 @@ const cellShapeList& cells = mesh.cellShapes(); gmvFile << "gmvinput " << format << nl; gmvFile << "nodes " << nPoints << nl; -for(label indx=0;indx<nPoints;indx++) +for (label indx=0;indx<nPoints;indx++) { gmvFile << points[indx].x() << " "; } gmvFile << nl; -for(label indx=0;indx<nPoints;indx++) +for (label indx=0;indx<nPoints;indx++) { gmvFile << points[indx].y() << " "; } gmvFile << nl; -for(label indx=0;indx<nPoints;indx++) +for (label indx=0;indx<nPoints;indx++) { gmvFile << points[indx].z() << " "; } gmvFile << nl; gmvFile << "cells " << cells.size() << nl; -for(label indx=0;indx<cells.size();indx++) +for (label indx=0;indx<cells.size();indx++) { label nNodes = cells[indx].size(); if (nNodes == 8) { gmvFile << "hex " << 8 << " "; - for(label ip=0; ip<nNodes; ip++) + for (label ip=0; ip<nNodes; ip++) { gmvFile << cells[indx][ip] + 1 << " "; } @@ -35,7 +35,7 @@ for(label indx=0;indx<cells.size();indx++) else if (nNodes == 4) { gmvFile << "tet " << 4 << " "; - for(label ip=0; ip<nNodes; ip++) + for (label ip=0; ip<nNodes; ip++) { gmvFile << cells[indx][ip] + 1 << " "; } @@ -44,7 +44,7 @@ for(label indx=0;indx<cells.size();indx++) else if (nNodes == 6) { gmvFile << "prism " << 6 << " "; - for(label ip=0; ip<nNodes; ip++) + for (label ip=0; ip<nNodes; ip++) { gmvFile << cells[indx][ip] + 1 << " "; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/itoa.C b/applications/utilities/postProcessing/dataConversion/foamToGMV/itoa.C index 391d2c041c3..73df488b11b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/itoa.C +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/itoa.C @@ -44,7 +44,7 @@ word itoa(const label n) label leftOfN = n; - for(label i=0; i<length; i++) + for (label i=0; i<length; i++) { label j = label(leftOfN/pow(10, length-i-1)); leftOfN -= j*pow(10,length-i-1); 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 3805a1e498e..3d278c03675 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 @@ -32,7 +32,7 @@ int USERD_get_gold_part_build_info strncpy(part_descriptions[0], meshName, Z_BUFL); - for(label i=0; i<nPatches; i++) + for (label i=0; i<nPatches; i++) { word patchName(meshPtr->boundary()[i].name()); strncpy(part_descriptions[i+1], patchName.c_str(), Z_BUFL); @@ -104,7 +104,7 @@ int USERD_get_gold_part_build_info const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh(); - for(label i=0; i<nPatches; i++) + for (label i=0; i<nPatches; i++) { label nTri03 = 0; label nQuad04 = 0; diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_conn.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_conn.H index 74289710fc6..436d68d2591 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_conn.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_conn.H @@ -36,11 +36,11 @@ int USERD_get_nfaced_conn {} else { - for(label i=0; i<nFacesInCell; i++) + for (label i=0; i<nFacesInCell; i++) { label facei = cells[n][i]; label nPoints = faces[facei].size(); - for(label j=0; j<nPoints; j++) + for (label j=0; j<nPoints; j++) { nfaced_conn_array[nPoint++] = faces[facei][j] + 1; } @@ -49,11 +49,11 @@ int USERD_get_nfaced_conn } else { - for(label i=0; i<nFacesInCell; i++) + for (label i=0; i<nFacesInCell; i++) { label facei = cells[n][i]; label nPoints = faces[facei].size(); - for(label j=0; j<nPoints; j++) + for (label j=0; j<nPoints; j++) { nfaced_conn_array[nPoint++] = faces[facei][j] + 1; } diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_nodes_per_face.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_nodes_per_face.H index 4629c57c387..335f928516a 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_nodes_per_face.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nfaced_nodes_per_face.H @@ -38,7 +38,7 @@ int USERD_get_nfaced_nodes_per_face {} else { - for(label i=0; i<nFacesInCell; i++) + for (label i=0; i<nFacesInCell; i++) { label facei = cells[n][i]; label nFacePoints = faces[facei].size(); @@ -48,7 +48,7 @@ int USERD_get_nfaced_nodes_per_face } else { - for(label i=0; i<nFacesInCell; i++) + for (label i=0; i<nFacesInCell; i++) { label facei = cells[n][i]; label nFacePoints = faces[facei].size(); diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nsided_conn.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nsided_conn.H index d5baece99bd..c99361c3fb0 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nsided_conn.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_nsided_conn.H @@ -30,7 +30,7 @@ int USERD_get_nsided_conn label nPoints = bMesh[patchi][facei].size(); if ((nPoints != 3) && (nPoints != 4)) { - for(label i=0; i<nPoints; i++) + for (label i=0; i<nPoints; i++) { nsided_conn_array[np++] = bMesh[patchi][facei][i] + 1; } diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_part_elements_by_type.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_part_elements_by_type.H index cd13e108f91..d90f3643fc7 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_part_elements_by_type.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_part_elements_by_type.H @@ -193,7 +193,7 @@ int USERD_get_part_elements_by_type label nPoints = bMesh[patchi][n].size(); if (nPoints == 3) { - for(label i=0; i<nPoints; i++) + for (label i=0; i<nPoints; i++) { label ip = bMesh[patchi][n][i]; conn_array[nTri03][i] = ip + 1; @@ -209,7 +209,7 @@ int USERD_get_part_elements_by_type label nPoints = bMesh[patchi][n].size(); if (nPoints == 4) { - for(label i=0; i<nPoints; i++) + for (label i=0; i<nPoints; i++) { label ip = bMesh[patchi][n][i]; conn_array[nQuad04][i] = ip + 1; diff --git a/applications/utilities/postProcessing/graphics/fieldview9Reader/fieldview9Reader.C b/applications/utilities/postProcessing/graphics/fieldview9Reader/fieldview9Reader.C index 17f1dfcb2ee..a658631a9f1 100644 --- a/applications/utilities/postProcessing/graphics/fieldview9Reader/fieldview9Reader.C +++ b/applications/utilities/postProcessing/graphics/fieldview9Reader/fieldview9Reader.C @@ -314,7 +314,7 @@ static void storeScalarField Info<< "Storing " << nTotPoints << " of dummy values of " << fieldName << endl; - for(label i = 0; i < nPoints; i++) + for (label i = 0; i < nPoints; i++) { vars[pointI++] = 0.0; } @@ -388,7 +388,7 @@ static void storeVectorField for (direction d = 0; d < vector::nComponents; d++) { - for(label i = 0; i < nPoints; i++) + for (label i = 0; i < nPoints; i++) { vars[pointI++] = 0.0; } diff --git a/applications/utilities/surface/surfaceCheck/surfaceCheck.C b/applications/utilities/surface/surfaceCheck/surfaceCheck.C index d283ec66afc..1a8253b25d7 100644 --- a/applications/utilities/surface/surfaceCheck/surfaceCheck.C +++ b/applications/utilities/surface/surfaceCheck/surfaceCheck.C @@ -550,7 +550,7 @@ int main(int argc, char *argv[]) fileName surfFileNameBase(surfFileName.name()); - for(label zone = 0; zone < numZones; zone++) + for (label zone = 0; zone < numZones; zone++) { boolList includeMap(surf.size(), false); diff --git a/applications/utilities/surface/surfaceCoarsen/surfaceCoarsen.C b/applications/utilities/surface/surfaceCoarsen/surfaceCoarsen.C index 146f8d1213e..ea4f795edad 100644 --- a/applications/utilities/surface/surfaceCoarsen/surfaceCoarsen.C +++ b/applications/utilities/surface/surfaceCoarsen/surfaceCoarsen.C @@ -131,19 +131,19 @@ int main(int argc, char *argv[]) // rearrange the vertex list ::List< ::Vector> temp_list; - for(int i=0;i<vert.num;i++) + for (int i=0;i<vert.num;i++) { temp_list.Add(vert[i]); } - for(int i=0;i<vert.num;i++) + for (int i=0;i<vert.num;i++) { vert[permutation[i]]=temp_list[i]; } // update the changes in the entries in the triangle list - for(int i=0;i<tri.num;i++) + for (int i=0;i<tri.num;i++) { - for(int j=0;j<3;j++) + for (int j=0;j<3;j++) { tri[i].v[j] = permutation[tri[i].v[j]]; } @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) // Convert vert into pointField. pointField newPoints(vert.num); - for(int i=0; i<vert.num; i++) + for (int i=0; i<vert.num; i++) { const ::Vector & v = vert[i]; diff --git a/applications/utilities/surface/surfacePointMerge/surfacePointMerge.C b/applications/utilities/surface/surfacePointMerge/surfacePointMerge.C index 2ad5af8c571..f206f6e931e 100644 --- a/applications/utilities/surface/surfacePointMerge/surfacePointMerge.C +++ b/applications/utilities/surface/surfacePointMerge/surfacePointMerge.C @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) triSurface cleanSurf(surf1); - while(true) + while (true) { label nOldVert = cleanSurf.nPoints(); diff --git a/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C b/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C index 55a7231e332..bce23c98468 100644 --- a/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C +++ b/applications/utilities/surface/surfaceSmooth/surfaceSmooth.C @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) const labelListList& pointEdges = surf1.pointEdges(); - for(label iter = 0; iter < iters; iter++) + for (label iter = 0; iter < iters; iter++) { forAll(pointEdges, vertI) { diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org index da50ffcd93a..27725cf1cd0 100644 --- a/doc/codingStyleGuide.org +++ b/doc/codingStyleGuide.org @@ -10,11 +10,12 @@ *** General + 80 character lines max - + The body of control statements (eg, if, else, while, etc). - always delineated with brace brackets - + Use spaces for indentation, not tab characters. + The normal indentation is 4 spaces per logical level. + + Use spaces for indentation, not tab characters. + Avoid trailing whitespace. + + The body of control statements (eg, if, else, while, etc). + always delineated with brace brackets. A possible exception can be + made with 'break' or 'continue' as part of a control structure. + stream output =<<= is always four characters after the start of the stream, @@ -152,7 +153,7 @@ : code; :} -*** =for= Loops +*** =for= and =while= Loops :for (i = 0; i < maxI; i++) :{ : code; @@ -180,7 +181,7 @@ Note that when indexing through iterators, it is often slightly more efficient to use the pre-increment form. Eg, =++iter= instead of =iter++= -*** =forAll= loops +*** =forAll= , =forAllIter=, etc. loops like =for= loops, but :forAll( diff --git a/src/OSspecific/POSIX/printStack.C b/src/OSspecific/POSIX/printStack.C index a6c2743298b..13410763757 100644 --- a/src/OSspecific/POSIX/printStack.C +++ b/src/OSspecific/POSIX/printStack.C @@ -181,7 +181,7 @@ void error::printStack(Ostream& os) { IFstream is("/proc/" + name(pid()) + "/maps"); - while(is.good()) + while (is.good()) { string line; is.getLine(line); diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C index 5159644fbff..d7367856cc3 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C @@ -57,11 +57,11 @@ Foam::Ostream& Foam::FaceCellWave<Type>::writeFaces { os << nFaces; - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { os << ' ' << faceLabels[i]; } - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { os << ' ' << faceInfo[i]; } @@ -70,11 +70,11 @@ Foam::Ostream& Foam::FaceCellWave<Type>::writeFaces { os << nFaces; - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { os << faceLabels[i]; } - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { os << faceInfo[i]; } @@ -95,11 +95,11 @@ Foam::Istream& Foam::FaceCellWave<Type>::readFaces { is >> nFaces; - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { is >> faceLabels[i]; } - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { is >> faceInfo[i]; } @@ -254,7 +254,7 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const { label cycOffset = patch.size()/2; - for(label patchFaceI = 0; patchFaceI < cycOffset; patchFaceI++) + for (label patchFaceI = 0; patchFaceI < cycOffset; patchFaceI++) { label i1 = patch.start() + patchFaceI; label i2 = i1 + cycOffset; @@ -339,7 +339,7 @@ void Foam::FaceCellWave<Type>::mergeFaceInfo const bool ) { - for(label changedFaceI = 0; changedFaceI < nFaces; changedFaceI++) + for (label changedFaceI = 0; changedFaceI < nFaces; changedFaceI++) { const Type& neighbourWallInfo = changedFacesInfo[changedFaceI]; label patchFaceI = changedFaces[changedFaceI]; @@ -377,7 +377,7 @@ Foam::label Foam::FaceCellWave<Type>::getChangedPatchFaces { label nChangedPatchFaces = 0; - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { label patchFaceI = i + startFaceI; @@ -406,7 +406,7 @@ void Foam::FaceCellWave<Type>::leaveDomain { const vectorField& fc = mesh_.faceCentres(); - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { label patchFaceI = faceLabels[i]; @@ -428,7 +428,7 @@ void Foam::FaceCellWave<Type>::enterDomain { const vectorField& fc = mesh_.faceCentres(); - for(label i = 0; i < nFaces; i++) + for (label i = 0; i < nFaces; i++) { label patchFaceI = faceLabels[i]; @@ -451,14 +451,14 @@ void Foam::FaceCellWave<Type>::transform { const tensor& T = rotTensor[0]; - for(label faceI = 0; faceI < nFaces; faceI++) + for (label faceI = 0; faceI < nFaces; faceI++) { faceInfo[faceI].transform(mesh_, T); } } else { - for(label faceI = 0; faceI < nFaces; faceI++) + for (label faceI = 0; faceI < nFaces; faceI++) { faceInfo[faceI].transform(mesh_, rotTensor[faceI]); } @@ -510,7 +510,7 @@ void Foam::FaceCellWave<Type>::offset labelList& faces ) { - for(label faceI = 0; faceI < nFaces; faceI++) + for (label faceI = 0; faceI < nFaces; faceI++) { faces[faceI] += cycOffset; } @@ -1064,7 +1064,7 @@ Foam::label Foam::FaceCellWave<Type>::iterate(const label maxIter) handleProcPatches(); } - while(iter_ < maxIter) + while (iter_ < maxIter) { if (debug) { diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C index c0600bd97c4..a5418574f6a 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctions.C @@ -412,7 +412,7 @@ template<template<class> class Field, class Type> Type max(const FieldField<Field, Type>& f) { label i = 0; - while(i < f.size() && !f[i].size()) i++; + while (i < f.size() && !f[i].size()) i++; if (i < f.size()) { @@ -440,12 +440,12 @@ template<template<class> class Field, class Type> Type min(const FieldField<Field, Type>& f) { label i = 0; - while(i < f.size() && !f[i].size()) i++; + while (i < f.size() && !f[i].size()) i++; if (i < f.size()) { label i = 0; - while(!f[i].size()) i++; + while (!f[i].size()) i++; Type Min(min(f[i])); diff --git a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C index ad57b17b81c..3576c701c5e 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C +++ b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C @@ -382,9 +382,9 @@ Foam::SVD::SVD(const scalarRectangularMatrix& A, const scalar minCondition) multiply(SVDA, U_, S_, transpose(V_)); scalar maxDiff = 0; scalar diff = 0; - for(label i = 0; i < A.n(); i++) + for (label i = 0; i < A.n(); i++) { - for(label j = 0; j < A.m(); j++) + for (label j = 0; j < A.m(); j++) { diff = mag(A[i][j] - SVDA[i][j]); if (diff > maxDiff) maxDiff = diff; diff --git a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVDI.H b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVDI.H index 82d6c5a6c25..9f406440cda 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVDI.H +++ b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVDI.H @@ -63,7 +63,7 @@ inline Foam::label Foam::SVD::nZeros() const inline Foam::scalar Foam::SVD::minNonZeroS() const { scalar minS = S_[0]; - for(label i = 1; i < S_.size(); i++) + for (label i = 1; i < S_.size(); i++) { scalar s = S_[i]; if (s > VSMALL && s < minS) minS = s; diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C index 53fdf6ecfe7..56fe4f6742c 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C @@ -159,11 +159,11 @@ void Foam::multiply ans = scalarRectangularMatrix(A.n(), B.m(), scalar(0)); - for(register label i = 0; i < A.n(); i++) + for (register label i = 0; i < A.n(); i++) { - for(register label j = 0; j < B.m(); j++) + for (register label j = 0; j < B.m(); j++) { - for(register label l = 0; l < B.n(); l++) + for (register label l = 0; l < B.n(); l++) { ans[i][j] += A[i][l]*B[l][j]; } @@ -210,14 +210,14 @@ void Foam::multiply ans = scalarRectangularMatrix(A.n(), C.m(), scalar(0)); - for(register label i = 0; i < A.n(); i++) + for (register label i = 0; i < A.n(); i++) { - for(register label g = 0; g < C.m(); g++) + for (register label g = 0; g < C.m(); g++) { - for(register label l = 0; l < C.n(); l++) + for (register label l = 0; l < C.n(); l++) { scalar ab = 0; - for(register label j = 0; j < A.m(); j++) + for (register label j = 0; j < A.m(); j++) { ab += A[i][j]*B[j][l]; } @@ -266,11 +266,11 @@ void Foam::multiply ans = scalarRectangularMatrix(A.n(), C.m(), scalar(0)); - for(register label i = 0; i < A.n(); i++) + for (register label i = 0; i < A.n(); i++) { - for(register label g = 0; g < C.m(); g++) + for (register label g = 0; g < C.m(); g++) { - for(register label l = 0; l < C.n(); l++) + for (register label l = 0; l < C.n(); l++) { ans[i][g] += C[l][g] * A[i][l]*B[l]; } diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C index dffd5db8bb6..93046b33079 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C +++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C @@ -284,7 +284,7 @@ void Foam::cellMatcher::write(Foam::Ostream& os) const { os << " "; - for(label fp = 0; fp < faceSize_[faceI]; fp++) + for (label fp = 0; fp < faceSize_[faceI]; fp++) { os << ' ' << localFaces_[faceI][fp]; } diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/tetWedgeMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/tetWedgeMatcher.C index 00aacad3ad3..af815d58736 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/tetWedgeMatcher.C +++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/tetWedgeMatcher.C @@ -116,7 +116,7 @@ bool Foam::tetWedgeMatcher::matchShape const face& face0 = localFaces_[face0I]; // Try all rotations of this face - for(label face0vert0 = 0; face0vert0 < faceSize_[face0I]; face0vert0++) + for (label face0vert0 = 0; face0vert0 < faceSize_[face0I]; face0vert0++) { // // Try to follow prespecified path on faces of cell, diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/wedgeMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/wedgeMatcher.C index 79af03bad80..97512ad427e 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/wedgeMatcher.C +++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/wedgeMatcher.C @@ -108,7 +108,7 @@ bool Foam::wedgeMatcher::matchShape const face& face0 = localFaces_[face0I]; // Try all rotations of this face - for(label face0vert0 = 0; face0vert0 < faceSize_[face0I]; face0vert0++) + for (label face0vert0 = 0; face0vert0 < faceSize_[face0I]; face0vert0++) { // // Try to follow prespecified path on faces of cell, diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 55be336fa21..6e3d88979ee 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -216,7 +216,7 @@ Foam::label Foam::face::split label minIndex = index; scalar minDiff = constant::mathematical::pi; - for(label i = 0; i < size() - 3; i++) + for (label i = 0; i < size() - 3; i++) { vector splitEdge ( diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index a6aaaf3b169..9ca9d2d416a 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -175,7 +175,7 @@ bool Foam::primitiveMesh::checkClosedCells { scalar maxOpenness = 0; - for(direction cmpt=0; cmpt<vector::nComponents; cmpt++) + for (direction cmpt=0; cmpt<vector::nComponents; cmpt++) { maxOpenness = max ( @@ -654,7 +654,7 @@ bool Foam::primitiveMesh::checkFaceSkewness nWarnSkew++; } - if(skewness > maxSkew) + if (skewness > maxSkew) { maxSkew = skewness; } @@ -702,7 +702,7 @@ bool Foam::primitiveMesh::checkFaceSkewness nWarnSkew++; } - if(skewness > maxSkew) + if (skewness > maxSkew) { maxSkew = skewness; } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C index b7278ecf490..38f8597985e 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C @@ -468,7 +468,7 @@ Foam::label Foam::primitiveMesh::findFirstCommonElementFromSortedLists while (iter1 != list1.end() && iter2 != list2.end()) { - if( *iter1 < *iter2) + if (*iter1 < *iter2) { ++iter1; } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C index ef48f93ba0e..1fb91286e10 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C @@ -114,7 +114,7 @@ void Foam::patchZones::markZone(label faceI) // Zones on all edges. labelList edgeZone(pp_.nEdges(), -1); - while(1) + while (true) { changedEdges = faceToEdge(changedFaces, edgeZone); diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C index 7bf07845e2f..db45597ba70 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C @@ -223,7 +223,7 @@ Foam::SHA1::processBlock(const void *data, size_t len) { \ E += rol_uint32(A, 5) + F(B, C, D) + K + M; \ B = rol_uint32(B, 30); \ - } while(0) + } while (0) while (words < endp) { diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.C b/src/dynamicMesh/boundaryMesh/boundaryMesh.C index b71e0a569ed..2ca4973e7c1 100644 --- a/src/dynamicMesh/boundaryMesh/boundaryMesh.C +++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.C @@ -390,7 +390,7 @@ void Foam::boundaryMesh::markZone // Zones on all edges. labelList edgeZone(mesh().nEdges(), -1); - while(1) + while (true) { changedEdges = faceToEdge ( diff --git a/src/dynamicMesh/motionSmoother/motionSmoother.C b/src/dynamicMesh/motionSmoother/motionSmoother.C index d780ec79dde..b4288c20073 100644 --- a/src/dynamicMesh/motionSmoother/motionSmoother.C +++ b/src/dynamicMesh/motionSmoother/motionSmoother.C @@ -65,7 +65,7 @@ void Foam::motionSmoother::makePatchPatchAddressing() forAll(bm, patchi) { - if(!isA<emptyPolyPatch>(bm[patchi])) + if (!isA<emptyPolyPatch>(bm[patchi])) { nPatchPatchPoints += bm[patchi].boundaryPoints().size(); } @@ -83,7 +83,7 @@ void Foam::motionSmoother::makePatchPatchAddressing() forAll(bm, patchi) { - if(!isA<emptyPolyPatch>(bm[patchi])) + if (!isA<emptyPolyPatch>(bm[patchi])) { const labelList& bp = bm[patchi].boundaryPoints(); const labelList& meshPoints = bm[patchi].meshPoints(); diff --git a/src/dynamicMesh/motionSmoother/motionSmootherTemplates.C b/src/dynamicMesh/motionSmoother/motionSmootherTemplates.C index 232c19d6b5b..4ea2fa92606 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherTemplates.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherTemplates.C @@ -51,7 +51,7 @@ void Foam::motionSmoother::checkConstraints forAll(bm, patchi) { - if(!isA<emptyPolyPatch>(bm[patchi])) + if (!isA<emptyPolyPatch>(bm[patchi])) { nPatchPatchPoints += bm[patchi].boundaryPoints().size(); } @@ -81,7 +81,7 @@ void Foam::motionSmoother::checkConstraints forAll(bm, patchi) { - if(!isA<emptyPolyPatch>(bm[patchi])) + if (!isA<emptyPolyPatch>(bm[patchi])) { const labelList& bp = bm[patchi].boundaryPoints(); const labelList& meshPoints = bm[patchi].meshPoints(); @@ -93,7 +93,7 @@ void Foam::motionSmoother::checkConstraints } } } - + // Forward evaluation @@ -106,7 +106,7 @@ void Foam::motionSmoother::checkConstraints forAll(bm, patchi) { - if(!isA<emptyPolyPatch>(bm[patchi])) + if (!isA<emptyPolyPatch>(bm[patchi])) { const labelList& bp = bm[patchi].boundaryPoints(); const labelList& meshPoints = bm[patchi].meshPoints(); @@ -246,7 +246,7 @@ Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > else { res[pointI] /= sumWeight[pointI]; - } + } } res.correctBoundaryConditions(); diff --git a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C index bfa9b2ca0c1..8261941be2b 100644 --- a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C +++ b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C @@ -1790,7 +1790,7 @@ void Foam::faceCoupleInfo::subDivisionMatch cutPointI = cutEdges[cutEdgeI].otherVertex(cutPointI); - } while(cutPointI != cutPoint1); + } while (cutPointI != cutPoint1); } if (debug) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 11b4178d3f0..5574abcb86d 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -262,7 +262,7 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString // - which hasn't been handled yet // - with same neighbour // - that needs extrusion - while(true) + while (true) { label prevFp = fEdges.rcIndex(startFp); @@ -286,7 +286,7 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString // Search forward for end of string endFp = startFp; - while(true) + while (true) { label nextFp = fEdges.fcIndex(endFp); diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C index 7727e04c87f..25a0414f830 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C @@ -456,7 +456,7 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod) { break; } - } while(true); + } while (true); // Keep track of faces that have been done already. diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C index be15413fab5..6c7d321533a 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C @@ -2319,7 +2319,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement allCellInfo ); - while(true) + while (true) { if (debug) { diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.C b/src/dynamicMesh/slidingInterface/slidingInterface.C index 316dd389b6f..12d99e8083e 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterface.C +++ b/src/dynamicMesh/slidingInterface/slidingInterface.C @@ -420,7 +420,7 @@ void Foam::slidingInterface::setRefinement(polyTopoChange& ref) const } coupleInterface(ref); - + trigger_ = false; } } @@ -430,7 +430,7 @@ void Foam::slidingInterface::modifyMotionPoints(pointField& motionPoints) const { if (debug) { - Pout<< "void slidingInterface::modifyMotionPoints(" + Pout<< "void slidingInterface::modifyMotionPoints(" << "pointField& motionPoints) const for object " << name() << " : " << "Adjusting motion points." << endl; } @@ -485,7 +485,7 @@ void Foam::slidingInterface::modifyMotionPoints(pointField& motionPoints) const else { // A cut point is not a projected slave point. Therefore, it - // must be an edge-to-edge intersection. + // must be an edge-to-edge intersection. Map<Pair<edge> >::const_iterator cpepmIter = cpepm.find(cutPoints[pointI]); @@ -499,7 +499,7 @@ void Foam::slidingInterface::modifyMotionPoints(pointField& motionPoints) const // slidingInterface::coupleInterface. This is done for // efficiency reasons and avoids multiple creation of // cutting planes. Please update both simultaneously. - // + // const edge& globalMasterEdge = cpepmIter().first(); const label curMasterEdgeIndex = @@ -582,7 +582,7 @@ void Foam::slidingInterface::modifyMotionPoints(pointField& motionPoints) const if (slaveCut.hit()) { // Strict checking of slave cut to avoid capturing - // end points. + // end points. scalar cutOnSlave = ( ( @@ -615,7 +615,7 @@ void Foam::slidingInterface::modifyMotionPoints(pointField& motionPoints) const << cme.line(masterLocalPoints) << " slave edge: " << curSlaveLine << " point: " << masterCutPoint - << " weight: " << + << " weight: " << ( ( slaveCut.missPoint() @@ -657,7 +657,7 @@ void Foam::slidingInterface::updateMesh(const mapPolyMesh& m) { if (debug) { - Pout<< "void slidingInterface::updateMesh(const mapPolyMesh& m)" + Pout<< "void slidingInterface::updateMesh(const mapPolyMesh& m)" << " const for object " << name() << " : " << "Updating topology." << endl; } @@ -771,7 +771,7 @@ void Foam::slidingInterface::write(Ostream& os) const // To write out all those tolerances #define WRITE_NON_DEFAULT(name) \ - if( name ## _ != name ## Default_ )\ + if ( name ## _ != name ## Default_ )\ { \ os << " " #name " " << name ## _ << token::END_STATEMENT << nl; \ } diff --git a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C index dfaef4308e6..439d83e1786 100644 --- a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C +++ b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C @@ -107,7 +107,7 @@ bool Foam::adjustPhi { massCorr = (massIn - fixedMassOut)/adjustableMassOut; } - else if(mag(fixedMassOut - massIn)/totalFlux > 1e-10) + else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10) { FatalErrorIn ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index ce005c5683e..2ae16afc957 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -74,7 +74,7 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() ); } - for(label i=1; i<f_.size(); i++) + for (label i=1; i<f_.size(); i++) { jump_ += f_[i]*pow(Un, i); } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H index 22083de571e..5c4d711ab30 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H @@ -162,7 +162,7 @@ inline void cellLimitedGrad<Type>::limitFace const Type& extrapolate ) { - for(direction cmpt=0; cmpt<Type::nComponents; cmpt++) + for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { cellLimitedGrad<scalar>::limitFace ( diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H index d9b389d0f54..f48ed450d9a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H @@ -164,7 +164,7 @@ inline void cellMDLimitedGrad<Type>::limitFace const vector& dcf ) { - for(direction cmpt=0; cmpt<Type::nComponents; cmpt++) + for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { vector gi(g[cmpt], g[cmpt+3], g[cmpt+6]); cellMDLimitedGrad<scalar>::limitFace diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.C b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.C index 11e54fc5c15..bd65a3fd375 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.C @@ -108,7 +108,7 @@ Foam::quadraticFitSnGradData::quadraticFitSnGradData // find the fit coefficients for every face in the mesh - for(label faci = 0; faci < mesh.nInternalFaces(); faci++) + for (label faci = 0; faci < mesh.nInternalFaces(); faci++) { snGradPolySize[faci] = calcFit(stencilPoints[faci], faci); } @@ -206,7 +206,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit // calculate the matrix of the polynomial components scalarRectangularMatrix B(C.size(), minSize_, scalar(0)); - for(label ip = 0; ip < C.size(); ip++) + for (label ip = 0; ip < C.size(); ip++) { const point& p = C[ip]; @@ -254,7 +254,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit const scalar deltaCoeff = mesh().deltaCoeffs()[faci]; bool goodFit = false; - for(int iIt = 0; iIt < 10 && !goodFit; iIt++) + for (int iIt = 0; iIt < 10 && !goodFit; iIt++) { SVD svd(B, SMALL); @@ -270,7 +270,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit { fit_[faci][0] = fit0; fit_[faci][1] = fit1; - for(label i = 2; i < stencilSize; i++) + for (label i = 2; i < stencilSize; i++) { fit_[faci][i] = wts[0]*wts[i]*svd.VSinvUt()[1][i]/scale; } @@ -282,13 +282,13 @@ Foam::label Foam::quadraticFitSnGradData::calcFit wts[0] *= 10; wts[1] *= 10; - for(label i = 0; i < B.n(); i++) + for (label i = 0; i < B.n(); i++) { B[i][0] *= 10; B[i][1] *= 10; } - for(label j = 0; j < B.m(); j++) + for (label j = 0; j < B.m(); j++) { B[0][j] *= 10; B[1][j] *= 10; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 5e85f505922..9ce8d888c4b 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -725,7 +725,7 @@ Foam::fvMatrix<Type>::H() const ) ); - for(direction cmpt=0; cmpt<Type::nComponents; cmpt++) + for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { if (validComponents[cmpt] == -1) { diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index c56899bd62e..a78d6be6cf2 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -90,7 +90,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve ) ); - for(direction cmpt=0; cmpt<Type::nComponents; cmpt++) + for (direction cmpt=0; cmpt<Type::nComponents; cmpt++) { if (validComponents[cmpt] == -1) continue; diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index 151de78a1ef..89e0260456a 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -478,7 +478,7 @@ void Foam::MULES::limiter scalarField sumlPhip(psiIf.size()); scalarField mSumlPhim(psiIf.size()); - for(int j=0; j<nLimiterIter; j++) + for (int j=0; j<nLimiterIter; j++) { sumlPhip = 0.0; mSumlPhim = 0.0; diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C index 3ecbd0a1972..dc2aec8960d 100644 --- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C +++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C @@ -1341,7 +1341,7 @@ void Foam::fvMeshSubset::setLargeCellSubset { labelList region(baseMesh().nCells(), 0); - forAllConstIter (labelHashSet, globalCellMap, iter) + forAllConstIter(labelHashSet, globalCellMap, iter) { region[iter.key()] = 1; } diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/findCellPointFaceTriangle.H b/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/findCellPointFaceTriangle.H index dc9e2baa00f..490b20f182c 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/findCellPointFaceTriangle.H +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/findCellPointFaceTriangle.H @@ -45,7 +45,7 @@ bool interpolationCellPointFace<Type>::findTriangle // calculate triangle edge vectors and triangle face normal // the 'i':th edge is opposite node i vector edge[3], normal[3]; - for(label i=0; i<3; i++) + for (label i=0; i<3; i++) { label ip0 = (i+1) % 3; label ipp = (i+2) % 3; @@ -55,7 +55,7 @@ bool interpolationCellPointFace<Type>::findTriangle vector triangleFaceNormal = edge[1] ^ edge[2]; // calculate edge normal (pointing inwards) - for(label i=0; i<3; i++) + for (label i=0; i<3; i++) { normal[i] = triangleFaceNormal ^ edge[i]; normal[i] /= mag(normal[i]) + VSMALL; @@ -63,7 +63,7 @@ bool interpolationCellPointFace<Type>::findTriangle // check if position is inside triangle bool inside = true; - for(label i=0; i<3; i++) + for (label i=0; i<3; i++) { label ip = (i+1) % 3; inside = inside && (((newPos - tetPoints[ip]) & edge[i]) >= 0); @@ -74,7 +74,7 @@ bool interpolationCellPointFace<Type>::findTriangle foundTriangle = true; // calculate phi-values - for(label i=0; i<3; i++) + for (label i=0; i<3; i++) { label ip = (i+1) % 3; scalar phiMax = max(VSMALL, normal[i] & edge[ip]); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C index fb9611e9c8a..4870127e51d 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C @@ -86,7 +86,7 @@ void Foam::CentredFitData<Polynomial>::calcFit() const surfaceScalarField& w = mesh.surfaceInterpolation::weights(); - for(label facei = 0; facei < mesh.nInternalFaces(); facei++) + for (label facei = 0; facei < mesh.nInternalFaces(); facei++) { FitData < diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C index a48355872f4..62d464dcd67 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C @@ -165,7 +165,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit // Matrix of the polynomial components scalarRectangularMatrix B(C.size(), minSize_, scalar(0)); - for(label ip = 0; ip < C.size(); ip++) + for (label ip = 0; ip < C.size(); ip++) { const point& p = C[ip]; @@ -195,7 +195,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit } // Additional weighting for constant and linear terms - for(label i = 0; i < B.n(); i++) + for (label i = 0; i < B.n(); i++) { B[i][0] *= wts[0]; B[i][1] *= wts[0]; @@ -206,14 +206,14 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit coeffsi.setSize(stencilSize); bool goodFit = false; - for(int iIt = 0; iIt < 8 && !goodFit; iIt++) + for (int iIt = 0; iIt < 8 && !goodFit; iIt++) { SVD svd(B, SMALL); scalar maxCoeff = 0; label maxCoeffi = 0; - for(label i=0; i<stencilSize; i++) + for (label i=0; i<stencilSize; i++) { coeffsi[i] = wts[0]*wts[i]*svd.VSinvUt()[0][i]; if (mag(coeffsi[i]) > maxCoeff) @@ -271,13 +271,13 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit wts[1] *= 10; } - for(label j = 0; j < B.m(); j++) + for (label j = 0; j < B.m(); j++) { B[0][j] *= 10; B[1][j] *= 10; } - for(label i = 0; i < B.n(); i++) + for (label i = 0; i < B.n(); i++) { B[i][0] *= 10; B[i][1] *= 10; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C index cd7a206ba50..0841fe7d72a 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C @@ -97,7 +97,7 @@ void Foam::UpwindFitData<Polynomial>::calcFit() // find the fit coefficients for every owner //Pout<< "-- Owner --" << endl; - for(label facei = 0; facei < mesh.nInternalFaces(); facei++) + for (label facei = 0; facei < mesh.nInternalFaces(); facei++) { FitData < @@ -156,7 +156,7 @@ void Foam::UpwindFitData<Polynomial>::calcFit() // find the fit coefficients for every neighbour //Pout<< "-- Neighbour --" << endl; - for(label facei = 0; facei < mesh.nInternalFaces(); facei++) + for (label facei = 0; facei < mesh.nInternalFaces(); facei++) { FitData < diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C index 16cd028f726..6cebe3369bd 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C @@ -63,7 +63,7 @@ void pointPatchInterpolation::makePatchPatchAddressing() forAll(bm, patchi) { - if(!isA<emptyFvPatch>(bm[patchi]) && !bm[patchi].coupled()) + if (!isA<emptyFvPatch>(bm[patchi]) && !bm[patchi].coupled()) { nPatchPatchPoints += bm[patchi].patch().boundaryPoints().size(); } @@ -81,7 +81,7 @@ void pointPatchInterpolation::makePatchPatchAddressing() forAll(bm, patchi) { - if(!isA<emptyFvPatch>(bm[patchi]) && !bm[patchi].coupled()) + if (!isA<emptyFvPatch>(bm[patchi]) && !bm[patchi].coupled()) { const labelList& bp = bm[patchi].patch().boundaryPoints(); const labelList& meshPoints = bm[patchi].patch().meshPoints(); @@ -129,10 +129,10 @@ void pointPatchInterpolation::makePatchPatchAddressing() { if (patchPatchPointConstraints[i].first() != 0) { - patchPatchPointConstraintPoints_[nConstraints] = + patchPatchPointConstraintPoints_[nConstraints] = patchPatchPoints_[i]; - patchPatchPointConstraintTensors_[nConstraints] = + patchPatchPointConstraintTensors_[nConstraints] = patchPatchPointConstraints[i].constraintTransformation(); nConstraints++; diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index 4838da0ad1d..2b85924f8b3 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -208,7 +208,7 @@ Foam::label Foam::Particle<ParticleType>::track facei_ = -1; // Tracks to endPosition or stop on boundary - while(!onBoundary() && stepFraction_ < 1.0 - SMALL) + while (!onBoundary() && stepFraction_ < 1.0 - SMALL) { stepFraction_ += trackToFace(endPosition, td)*(1.0 - stepFraction_); } diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index d2f2221db9e..c0913258454 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -114,7 +114,7 @@ bool Foam::parcel::move(spray& sDB) scalarField Yfg(Nf, 0.0); scalar cpMixture = 0.0; - for(label i=0; i<Ns; i++) + for (label i=0; i<Ns; i++) { const volScalarField& Yi = sDB.composition().Y()[i]; if (sDB.isLiquidFuel()[i]) @@ -341,7 +341,7 @@ void Foam::parcel::updateParcelProperties // calculate mean molecular weight scalar W = 0.0; - for(label i=0; i<Ns; i++) + for (label i=0; i<Ns; i++) { W += sDB.composition().Y()[i][celli]/sDB.gasProperties()[i].W(); @@ -357,7 +357,7 @@ void Foam::parcel::updateParcelProperties // correct the gaseous temperature for evaporated fuel scalar cpMix = 0.0; - for(label i=0; i<Ns; i++) + for (label i=0; i<Ns; i++) { cpMix += sDB.composition().Y()[i][celli] *sDB.gasProperties()[i].Cp(T()); @@ -475,7 +475,7 @@ void Foam::parcel::updateParcelProperties newMass = m(); newhg = 0.0; scalarField Ynew(fuels.Y(X())); - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; newhg += Ynew[i]*sDB.gasProperties()[j].H(Tnew); @@ -523,7 +523,7 @@ void Foam::parcel::updateParcelProperties scalar liquidcL = sDB.fuels().cp(pg, TDroplet, X()); cpMix = 0.0; - for(label i=0; i<Ns; i++) + for (label i=0; i<Ns; i++) { if (sDB.isLiquidFuel()[i]) { @@ -541,7 +541,7 @@ void Foam::parcel::updateParcelProperties scalar z = 0.0; scalar tauEvap = 0.0; - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { tauEvap += X()[i]*fuels.properties()[i].W()/tauEvaporation[i]; } @@ -628,7 +628,7 @@ void Foam::parcel::updateParcelProperties // if the droplet is NOT boiling use implicit scheme. if (sDB.evaporation().evaporation()) { - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { // immediately evaporate mass that has reached critical // condition diff --git a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C index 131e9f885f9..94cc2df8f8a 100644 --- a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C +++ b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C @@ -74,7 +74,7 @@ void parcel::setRelaxationTimes scalar cpMixture = 0.0; scalar muf = 0.0; - for(label i=0; i<Ns; i++) + for (label i=0; i<Ns; i++) { scalar Y = sDB.composition().Y()[i][celli]; W += Y/sDB.gasProperties()[i].W(); @@ -90,7 +90,7 @@ void parcel::setRelaxationTimes scalarField psat(Nf, 0.0); scalarField msat(Nf, 0.0); - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; scalar Y = sDB.composition().Y()[j][celli]; @@ -121,14 +121,14 @@ void parcel::setRelaxationTimes scalarField Ys(Nf, 0.0); scalar Wliq = 0.0; - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; scalar Wi = sDB.gasProperties()[j].W(); Wliq += Xs[i]*Wi; } - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; scalar Wi = sDB.gasProperties()[j].W(); @@ -140,9 +140,9 @@ void parcel::setRelaxationTimes // calculate the characteritic times - if(liquidCore_> 0.5) + if (liquidCore_> 0.5) { -// no drag for parcels in the liquid core.. + // no drag for parcels in the liquid core. tauMomentum = GREAT; } else @@ -177,7 +177,7 @@ void parcel::setRelaxationTimes // this is mainly to put a limit on the evaporation time, // since tauEvaporation is very very small close to the boiling point. - for(label i=0; i<Nf; i++) + for (label i=0; i<Nf; i++) { scalar Td = min(T(), 0.999*fuels.properties()[i].Tc()); bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure; @@ -187,7 +187,7 @@ void parcel::setRelaxationTimes scalar partialPressure = Xf[i]*pressure; // saturated vapour - if(partialPressure > psat[i]) + if (partialPressure > psat[i]) { tauEvaporation[i] = GREAT; } @@ -259,7 +259,7 @@ void parcel::setRelaxationTimes scalar vapourSurfaceEnthalpy = 0.0; scalar vapourFarEnthalpy = 0.0; - for(label k = 0; k < sDB.gasProperties().size(); k++) + for (label k = 0; k < sDB.gasProperties().size(); k++) { vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface); vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature); diff --git a/src/lagrangian/dieselSpray/spray/sprayFunctions.C b/src/lagrangian/dieselSpray/spray/sprayFunctions.C index fb3e9541b15..632d47411ad 100644 --- a/src/lagrangian/dieselSpray/spray/sprayFunctions.C +++ b/src/lagrangian/dieselSpray/spray/sprayFunctions.C @@ -77,7 +77,7 @@ scalar spray::injectedEnthalpy scalar Wl = fuels_->W(X); scalar hg = 0.0; - for(label j=0; j<Nf; j++) + for (label j=0; j<Nf; j++) { label k = liquidToGasIndex_[j]; hg += gasProperties()[k].H(T)*gasProperties()[k].W()*X[j]/Wl; @@ -133,7 +133,7 @@ scalar spray::liquidEnthalpy() const scalar hg = 0.0; scalar Wl = fuels().W(elmnt().X()); - for(label j=0; j<Nf; j++) + for (label j=0; j<Nf; j++) { label k = liquidToGasIndex_[j]; @@ -177,7 +177,7 @@ scalar spray::liquidTotalEnthalpy() const scalar hg = 0.0; scalar Wl = fuels().W(elmnt().X()); - for(label j=0; j<Nf; j++) + for (label j=0; j<Nf; j++) { label k = liquidToGasIndex_[j]; hg += @@ -251,7 +251,7 @@ scalar spray::liquidPenetration vector ip(vector::zero); if (nHoles > 1) { - for(label i=0;i<nHoles;i++) + for (label i=0;i<nHoles;i++) { ip += injectors_[nozzlei].properties()->position(i); } @@ -308,7 +308,7 @@ scalar spray::liquidPenetration if (de < dist[i]) { found = true; - for(label j=n; j>i; j--) + for (label j=n; j>i; j--) { m[j] = m[j-1]; dist[j] = dist[j-1]; diff --git a/src/lagrangian/dieselSpray/spray/sprayInject.C b/src/lagrangian/dieselSpray/spray/sprayInject.C index b0aea70def1..f53ad174836 100644 --- a/src/lagrangian/dieselSpray/spray/sprayInject.C +++ b/src/lagrangian/dieselSpray/spray/sprayInject.C @@ -79,12 +79,12 @@ void spray::inject() ) ); - for(label j=0; j<Np; j++) + for (label j=0; j<Np; j++) { // calculate the time of injection for parcel 'j' scalar toi = time0 + constT + deltaT*j/scalar(Np); - for(label n=0; n<nHoles; n++) + for (label n=0; n<nHoles; n++) { // calculate the velocity of the injected parcel @@ -164,8 +164,8 @@ void spray::inject() delete pPtr; } } // if (injectorCell.... - } // for(label n=0... - } // for(label j=0.... + } // for (label n=0... + } // for (label j=0.... } // if (mass>0)... } // forAll(injectors)... diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C index 2478061ab14..01525723f9b 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C @@ -183,7 +183,7 @@ void LISA::atomizeParcel scalar kOld = 0.0; - for(label i=0; i<40; i++) + for (label i=0; i<40; i++) { k = kPos diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C index d381e9516f5..1db72fe0088 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C @@ -109,7 +109,7 @@ void gradientDispersionRAS::disperseParcels() const scalar x1 = 0.0; scalar x2 = 0.0; scalar rsq = 10.0; - while((rsq > 1.0) || (rsq == 0.0)) + while ((rsq > 1.0) || (rsq == 0.0)) { x1 = 2.0*spray_.rndGen().scalar01() - 1.0; x2 = 2.0*spray_.rndGen().scalar01() - 1.0; diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C index 36cf7b05885..5c8d8732f8b 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C +++ b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C @@ -111,7 +111,7 @@ void stochasticDispersionRAS::disperseParcels() const // numerical recipes... Ch. 7. Random Numbers... scalar x1,x2; scalar rsq = 10.0; - while((rsq > 1.0) || (rsq == 0.0)) + while ((rsq > 1.0) || (rsq == 0.0)) { x1 = 2.0*spray_.rndGen().scalar01() - 1.0; x2 = 2.0*spray_.rndGen().scalar01() - 1.0; diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C index 83c0e17a7b9..afb24110d8d 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C +++ b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C @@ -160,7 +160,7 @@ scalar RutlandFlashBoil::relaxationTime scalar logXratio = log(1.0 + Xratio); scalar Fb = 1.0; - if(logXratio > SMALL) + if (logXratio > SMALL) { Fb = pow((1.0 + Xratio), FbExp)*log(1.0 + Xratio)/Xratio; } @@ -286,7 +286,7 @@ scalar RutlandFlashBoil::boilingTime Gneg = Gneg/10.0; Gneg = max(Gneg, VSMALL); FgNeg = Gneg + Gf - B*log(1.0 + (1.0 + Gf/Gneg)*A); - if(FgNeg < 0.0) + if (FgNeg < 0.0) { break; } diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index f7aaaa724d2..5c7819c709a 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -380,7 +380,7 @@ void Foam::DsmcCloud<ParcelType>::collisions() { candidateQ = subCellPs[rndGen_.integer(0, nSC - 1)]; - } while(candidateP == candidateQ); + } while (candidateP == candidateQ); } else { @@ -392,7 +392,7 @@ void Foam::DsmcCloud<ParcelType>::collisions() { candidateQ = rndGen_.integer(0, nC - 1); - } while(candidateP == candidateQ); + } while (candidateP == candidateQ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -405,7 +405,7 @@ void Foam::DsmcCloud<ParcelType>::collisions() // label candidateQ = rndGen_.integer(0, nC-1); // // If the same candidate is chosen, choose again - // while(candidateP == candidateQ) + // while (candidateP == candidateQ) // { // candidateQ = rndGen_.integer(0, nC-1); // } diff --git a/src/lagrangian/molecularDynamics/molecularMeasurements/correlationFunction/correlationFunction.C b/src/lagrangian/molecularDynamics/molecularMeasurements/correlationFunction/correlationFunction.C index c9e975e296a..2dd3e9bf3fa 100644 --- a/src/lagrangian/molecularDynamics/molecularMeasurements/correlationFunction/correlationFunction.C +++ b/src/lagrangian/molecularDynamics/molecularMeasurements/correlationFunction/correlationFunction.C @@ -185,7 +185,7 @@ void Foam::correlationFunction<Type>::calculateCorrelationFunction const Type& currentValue ) { - if( measurandFieldSize() != 1) + if (measurandFieldSize() != 1) { FatalErrorIn("correlationFunction<Type>::calculateCorrelationFunction") << "Trying to supply a single value to calculate the correlation " diff --git a/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C b/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C index f1036eaa0e9..1a587f3022b 100644 --- a/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C +++ b/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C @@ -667,7 +667,7 @@ const Foam::labelList Foam::interactionLists::referredCellsInRangeOfSegment ) ) { - if(findIndex(referredCellsFoundInRange, rIL) == -1) + if (findIndex(referredCellsFoundInRange, rIL) == -1) { referredCellsFoundInRange.append(rIL); } diff --git a/src/lagrangian/molecularDynamics/molecule/interactionLists/referredCell/referredCell.C b/src/lagrangian/molecularDynamics/molecule/interactionLists/referredCell/referredCell.C index 225ad5902a0..0059fad4b94 100644 --- a/src/lagrangian/molecularDynamics/molecule/interactionLists/referredCell/referredCell.C +++ b/src/lagrangian/molecularDynamics/molecule/interactionLists/referredCell/referredCell.C @@ -277,7 +277,7 @@ referredCell::referredCell // Allow sourceCell = -1 to create a dummy referredCell // to obtain the transformation - if(sourceCell >= 0) + if (sourceCell >= 0) { setConstructionData(mesh, sourceCell); } diff --git a/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H b/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H index 9781c9d70f4..4e93070479e 100644 --- a/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H @@ -152,7 +152,7 @@ if (runTime.outputTime()) forAll(totalTemperature.internalField(), tT) { - if(totalN_sum[tT] > 0) + if (totalN_sum[tT] > 0) { totalTemperature.internalField()[tT] = totalTemperatureVTerms_sum[tT] @@ -181,7 +181,7 @@ if (runTime.outputTime()) forAll(singleSpeciesMeanKE, sSMKE) { - if(allSpeciesN_RU[mKE][sSMKE]) + if (allSpeciesN_RU[mKE][sSMKE]) { singleSpeciesMeanKE[sSMKE] = allSpeciesM_RU[mKE][sSMKE] @@ -208,7 +208,7 @@ if (runTime.outputTime()) forAll(totalMeanKE.internalField(), tMKE) { - if(totalN_sum[tMKE] > 0) + if (totalN_sum[tMKE] > 0) { totalMeanKE.internalField()[tMKE] = totalKE_sum[tMKE] diff --git a/src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H b/src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H index 4448b9e1783..446e58da05f 100644 --- a/src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H @@ -73,7 +73,7 @@ label singleStepDOFs = 0; //singleStepCentreOfMass += mol().position()*molMass; } - // if(singleStepNMols) + // if (singleStepNMols) // { // singleStepCentreOfMass /= singleStepTotalMass; // } @@ -104,7 +104,7 @@ label singleStepDOFs = 0; singleStepTotalAngularMomentum += molPiGlobal; //+((mol().position() - singleStepCentreOfMass) ^ (molV * molMass)); - if(mag(molV) > singleStepMaxVelocityMag) + if (mag(molV) > singleStepMaxVelocityMag) { singleStepMaxVelocityMag = mag(molV); } diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H b/src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H index 447a04e4ea3..b13f5ea6a02 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H @@ -77,7 +77,7 @@ inline Foam::molecule::constantProperties::constantProperties siteReferencePositions_ -= centreOfMass; - if(siteIds_.size() == 1) + if (siteIds_.size() == 1) { // Single site molecule - no rotational motion. @@ -85,7 +85,7 @@ inline Foam::molecule::constantProperties::constantProperties momentOfInertia_ = diagTensor(-1, -1, -1); } - else if(linearMoleculeTest()) + else if (linearMoleculeTest()) { // Linear molecule. diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C index f341267b846..a50159ee933 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C @@ -509,7 +509,7 @@ void Foam::moleculeCloud::initialiseMolecules zoneDict.lookup("latticePositions") ); - if(latticeIds.size() != latticePositions.size()) + if (latticeIds.size() != latticePositions.size()) { FatalErrorIn("Foam::moleculeCloud::initialiseMolecules") << "latticeIds and latticePositions must be the same " diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudI.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudI.H index fee67cfced4..2a92af07cfe 100644 --- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudI.H +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudI.H @@ -75,7 +75,7 @@ inline void Foam::moleculeCloud::evaluatePair scalar rsIsJMagSq = magSqr(rsIsJ); - if(pairPot.rCutSqr(idsI, idsJ, rsIsJMagSq)) + if (pairPot.rCutSqr(idsI, idsJ, rsIsJMagSq)) { scalar rsIsJMag = mag(rsIsJ); @@ -118,7 +118,7 @@ inline void Foam::moleculeCloud::evaluatePair scalar rsIsJMagSq = magSqr(rsIsJ); - if(rsIsJMagSq <= electrostatic.rCutSqr()) + if (rsIsJMagSq <= electrostatic.rCutSqr()) { scalar rsIsJMag = mag(rsIsJ); diff --git a/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialList.C b/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialList.C index 2d77c4ce595..26b99d7e3b8 100644 --- a/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialList.C +++ b/src/lagrangian/molecularDynamics/potential/pairPotential/pairPotentialList/pairPotentialList.C @@ -158,7 +158,7 @@ void Foam::pairPotentialList::readPairPotentialDict { OFstream ppTabFile(mesh.time().path()/"electrostatic"); - if(!electrostaticPotential_->writeEnergyAndForceTables(ppTabFile)) + if (!electrostaticPotential_->writeEnergyAndForceTables(ppTabFile)) { FatalErrorIn("pairPotentialList::readPairPotentialDict") << "Failed writing to " diff --git a/src/lagrangian/molecularDynamics/potential/potential/potential.C b/src/lagrangian/molecularDynamics/potential/potential/potential.C index e3f6b501d1e..2fc95108dd5 100644 --- a/src/lagrangian/molecularDynamics/potential/potential/potential.C +++ b/src/lagrangian/molecularDynamics/potential/potential/potential.C @@ -53,7 +53,7 @@ void Foam::potential::setSiteIdList(const IOdictionary& moleculePropertiesDict) { const word& siteId = siteIdNames[sI]; - if(findIndex(siteIdList, siteId) == -1) + if (findIndex(siteIdList, siteId) == -1) { siteIdList.append(siteId); } @@ -65,14 +65,14 @@ void Foam::potential::setSiteIdList(const IOdictionary& moleculePropertiesDict) { const word& siteId = pairPotSiteIds[sI]; - if(findIndex(siteIdNames, siteId) == -1) + if (findIndex(siteIdNames, siteId) == -1) { FatalErrorIn("potential.C") << nl << siteId << " in pairPotentialSiteIds is not in siteIds: " << siteIdNames << nl << abort(FatalError); } - if(findIndex(pairPotentialSiteIdList, siteId) == -1) + if (findIndex(pairPotentialSiteIdList, siteId) == -1) { pairPotentialSiteIdList.append(siteId); } @@ -85,7 +85,7 @@ void Foam::potential::setSiteIdList(const IOdictionary& moleculePropertiesDict) { const word& siteId = siteIdList[aSIN]; - if(findIndex(pairPotentialSiteIdList, siteId) == -1) + if (findIndex(pairPotentialSiteIdList, siteId) == -1) { pairPotentialSiteIdList.append(siteId); } @@ -287,7 +287,7 @@ void Foam::potential::potential::readMdInitialiseDict { const word& id = latticeIds[i]; - if(!moleculePropertiesDict.found(id)) + if (!moleculePropertiesDict.found(id)) { FatalErrorIn("potential.C") << nl << "Molecule type " diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C index 78c2fabfc25..bc2dcabf58e 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C @@ -468,7 +468,7 @@ void Foam::autoLayerDriver::findIsolatedRegions // Keep count of number of points unextruded label nPointCounter = 0; - while(true) + while (true) { // Stop layer growth where mesh wraps around edge with a // large feature angle diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/ExactParticle.C b/src/mesh/autoMesh/autoHexMesh/trackedParticle/ExactParticle.C index 237e35276c3..0bda7cd1cc4 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/ExactParticle.C +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/ExactParticle.C @@ -39,7 +39,7 @@ Foam::label Foam::ExactParticle<ParticleType>::track this->facei_ = -1; // Tracks to endPosition or stop on boundary - while(!this->onBoundary() && this->stepFraction_ < 1.0 - SMALL) + while (!this->onBoundary() && this->stepFraction_ < 1.0 - SMALL) { this->stepFraction_ += trackToFace(endPosition, td) diff --git a/src/meshTools/PointEdgeWave/PointEdgeWave.C b/src/meshTools/PointEdgeWave/PointEdgeWave.C index 81309490d5f..7dcaea3f850 100644 --- a/src/meshTools/PointEdgeWave/PointEdgeWave.C +++ b/src/meshTools/PointEdgeWave/PointEdgeWave.C @@ -994,7 +994,7 @@ Foam::label Foam::PointEdgeWave<Type>::iterate(const label maxIter) label iter = 0; - while(iter < maxIter) + while (iter < maxIter) { if (debug) { diff --git a/src/meshTools/cellClassification/cellClassification.C b/src/meshTools/cellClassification/cellClassification.C index 518fd5ae4a0..58c1cfeb467 100644 --- a/src/meshTools/cellClassification/cellClassification.C +++ b/src/meshTools/cellClassification/cellClassification.C @@ -683,7 +683,7 @@ Foam::label Foam::cellClassification::fillHangingCells { label nTotChanged = 0; - for(label iter = 0; iter < maxIter; iter++) + for (label iter = 0; iter < maxIter; iter++) { label nChanged = 0; @@ -740,7 +740,7 @@ Foam::label Foam::cellClassification::fillRegionEdges { label nTotChanged = 0; - for(label iter = 0; iter < maxIter; iter++) + for (label iter = 0; iter < maxIter; iter++) { // Get interface between meshType cells and non-meshType cells as a list // of faces and for each face the cell which is the meshType. @@ -809,7 +809,7 @@ Foam::label Foam::cellClassification::fillRegionPoints { label nTotChanged = 0; - for(label iter = 0; iter < maxIter; iter++) + for (label iter = 0; iter < maxIter; iter++) { // Get interface between meshType cells and non-meshType cells as a list // of faces and for each face the cell which is the meshType. diff --git a/src/meshTools/cellDist/cellDistFuncs.C b/src/meshTools/cellDist/cellDistFuncs.C index bca2841273c..76ec6eee355 100644 --- a/src/meshTools/cellDist/cellDistFuncs.C +++ b/src/meshTools/cellDist/cellDistFuncs.C @@ -121,7 +121,7 @@ Foam::scalar Foam::cellDistFuncs::smallestDist scalar minDist = GREAT; minFaceI = -1; - for(label wallFaceI = 0; wallFaceI < nWallFaces; wallFaceI++) + for (label wallFaceI = 0; wallFaceI < nWallFaces; wallFaceI++) { label patchFaceI = wallFaces[wallFaceI]; diff --git a/src/meshTools/meshSearch/meshSearch.C b/src/meshTools/meshSearch/meshSearch.C index 9b822b11516..7448c7faa3d 100644 --- a/src/meshTools/meshSearch/meshSearch.C +++ b/src/meshTools/meshSearch/meshSearch.C @@ -791,7 +791,7 @@ Foam::label Foam::meshSearch::findCell + offset(curHit.hitPoint(), curHit.index(), edgeVec); } } - while(true); + while (true); } else { @@ -928,7 +928,7 @@ Foam::List<Foam::pointIndexHit> Foam::meshSearch::intersections + offset(bHit.hitPoint(), bHit.index(), edgeVec); } - } while(bHit.hit()); + } while (bHit.hit()); hits.shrink(); diff --git a/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C b/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C index e3c2c2f4ecb..17a59862604 100644 --- a/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C +++ b/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C @@ -280,7 +280,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh) blockHead = true; } } - else if(cellPoints[pointI] == newEdgeEnd) + else if (cellPoints[pointI] == newEdgeEnd) { if (pointUsage[pointI] > 2) { @@ -375,7 +375,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh) blockHead = true; } } - else if(cellPoints[pointI] == curEdgeEnd) + else if (cellPoints[pointI] == curEdgeEnd) { if (pointUsage[pointI] > 2) { diff --git a/src/meshTools/regionSplit/regionSplit.C b/src/meshTools/regionSplit/regionSplit.C index 667a2ddc5d1..b415d66f02e 100644 --- a/src/meshTools/regionSplit/regionSplit.C +++ b/src/meshTools/regionSplit/regionSplit.C @@ -342,7 +342,7 @@ Foam::label Foam::regionSplit::calcRegionSplit nRegions++; unsetCellI++; } - while(true); + while (true); if (debug) diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C index 11e2eadd483..7f822733b8a 100644 --- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C @@ -35,13 +35,9 @@ License namespace Foam { - -defineTypeNameAndDebug(setsToFaceZone, 0); - -addToRunTimeSelectionTable(topoSetSource, setsToFaceZone, word); - -addToRunTimeSelectionTable(topoSetSource, setsToFaceZone, istream); - + defineTypeNameAndDebug(setsToFaceZone, 0); + addToRunTimeSelectionTable(topoSetSource, setsToFaceZone, word); + addToRunTimeSelectionTable(topoSetSource, setsToFaceZone, istream); } @@ -155,7 +151,7 @@ void Foam::setsToFaceZone::applyToSet { flip = false; } - else if(!ownFound && neiFound) + else if (!ownFound && neiFound) { flip = true; } diff --git a/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C b/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C index 2e7ba2f8819..4721cb48ab4 100644 --- a/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C +++ b/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C @@ -330,7 +330,7 @@ Foam::edgeSurface::edgeSurface labelList edgeLabels(edges_.size() - nSurfaceEdges_); label i = 0; - for(label edgeI = nSurfaceEdges_; edgeI < edges_.size(); edgeI++) + for (label edgeI = nSurfaceEdges_; edgeI < edges_.size(); edgeI++) { edgeLabels[i++] = edgeI; } diff --git a/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C b/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C index be758c07fdf..201593990b2 100644 --- a/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C +++ b/src/meshTools/triSurface/booleanOps/intersectedSurface/intersectedSurface.C @@ -597,7 +597,7 @@ Foam::face Foam::intersectedSurface::walkFace label vertI = startVertI; label edgeI = startEdgeI; - while(true) + while (true) { const edge& e = edges[edgeI]; diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C index fffcd6792d4..a25664a130d 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C @@ -705,7 +705,7 @@ void Foam::surfaceIntersection::doCutEdges doTrack = false; } } - while(doTrack); + while (doTrack); } intersection::setPlanarTol(oldTol); } diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C index cdaf91b2e42..a710c98d44c 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C @@ -155,7 +155,7 @@ void Foam::surfaceIntersection::removeDuplicates // Insert first elems[elemI++] = map[oldElems[0]]; - for(label vertI = 1; vertI < oldElems.size(); vertI++) + for (label vertI = 1; vertI < oldElems.size(); vertI++) { // Insert others only if they differ from one before label newVertI = map[oldElems[vertI]]; @@ -294,7 +294,7 @@ void Foam::surfaceIntersection::writeIntersectedEdges os << "l " << e.start()+1 << ' ' << extraVerts[0] + surf.nPoints() + 1 << endl; - for(label i = 1; i < extraVerts.size(); i++) + for (label i = 1; i < extraVerts.size(); i++) { os << "l " << extraVerts[i-1] + surf.nPoints() + 1 << ' ' << extraVerts[i] + surf.nPoints() + 1 << endl; diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C index 34a23074475..045693caa84 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C @@ -185,7 +185,7 @@ void Foam::orientedSurface::walkSurface // List of edges that were changed in the last iteration. labelList changedEdges; - while(true) + while (true) { changedEdges = faceToEdge(s, changedFaces); diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C index 0e97a633165..773c4234190 100644 --- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C +++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C @@ -2702,7 +2702,7 @@ void Foam::triSurfaceTools::calcInterpolationWeights // calculate edge normal (pointing inwards) FixedList<vector, 3> normal; - for(label i=0; i<3; i++) + for (label i=0; i<3; i++) { normal[i] = triangleFaceNormal ^ edge[i]; normal[i] /= mag(normal[i]) + VSMALL; diff --git a/src/sampling/include/mapPatch.H b/src/sampling/include/mapPatch.H index 4ed64b1f663..371317a0ab2 100644 --- a/src/sampling/include/mapPatch.H +++ b/src/sampling/include/mapPatch.H @@ -1,4 +1,4 @@ - if(planeMapping && targetPatchNamePresent && cut.cut()) + if (planeMapping && targetPatchNamePresent && cut.cut()) { //Map variables U, phi & k //Info<< typeInfo("isoLESmodel") << endl; @@ -10,7 +10,7 @@ forAll(cutCells, cCellsI) { - if(sgsModel.type() == "SpalartAllmaras") + if (sgsModel.type() == "SpalartAllmaras") { planeNuTilda[cCellsI] = sgsModel.nuTilda()()[cutCells[cCellsI]]; } @@ -21,7 +21,7 @@ planeU[cCellsI] = U[cutCells[cCellsI]]; } - if(sgsModel.type() == "SpalartAllmaras") + if (sgsModel.type() == "SpalartAllmaras") { Info<< "Mapping NuTilda." << endl; sgsModel.nuTilda()().boundaryField()[targetPatchNumber] == diff --git a/src/sampling/sampledSet/curve/curveSet.C b/src/sampling/sampledSet/curve/curveSet.C index 7b0a0b8e035..b294ab36000 100644 --- a/src/sampling/sampledSet/curve/curveSet.C +++ b/src/sampling/sampledSet/curve/curveSet.C @@ -60,7 +60,7 @@ bool Foam::curveSet::trackToBoundary // Alias const point& trackPt = singleParticle.position(); - while(true) + while (true) { // Local geometry info const vector offset = sampleCoords_[sampleI+1] - sampleCoords_[sampleI]; @@ -145,7 +145,7 @@ void Foam::curveSet::calcSamples << sampleCoords_ << exit(FatalError); } point oldPoint = sampleCoords_[0]; - for(label sampleI = 1; sampleI < sampleCoords_.size(); sampleI++) + for (label sampleI = 1; sampleI < sampleCoords_.size(); sampleI++) { if (mag(sampleCoords_[sampleI] - oldPoint) < SMALL) { @@ -169,7 +169,7 @@ void Foam::curveSet::calcSamples label sampleI = 0; point lastSample(GREAT, GREAT, GREAT); - while(true) + while (true) { // Get boundary intersection point trackPt; @@ -243,7 +243,7 @@ void Foam::curveSet::calcSamples // No intersection found. Go to next point sampleI++; } - } while((trackCellI == -1) && (sampleI < sampleCoords_.size() - 1)); + } while ((trackCellI == -1) && (sampleI < sampleCoords_.size() - 1)); if (sampleI == sampleCoords_.size() - 1) { @@ -278,7 +278,7 @@ void Foam::curveSet::calcSamples ); // fill sampleSegments - for(label i = samplingPts.size() - 1; i >= startSegmentI; --i) + for (label i = samplingPts.size() - 1; i >= startSegmentI; --i) { samplingSegments.append(segmentI); } diff --git a/src/sampling/sampledSet/face/faceOnlySet.C b/src/sampling/sampledSet/face/faceOnlySet.C index fba774f8021..e66d05884b5 100644 --- a/src/sampling/sampledSet/face/faceOnlySet.C +++ b/src/sampling/sampledSet/face/faceOnlySet.C @@ -65,7 +65,7 @@ bool Foam::faceOnlySet::trackToBoundary // Alias const point& trackPt = singleParticle.position(); - while(true) + while (true) { point oldPoint = trackPt; @@ -199,7 +199,7 @@ void Foam::faceOnlySet::calcSamples // index in bHits; current boundary intersection label bHitI = 1; - while(true) + while (true) { if (trackFaceI != -1) { @@ -230,7 +230,7 @@ void Foam::faceOnlySet::calcSamples ); // fill sampleSegments - for(label i = samplingPts.size() - 1; i >= startSegmentI; --i) + for (label i = samplingPts.size() - 1; i >= startSegmentI; --i) { samplingSegments.append(segmentI); } diff --git a/src/sampling/sampledSet/midPoint/midPointSet.C b/src/sampling/sampledSet/midPoint/midPointSet.C index 0ec01f6571b..ffe75103426 100644 --- a/src/sampling/sampledSet/midPoint/midPointSet.C +++ b/src/sampling/sampledSet/midPoint/midPointSet.C @@ -54,7 +54,7 @@ void Foam::midPointSet::genSamples() label sampleI = 0; - while(true) + while (true) { // calculate midpoint between sampleI and sampleI+1 (if in same segment) while diff --git a/src/sampling/sampledSet/midPointAndFace/midPointAndFaceSet.C b/src/sampling/sampledSet/midPointAndFace/midPointAndFaceSet.C index 7e110ef9018..e5a2a9caea2 100644 --- a/src/sampling/sampledSet/midPointAndFace/midPointAndFaceSet.C +++ b/src/sampling/sampledSet/midPointAndFace/midPointAndFaceSet.C @@ -56,7 +56,7 @@ void Foam::midPointAndFaceSet::genSamples() label sampleI = 0; - while(true) + while (true) { // sampleI is start of segment diff --git a/src/sampling/sampledSet/uniform/uniformSet.C b/src/sampling/sampledSet/uniform/uniformSet.C index 9b25ba42345..ee293d6588e 100644 --- a/src/sampling/sampledSet/uniform/uniformSet.C +++ b/src/sampling/sampledSet/uniform/uniformSet.C @@ -65,7 +65,7 @@ bool Foam::uniformSet::nextSample samplePt += offset; sampleI++; - for(; sampleI < nPoints_; sampleI++) + for (; sampleI < nPoints_; sampleI++) { scalar s = (samplePt - currentPt) & normOffset; @@ -103,7 +103,7 @@ bool Foam::uniformSet::trackToBoundary // Alias const point& trackPt = singleParticle.position(); - while(true) + while (true) { // Find next samplePt on/after trackPt. Update samplePt, sampleI if (!nextSample(trackPt, offset, smallDist, samplePt, sampleI)) @@ -305,7 +305,7 @@ void Foam::uniformSet::calcSamples // index in bHits; current boundary intersection label bHitI = 1; - while(true) + while (true) { // Initialize tracking starting from trackPt Cloud<passiveParticle> particles(mesh(), IDLList<passiveParticle>()); @@ -329,7 +329,7 @@ void Foam::uniformSet::calcSamples ); // fill sampleSegments - for(label i = samplingPts.size() - 1; i >= startSegmentI; --i) + for (label i = samplingPts.size() - 1; i >= startSegmentI; --i) { samplingSegments.append(segmentI); } diff --git a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C index c916fe16c3c..4ebdbb976b0 100644 --- a/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/raw/rawSurfaceWriter.C @@ -192,7 +192,7 @@ void Foam::rawSurfaceWriter<Type>::writeData { // header os << "# xx xy xz yy yz "; - for(int i=0; i<6; i++) + for (int i=0; i<6; i++) { os << fieldName << "_" << i << " "; } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 7153826609d..3e204e65b1d 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C @@ -707,7 +707,7 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::solve // calculate the chemical source terms scalar cTot = 0.0; - while(timeLeft > SMALL) + while (timeLeft > SMALL) { tauC = solver().solve(c, Ti, pi, t, dt); t += dt; diff --git a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C b/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C index f157c2645f6..becfd94db21 100644 --- a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C +++ b/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C @@ -118,7 +118,7 @@ Foam::scalar Foam::RosinRammler::sample() const scalar xx = pow(x/d_[i], n_[i]); p += ls_[i]*xx*exp(-xx); } - } while(y>p); + } while (y>p); return x; } diff --git a/src/thermophysicalModels/pdfs/exponential/exponential.C b/src/thermophysicalModels/pdfs/exponential/exponential.C index 6ebe918fe89..8498c2c9e2a 100644 --- a/src/thermophysicalModels/pdfs/exponential/exponential.C +++ b/src/thermophysicalModels/pdfs/exponential/exponential.C @@ -105,7 +105,7 @@ Foam::scalar Foam::exponential::sample() const { p += ls_[i]*exp(-lambda_[i]*x); } - } while(p>y); + } while (p>y); return x; } diff --git a/src/thermophysicalModels/pdfs/general/general.C b/src/thermophysicalModels/pdfs/general/general.C index 59b1a75953f..33d3e3f57d4 100644 --- a/src/thermophysicalModels/pdfs/general/general.C +++ b/src/thermophysicalModels/pdfs/general/general.C @@ -96,7 +96,7 @@ Foam::scalar Foam::general::sample() const + (x - xy_[i][0]) *(xy_[i+1][1] - xy_[i][1]) /(xy_[i+1][0] - xy_[i][0]); - } while(p>y); + } while (p>y); return x; } diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index f683d77bcea..7821fb7d580 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -309,7 +309,7 @@ void Foam::radiation::fvDOM::calculate() Info<< "Radiation solver iter: " << radIter << endl; - } while(maxResidual > convergence_ && radIter < maxIter_); + } while (maxResidual > convergence_ && radIter < maxIter_); updateG(); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index a6841241225..9302e166594 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -813,7 +813,7 @@ void Foam::chemkinReader::read yy_buffer_state* bufferPtr(yy_create_buffer(&thermoStream, yyBufSize)); yy_switch_to_buffer(bufferPtr); - while(lex() != 0) + while (lex() != 0) {} yy_delete_buffer(bufferPtr); @@ -838,7 +838,7 @@ void Foam::chemkinReader::read initReactionKeywordTable(); - while(lex() != 0) + while (lex() != 0) {} yy_delete_buffer(bufferPtr); diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index de679103806..0afbc9a457d 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -234,7 +234,7 @@ private: { elementName[1] = tolower(elementName[1]); } - else if(elementName[0] == 'E') + else if (elementName[0] == 'E') { elementName = 'e'; } diff --git a/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C b/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C index 20c3d9cc65d..d98a504bc4c 100644 --- a/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C +++ b/src/triSurface/triSurface/interfaces/OBJ/readOBJ.C @@ -107,7 +107,7 @@ bool triSurface::readOBJ(const fileName& OBJfileName) // Assume 'f' is followed by space. string::size_type endNum = 1; - while(true) + while (true) { string::size_type startNum = line.find_first_not_of(' ', endNum); diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L index 208aa13d161..2d04d364075 100644 --- a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L +++ b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L @@ -399,7 +399,7 @@ bool triSurface::readSTLASCII(const fileName& STLfileName) // Create the lexer obtaining the approximate number of vertices in the STL // from the file size STLLexer lexer(&STLstream.stdStream(), Foam::fileSize(STLfileName)/400); - while(lexer.lex() != 0) + while (lexer.lex() != 0) {} DynamicList<STLpoint>& STLpoints = lexer.STLpoints(); diff --git a/src/triSurface/triSurface/interfaces/TRI/readTRI.C b/src/triSurface/triSurface/interfaces/TRI/readTRI.C index c0452e46aaf..d0dc0b3c314 100644 --- a/src/triSurface/triSurface/interfaces/TRI/readTRI.C +++ b/src/triSurface/triSurface/interfaces/TRI/readTRI.C @@ -63,7 +63,7 @@ bool triSurface::readTRI(const fileName& TRIfileName) // Max region number so far label maxRegion = 0; - while(TRIfile) + while (TRIfile) { string line = getLineNoComment(TRIfile); diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C index 83674b6b90b..96ca3d78a36 100644 --- a/src/triSurface/triSurface/triSurface.C +++ b/src/triSurface/triSurface/triSurface.C @@ -838,7 +838,7 @@ void Foam::triSurface::markZone // List of faces whose faceZone has been set. labelList changedFaces(1, faceI); - while(true) + while (true) { // Pick up neighbours of changedFaces DynamicList<label> newChangedFaces(2*changedFaces.size()); diff --git a/src/triSurface/triSurface/triSurfaceAddressing.C b/src/triSurface/triSurface/triSurfaceAddressing.C index ce2e5608f47..14a383c9fc3 100644 --- a/src/triSurface/triSurface/triSurfaceAddressing.C +++ b/src/triSurface/triSurface/triSurfaceAddressing.C @@ -91,7 +91,7 @@ void triSurface::calcSortedEdgeFaces() const // e0 is reference so angle is 0 faceAngles[0] = 0; - for(label nbI = 1; nbI < myFaceNbs.size(); nbI++) + for (label nbI = 1; nbI < myFaceNbs.size(); nbI++) { // Get opposite vertex const labelledTri& f = localFaces()[myFaceNbs[nbI]]; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index c202ac479c8..a857b587e30 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -186,7 +186,7 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus yPlusLast = yp; yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - } while(mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); yPlus[facei] = max(0.0, yp); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index bccc07672ff..ba5f0e79c5a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -98,7 +98,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus yPlusLast = yp; yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - } while(mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10 ); + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10 ); yPlus[facei] = max(0.0, yp); } diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C index caa975f3376..c4f266376a9 100644 --- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C +++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) plot3dFile >> coord; // if statement ignores the first layer in i and j - if(i>0 && j>0) + if (i>0 && j>0) { points[p++][comp] = coord; } @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) // correct error in biconic meshes forAll(points, i) { - if(points[i][1] < 1e-07) + if (points[i][1] < 1e-07) { points[i][1] = 0.0; } diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H index 5a67dd0497b..cab105511b2 100644 --- a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H @@ -19,7 +19,7 @@ )*rUAf; adjustPhi(phi, U, p); - for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( -- GitLab