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_; refValue() = Uwall_;
if(thermalCreep_) if (thermalCreep_)
{ {
const volScalarField& vsfT = const volScalarField& vsfT =
this->db().objectRegistry::lookupObject<volScalarField>("T"); 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); refValue() -= 3.0*pnu/(4.0*pT)*transform(I - n*n, gradpT);
} }
if(curvature_) if (curvature_)
{ {
const fvPatchTensorField& ptauMC = const fvPatchTensorField& ptauMC =
patch().lookupPatchField<volTensorField, tensor>("tauMC"); patch().lookupPatchField<volTensorField, tensor>("tauMC");

View File

@ -11,7 +11,7 @@
runTime.path()/runTime.timeName()/"uniform"/"gradP.raw" runTime.path()/runTime.timeName()/"uniform"/"gradP.raw"
); );
if(gradPFile.good()) if (gradPFile.good())
{ {
gradPFile >> gradP; gradPFile >> gradP;
Info<< "Reading average pressure gradient" <<endl Info<< "Reading average pressure gradient" <<endl

View File

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

View File

@ -29,7 +29,7 @@
for (label i=0; i<p.boundaryField().size(); i++) for (label i=0; i<p.boundaryField().size(); i++)
{ {
if(p.boundaryField()[i].fixesValue()) if (p.boundaryField()[i].fixesValue())
{ {
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
} }
@ -50,7 +50,7 @@
pcorrTypes pcorrTypes
); );
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn
( (

View File

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

View File

@ -34,7 +34,7 @@
surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); 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 fvScalarMatrix pEqn
( (

View File

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

View File

@ -30,7 +30,7 @@
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqnIncomp fvScalarMatrix pEqnIncomp
( (

View File

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

View File

@ -18,7 +18,7 @@
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rAUf; )*rAUf;
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (

View File

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

View File

@ -19,7 +19,7 @@
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (

View File

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

View File

@ -23,7 +23,7 @@
const volScalarField& vDotcP = vDotP[0](); const volScalarField& vDotcP = vDotP[0]();
const volScalarField& vDotvP = vDotP[1](); const volScalarField& vDotvP = vDotP[1]();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (

View File

@ -125,7 +125,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::rho() const
tmp<volScalarField> trho = iter()*iter().rho(); tmp<volScalarField> trho = iter()*iter().rho();
for(++iter; iter != phases_.end(); ++iter) for (++iter; iter != phases_.end(); ++iter)
{ {
trho() += iter()*iter().rho(); trho() += iter()*iter().rho();
} }
@ -140,7 +140,7 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::mu() const
tmp<volScalarField> tmu = iter()*iter().rho()*iter().nu(); 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(); tmu() += iter()*iter().rho()*iter().nu();
} }
@ -156,7 +156,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::muf() const
tmp<surfaceScalarField> tmuf = tmp<surfaceScalarField> tmuf =
fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
for(++iter; iter != phases_.end(); ++iter) for (++iter; iter != phases_.end(); ++iter)
{ {
tmuf() += tmuf() +=
fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu());
@ -210,7 +210,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const
PtrDictionary<phase>::const_iterator iter2 = iter1; PtrDictionary<phase>::const_iterator iter2 = iter1;
++iter2; ++iter2;
for(; iter2 != phases_.end(); ++iter2) for (; iter2 != phases_.end(); ++iter2)
{ {
const phase& alpha2 = iter2(); const phase& alpha2 = iter2();
@ -489,7 +489,7 @@ void Foam::multiphaseMixture::solveAlphas
if (cycleAlpha) if (cycleAlpha)
{ {
PtrDictionary<phase>::iterator refPhaseIter = phases_.begin(); 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; ++refPhaseIter;
} }

View File

@ -18,7 +18,7 @@
+ fvc::interpolate(rho)*(g & mesh.Sf()) + fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf; )*rUAf;
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (

View File

@ -17,7 +17,7 @@ phi =
surfaceScalarField phiU("phiU", phi); surfaceScalarField phiU("phiU", phi);
phi += fvc::interpolate(rho)*(g & mesh.Sf())*rUAf; phi += fvc::interpolate(rho)*(g & mesh.Sf())*rUAf;
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (

View File

@ -13,7 +13,7 @@
phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rUAf; 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 fvScalarMatrix pEqn
( (

View File

@ -78,7 +78,7 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowErgunWenYu::K
forAll(Re, celli) forAll(Re, celli)
{ {
if(Re[celli] > 1000.0) if (Re[celli] > 1000.0)
{ {
Cds[celli] = 0.44; Cds[celli] = 0.44;
} }

View File

@ -77,7 +77,7 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowSchillerNaumann::K
forAll(Re, celli) forAll(Re, celli)
{ {
if(Re[celli] > 1000.0) if (Re[celli] > 1000.0)
{ {
Cds[celli] = 0.44; Cds[celli] = 0.44;
} }

View File

@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::SchillerNaumann::K
forAll(Re, celli) forAll(Re, celli)
{ {
if(Re[celli] > 1000.0) if (Re[celli] > 1000.0)
{ {
Cds[celli] = 0.44; Cds[celli] = 0.44;
} }

View File

@ -77,7 +77,7 @@ Foam::tmp<Foam::volScalarField> Foam::WenYu::K
forAll(Re, celli) forAll(Re, celli)
{ {
if(Re[celli] > 1000.0) if (Re[celli] > 1000.0)
{ {
Cds[celli] = 0.44; Cds[celli] = 0.44;
} }

View File

@ -47,7 +47,7 @@
surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob); 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 fvScalarMatrix pEqn
( (

View File

@ -135,7 +135,7 @@ int main(int argc, char *argv[])
sum = 0; sum = 0;
for (label iter = 0; iter < nIters; ++iter) 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]; sum += stlVector[i];
} }

View File

@ -477,7 +477,7 @@ int main(int argc, char *argv[])
// vf, // vf,
// stencilData // stencilData
// ); // );
// for(label faci = 0; faci < mesh.nInternalFaces(); faci++) // for (label faci = 0; faci < mesh.nInternalFaces(); faci++)
// { // {
// const scalarList& stData = stencilData[faceI]; // const scalarList& stData = stencilData[faceI];
// const scalarList& stWeight = fit[faceI]; // const scalarList& stWeight = fit[faceI];

View File

@ -230,7 +230,7 @@ int main(int argc, char *argv[])
// Dump route as lines. // Dump route as lines.
labelList route(cellRouter.getRoute(-(pathI + 1))); labelList route(cellRouter.getRoute(-(pathI + 1)));
for(label elemI = 1; elemI < route.size(); elemI++) for (label elemI = 1; elemI < route.size(); elemI++)
{ {
objFile objFile
<< "l " << route[elemI-1]+1 << ' ' << "l " << route[elemI-1]+1 << ' '

View File

@ -315,7 +315,7 @@ bool Foam::router::route(const labelList& path, const label pathValue)
setWeights(0, path[0]); setWeights(0, path[0]);
// Check if all endPoints can be reached // 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) 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 // 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 fixWeights
( (

View File

@ -264,7 +264,7 @@ int main(int argc, char *argv[])
} }
yyFlexLexer lexer(&ansysStream); yyFlexLexer lexer(&ansysStream);
while(lexer.yylex() != 0) while (lexer.yylex() != 0)
{} {}
Info<< "Creating points" << endl; Info<< "Creating points" << endl;

View File

@ -813,7 +813,7 @@ int main(int argc, char *argv[])
yyFlexLexer lexer(&fluentStream.stdStream()); yyFlexLexer lexer(&fluentStream.stdStream());
while(lexer.yylex() != 0) while (lexer.yylex() != 0)
{} {}
Info<< "\nFINISHED LEXING\n\n"; 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 // Set the owner of these faces to -1 so that they do not get
// added to the mesh // added to the mesh
for(label facei = start; facei <= end; facei++) for (label facei = start; facei <= end; facei++)
{ {
owner[facei] = -1; owner[facei] = -1;
} }

View File

@ -898,7 +898,7 @@ int main(int argc, char *argv[])
} }
yyFlexLexer lexer(&fluentStream); yyFlexLexer lexer(&fluentStream);
while(lexer.yylex() != 0) while (lexer.yylex() != 0)
{} {}
Info<< "\n\nFINISHED LEXING\n\n\n"; Info<< "\n\nFINISHED LEXING\n\n\n";
@ -1388,7 +1388,7 @@ int main(int argc, char *argv[])
meshFaces[j] = cMeshFace; meshFaces[j] = cMeshFace;
pFaceSet.insert(cMeshFace); pFaceSet.insert(cMeshFace);
} }
if(writeSets) if (writeSets)
{ {
Info<< "Writing patch " << patchNames[patchI] Info<< "Writing patch " << patchNames[patchI]
<< " of size " << sz << " to faceSet." << endl; << " 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 //it will be put in a default wall boundary
//internal boundaries are simply ignored //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 //first face is external and has valid non-internal type
@ -1423,7 +1427,7 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
if(facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1) if (facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Face " << faceI << " on new patch " << "Face " << faceI << " on new patch "
@ -1475,7 +1479,7 @@ int main(int argc, char *argv[])
DynamicList<label> defaultBoundaryFaces(facePatchID.size()); DynamicList<label> defaultBoundaryFaces(facePatchID.size());
forAll(facePatchID, idI) forAll(facePatchID, idI)
{ {
if(facePatchID[idI] == -1) if (facePatchID[idI] == -1)
{ {
defaultBoundaryFaces.append(idI); defaultBoundaryFaces.append(idI);
facePatchID[idI] = nBoundaries; facePatchID[idI] = nBoundaries;
@ -1616,9 +1620,9 @@ int main(int argc, char *argv[])
{ {
label nei = pShapeMesh.faceNeighbour()[faceI]; label nei = pShapeMesh.faceNeighbour()[faceI];
label own = pShapeMesh.faceOwner()[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); zoneFaces.append(faceI);
} }
@ -1641,7 +1645,7 @@ int main(int argc, char *argv[])
const labelList& faceCells = bPatches[pI].faceCells(); const labelList& faceCells = bPatches[pI].faceCells();
forAll(faceCells, fcI) forAll(faceCells, fcI)
{ {
if(zoneCell[faceCells[fcI] ]) if (zoneCell[faceCells[fcI] ])
{ {
boundaryZones[pI].append(name); boundaryZones[pI].append(name);
break; break;
@ -1715,7 +1719,7 @@ int main(int argc, char *argv[])
cellSet internal(pShapeMesh, name, end() - start()); cellSet internal(pShapeMesh, name, end() - start());
// shift cell indizes by 1 // 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); internal.insert(celli);
} }

View File

@ -665,7 +665,7 @@ int main(int argc, char *argv[])
} }
yyFlexLexer lexer(&gambitStream); yyFlexLexer lexer(&gambitStream);
while(lexer.yylex() != 0) while (lexer.yylex() != 0)
{} {}
Info<< "Finished lexing" << endl; Info<< "Finished lexing" << endl;

View File

@ -314,14 +314,14 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
IStringStream lineStr(line); IStringStream lineStr(line);
label nSpaces = lineStr.str().count(' '); label nSpaces = lineStr.str().count(' ');
if(nSpaces == 1) if (nSpaces == 1)
{ {
lineStr >> regionI >> regionName; lineStr >> regionI >> regionName;
Info<< " " << regionI << '\t' Info<< " " << regionI << '\t'
<< string::validate<word>(regionName) << endl; << string::validate<word>(regionName) << endl;
} }
else if(nSpaces == 2) else if (nSpaces == 2)
{ {
// >= Gmsh2.4 physical types has tag in front. // >= Gmsh2.4 physical types has tag in front.
label physType; label physType;

View File

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

View File

@ -20,7 +20,7 @@ pointField points(nPoints);
label i4; label i4;
labelList idface(nPoints), fv(nPoints); labelList idface(nPoints), fv(nPoints);
for(label i=0; i<nPoints; i++) for (label i=0; i<nPoints; i++)
{ {
scalar ffv; scalar ffv;
kivaFile kivaFile
@ -44,7 +44,7 @@ labelList i1tab(nPoints), i3tab(nPoints), i8tab(nPoints), idreg(nPoints),
label nBfaces = 0; label nBfaces = 0;
for(label i=0; i<nPoints; i++) for (label i=0; i<nPoints; i++)
{ {
label i1, i3, i8; label i1, i3, i8;
scalar ff, fbcl, fbcf, fbcb; scalar ff, fbcl, fbcf, fbcb;
@ -85,7 +85,7 @@ if (mTable == 0)
labelList imtab(nPoints), jmtab(nPoints), kmtab(nPoints); 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; label im, jm, km;
kivaFile >> i4 >> 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 // 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) if (f[i] > 0.0)
{ {
@ -237,7 +237,7 @@ List<SLList<face> > pFaces[nBCs];
face quadFace(4); face quadFace(4);
face triFace(3); face triFace(3);
for(label i=0; i<nPoints; i++) for (label i=0; i<nPoints; i++)
{ {
if (f[i] > 0) if (f[i] > 0)
{ {

View File

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

View File

@ -545,7 +545,7 @@ void starMesh::createCoupleMatches()
points_[masterEdges[masterEdgeI].start()]; points_[masterEdges[masterEdgeI].start()];
// loop until the next label to add is -1 // loop until the next label to add is -1
for(;;) for (;;)
{ {
label nextPointLabel = -1; label nextPointLabel = -1;
label usedI = -1; label usedI = -1;
@ -739,7 +739,7 @@ void starMesh::createCoupleMatches()
points_[slaveEdges[slaveEdgeI].start()]; points_[slaveEdges[slaveEdgeI].start()];
// loop until the next label to add is -1 // loop until the next label to add is -1
for(;;) for (;;)
{ {
label nextPointLabel = -1; label nextPointLabel = -1;
label usedI = -1; label usedI = -1;

View File

@ -96,7 +96,7 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
label nTetWedge = 0; label nTetWedge = 0;
label nUnknown = 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)) if (hex.isA(mesh, cellI))
{ {

View File

@ -75,7 +75,7 @@ void writeBytes(char* start, int nBytes)
cout<< start << " : "; cout<< start << " : ";
for(int i = 0; i < nBytes; i++) for (int i = 0; i < nBytes; i++)
{ {
cout<< " " << start[i]; cout<< " " << start[i];
} }

View File

@ -423,7 +423,7 @@ int main()
fwrite(ibuf, sizeof(int), 3, outfp); 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, fwrite(trim_cell_face[i], sizeof(int), trim_cell_face[i][0] + 1,
outfp); outfp);
@ -433,7 +433,7 @@ int main()
fwrite(ibuf, sizeof(int), 3, outfp); 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, fwrite(hang_cell_face[i], sizeof(int), hang_cell_face[i][0] + 1,
outfp); outfp);
@ -519,7 +519,7 @@ int main()
ibuf[0] = A_WALL; /* wall value */ ibuf[0] = A_WALL; /* wall value */
ibuf[1] = 0; /* number of hanging nodes */ 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(ibuf, sizeof(int), 1, outfp); /* write wall value */
fwrite(trim_cell_face[i], sizeof(int), trim_cell_face[i][0] + 1, 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[2] = 1; /* number of hanging nodes for face 3 */
ibuf[3] = 31; /* the node number for the hanging node on 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(ibuf, sizeof(int), 1, outfp); /* write wall value */
fwrite(hang_cell_face[i], sizeof(int), hang_cell_face[i][0] + 1, 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); fwrite(&ibuf[2], sizeof(int), 2, outfp);
/* write out face info for last 3 faces */ /* 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(ibuf, sizeof(int), 1, outfp); /* write wall value */
fwrite(hang_cell_face[i], sizeof(int), hang_cell_face[i][0] + 1, 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; Info<< TimeList << endl;
label nTimes = TimeList.size(); label nTimes = TimeList.size();
for(label n=1; n < nTimes; n++) for (label n=1; n < nTimes; n++)
{ {
if (TimeList[n].value() > startTime) if (TimeList[n].value() > startTime)
{ {

View File

@ -24,7 +24,7 @@ for (label i=0; i < nTypes; i++)
{ {
volScalarField gmvScalarField(fieldObject, mesh); volScalarField gmvScalarField(fieldObject, mesh);
gmvFile << fieldName << " 0" << nl; gmvFile << fieldName << " 0" << nl;
for(label indx=0;indx<mesh.nCells();indx++) for (label indx=0;indx<mesh.nCells();indx++)
{ {
gmvFile << gmvScalarField[indx] << " "; gmvFile << gmvScalarField[indx] << " ";
} }

View File

@ -4,29 +4,29 @@ const cellShapeList& cells = mesh.cellShapes();
gmvFile << "gmvinput " << format << nl; gmvFile << "gmvinput " << format << nl;
gmvFile << "nodes " << nPoints << nl; gmvFile << "nodes " << nPoints << nl;
for(label indx=0;indx<nPoints;indx++) for (label indx=0;indx<nPoints;indx++)
{ {
gmvFile << points[indx].x() << " "; gmvFile << points[indx].x() << " ";
} }
gmvFile << nl; gmvFile << nl;
for(label indx=0;indx<nPoints;indx++) for (label indx=0;indx<nPoints;indx++)
{ {
gmvFile << points[indx].y() << " "; gmvFile << points[indx].y() << " ";
} }
gmvFile << nl; gmvFile << nl;
for(label indx=0;indx<nPoints;indx++) for (label indx=0;indx<nPoints;indx++)
{ {
gmvFile << points[indx].z() << " "; gmvFile << points[indx].z() << " ";
} }
gmvFile << nl; gmvFile << nl;
gmvFile << "cells " << cells.size() << 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(); label nNodes = cells[indx].size();
if (nNodes == 8) if (nNodes == 8)
{ {
gmvFile << "hex " << 8 << " "; gmvFile << "hex " << 8 << " ";
for(label ip=0; ip<nNodes; ip++) for (label ip=0; ip<nNodes; ip++)
{ {
gmvFile << cells[indx][ip] + 1 << " "; gmvFile << cells[indx][ip] + 1 << " ";
} }
@ -35,7 +35,7 @@ for(label indx=0;indx<cells.size();indx++)
else if (nNodes == 4) else if (nNodes == 4)
{ {
gmvFile << "tet " << 4 << " "; gmvFile << "tet " << 4 << " ";
for(label ip=0; ip<nNodes; ip++) for (label ip=0; ip<nNodes; ip++)
{ {
gmvFile << cells[indx][ip] + 1 << " "; gmvFile << cells[indx][ip] + 1 << " ";
} }
@ -44,7 +44,7 @@ for(label indx=0;indx<cells.size();indx++)
else if (nNodes == 6) else if (nNodes == 6)
{ {
gmvFile << "prism " << 6 << " "; gmvFile << "prism " << 6 << " ";
for(label ip=0; ip<nNodes; ip++) for (label ip=0; ip<nNodes; ip++)
{ {
gmvFile << cells[indx][ip] + 1 << " "; gmvFile << cells[indx][ip] + 1 << " ";
} }

View File

@ -44,7 +44,7 @@ word itoa(const label n)
label leftOfN = 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)); label j = label(leftOfN/pow(10, length-i-1));
leftOfN -= j*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); 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()); word patchName(meshPtr->boundary()[i].name());
strncpy(part_descriptions[i+1], patchName.c_str(), Z_BUFL); 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(); const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
for(label i=0; i<nPatches; i++) for (label i=0; i<nPatches; i++)
{ {
label nTri03 = 0; label nTri03 = 0;
label nQuad04 = 0; label nQuad04 = 0;

View File

@ -36,11 +36,11 @@ int USERD_get_nfaced_conn
{} {}
else else
{ {
for(label i=0; i<nFacesInCell; i++) for (label i=0; i<nFacesInCell; i++)
{ {
label facei = cells[n][i]; label facei = cells[n][i];
label nPoints = faces[facei].size(); 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; nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
} }
@ -49,11 +49,11 @@ int USERD_get_nfaced_conn
} }
else else
{ {
for(label i=0; i<nFacesInCell; i++) for (label i=0; i<nFacesInCell; i++)
{ {
label facei = cells[n][i]; label facei = cells[n][i];
label nPoints = faces[facei].size(); 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; nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
} }

View File

@ -38,7 +38,7 @@ int USERD_get_nfaced_nodes_per_face
{} {}
else else
{ {
for(label i=0; i<nFacesInCell; i++) for (label i=0; i<nFacesInCell; i++)
{ {
label facei = cells[n][i]; label facei = cells[n][i];
label nFacePoints = faces[facei].size(); label nFacePoints = faces[facei].size();
@ -48,7 +48,7 @@ int USERD_get_nfaced_nodes_per_face
} }
else else
{ {
for(label i=0; i<nFacesInCell; i++) for (label i=0; i<nFacesInCell; i++)
{ {
label facei = cells[n][i]; label facei = cells[n][i];
label nFacePoints = faces[facei].size(); label nFacePoints = faces[facei].size();

View File

@ -30,7 +30,7 @@ int USERD_get_nsided_conn
label nPoints = bMesh[patchi][facei].size(); label nPoints = bMesh[patchi][facei].size();
if ((nPoints != 3) && (nPoints != 4)) 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; 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(); label nPoints = bMesh[patchi][n].size();
if (nPoints == 3) if (nPoints == 3)
{ {
for(label i=0; i<nPoints; i++) for (label i=0; i<nPoints; i++)
{ {
label ip = bMesh[patchi][n][i]; label ip = bMesh[patchi][n][i];
conn_array[nTri03][i] = ip + 1; conn_array[nTri03][i] = ip + 1;
@ -209,7 +209,7 @@ int USERD_get_part_elements_by_type
label nPoints = bMesh[patchi][n].size(); label nPoints = bMesh[patchi][n].size();
if (nPoints == 4) if (nPoints == 4)
{ {
for(label i=0; i<nPoints; i++) for (label i=0; i<nPoints; i++)
{ {
label ip = bMesh[patchi][n][i]; label ip = bMesh[patchi][n][i];
conn_array[nQuad04][i] = ip + 1; conn_array[nQuad04][i] = ip + 1;

View File

@ -314,7 +314,7 @@ static void storeScalarField
Info<< "Storing " << nTotPoints << " of dummy values of " << fieldName Info<< "Storing " << nTotPoints << " of dummy values of " << fieldName
<< endl; << endl;
for(label i = 0; i < nPoints; i++) for (label i = 0; i < nPoints; i++)
{ {
vars[pointI++] = 0.0; vars[pointI++] = 0.0;
} }
@ -388,7 +388,7 @@ static void storeVectorField
for (direction d = 0; d < vector::nComponents; d++) 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; vars[pointI++] = 0.0;
} }

View File

@ -550,7 +550,7 @@ int main(int argc, char *argv[])
fileName surfFileNameBase(surfFileName.name()); fileName surfFileNameBase(surfFileName.name());
for(label zone = 0; zone < numZones; zone++) for (label zone = 0; zone < numZones; zone++)
{ {
boolList includeMap(surf.size(), false); boolList includeMap(surf.size(), false);

View File

@ -131,19 +131,19 @@ int main(int argc, char *argv[])
// rearrange the vertex list // rearrange the vertex list
::List< ::Vector> temp_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]); 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]; vert[permutation[i]]=temp_list[i];
} }
// update the changes in the entries in the triangle list // 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]]; tri[i].v[j] = permutation[tri[i].v[j]];
} }
@ -181,7 +181,7 @@ int main(int argc, char *argv[])
// Convert vert into pointField. // Convert vert into pointField.
pointField newPoints(vert.num); 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]; const ::Vector & v = vert[i];

View File

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

View File

@ -78,7 +78,7 @@ int main(int argc, char *argv[])
const labelListList& pointEdges = surf1.pointEdges(); const labelListList& pointEdges = surf1.pointEdges();
for(label iter = 0; iter < iters; iter++) for (label iter = 0; iter < iters; iter++)
{ {
forAll(pointEdges, vertI) forAll(pointEdges, vertI)
{ {

View File

@ -10,11 +10,12 @@
*** General *** General
+ 80 character lines max + 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. + The normal indentation is 4 spaces per logical level.
+ Use spaces for indentation, not tab characters.
+ Avoid trailing whitespace. + 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 + stream output
=<<= is always four characters after the start of the stream, =<<= is always four characters after the start of the stream,
@ -152,7 +153,7 @@
: code; : code;
:} :}
*** =for= Loops *** =for= and =while= Loops
:for (i = 0; i < maxI; i++) :for (i = 0; i < maxI; i++)
:{ :{
: code; : code;
@ -180,7 +181,7 @@
Note that when indexing through iterators, it is often slightly more Note that when indexing through iterators, it is often slightly more
efficient to use the pre-increment form. Eg, =++iter= instead of =iter++= efficient to use the pre-increment form. Eg, =++iter= instead of =iter++=
*** =forAll= loops *** =forAll= , =forAllIter=, etc. loops
like =for= loops, but like =for= loops, but
:forAll( :forAll(

View File

@ -181,7 +181,7 @@ void error::printStack(Ostream& os)
{ {
IFstream is("/proc/" + name(pid()) + "/maps"); IFstream is("/proc/" + name(pid()) + "/maps");
while(is.good()) while (is.good())
{ {
string line; string line;
is.getLine(line); is.getLine(line);

View File

@ -57,11 +57,11 @@ Foam::Ostream& Foam::FaceCellWave<Type>::writeFaces
{ {
os << nFaces; os << nFaces;
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
os << ' ' << faceLabels[i]; os << ' ' << faceLabels[i];
} }
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
os << ' ' << faceInfo[i]; os << ' ' << faceInfo[i];
} }
@ -70,11 +70,11 @@ Foam::Ostream& Foam::FaceCellWave<Type>::writeFaces
{ {
os << nFaces; os << nFaces;
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
os << faceLabels[i]; os << faceLabels[i];
} }
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
os << faceInfo[i]; os << faceInfo[i];
} }
@ -95,11 +95,11 @@ Foam::Istream& Foam::FaceCellWave<Type>::readFaces
{ {
is >> nFaces; is >> nFaces;
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
is >> faceLabels[i]; is >> faceLabels[i];
} }
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
is >> faceInfo[i]; is >> faceInfo[i];
} }
@ -254,7 +254,7 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
{ {
label cycOffset = patch.size()/2; 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 i1 = patch.start() + patchFaceI;
label i2 = i1 + cycOffset; label i2 = i1 + cycOffset;
@ -339,7 +339,7 @@ void Foam::FaceCellWave<Type>::mergeFaceInfo
const bool const bool
) )
{ {
for(label changedFaceI = 0; changedFaceI < nFaces; changedFaceI++) for (label changedFaceI = 0; changedFaceI < nFaces; changedFaceI++)
{ {
const Type& neighbourWallInfo = changedFacesInfo[changedFaceI]; const Type& neighbourWallInfo = changedFacesInfo[changedFaceI];
label patchFaceI = changedFaces[changedFaceI]; label patchFaceI = changedFaces[changedFaceI];
@ -377,7 +377,7 @@ Foam::label Foam::FaceCellWave<Type>::getChangedPatchFaces
{ {
label nChangedPatchFaces = 0; label nChangedPatchFaces = 0;
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
label patchFaceI = i + startFaceI; label patchFaceI = i + startFaceI;
@ -406,7 +406,7 @@ void Foam::FaceCellWave<Type>::leaveDomain
{ {
const vectorField& fc = mesh_.faceCentres(); const vectorField& fc = mesh_.faceCentres();
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
label patchFaceI = faceLabels[i]; label patchFaceI = faceLabels[i];
@ -428,7 +428,7 @@ void Foam::FaceCellWave<Type>::enterDomain
{ {
const vectorField& fc = mesh_.faceCentres(); const vectorField& fc = mesh_.faceCentres();
for(label i = 0; i < nFaces; i++) for (label i = 0; i < nFaces; i++)
{ {
label patchFaceI = faceLabels[i]; label patchFaceI = faceLabels[i];
@ -451,14 +451,14 @@ void Foam::FaceCellWave<Type>::transform
{ {
const tensor& T = rotTensor[0]; const tensor& T = rotTensor[0];
for(label faceI = 0; faceI < nFaces; faceI++) for (label faceI = 0; faceI < nFaces; faceI++)
{ {
faceInfo[faceI].transform(mesh_, T); faceInfo[faceI].transform(mesh_, T);
} }
} }
else else
{ {
for(label faceI = 0; faceI < nFaces; faceI++) for (label faceI = 0; faceI < nFaces; faceI++)
{ {
faceInfo[faceI].transform(mesh_, rotTensor[faceI]); faceInfo[faceI].transform(mesh_, rotTensor[faceI]);
} }
@ -510,7 +510,7 @@ void Foam::FaceCellWave<Type>::offset
labelList& faces labelList& faces
) )
{ {
for(label faceI = 0; faceI < nFaces; faceI++) for (label faceI = 0; faceI < nFaces; faceI++)
{ {
faces[faceI] += cycOffset; faces[faceI] += cycOffset;
} }
@ -1064,7 +1064,7 @@ Foam::label Foam::FaceCellWave<Type>::iterate(const label maxIter)
handleProcPatches(); handleProcPatches();
} }
while(iter_ < maxIter) while (iter_ < maxIter)
{ {
if (debug) if (debug)
{ {

View File

@ -412,7 +412,7 @@ template<template<class> class Field, class Type>
Type max(const FieldField<Field, Type>& f) Type max(const FieldField<Field, Type>& f)
{ {
label i = 0; label i = 0;
while(i < f.size() && !f[i].size()) i++; while (i < f.size() && !f[i].size()) i++;
if (i < f.size()) if (i < f.size())
{ {
@ -440,12 +440,12 @@ template<template<class> class Field, class Type>
Type min(const FieldField<Field, Type>& f) Type min(const FieldField<Field, Type>& f)
{ {
label i = 0; label i = 0;
while(i < f.size() && !f[i].size()) i++; while (i < f.size() && !f[i].size()) i++;
if (i < f.size()) if (i < f.size())
{ {
label i = 0; label i = 0;
while(!f[i].size()) i++; while (!f[i].size()) i++;
Type Min(min(f[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_)); multiply(SVDA, U_, S_, transpose(V_));
scalar maxDiff = 0; scalar maxDiff = 0;
scalar diff = 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]); diff = mag(A[i][j] - SVDA[i][j]);
if (diff > maxDiff) maxDiff = diff; 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 inline Foam::scalar Foam::SVD::minNonZeroS() const
{ {
scalar minS = S_[0]; scalar minS = S_[0];
for(label i = 1; i < S_.size(); i++) for (label i = 1; i < S_.size(); i++)
{ {
scalar s = S_[i]; scalar s = S_[i];
if (s > VSMALL && s < minS) minS = s; if (s > VSMALL && s < minS) minS = s;

View File

@ -159,11 +159,11 @@ void Foam::multiply
ans = scalarRectangularMatrix(A.n(), B.m(), scalar(0)); 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]; ans[i][j] += A[i][l]*B[l][j];
} }
@ -210,14 +210,14 @@ void Foam::multiply
ans = scalarRectangularMatrix(A.n(), C.m(), scalar(0)); 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; 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]; ab += A[i][j]*B[j][l];
} }
@ -266,11 +266,11 @@ void Foam::multiply
ans = scalarRectangularMatrix(A.n(), C.m(), scalar(0)); 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]; 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 << " "; os << " ";
for(label fp = 0; fp < faceSize_[faceI]; fp++) for (label fp = 0; fp < faceSize_[faceI]; fp++)
{ {
os << ' ' << localFaces_[faceI][fp]; os << ' ' << localFaces_[faceI][fp];
} }

View File

@ -116,7 +116,7 @@ bool Foam::tetWedgeMatcher::matchShape
const face& face0 = localFaces_[face0I]; const face& face0 = localFaces_[face0I];
// Try all rotations of this face // 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, // Try to follow prespecified path on faces of cell,

View File

@ -108,7 +108,7 @@ bool Foam::wedgeMatcher::matchShape
const face& face0 = localFaces_[face0I]; const face& face0 = localFaces_[face0I];
// Try all rotations of this face // 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, // Try to follow prespecified path on faces of cell,

View File

@ -216,7 +216,7 @@ Foam::label Foam::face::split
label minIndex = index; label minIndex = index;
scalar minDiff = constant::mathematical::pi; scalar minDiff = constant::mathematical::pi;
for(label i = 0; i < size() - 3; i++) for (label i = 0; i < size() - 3; i++)
{ {
vector splitEdge vector splitEdge
( (

View File

@ -175,7 +175,7 @@ bool Foam::primitiveMesh::checkClosedCells
{ {
scalar maxOpenness = 0; scalar maxOpenness = 0;
for(direction cmpt=0; cmpt<vector::nComponents; cmpt++) for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
{ {
maxOpenness = max maxOpenness = max
( (
@ -654,7 +654,7 @@ bool Foam::primitiveMesh::checkFaceSkewness
nWarnSkew++; nWarnSkew++;
} }
if(skewness > maxSkew) if (skewness > maxSkew)
{ {
maxSkew = skewness; maxSkew = skewness;
} }
@ -702,7 +702,7 @@ bool Foam::primitiveMesh::checkFaceSkewness
nWarnSkew++; nWarnSkew++;
} }
if(skewness > maxSkew) if (skewness > maxSkew)
{ {
maxSkew = skewness; maxSkew = skewness;
} }

View File

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

View File

@ -114,7 +114,7 @@ void Foam::patchZones::markZone(label faceI)
// Zones on all edges. // Zones on all edges.
labelList edgeZone(pp_.nEdges(), -1); labelList edgeZone(pp_.nEdges(), -1);
while(1) while (true)
{ {
changedEdges = faceToEdge(changedFaces, edgeZone); 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; \ E += rol_uint32(A, 5) + F(B, C, D) + K + M; \
B = rol_uint32(B, 30); \ B = rol_uint32(B, 30); \
} while(0) } while (0)
while (words < endp) while (words < endp)
{ {

View File

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

View File

@ -65,7 +65,7 @@ void Foam::motionSmoother::makePatchPatchAddressing()
forAll(bm, patchi) forAll(bm, patchi)
{ {
if(!isA<emptyPolyPatch>(bm[patchi])) if (!isA<emptyPolyPatch>(bm[patchi]))
{ {
nPatchPatchPoints += bm[patchi].boundaryPoints().size(); nPatchPatchPoints += bm[patchi].boundaryPoints().size();
} }
@ -83,7 +83,7 @@ void Foam::motionSmoother::makePatchPatchAddressing()
forAll(bm, patchi) forAll(bm, patchi)
{ {
if(!isA<emptyPolyPatch>(bm[patchi])) if (!isA<emptyPolyPatch>(bm[patchi]))
{ {
const labelList& bp = bm[patchi].boundaryPoints(); const labelList& bp = bm[patchi].boundaryPoints();
const labelList& meshPoints = bm[patchi].meshPoints(); const labelList& meshPoints = bm[patchi].meshPoints();

View File

@ -51,7 +51,7 @@ void Foam::motionSmoother::checkConstraints
forAll(bm, patchi) forAll(bm, patchi)
{ {
if(!isA<emptyPolyPatch>(bm[patchi])) if (!isA<emptyPolyPatch>(bm[patchi]))
{ {
nPatchPatchPoints += bm[patchi].boundaryPoints().size(); nPatchPatchPoints += bm[patchi].boundaryPoints().size();
} }
@ -81,7 +81,7 @@ void Foam::motionSmoother::checkConstraints
forAll(bm, patchi) forAll(bm, patchi)
{ {
if(!isA<emptyPolyPatch>(bm[patchi])) if (!isA<emptyPolyPatch>(bm[patchi]))
{ {
const labelList& bp = bm[patchi].boundaryPoints(); const labelList& bp = bm[patchi].boundaryPoints();
const labelList& meshPoints = bm[patchi].meshPoints(); const labelList& meshPoints = bm[patchi].meshPoints();
@ -106,7 +106,7 @@ void Foam::motionSmoother::checkConstraints
forAll(bm, patchi) forAll(bm, patchi)
{ {
if(!isA<emptyPolyPatch>(bm[patchi])) if (!isA<emptyPolyPatch>(bm[patchi]))
{ {
const labelList& bp = bm[patchi].boundaryPoints(); const labelList& bp = bm[patchi].boundaryPoints();
const labelList& meshPoints = bm[patchi].meshPoints(); const labelList& meshPoints = bm[patchi].meshPoints();

View File

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

View File

@ -262,7 +262,7 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString
// - which hasn't been handled yet // - which hasn't been handled yet
// - with same neighbour // - with same neighbour
// - that needs extrusion // - that needs extrusion
while(true) while (true)
{ {
label prevFp = fEdges.rcIndex(startFp); label prevFp = fEdges.rcIndex(startFp);
@ -286,7 +286,7 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString
// Search forward for end of string // Search forward for end of string
endFp = startFp; endFp = startFp;
while(true) while (true)
{ {
label nextFp = fEdges.fcIndex(endFp); label nextFp = fEdges.fcIndex(endFp);

View File

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

View File

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

View File

@ -771,7 +771,7 @@ void Foam::slidingInterface::write(Ostream& os) const
// To write out all those tolerances // To write out all those tolerances
#define WRITE_NON_DEFAULT(name) \ #define WRITE_NON_DEFAULT(name) \
if( name ## _ != name ## Default_ )\ if ( name ## _ != name ## Default_ )\
{ \ { \
os << " " #name " " << name ## _ << token::END_STATEMENT << nl; \ os << " " #name " " << name ## _ << token::END_STATEMENT << nl; \
} }

View File

@ -107,7 +107,7 @@ bool Foam::adjustPhi
{ {
massCorr = (massIn - fixedMassOut)/adjustableMassOut; massCorr = (massIn - fixedMassOut)/adjustableMassOut;
} }
else if(mag(fixedMassOut - massIn)/totalFlux > 1e-10) else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10)
{ {
FatalErrorIn 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); jump_ += f_[i]*pow(Un, i);
} }

View File

@ -162,7 +162,7 @@ inline void cellLimitedGrad<Type>::limitFace
const Type& extrapolate const Type& extrapolate
) )
{ {
for(direction cmpt=0; cmpt<Type::nComponents; cmpt++) for (direction cmpt=0; cmpt<Type::nComponents; cmpt++)
{ {
cellLimitedGrad<scalar>::limitFace cellLimitedGrad<scalar>::limitFace
( (

View File

@ -164,7 +164,7 @@ inline void cellMDLimitedGrad<Type>::limitFace
const vector& dcf 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]); vector gi(g[cmpt], g[cmpt+3], g[cmpt+6]);
cellMDLimitedGrad<scalar>::limitFace cellMDLimitedGrad<scalar>::limitFace

View File

@ -108,7 +108,7 @@ Foam::quadraticFitSnGradData::quadraticFitSnGradData
// find the fit coefficients for every face in the mesh // 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); snGradPolySize[faci] = calcFit(stencilPoints[faci], faci);
} }
@ -206,7 +206,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit
// calculate the matrix of the polynomial components // calculate the matrix of the polynomial components
scalarRectangularMatrix B(C.size(), minSize_, scalar(0)); 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]; const point& p = C[ip];
@ -254,7 +254,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit
const scalar deltaCoeff = mesh().deltaCoeffs()[faci]; const scalar deltaCoeff = mesh().deltaCoeffs()[faci];
bool goodFit = false; bool goodFit = false;
for(int iIt = 0; iIt < 10 && !goodFit; iIt++) for (int iIt = 0; iIt < 10 && !goodFit; iIt++)
{ {
SVD svd(B, SMALL); SVD svd(B, SMALL);
@ -270,7 +270,7 @@ Foam::label Foam::quadraticFitSnGradData::calcFit
{ {
fit_[faci][0] = fit0; fit_[faci][0] = fit0;
fit_[faci][1] = fit1; 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; 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[0] *= 10;
wts[1] *= 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][0] *= 10;
B[i][1] *= 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[0][j] *= 10;
B[1][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) 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; if (validComponents[cmpt] == -1) continue;

View File

@ -478,7 +478,7 @@ void Foam::MULES::limiter
scalarField sumlPhip(psiIf.size()); scalarField sumlPhip(psiIf.size());
scalarField mSumlPhim(psiIf.size()); scalarField mSumlPhim(psiIf.size());
for(int j=0; j<nLimiterIter; j++) for (int j=0; j<nLimiterIter; j++)
{ {
sumlPhip = 0.0; sumlPhip = 0.0;
mSumlPhim = 0.0; mSumlPhim = 0.0;

View File

@ -1341,7 +1341,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
{ {
labelList region(baseMesh().nCells(), 0); labelList region(baseMesh().nCells(), 0);
forAllConstIter (labelHashSet, globalCellMap, iter) forAllConstIter(labelHashSet, globalCellMap, iter)
{ {
region[iter.key()] = 1; region[iter.key()] = 1;
} }

View File

@ -45,7 +45,7 @@ bool interpolationCellPointFace<Type>::findTriangle
// calculate triangle edge vectors and triangle face normal // calculate triangle edge vectors and triangle face normal
// the 'i':th edge is opposite node i // the 'i':th edge is opposite node i
vector edge[3], normal[3]; 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 ip0 = (i+1) % 3;
label ipp = (i+2) % 3; label ipp = (i+2) % 3;
@ -55,7 +55,7 @@ bool interpolationCellPointFace<Type>::findTriangle
vector triangleFaceNormal = edge[1] ^ edge[2]; vector triangleFaceNormal = edge[1] ^ edge[2];
// calculate edge normal (pointing inwards) // 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] = triangleFaceNormal ^ edge[i];
normal[i] /= mag(normal[i]) + VSMALL; normal[i] /= mag(normal[i]) + VSMALL;
@ -63,7 +63,7 @@ bool interpolationCellPointFace<Type>::findTriangle
// check if position is inside triangle // check if position is inside triangle
bool inside = true; bool inside = true;
for(label i=0; i<3; i++) for (label i=0; i<3; i++)
{ {
label ip = (i+1) % 3; label ip = (i+1) % 3;
inside = inside && (((newPos - tetPoints[ip]) & edge[i]) >= 0); inside = inside && (((newPos - tetPoints[ip]) & edge[i]) >= 0);
@ -74,7 +74,7 @@ bool interpolationCellPointFace<Type>::findTriangle
foundTriangle = true; foundTriangle = true;
// calculate phi-values // calculate phi-values
for(label i=0; i<3; i++) for (label i=0; i<3; i++)
{ {
label ip = (i+1) % 3; label ip = (i+1) % 3;
scalar phiMax = max(VSMALL, normal[i] & edge[ip]); 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(); const surfaceScalarField& w = mesh.surfaceInterpolation::weights();
for(label facei = 0; facei < mesh.nInternalFaces(); facei++) for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{ {
FitData FitData
< <

View File

@ -165,7 +165,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
// Matrix of the polynomial components // Matrix of the polynomial components
scalarRectangularMatrix B(C.size(), minSize_, scalar(0)); 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]; const point& p = C[ip];
@ -195,7 +195,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
} }
// Additional weighting for constant and linear terms // 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][0] *= wts[0];
B[i][1] *= wts[0]; B[i][1] *= wts[0];
@ -206,14 +206,14 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
coeffsi.setSize(stencilSize); coeffsi.setSize(stencilSize);
bool goodFit = false; bool goodFit = false;
for(int iIt = 0; iIt < 8 && !goodFit; iIt++) for (int iIt = 0; iIt < 8 && !goodFit; iIt++)
{ {
SVD svd(B, SMALL); SVD svd(B, SMALL);
scalar maxCoeff = 0; scalar maxCoeff = 0;
label maxCoeffi = 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]; coeffsi[i] = wts[0]*wts[i]*svd.VSinvUt()[0][i];
if (mag(coeffsi[i]) > maxCoeff) if (mag(coeffsi[i]) > maxCoeff)
@ -271,13 +271,13 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
wts[1] *= 10; wts[1] *= 10;
} }
for(label j = 0; j < B.m(); j++) for (label j = 0; j < B.m(); j++)
{ {
B[0][j] *= 10; B[0][j] *= 10;
B[1][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][0] *= 10;
B[i][1] *= 10; B[i][1] *= 10;

View File

@ -97,7 +97,7 @@ void Foam::UpwindFitData<Polynomial>::calcFit()
// find the fit coefficients for every owner // find the fit coefficients for every owner
//Pout<< "-- Owner --" << endl; //Pout<< "-- Owner --" << endl;
for(label facei = 0; facei < mesh.nInternalFaces(); facei++) for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{ {
FitData FitData
< <
@ -156,7 +156,7 @@ void Foam::UpwindFitData<Polynomial>::calcFit()
// find the fit coefficients for every neighbour // find the fit coefficients for every neighbour
//Pout<< "-- Neighbour --" << endl; //Pout<< "-- Neighbour --" << endl;
for(label facei = 0; facei < mesh.nInternalFaces(); facei++) for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{ {
FitData FitData
< <

View File

@ -63,7 +63,7 @@ void pointPatchInterpolation::makePatchPatchAddressing()
forAll(bm, patchi) 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(); nPatchPatchPoints += bm[patchi].patch().boundaryPoints().size();
} }
@ -81,7 +81,7 @@ void pointPatchInterpolation::makePatchPatchAddressing()
forAll(bm, patchi) 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& bp = bm[patchi].patch().boundaryPoints();
const labelList& meshPoints = bm[patchi].patch().meshPoints(); const labelList& meshPoints = bm[patchi].patch().meshPoints();

View File

@ -208,7 +208,7 @@ Foam::label Foam::Particle<ParticleType>::track
facei_ = -1; facei_ = -1;
// Tracks to endPosition or stop on boundary // 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_); stepFraction_ += trackToFace(endPosition, td)*(1.0 - stepFraction_);
} }

View File

@ -114,7 +114,7 @@ bool Foam::parcel::move(spray& sDB)
scalarField Yfg(Nf, 0.0); scalarField Yfg(Nf, 0.0);
scalar cpMixture = 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]; const volScalarField& Yi = sDB.composition().Y()[i];
if (sDB.isLiquidFuel()[i]) if (sDB.isLiquidFuel()[i])
@ -341,7 +341,7 @@ void Foam::parcel::updateParcelProperties
// calculate mean molecular weight // calculate mean molecular weight
scalar W = 0.0; 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(); 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 // correct the gaseous temperature for evaporated fuel
scalar cpMix = 0.0; scalar cpMix = 0.0;
for(label i=0; i<Ns; i++) for (label i=0; i<Ns; i++)
{ {
cpMix += sDB.composition().Y()[i][celli] cpMix += sDB.composition().Y()[i][celli]
*sDB.gasProperties()[i].Cp(T()); *sDB.gasProperties()[i].Cp(T());
@ -475,7 +475,7 @@ void Foam::parcel::updateParcelProperties
newMass = m(); newMass = m();
newhg = 0.0; newhg = 0.0;
scalarField Ynew(fuels.Y(X())); scalarField Ynew(fuels.Y(X()));
for(label i=0; i<Nf; i++) for (label i=0; i<Nf; i++)
{ {
label j = sDB.liquidToGasIndex()[i]; label j = sDB.liquidToGasIndex()[i];
newhg += Ynew[i]*sDB.gasProperties()[j].H(Tnew); newhg += Ynew[i]*sDB.gasProperties()[j].H(Tnew);
@ -523,7 +523,7 @@ void Foam::parcel::updateParcelProperties
scalar liquidcL = sDB.fuels().cp(pg, TDroplet, X()); scalar liquidcL = sDB.fuels().cp(pg, TDroplet, X());
cpMix = 0.0; cpMix = 0.0;
for(label i=0; i<Ns; i++) for (label i=0; i<Ns; i++)
{ {
if (sDB.isLiquidFuel()[i]) if (sDB.isLiquidFuel()[i])
{ {
@ -541,7 +541,7 @@ void Foam::parcel::updateParcelProperties
scalar z = 0.0; scalar z = 0.0;
scalar tauEvap = 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]; 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 the droplet is NOT boiling use implicit scheme.
if (sDB.evaporation().evaporation()) 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 // immediately evaporate mass that has reached critical
// condition // condition

View File

@ -74,7 +74,7 @@ void parcel::setRelaxationTimes
scalar cpMixture = 0.0; scalar cpMixture = 0.0;
scalar muf = 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]; scalar Y = sDB.composition().Y()[i][celli];
W += Y/sDB.gasProperties()[i].W(); W += Y/sDB.gasProperties()[i].W();
@ -90,7 +90,7 @@ void parcel::setRelaxationTimes
scalarField psat(Nf, 0.0); scalarField psat(Nf, 0.0);
scalarField msat(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]; label j = sDB.liquidToGasIndex()[i];
scalar Y = sDB.composition().Y()[j][celli]; scalar Y = sDB.composition().Y()[j][celli];
@ -121,14 +121,14 @@ void parcel::setRelaxationTimes
scalarField Ys(Nf, 0.0); scalarField Ys(Nf, 0.0);
scalar Wliq = 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]; label j = sDB.liquidToGasIndex()[i];
scalar Wi = sDB.gasProperties()[j].W(); scalar Wi = sDB.gasProperties()[j].W();
Wliq += Xs[i]*Wi; Wliq += Xs[i]*Wi;
} }
for(label i=0; i<Nf; i++) for (label i=0; i<Nf; i++)
{ {
label j = sDB.liquidToGasIndex()[i]; label j = sDB.liquidToGasIndex()[i];
scalar Wi = sDB.gasProperties()[j].W(); scalar Wi = sDB.gasProperties()[j].W();
@ -140,9 +140,9 @@ void parcel::setRelaxationTimes
// calculate the characteritic times // 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; tauMomentum = GREAT;
} }
else else
@ -177,7 +177,7 @@ void parcel::setRelaxationTimes
// this is mainly to put a limit on the evaporation time, // this is mainly to put a limit on the evaporation time,
// since tauEvaporation is very very small close to the boiling point. // 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()); scalar Td = min(T(), 0.999*fuels.properties()[i].Tc());
bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure; bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure;
@ -187,7 +187,7 @@ void parcel::setRelaxationTimes
scalar partialPressure = Xf[i]*pressure; scalar partialPressure = Xf[i]*pressure;
// saturated vapour // saturated vapour
if(partialPressure > psat[i]) if (partialPressure > psat[i])
{ {
tauEvaporation[i] = GREAT; tauEvaporation[i] = GREAT;
} }
@ -259,7 +259,7 @@ void parcel::setRelaxationTimes
scalar vapourSurfaceEnthalpy = 0.0; scalar vapourSurfaceEnthalpy = 0.0;
scalar vapourFarEnthalpy = 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); vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface);
vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature); 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 Wl = fuels_->W(X);
scalar hg = 0.0; scalar hg = 0.0;
for(label j=0; j<Nf; j++) for (label j=0; j<Nf; j++)
{ {
label k = liquidToGasIndex_[j]; label k = liquidToGasIndex_[j];
hg += gasProperties()[k].H(T)*gasProperties()[k].W()*X[j]/Wl; hg += gasProperties()[k].H(T)*gasProperties()[k].W()*X[j]/Wl;
@ -133,7 +133,7 @@ scalar spray::liquidEnthalpy() const
scalar hg = 0.0; scalar hg = 0.0;
scalar Wl = fuels().W(elmnt().X()); scalar Wl = fuels().W(elmnt().X());
for(label j=0; j<Nf; j++) for (label j=0; j<Nf; j++)
{ {
label k = liquidToGasIndex_[j]; label k = liquidToGasIndex_[j];
@ -177,7 +177,7 @@ scalar spray::liquidTotalEnthalpy() const
scalar hg = 0.0; scalar hg = 0.0;
scalar Wl = fuels().W(elmnt().X()); scalar Wl = fuels().W(elmnt().X());
for(label j=0; j<Nf; j++) for (label j=0; j<Nf; j++)
{ {
label k = liquidToGasIndex_[j]; label k = liquidToGasIndex_[j];
hg += hg +=
@ -251,7 +251,7 @@ scalar spray::liquidPenetration
vector ip(vector::zero); vector ip(vector::zero);
if (nHoles > 1) if (nHoles > 1)
{ {
for(label i=0;i<nHoles;i++) for (label i=0;i<nHoles;i++)
{ {
ip += injectors_[nozzlei].properties()->position(i); ip += injectors_[nozzlei].properties()->position(i);
} }
@ -308,7 +308,7 @@ scalar spray::liquidPenetration
if (de < dist[i]) if (de < dist[i])
{ {
found = true; found = true;
for(label j=n; j>i; j--) for (label j=n; j>i; j--)
{ {
m[j] = m[j-1]; m[j] = m[j-1];
dist[j] = dist[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' // calculate the time of injection for parcel 'j'
scalar toi = time0 + constT + deltaT*j/scalar(Np); 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 // calculate the velocity of the injected parcel
@ -164,8 +164,8 @@ void spray::inject()
delete pPtr; delete pPtr;
} }
} // if (injectorCell.... } // if (injectorCell....
} // for(label n=0... } // for (label n=0...
} // for(label j=0.... } // for (label j=0....
} // if (mass>0)... } // if (mass>0)...
} // forAll(injectors)... } // forAll(injectors)...

View File

@ -183,7 +183,7 @@ void LISA::atomizeParcel
scalar kOld = 0.0; scalar kOld = 0.0;
for(label i=0; i<40; i++) for (label i=0; i<40; i++)
{ {
k = kPos k = kPos

View File

@ -109,7 +109,7 @@ void gradientDispersionRAS::disperseParcels() const
scalar x1 = 0.0; scalar x1 = 0.0;
scalar x2 = 0.0; scalar x2 = 0.0;
scalar rsq = 10.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; x1 = 2.0*spray_.rndGen().scalar01() - 1.0;
x2 = 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... // numerical recipes... Ch. 7. Random Numbers...
scalar x1,x2; scalar x1,x2;
scalar rsq = 10.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; x1 = 2.0*spray_.rndGen().scalar01() - 1.0;
x2 = 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 logXratio = log(1.0 + Xratio);
scalar Fb = 1.0; scalar Fb = 1.0;
if(logXratio > SMALL) if (logXratio > SMALL)
{ {
Fb = pow((1.0 + Xratio), FbExp)*log(1.0 + Xratio)/Xratio; Fb = pow((1.0 + Xratio), FbExp)*log(1.0 + Xratio)/Xratio;
} }
@ -286,7 +286,7 @@ scalar RutlandFlashBoil::boilingTime
Gneg = Gneg/10.0; Gneg = Gneg/10.0;
Gneg = max(Gneg, VSMALL); Gneg = max(Gneg, VSMALL);
FgNeg = Gneg + Gf - B*log(1.0 + (1.0 + Gf/Gneg)*A); FgNeg = Gneg + Gf - B*log(1.0 + (1.0 + Gf/Gneg)*A);
if(FgNeg < 0.0) if (FgNeg < 0.0)
{ {
break; break;
} }

View File

@ -380,7 +380,7 @@ void Foam::DsmcCloud<ParcelType>::collisions()
{ {
candidateQ = subCellPs[rndGen_.integer(0, nSC - 1)]; candidateQ = subCellPs[rndGen_.integer(0, nSC - 1)];
} while(candidateP == candidateQ); } while (candidateP == candidateQ);
} }
else else
{ {
@ -392,7 +392,7 @@ void Foam::DsmcCloud<ParcelType>::collisions()
{ {
candidateQ = rndGen_.integer(0, nC - 1); 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); // label candidateQ = rndGen_.integer(0, nC-1);
// // If the same candidate is chosen, choose again // // If the same candidate is chosen, choose again
// while(candidateP == candidateQ) // while (candidateP == candidateQ)
// { // {
// candidateQ = rndGen_.integer(0, nC-1); // candidateQ = rndGen_.integer(0, nC-1);
// } // }

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