Apply coding style recommendations:

- space between keyword and bracket in 'for(..)', 'if(..)', 'while(..)'
This commit is contained in:
Mark Olesen
2009-11-30 08:55:03 +01:00
parent 6bdb7fb7b5
commit 909e6b27e4
148 changed files with 343 additions and 342 deletions

View File

@ -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");

View File

@ -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

View File

@ -5,7 +5,7 @@
runTime.path()/runTime.timeName()/"uniform"/"gradP.raw"
);
if(gradPFile.good())
if (gradPFile.good())
{
gradPFile << gradP << endl;
}

View File

@ -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
(

View File

@ -1,4 +1,4 @@
if(turbulence)
if (turbulence)
{
if (mesh.changing())
{

View File

@ -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
(

View File

@ -42,7 +42,7 @@
adjustPhi(phi, U, pcorr);
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pcorrEqn
(

View File

@ -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
(

View File

@ -42,7 +42,7 @@
adjustPhi(phi, U, pcorr);
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pcorrEqn
(

View File

@ -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
(

View File

@ -34,7 +34,7 @@
adjustPhi(phi, U, pcorr);
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pcorrEqn
(

View File

@ -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
(

View File

@ -34,7 +34,7 @@
adjustPhi(phi, U, pcorr);
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pcorrEqn
(

View File

@ -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
(

View File

@ -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;
}

View File

@ -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
(

View File

@ -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
(

View File

@ -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
(

View File

@ -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();

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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
(

View File

@ -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];
}

View File

@ -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];

View File

@ -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 << ' '

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -412,7 +412,7 @@ void readPatches
Sout<< "Starting reading patches at line " << is.lineNumber() << '.'
<< endl;
while(true)
while (true)
{
string line;
is.getLine(line);

View File

@ -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)
{

View File

@ -1410,7 +1410,7 @@ void Foam::meshDualiser::setRefinement
meshMod
);
}
while(fp != 0);
while (fp != 0);
}
}

View File

@ -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;

View File

@ -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))
{

View File

@ -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];
}

View File

@ -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,

View File

@ -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)
{

View File

@ -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] << " ";
}

View File

@ -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 << " ";
}

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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();

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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];

View File

@ -65,7 +65,7 @@ int main(int argc, char *argv[])
triSurface cleanSurf(surf1);
while(true)
while (true)
{
label nOldVert = cleanSurf.nPoints();

View File

@ -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)
{

View File

@ -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(

View File

@ -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);

View File

@ -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)
{

View File

@ -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]));

View File

@ -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;

View File

@ -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;

View File

@ -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];
}

View File

@ -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];
}

View File

@ -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,

View File

@ -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,

View File

@ -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
(

View File

@ -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;
}

View File

@ -468,7 +468,7 @@ Foam::label Foam::primitiveMesh::findFirstCommonElementFromSortedLists
while (iter1 != list1.end() && iter2 != list2.end())
{
if( *iter1 < *iter2)
if (*iter1 < *iter2)
{
++iter1;
}

View File

@ -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);

View File

@ -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)
{

View File

@ -390,7 +390,7 @@ void Foam::boundaryMesh::markZone
// Zones on all edges.
labelList edgeZone(mesh().nEdges(), -1);
while(1)
while (true)
{
changedEdges = faceToEdge
(

View File

@ -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();

View File

@ -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();

View File

@ -1790,7 +1790,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
cutPointI = cutEdges[cutEdgeI].otherVertex(cutPointI);
} while(cutPointI != cutPoint1);
} while (cutPointI != cutPoint1);
}
if (debug)

View File

@ -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);

View File

@ -456,7 +456,7 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
{
break;
}
} while(true);
} while (true);
// Keep track of faces that have been done already.

View File

@ -2319,7 +2319,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
allCellInfo
);
while(true)
while (true)
{
if (debug)
{

View File

@ -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; \
}

View File

@ -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
(

View File

@ -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);
}

View File

@ -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
(

View File

@ -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

View File

@ -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;

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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]);

View File

@ -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
<

View File

@ -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;

View File

@ -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
<

View File

@ -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++;

View File

@ -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_);
}

View File

@ -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

View File

@ -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);

View File

@ -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];

View File

@ -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)...

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
// }

Some files were not shown because too many files have changed in this diff Show More