Standardized cell, patch and face loop index names

This commit is contained in:
Henry Weller
2016-04-25 10:28:32 +01:00
parent 6a27f7af46
commit 8c4f6b8fcb
849 changed files with 13266 additions and 13266 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -131,11 +131,11 @@ int main(int argc, char *argv[])
protectedCell = 0;
}
forAll(betav, cellI)
forAll(betav, celli)
{
if (betav[cellI] < 0.99)
if (betav[celli] < 0.99)
{
protectedCell[cellI] = 1;
protectedCell[celli] = 1;
}
}

View File

@ -155,11 +155,11 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
volScalarField& D(tmpD.ref());
forAll(p, cellI)
forAll(p, celli)
{
D[cellI] =
localThermo.alphah(p[cellI], T[cellI])
/localThermo.rho(p[cellI], T[cellI]);
D[celli] =
localThermo.alphah(p[celli], T[celli])
/localThermo.rho(p[celli], T[celli]);
}
D /= Le_;
@ -209,11 +209,11 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
volScalarField& L(tmpL.ref());
forAll(p, cellI)
forAll(p, celli)
{
L[cellI] =
localThermo.Ha(p[cellI], Tf[cellI])
- otherLocalThermo.Ha(otherP[cellI], Tf[cellI]);
L[celli] =
localThermo.Ha(p[celli], Tf[celli])
- otherLocalThermo.Ha(otherP[celli], Tf[celli]);
}
return tmpL;

View File

@ -85,23 +85,23 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
tmp<scalarField> typsf(new scalarField(this->size()));
scalarField& ypsf = typsf.ref();
forAll(ypsf, faceI)
forAll(ypsf, facei)
{
scalar ypt = 11.0;
for (int i=0; i<maxIters_; i++)
{
scalar f = ypt - (log(E_*ypt)/kappa_ + P[faceI])/Prat[faceI];
scalar df = 1 - 1.0/(ypt*kappa_*Prat[faceI]);
scalar f = ypt - (log(E_*ypt)/kappa_ + P[facei])/Prat[facei];
scalar df = 1 - 1.0/(ypt*kappa_*Prat[facei]);
scalar yptNew = ypt - f/df;
if (yptNew < VSMALL)
{
ypsf[faceI] = 0;
ypsf[facei] = 0;
}
else if (mag(yptNew - ypt) < tolerance_)
{
ypsf[faceI] = yptNew;
ypsf[facei] = yptNew;
}
else
{
@ -109,7 +109,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
}
}
ypsf[faceI] = ypt;
ypsf[facei] = ypt;
}
return typsf;
@ -200,32 +200,32 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
scalarField& alphatConv = talphatConv.ref();
// Populate boundary values
forAll(alphatConv, faceI)
forAll(alphatConv, facei)
{
// Evaluate new effective thermal diffusivity
scalar alphaEff = 0.0;
if (yPlus[faceI] < yPlusTherm[faceI])
if (yPlus[facei] < yPlusTherm[facei])
{
scalar A = qDot[faceI]*rhow[faceI]*uTau[faceI]*y[faceI];
scalar B = qDot[faceI]*Pr[faceI]*yPlus[faceI];
scalar C = Pr[faceI]*0.5*rhow[faceI]*uTau[faceI]*sqr(magUp[faceI]);
scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei];
scalar B = qDot[facei]*Pr[facei]*yPlus[facei];
scalar C = Pr[facei]*0.5*rhow[facei]*uTau[facei]*sqr(magUp[facei]);
alphaEff = A/(B + C + VSMALL);
}
else
{
scalar A = qDot[faceI]*rhow[faceI]*uTau[faceI]*y[faceI];
scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei];
scalar B =
qDot[faceI]*Prt_*(1.0/kappa_*log(E_*yPlus[faceI]) + P[faceI]);
qDot[facei]*Prt_*(1.0/kappa_*log(E_*yPlus[facei]) + P[facei]);
scalar magUc =
uTau[faceI]/kappa_*log(E_*yPlusTherm[faceI]) - mag(Uw[faceI]);
uTau[facei]/kappa_*log(E_*yPlusTherm[facei]) - mag(Uw[facei]);
scalar C =
0.5*rhow[faceI]*uTau[faceI]
*(Prt_*sqr(magUp[faceI]) + (Pr[faceI] - Prt_)*sqr(magUc));
0.5*rhow[facei]*uTau[facei]
*(Prt_*sqr(magUp[facei]) + (Pr[facei] - Prt_)*sqr(magUc));
alphaEff = A/(B + C + VSMALL);
}
// Update convective heat transfer turbulent thermal diffusivity
alphatConv[faceI] = max(0.0, alphaEff - alphaw[faceI]);
alphatConv[facei] = max(0.0, alphaEff - alphaw[facei]);
}
return talphatConv;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,9 +88,9 @@ int main(int argc, char *argv[])
dimensionedScalar("aggomeration", dimless, 0.0)
);
scalarField& fld = scalarAgglomeration.internalField();
forAll(fld, cellI)
forAll(fld, celli)
{
fld[cellI] = cellToCoarse[cellI];
fld[celli] = cellToCoarse[celli];
}
fld /= max(fld);
scalarAgglomeration.correctBoundaryConditions();
@ -167,9 +167,9 @@ int main(int argc, char *argv[])
dimensionedScalar("aggomeration", dimless, 0.0)
);
scalarField& fld = scalarAgglomeration.internalField();
forAll(fld, cellI)
forAll(fld, celli)
{
fld[cellI] = cellToCoarse[cellI];
fld[celli] = cellToCoarse[celli];
}
if (normalise)
{
@ -185,9 +185,9 @@ int main(int argc, char *argv[])
label vertI = 0;
// Write all mesh cc
forAll(mesh.cellCentres(), cellI)
forAll(mesh.cellCentres(), celli)
{
meshTools::writeOBJ(str, mesh.cellCentres()[cellI]);
meshTools::writeOBJ(str, mesh.cellCentres()[celli]);
vertI++;
}
@ -205,9 +205,9 @@ int main(int argc, char *argv[])
forAll(cellLabels, i)
{
label cellI = cellLabels[i];
label celli = cellLabels[i];
str << "l " << cellI+1 << ' ' << vertI << nl;
str << "l " << celli+1 << ' ' << vertI << nl;
}
}
}

View File

@ -114,9 +114,9 @@ int main(int argc, char *argv[])
dimensionedScalar("patchDist", dimLength, 0.0)
);
scalarField pf(vsf.boundaryField()[patch.index()].size());
forAll(pf, faceI)
forAll(pf, facei)
{
pf[faceI] = Foam::sqrt(allFaceInfo[faceI].distSqr());
pf[facei] = Foam::sqrt(allFaceInfo[facei].distSqr());
}
vsf.boundaryFieldRef()[patch.index()] = pf;

View File

@ -72,10 +72,10 @@ using namespace Foam;
// const faceList& localFaces = p.localFaces();
// const vectorField& faceAreas = mesh.faceAreas();
//
// forAll(localFaces, faceI)
// forAll(localFaces, facei)
// {
// const face& f = localFaces[faceI];
// const vector& n = faceAreas[meshFaces[faceI]];
// const face& f = localFaces[facei];
// const vector& n = faceAreas[meshFaces[facei]];
// forAll(f, fp)
// {
// extrudeN[f[fp]] += n;

View File

@ -168,13 +168,13 @@ int main(int argc, char *argv[])
// stencilPoints
// );
//
// forAll(stencilPoints, faceI)
// forAll(stencilPoints, facei)
// {
// writeStencilOBJ
// (
// runTime.path()/"faceEdgeCell" + Foam::name(faceI) + ".obj",
// mesh.faceCentres()[faceI],
// stencilPoints[faceI]
// runTime.path()/"faceEdgeCell" + Foam::name(facei) + ".obj",
// mesh.faceCentres()[facei],
// stencilPoints[facei]
// );
// }
// }
@ -200,14 +200,14 @@ int main(int argc, char *argv[])
// //{
// // const labelListList& stencil = addressing.stencil();
// // List<List<scalar>> stencilWeights(stencil.size());
// // forAll(stencil, faceI)
// // forAll(stencil, facei)
// // {
// // const labelList& fStencil = stencil[faceI];
// // const labelList& fStencil = stencil[facei];
// //
// // if (fStencil.size() > 0)
// // {
// // // Uniform weights
// // stencilWeights[faceI] = scalarList
// // stencilWeights[facei] = scalarList
// // (
// // fStencil.size(),
// // 1.0/fStencil.size()
@ -230,15 +230,15 @@ int main(int argc, char *argv[])
// stencilPoints
// );
//
// forAll(stencilPoints, faceI)
// forAll(stencilPoints, facei)
// {
// if (stencilPoints[faceI].size() >= 15)
// if (stencilPoints[facei].size() >= 15)
// {
// writeStencilOBJ
// (
// runTime.path()/"centredFace" + Foam::name(faceI) + ".obj",
// mesh.faceCentres()[faceI],
// stencilPoints[faceI]
// runTime.path()/"centredFace" + Foam::name(facei) + ".obj",
// mesh.faceCentres()[facei],
// stencilPoints[facei]
// );
// }
// }
@ -267,13 +267,13 @@ int main(int argc, char *argv[])
// // stencilPoints
// //);
// //
// //forAll(stencilPoints, faceI)
// //forAll(stencilPoints, facei)
// //{
// // writeStencilOBJ
// // (
// // runTime.path()/"centredPoint" + Foam::name(faceI) + ".obj",
// // mesh.faceCentres()[faceI],
// // stencilPoints[faceI]
// // runTime.path()/"centredPoint" + Foam::name(facei) + ".obj",
// // mesh.faceCentres()[facei],
// // stencilPoints[facei]
// // );
// //}
// }
@ -302,13 +302,13 @@ int main(int argc, char *argv[])
// // stencilPoints
// //);
// //
// //forAll(stencilPoints, faceI)
// //forAll(stencilPoints, facei)
// //{
// // writeStencilOBJ
// // (
// // runTime.path()/"centredEdge" + Foam::name(faceI) + ".obj",
// // mesh.faceCentres()[faceI],
// // stencilPoints[faceI]
// // runTime.path()/"centredEdge" + Foam::name(facei) + ".obj",
// // mesh.faceCentres()[facei],
// // stencilPoints[facei]
// // );
// //}
// }
@ -340,13 +340,13 @@ int main(int argc, char *argv[])
// ownPoints
// );
//
// forAll(ownPoints, faceI)
// forAll(ownPoints, facei)
// {
// writeStencilOBJ
// (
// runTime.path()/"ownFEC" + Foam::name(faceI) + ".obj",
// mesh.faceCentres()[faceI],
// ownPoints[faceI]
// runTime.path()/"ownFEC" + Foam::name(facei) + ".obj",
// mesh.faceCentres()[facei],
// ownPoints[facei]
// );
// }
// }
@ -361,13 +361,13 @@ int main(int argc, char *argv[])
// neiPoints
// );
//
// forAll(neiPoints, faceI)
// forAll(neiPoints, facei)
// {
// writeStencilOBJ
// (
// runTime.path()/"neiFEC" + Foam::name(faceI) + ".obj",
// mesh.faceCentres()[faceI],
// neiPoints[faceI]
// runTime.path()/"neiFEC" + Foam::name(facei) + ".obj",
// mesh.faceCentres()[facei],
// neiPoints[facei]
// );
// }
// }
@ -400,13 +400,13 @@ int main(int argc, char *argv[])
// ownPoints
// );
//
// forAll(ownPoints, faceI)
// forAll(ownPoints, facei)
// {
// writeStencilOBJ
// (
// runTime.path()/"ownCFC" + Foam::name(faceI) + ".obj",
// mesh.faceCentres()[faceI],
// ownPoints[faceI]
// runTime.path()/"ownCFC" + Foam::name(facei) + ".obj",
// mesh.faceCentres()[facei],
// ownPoints[facei]
// );
// }
// }
@ -421,13 +421,13 @@ int main(int argc, char *argv[])
// neiPoints
// );
//
// forAll(neiPoints, faceI)
// forAll(neiPoints, facei)
// {
// writeStencilOBJ
// (
// runTime.path()/"neiCFC" + Foam::name(faceI) + ".obj",
// mesh.faceCentres()[faceI],
// neiPoints[faceI]
// runTime.path()/"neiCFC" + Foam::name(facei) + ".obj",
// mesh.faceCentres()[facei],
// neiPoints[facei]
// );
// }
// }
@ -458,13 +458,13 @@ int main(int argc, char *argv[])
stencilPoints
);
forAll(stencilPoints, cellI)
forAll(stencilPoints, celli)
{
writeStencilOBJ
(
runTime.path()/"centredCECCell" + Foam::name(cellI) + ".obj",
mesh.cellCentres()[cellI],
stencilPoints[cellI]
runTime.path()/"centredCECCell" + Foam::name(celli) + ".obj",
mesh.cellCentres()[celli],
stencilPoints[celli]
);
}
}
@ -486,13 +486,13 @@ int main(int argc, char *argv[])
stencilPoints
);
forAll(stencilPoints, cellI)
forAll(stencilPoints, celli)
{
writeStencilOBJ
(
runTime.path()/"centredCPCCell" + Foam::name(cellI) + ".obj",
mesh.cellCentres()[cellI],
stencilPoints[cellI]
runTime.path()/"centredCPCCell" + Foam::name(celli) + ".obj",
mesh.cellCentres()[celli],
stencilPoints[celli]
);
}
}
@ -514,13 +514,13 @@ int main(int argc, char *argv[])
stencilPoints
);
forAll(stencilPoints, cellI)
forAll(stencilPoints, celli)
{
writeStencilOBJ
(
runTime.path()/"centredCFCCell" + Foam::name(cellI) + ".obj",
mesh.cellCentres()[cellI],
stencilPoints[cellI]
runTime.path()/"centredCFCCell" + Foam::name(celli) + ".obj",
mesh.cellCentres()[celli],
stencilPoints[celli]
);
}
}
@ -538,12 +538,12 @@ int main(int argc, char *argv[])
// );
// for (label faci = 0; faci < mesh.nInternalFaces(); faci++)
// {
// const scalarList& stData = stencilData[faceI];
// const scalarList& stWeight = fit[faceI];
// const scalarList& stData = stencilData[facei];
// const scalarList& stWeight = fit[facei];
//
// forAll(stData, i)
// {
// sf[faceI] += stWeight[i]*stData[i];
// sf[facei] += stWeight[i]*stData[i];
// }
// }
// See finiteVolume/lnInclude/leastSquaresGrad.C

View File

@ -150,9 +150,9 @@ int main(int argc, char *argv[])
List<point> compactFld(map.constructSize(), Zero);
// Insert my internal values
forAll(fld, cellI)
forAll(fld, celli)
{
compactFld[cellI] = fld[cellI];
compactFld[celli] = fld[celli];
}
// Insert my boundary values
label nCompact = fld.size();
@ -172,27 +172,27 @@ int main(int argc, char *argv[])
// 2. Pull to stencil
stencilPoints.setSize(stencil.size());
forAll(stencil, cellI)
forAll(stencil, celli)
{
const labelList& compactCells = stencil[cellI];
const labelList& compactCells = stencil[celli];
stencilPoints[cellI].setSize(compactCells.size());
stencilPoints[celli].setSize(compactCells.size());
forAll(compactCells, i)
{
stencilPoints[cellI][i] = compactFld[compactCells[i]];
stencilPoints[celli][i] = compactFld[compactCells[i]];
}
}
}
forAll(stencilPoints, cellI)
forAll(stencilPoints, celli)
{
writeStencilOBJ
(
runTime.path()/"centredCell" + Foam::name(cellI) + ".obj",
mesh.cellCentres()[cellI],
stencilPoints[cellI]
runTime.path()/"centredCell" + Foam::name(celli) + ".obj",
mesh.cellCentres()[celli],
stencilPoints[celli]
);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,26 +66,26 @@ int main(int argc, char *argv[])
}
// convert from local to global and back.
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
for (label celli = 0; celli < mesh.nCells(); celli++)
{
// to global index
label globalCellI = globalNumbering.toGlobal(cellI);
label globalCellI = globalNumbering.toGlobal(celli);
// and back
label procI = globalNumbering.whichProcID(globalCellI);
label localCellI = globalNumbering.toLocal(globalCellI);
if (procI != Pstream::myProcNo() || localCellI != cellI)
if (procI != Pstream::myProcNo() || localCellI != celli)
{
FatalErrorInFunction
<< "Problem. cellI:" << cellI << " localCellI:" << localCellI
<< "Problem. celli:" << celli << " localCellI:" << localCellI
<< " procI:" << procI << abort(FatalError);
}
if (!globalNumbering.isLocal(globalCellI))
{
FatalErrorInFunction
<< "Problem. cellI:" << cellI << " globalCellI:" << globalCellI
<< "Problem. celli:" << celli << " globalCellI:" << globalCellI
<< " not local" << abort(FatalError);
}
}

View File

@ -196,16 +196,16 @@ int main(int argc, char *argv[])
}
{
const label cellI = args.optionLookupOrDefault("cell", 0);
const label celli = args.optionLookupOrDefault("cell", 0);
tensorField mI(momentOfInertia::meshInertia(mesh));
tensor& J = mI[cellI];
tensor& J = mI[celli];
vector eVal = eigenValues(J);
Info<< nl
<< "Inertia tensor of cell " << cellI << " " << J << nl
<< "Inertia tensor of cell " << celli << " " << J << nl
<< "eigenValues (principal moments) " << eVal << endl;
J /= cmptMax(eVal);
@ -215,16 +215,16 @@ int main(int argc, char *argv[])
Info<< "eigenVectors (principal axes, from normalised inertia) " << eVec
<< endl;
OFstream str("cell_" + name(cellI) + "_inertia.obj");
OFstream str("cell_" + name(celli) + "_inertia.obj");
Info<< nl << "Writing scaled principal axes of cell " << cellI << " to "
Info<< nl << "Writing scaled principal axes of cell " << celli << " to "
<< str.name() << endl;
const point& cC = mesh.cellCentres()[cellI];
const point& cC = mesh.cellCentres()[celli];
scalar scale = mag
(
(cC - mesh.faceCentres()[mesh.cells()[cellI][0]])
(cC - mesh.faceCentres()[mesh.cells()[celli][0]])
/eVal.component(findMin(eVal))
);

View File

@ -76,11 +76,11 @@ int main(int argc, char *argv[])
DynamicList<label> changedEdges(4*patch.size());
DynamicList<patchEdgeFaceRegions> changedInfo(changedEdges.size());
forAll(patch, faceI)
forAll(patch, facei)
{
const labelList& fEdges = patch.faceEdges()[faceI];
const labelList& fEdges = patch.faceEdges()[facei];
label globalFaceI = globalNumbering.toGlobal(faceI);
label globalFaceI = globalNumbering.toGlobal(facei);
forAll(fEdges, i)
{
@ -117,13 +117,13 @@ int main(int argc, char *argv[])
{
labelList currentRegion(patch.nPoints(), -1);
forAll(patch.localFaces(), faceI)
forAll(patch.localFaces(), facei)
{
const face& f = patch.localFaces()[faceI];
const face& f = patch.localFaces()[facei];
forAll(f, fp)
{
label faceRegion = allFaceInfo[faceI].regions()[fp];
label faceRegion = allFaceInfo[facei].regions()[fp];
label pointI = f[fp];

View File

@ -59,11 +59,11 @@ void checkFaceEdges
const labelListList& faceEdges
)
{
forAll(faceEdges, faceI)
forAll(faceEdges, facei)
{
const face& f = localFaces[faceI];
const face& f = localFaces[facei];
const labelList& myEdges = faceEdges[faceI];
const labelList& myEdges = faceEdges[facei];
forAll(f, fp)
{
@ -73,7 +73,7 @@ void checkFaceEdges
{
FatalErrorInFunction
<< "Edges of face not in face point order:"
<< "face:" << faceI << " localF:" << f
<< "face:" << facei << " localF:" << f
<< " faceEdges:" << myEdges
<< abort(FatalError);
}
@ -130,9 +130,9 @@ void writeFaceEdges
writeObj(feStream, localPoints);
forAll(faceEdges, faceI)
forAll(faceEdges, facei)
{
const labelList& myEdges = faceEdges[faceI];
const labelList& myEdges = faceEdges[facei];
forAll(myEdges, i)
{
@ -158,9 +158,9 @@ void writeEdgeFaces
pointField ctrs(localFaces.size(), Zero);
forAll(localFaces, faceI)
forAll(localFaces, facei)
{
ctrs[faceI] = localFaces[faceI].centre(localPoints);
ctrs[facei] = localFaces[facei].centre(localPoints);
}
writeObj(efStream, ctrs);
@ -190,19 +190,19 @@ void writeFaceFaces
pointField ctrs(localFaces.size(), Zero);
forAll(localFaces, faceI)
forAll(localFaces, facei)
{
ctrs[faceI] = localFaces[faceI].centre(localPoints);
ctrs[facei] = localFaces[facei].centre(localPoints);
}
writeObj(ffStream, ctrs);
forAll(faceFaces, faceI)
forAll(faceFaces, facei)
{
const labelList& nbrs = faceFaces[faceI];
const labelList& nbrs = faceFaces[facei];
forAll(nbrs, nbI)
{
ffStream << "l " << faceI+1 << ' ' << nbrs[nbI]+1 << endl;
ffStream << "l " << facei+1 << ' ' << nbrs[nbI]+1 << endl;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -141,15 +141,15 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
{
PackedList<3> bits(mesh.nFaces());
forAll(bits, faceI)
forAll(bits, facei)
{
bits.set(faceI, rndGen.integer(0,3));
bits.set(facei, rndGen.integer(0,3));
}
labelList faceValues(mesh.nFaces());
forAll(bits, faceI)
forAll(bits, facei)
{
faceValues[faceI] = bits.get(faceI);
faceValues[facei] = bits.get(facei);
}
PackedList<3> maxBits(bits);
@ -161,20 +161,20 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
syncTools::syncFaceList(mesh, maxBits, maxEqOp<unsigned int>());
syncTools::syncFaceList(mesh, maxFaceValues, maxEqOp<label>());
forAll(bits, faceI)
forAll(bits, facei)
{
if
(
faceValues[faceI] != label(bits.get(faceI))
|| maxFaceValues[faceI] != label(maxBits.get(faceI))
faceValues[facei] != label(bits.get(facei))
|| maxFaceValues[facei] != label(maxBits.get(facei))
)
{
FatalErrorInFunction
<< "face:" << faceI
<< " minlabel:" << faceValues[faceI]
<< " minbits:" << bits.get(faceI)
<< " maxLabel:" << maxFaceValues[faceI]
<< " maxBits:" << maxBits.get(faceI)
<< "face:" << facei
<< " minlabel:" << faceValues[facei]
<< " minbits:" << bits.get(facei)
<< " maxLabel:" << maxFaceValues[facei]
<< " maxBits:" << maxBits.get(facei)
<< exit(FatalError);
}
}
@ -532,14 +532,14 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
maxMagSqrEqOp<point>()
);
forAll(syncedFc, faceI)
forAll(syncedFc, facei)
{
if (mag(syncedFc[faceI] - mesh.faceCentres()[faceI]) > SMALL)
if (mag(syncedFc[facei] - mesh.faceCentres()[facei]) > SMALL)
{
FatalErrorInFunction
<< "Face " << faceI
<< " original centre " << mesh.faceCentres()[faceI]
<< " synced centre " << syncedFc[faceI]
<< "Face " << facei
<< " original centre " << mesh.faceCentres()[facei]
<< " synced centre " << syncedFc[facei]
<< exit(FatalError);
}
}
@ -552,11 +552,11 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
PackedBoolList isMasterFace(syncTools::getMasterFaces(mesh));
forAll(isMasterFace, faceI)
forAll(isMasterFace, facei)
{
if (isMasterFace[faceI])
if (isMasterFace[facei])
{
nMasters[faceI] = 1;
nMasters[facei] = 1;
}
}
@ -567,14 +567,14 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
plusEqOp<label>()
);
forAll(nMasters, faceI)
forAll(nMasters, facei)
{
if (nMasters[faceI] != 1)
if (nMasters[facei] != 1)
{
FatalErrorInFunction
<< "Face " << faceI
<< " centre " << mesh.faceCentres()[faceI]
<< " has " << nMasters[faceI]
<< "Face " << facei
<< " centre " << mesh.faceCentres()[facei]
<< " has " << nMasters[facei]
<< " masters."
<< exit(FatalError);
}

View File

@ -68,7 +68,7 @@ void modifyOrAddFace
(
polyTopoChange& meshMod,
const face& f,
const label faceI,
const label facei,
const label own,
const bool flipFaceFlux,
const label newPatchI,
@ -78,7 +78,7 @@ void modifyOrAddFace
PackedBoolList& modifiedFace
)
{
if (!modifiedFace[faceI])
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
@ -86,7 +86,7 @@ void modifyOrAddFace
polyModifyFace
(
f, // modified face
faceI, // label of face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
@ -96,7 +96,7 @@ void modifyOrAddFace
zoneFlip // face flip in zone
)
);
modifiedFace[faceI] = 1;
modifiedFace[facei] = 1;
}
else
{
@ -110,7 +110,7 @@ void modifyOrAddFace
-1, // neighbour
-1, // master point
-1, // master edge
faceI, // master face
facei, // master face
flipFaceFlux, // face flip
newPatchI, // patch for face
zoneID, // zone for face
@ -321,18 +321,18 @@ void createCoupledBaffles
{
const faceZoneMesh& faceZones = mesh.faceZones();
forAll(coupledWantedPatch, faceI)
forAll(coupledWantedPatch, facei)
{
if (coupledWantedPatch[faceI] != -1)
if (coupledWantedPatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
label zoneID = faceZones.whichZone(faceI);
const face& f = mesh.faces()[facei];
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Use owner side of face
@ -340,34 +340,34 @@ void createCoupledBaffles
(
meshMod,
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
false, // face flip
coupledWantedPatch[faceI], // patch for face
coupledWantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add status
);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Use neighbour side of face
modifyOrAddFace
(
meshMod,
f.reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI],// owner
facei, // label of face
mesh.faceNeighbour()[facei],// owner
false, // face flip
coupledWantedPatch[faceI], // patch for face
coupledWantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add status
@ -389,29 +389,29 @@ void createCyclicCoupledBaffles
{
const faceZoneMesh& faceZones = mesh.faceZones();
forAll(cyclicMasterPatch, faceI)
forAll(cyclicMasterPatch, facei)
{
if (cyclicMasterPatch[faceI] != -1)
if (cyclicMasterPatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
modifyOrAddFace
(
meshMod,
f.reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI], // owner
facei, // label of face
mesh.faceNeighbour()[facei], // owner
false, // face flip
cyclicMasterPatch[faceI], // patch for face
cyclicMasterPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add
@ -419,30 +419,30 @@ void createCyclicCoupledBaffles
}
}
forAll(cyclicSlavePatch, faceI)
forAll(cyclicSlavePatch, facei)
{
if (cyclicSlavePatch[faceI] != -1)
if (cyclicSlavePatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
if (mesh.isInternalFace(faceI))
const face& f = mesh.faces()[facei];
if (mesh.isInternalFace(facei))
{
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Use owner side of face
modifyOrAddFace
(
meshMod,
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
false, // face flip
cyclicSlavePatch[faceI], // patch for face
cyclicSlavePatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add status
@ -462,19 +462,19 @@ void createBaffles
{
const faceZoneMesh& faceZones = mesh.faceZones();
Info << "faceZone:createBaffle " << faceZones << endl;
forAll(wantedPatch, faceI)
forAll(wantedPatch, facei)
{
if (wantedPatch[faceI] != -1)
if (wantedPatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -482,26 +482,26 @@ void createBaffles
polyModifyFace
(
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
wantedPatch[faceI], // patch for face
wantedPatch[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -509,13 +509,13 @@ void createBaffles
polyAddFace
(
f.reverseFace(), // modified face
mesh.faceNeighbour()[faceI],// owner
mesh.faceNeighbour()[facei],// owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
faceI, // masterFaceID,
facei, // masterFaceID,
false, // face flip
wantedPatch[faceI], // patch for face
wantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)

View File

@ -299,20 +299,20 @@ void addCutNeighbours
forAllConstIter(labelHashSet, cutCells, iter)
{
const label cellI = iter.key();
const labelList& cFaces = mesh.cells()[cellI];
const label celli = iter.key();
const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
const label faceI = cFaces[i];
const label facei = cFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label nbr = mesh.faceOwner()[faceI];
label nbr = mesh.faceOwner()[facei];
if (nbr == cellI)
if (nbr == celli)
{
nbr = mesh.faceNeighbour()[faceI];
nbr = mesh.faceNeighbour()[facei];
}
if (selectInside && inside.found(nbr))
@ -351,11 +351,11 @@ bool limitRefinementLevel
)
{
// Do simple check on validity of refinement level.
forAll(refLevel, cellI)
forAll(refLevel, celli)
{
if (!excludeCells.found(cellI))
if (!excludeCells.found(celli))
{
const labelList& cCells = mesh.cellCells()[cellI];
const labelList& cCells = mesh.cellCells()[celli];
forAll(cCells, i)
{
@ -363,13 +363,13 @@ bool limitRefinementLevel
if (!excludeCells.found(nbr))
{
if (refLevel[cellI] - refLevel[nbr] >= limitDiff)
if (refLevel[celli] - refLevel[nbr] >= limitDiff)
{
FatalErrorInFunction
<< "Level difference between neighbouring cells "
<< cellI << " and " << nbr
<< celli << " and " << nbr
<< " greater than or equal to " << limitDiff << endl
<< "refLevels:" << refLevel[cellI] << ' '
<< "refLevels:" << refLevel[celli] << ' '
<< refLevel[nbr] << abort(FatalError);
}
}
@ -382,9 +382,9 @@ bool limitRefinementLevel
forAllConstIter(labelHashSet, cutCells, iter)
{
// cellI will be refined.
const label cellI = iter.key();
const labelList& cCells = mesh.cellCells()[cellI];
// celli will be refined.
const label celli = iter.key();
const labelList& cCells = mesh.cellCells()[celli];
forAll(cCells, i)
{
@ -392,7 +392,7 @@ bool limitRefinementLevel
if (!excludeCells.found(nbr) && !cutCells.found(nbr))
{
if (refLevel[cellI] + 1 - refLevel[nbr] >= limitDiff)
if (refLevel[celli] + 1 - refLevel[nbr] >= limitDiff)
{
addCutCells.insert(nbr);
}
@ -451,9 +451,9 @@ void doRefinement
refLevel.setSize(mesh.nCells());
for (label cellI = oldCells; cellI < mesh.nCells(); cellI++)
for (label celli = oldCells; celli < mesh.nCells(); celli++)
{
refLevel[cellI] = 0;
refLevel[celli] = 0;
}
const labelListList& addedCells = multiRef.addedCells();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ defineTypeNameAndDebug(cellSplitter, 0);
void Foam::cellSplitter::getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
@ -54,12 +54,12 @@ void Foam::cellSplitter::getFaceInfo
{
patchID = -1;
if (!mesh_.isInternalFace(faceI))
if (!mesh_.isInternalFace(facei))
{
patchID = mesh_.boundaryMesh().whichPatch(faceI);
patchID = mesh_.boundaryMesh().whichPatch(facei);
}
zoneID = mesh_.faceZones().whichZone(faceI);
zoneID = mesh_.faceZones().whichZone(facei);
zoneFlip = false;
@ -67,20 +67,20 @@ void Foam::cellSplitter::getFaceInfo
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
}
// Find the new owner of faceI (since the original cell has been split into
// Find the new owner of facei (since the original cell has been split into
// newCells
Foam::label Foam::cellSplitter::newOwner
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const
{
label oldOwn = mesh_.faceOwner()[faceI];
label oldOwn = mesh_.faceOwner()[facei];
Map<labelList>::const_iterator fnd = cellToCells.find(oldOwn);
@ -97,18 +97,18 @@ Foam::label Foam::cellSplitter::newOwner
const cell& cFaces = mesh_.cells()[oldOwn];
return newCells[findIndex(cFaces, faceI)];
return newCells[findIndex(cFaces, facei)];
}
}
Foam::label Foam::cellSplitter::newNeighbour
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const
{
label oldNbr = mesh_.faceNeighbour()[faceI];
label oldNbr = mesh_.faceNeighbour()[facei];
Map<labelList>::const_iterator fnd = cellToCells.find(oldNbr);
@ -125,7 +125,7 @@ Foam::label Foam::cellSplitter::newNeighbour
const cell& cFaces = mesh_.cells()[oldNbr];
return newCells[findIndex(cFaces, faceI)];
return newCells[findIndex(cFaces, facei)];
}
}
@ -164,9 +164,9 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
label anchorPoint = mesh_.cellPoints()[cellI][0];
label anchorPoint = mesh_.cellPoints()[celli][0];
label addedPointI =
meshMod.setAction
@ -179,11 +179,11 @@ void Foam::cellSplitter::setRefinement
true // supports a cell
)
);
addedPoints_.insert(cellI, addedPointI);
addedPoints_.insert(celli, addedPointI);
//Pout<< "Added point " << addedPointI
// << iter() << " in cell " << cellI << " with centre "
// << mesh_.cellCentres()[cellI] << endl;
// << iter() << " in cell " << celli << " with centre "
// << mesh_.cellCentres()[celli] << endl;
}
@ -195,15 +195,15 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
// Cells created for this cell.
labelList newCells(cFaces.size());
// First pyramid is the original cell
newCells[0] = cellI;
newCells[0] = celli;
// Add other pyramids
for (label i = 1; i < cFaces.size(); i++)
@ -216,7 +216,7 @@ void Foam::cellSplitter::setRefinement
-1, // master point
-1, // master edge
-1, // master face
cellI, // master cell
celli, // master cell
-1 // zone
)
);
@ -224,10 +224,10 @@ void Foam::cellSplitter::setRefinement
newCells[i] = addedCellI;
}
cellToCells.insert(cellI, newCells);
cellToCells.insert(celli, newCells);
//Pout<< "Split cell " << cellI
// << " with centre " << mesh_.cellCentres()[cellI] << nl
//Pout<< "Split cell " << celli
// << " with centre " << mesh_.cellCentres()[celli] << nl
// << " faces:" << cFaces << nl
// << " into :" << newCells << endl;
}
@ -240,13 +240,13 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
label midPointI = addedPoints_[cellI];
label midPointI = addedPoints_[celli];
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
const labelList& cEdges = mesh_.cellEdges()[cellI];
const labelList& cEdges = mesh_.cellEdges()[celli];
forAll(cEdges, i)
{
@ -255,11 +255,11 @@ void Foam::cellSplitter::setRefinement
// Get the faces on the cell using the edge
label face0, face1;
meshTools::getEdgeFaces(mesh_, cellI, edgeI, face0, face1);
meshTools::getEdgeFaces(mesh_, celli, edgeI, face0, face1);
// Get the cells on both sides of the face by indexing into cFaces.
// (since newly created cells are stored in cFaces order)
const labelList& newCells = cellToCells[cellI];
const labelList& newCells = cellToCells[celli];
label cell0 = newCells[findIndex(cFaces, face0)];
label cell1 = newCells[findIndex(cFaces, face1)];
@ -267,7 +267,7 @@ void Foam::cellSplitter::setRefinement
if (cell0 < cell1)
{
// Construct face to midpoint that is pointing away from
// (pyramid split off from) cellI
// (pyramid split off from) celli
const face& f0 = mesh_.faces()[face0];
@ -275,10 +275,10 @@ void Foam::cellSplitter::setRefinement
bool edgeInFaceOrder = (f0[f0.fcIndex(index)] == e[1]);
// Check if cellI is the face owner
// Check if celli is the face owner
face newF(3);
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == cellI))
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == celli))
{
// edge used in face order.
newF[0] = e[1];
@ -313,7 +313,7 @@ void Foam::cellSplitter::setRefinement
else
{
// Construct face to midpoint that is pointing away from
// (pyramid split off from) cellI
// (pyramid split off from) celli
const face& f1 = mesh_.faces()[face1];
@ -321,10 +321,10 @@ void Foam::cellSplitter::setRefinement
bool edgeInFaceOrder = (f1[f1.fcIndex(index)] == e[1]);
// Check if cellI is the face owner
// Check if celli is the face owner
face newF(3);
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == cellI))
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == celli))
{
// edge used in face order.
newF[0] = e[1];
@ -370,28 +370,28 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
faceUpToDate[faceI] = false;
faceUpToDate[facei] = false;
}
}
forAll(faceUpToDate, faceI)
forAll(faceUpToDate, facei)
{
if (!faceUpToDate[faceI])
if (!faceUpToDate[facei])
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
label newOwn = newOwner(faceI, cellToCells);
label newNbr = newNeighbour(faceI, cellToCells);
label newOwn = newOwner(facei, cellToCells);
label newNbr = newNeighbour(facei, cellToCells);
if (newOwn < newNbr)
{
@ -400,7 +400,7 @@ void Foam::cellSplitter::setRefinement
polyModifyFace
(
f,
faceI,
facei,
newOwn, // owner
newNbr, // neighbour
false, // flux flip
@ -418,7 +418,7 @@ void Foam::cellSplitter::setRefinement
polyModifyFace
(
f.reverseFace(),
faceI,
facei,
newNbr, // owner
newOwn, // neighbour
false, // flux flip
@ -433,17 +433,17 @@ void Foam::cellSplitter::setRefinement
}
else
{
label newOwn = newOwner(faceI, cellToCells);
label newOwn = newOwner(facei, cellToCells);
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
meshMod.setAction
(
polyModifyFace
(
mesh_.faces()[faceI],
faceI,
mesh_.faces()[facei],
facei,
newOwn, // owner
-1, // neighbour
false, // flux flip
@ -455,7 +455,7 @@ void Foam::cellSplitter::setRefinement
);
}
faceUpToDate[faceI] = true;
faceUpToDate[facei] = true;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ class cellSplitter
//- Get patch and zone info for face
void getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
@ -80,14 +80,14 @@ class cellSplitter
//- Find the new owner (if any) of the face.
label newOwner
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const;
//- Find the new neighbour (if any) of the face.
label newNeighbour
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const;

View File

@ -279,13 +279,13 @@ label findFace
// Find cell with cell centre close to given point.
label findCell(const primitiveMesh& mesh, const point& nearPoint)
{
label cellI = mesh.findCell(nearPoint);
label celli = mesh.findCell(nearPoint);
if (cellI != -1)
if (celli != -1)
{
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[cellI]);
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[celli]);
const labelList& cPoints = mesh.cellPoints()[cellI];
const labelList& cPoints = mesh.cellPoints()[celli];
label minI = -1;
scalar minDistSqr = GREAT;
@ -305,9 +305,9 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
// Decide if nearPoint unique enough.
Info<< "Found to point " << nearPoint << nl
<< " nearest cell : " << cellI
<< " nearest cell : " << celli
<< " distance " << Foam::sqrt(distToCcSqr)
<< " to cell centre " << mesh.cellCentres()[cellI] << nl
<< " to cell centre " << mesh.cellCentres()[celli] << nl
<< " nearest mesh point : " << minI
<< " distance " << Foam::sqrt(minDistSqr)
<< " to " << mesh.points()[minI] << nl
@ -318,11 +318,11 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
Info<< "Mesh point too close to nearest cell centre. Aborting"
<< endl;
cellI = -1;
celli = -1;
}
}
return cellI;
return celli;
}
@ -470,11 +470,11 @@ int main(int argc, char *argv[])
{
const Pair<point>& pts = facesToTriangulate[i];
label faceI = findFace(mesh, allBoundary, pts.first());
label facei = findFace(mesh, allBoundary, pts.first());
if (faceI == -1 || !faceToDecompose.insert(faceI, pts.second()))
if (facei == -1 || !faceToDecompose.insert(facei, pts.second()))
{
Info<< "Could not insert mesh face " << faceI
Info<< "Could not insert mesh face " << facei
<< " for input point " << pts.first() << nl
<< "Perhaps the face is already marked for splitting?" << endl;
@ -491,11 +491,11 @@ int main(int argc, char *argv[])
{
const Pair<point>& pts = cellsToPyramidise[i];
label cellI = findCell(mesh, pts.first());
label celli = findCell(mesh, pts.first());
if (cellI == -1 || !cellToPyrCentre.insert(cellI, pts.second()))
if (celli == -1 || !cellToPyrCentre.insert(celli, pts.second()))
{
Info<< "Could not insert mesh cell " << cellI
Info<< "Could not insert mesh cell " << celli
<< " for input point " << pts.first() << nl
<< "Perhaps the cell is already marked for splitting?" << endl;

View File

@ -64,17 +64,17 @@ bool limitRefinementLevel
label oldNCells = refCells.size();
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
const labelList& cCells = cellCells[cellI];
const labelList& cCells = cellCells[celli];
forAll(cCells, i)
{
if (refLevel[cCells[i]] > (refLevel[cellI]+1))
if (refLevel[cCells[i]] > (refLevel[celli]+1))
{
// Found neighbour with >=2 difference in refLevel.
refCells.insert(cellI);
refLevel[cellI]++;
refCells.insert(celli);
refLevel[celli]++;
break;
}
}
@ -308,11 +308,11 @@ int main(int argc, char *argv[])
Info<< "Setting field for patch "<< endl;
forAll(bField, faceI)
forAll(bField, facei)
{
label own = mesh.faceOwner()[pp.start() + faceI];
label own = mesh.faceOwner()[pp.start() + facei];
bField[faceI] = postRefLevel[own];
bField[facei] = postRefLevel[own];
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -135,41 +135,41 @@ void cutBySurface
// Is a bit of a hack but allows us to reuse all the functionality
// in cellClassification.
forAll(cellType, cellI)
forAll(cellType, celli)
{
label cType = cellType[cellI];
label cType = cellType[celli];
if (cType == cellClassification::CUT)
{
if (selectCut)
{
cellType[cellI] = MESH;
cellType[celli] = MESH;
}
else
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
}
}
else if (cType == cellClassification::INSIDE)
{
if (selectInside)
{
cellType[cellI] = MESH;
cellType[celli] = MESH;
}
else
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
}
}
else if (cType == cellClassification::OUTSIDE)
{
if (selectOutside)
{
cellType[cellI] = MESH;
cellType[celli] = MESH;
}
else
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
}
}
else
@ -269,27 +269,27 @@ label selectOutsideCells
forAll(outsidePts, outsidePtI)
{
// Find cell containing point. Linear search.
label cellI = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
label celli = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
if (cellI != -1 && cellType[cellI] == MESH)
if (celli != -1 && cellType[celli] == MESH)
{
Info<< "Marking cell " << cellI << " containing outside point "
<< outsidePts[outsidePtI] << " with type " << cellType[cellI]
Info<< "Marking cell " << celli << " containing outside point "
<< outsidePts[outsidePtI] << " with type " << cellType[celli]
<< " ..." << endl;
//
// Mark this cell and its faces to start walking from
//
// Mark faces of cellI
const labelList& cFaces = mesh.cells()[cellI];
// Mark faces of celli
const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (outsideFacesMap.insert(faceI))
if (outsideFacesMap.insert(facei))
{
outsideFaces.append(faceI);
outsideFaces.append(facei);
outsideFacesInfo.append(meshInfo);
}
}
@ -311,15 +311,15 @@ label selectOutsideCells
label nChanged = 0;
forAll(allCellInfo, cellI)
forAll(allCellInfo, celli)
{
if (cellType[cellI] == MESH)
if (cellType[celli] == MESH)
{
// Original cell was selected for meshing. Check if cell was
// reached from outsidePoints
if (allCellInfo[cellI].type() != MESH)
if (allCellInfo[celli].type() != MESH)
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
nChanged++;
}
}
@ -390,8 +390,8 @@ int main(int argc, char *argv[])
{
const point& outsidePoint = outsidePts[outsideI];
label cellI = queryMesh.findCell(outsidePoint, -1, false);
if (returnReduce(cellI, maxOp<label>()) == -1)
label celli = queryMesh.findCell(outsidePoint, -1, false);
if (returnReduce(celli, maxOp<label>()) == -1)
{
FatalErrorInFunction
<< "outsidePoint " << outsidePoint
@ -428,7 +428,7 @@ int main(int argc, char *argv[])
// Search engine on surface.
querySurf.reset(new triSurfaceSearch(surf));
// Set cellType[cellI] according to relation to surface
// Set cellType[celli] according to relation to surface
cutBySurface
(
mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,14 +100,14 @@ scalarField pack(const boolList& lst, const scalarField& elems)
// Given sin and cos of max angle between normals calculate whether f0 and f1
// on cellI make larger angle. Uses sinAngle only for quadrant detection.
// on celli make larger angle. Uses sinAngle only for quadrant detection.
bool largerAngle
(
const primitiveMesh& mesh,
const scalar cosAngle,
const scalar sinAngle,
const label cellI,
const label celli,
const label f0, // face label
const label f1,
@ -117,7 +117,7 @@ bool largerAngle
{
const labelList& own = mesh.faceOwner();
bool sameFaceOrder = !((own[f0] == cellI) ^ (own[f1] == cellI));
bool sameFaceOrder = !((own[f0] == celli) ^ (own[f1] == celli));
// Get cos between faceArea vectors. Correct so flat angle (180 degrees)
// gives -1.
@ -137,7 +137,7 @@ bool largerAngle
scalar fcCosAngle = n0 & c1c0;
if (own[f0] != cellI)
if (own[f0] != celli)
{
fcCosAngle = -fcCosAngle;
}
@ -190,7 +190,7 @@ bool largerAngle
bool splitHex
(
const polyMesh& mesh,
const label cellI,
const label celli,
const label edgeI,
DynamicList<label>& cutCells,
@ -214,13 +214,13 @@ bool splitHex
label leftFp = -1;
label rightFp = -1;
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
const face& f = faces[faceI];
const face& f = faces[facei];
label fp0 = findIndex(f, e[0]);
label fp1 = findIndex(f, e[1]);
@ -230,7 +230,7 @@ bool splitHex
if (fp1 != -1)
{
// Face uses e[1] but not e[0]
rightI = faceI;
rightI = facei;
rightFp = fp1;
if (leftI != -1)
@ -248,7 +248,7 @@ bool splitHex
}
else
{
leftI = faceI;
leftI = facei;
leftFp = fp0;
if (rightI != -1)
@ -287,7 +287,7 @@ bool splitHex
loopWeights[2] = -GREAT;
loopWeights[3] = -GREAT;
cutCells.append(cellI);
cutCells.append(celli);
cellLoops.append(loop);
cellEdgeWeights.append(loopWeights);
@ -295,13 +295,13 @@ bool splitHex
}
// Split cellI along edgeI with a plane along halfNorm direction.
// Split celli along edgeI with a plane along halfNorm direction.
bool splitCell
(
const polyMesh& mesh,
const geomCellLooper& cellCutter,
const label cellI,
const label celli,
const label edgeI,
const vector& halfNorm,
@ -339,7 +339,7 @@ bool splitCell
cellCutter.cut
(
cutPlane,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,
@ -349,7 +349,7 @@ bool splitCell
)
{
// Did manage to cut cell. Copy into overall list.
cutCells.append(cellI);
cutCells.append(celli);
cellLoops.append(loop);
cellEdgeWeights.append(loopWeights);
@ -397,15 +397,15 @@ void collectCuts
forAllConstIter(cellSet, cellsToCut, iter)
{
const label cellI = iter.key();
const labelList& cEdges = cellEdges[cellI];
const label celli = iter.key();
const labelList& cEdges = cellEdges[celli];
forAll(cEdges, i)
{
label edgeI = cEdges[i];
label f0, f1;
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0, f1);
meshTools::getEdgeFaces(mesh, celli, edgeI, f0, f1);
vector n0 = faceAreas[f0];
n0 /= mag(n0);
@ -421,7 +421,7 @@ void collectCuts
minCos,
minSin,
cellI,
celli,
f0,
f1,
n0,
@ -431,13 +431,13 @@ void collectCuts
{
bool splitOk = false;
if (!geometry && cellShapes[cellI].model() == hex)
if (!geometry && cellShapes[celli].model() == hex)
{
splitOk =
splitHex
(
mesh,
cellI,
celli,
edgeI,
cutCells,
@ -449,7 +449,7 @@ void collectCuts
{
vector halfNorm;
if ((own[f0] == cellI) ^ (own[f1] == cellI))
if ((own[f0] == celli) ^ (own[f1] == celli))
{
// Opposite owner orientation
halfNorm = 0.5*(n0 - n1);
@ -466,7 +466,7 @@ void collectCuts
(
mesh,
cellCutter,
cellI,
celli,
edgeI,
halfNorm,
@ -603,9 +603,9 @@ int main(int argc, char *argv[])
if (!readSet)
{
// Try all cells for cutting
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
for (label celli = 0; celli < mesh.nCells(); celli++)
{
cellsToCut.insert(cellI);
cellsToCut.insert(celli);
}
}
@ -658,13 +658,13 @@ int main(int argc, char *argv[])
}
// Remove cut cells from cellsToCut (Note:only relevant if -readSet)
forAll(cuts.cellLoops(), cellI)
forAll(cuts.cellLoops(), celli)
{
if (cuts.cellLoops()[cellI].size())
if (cuts.cellLoops()[celli].size())
{
//Info<< "Removing cut cell " << cellI << " from wishlist"
//Info<< "Removing cut cell " << celli << " from wishlist"
// << endl;
cellsToCut.erase(cellI);
cellsToCut.erase(celli);
}
}

View File

@ -67,27 +67,27 @@ labelList getInternalFaceOrder
// First unassigned face
label newFaceI = 0;
forAll(cells, cellI)
forAll(cells, celli)
{
const labelList& cFaces = cells[cellI];
const labelList& cFaces = cells[celli];
SortableList<label> nbr(cFaces.size());
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
label nbrCellI = neighbour[faceI];
label nbrCellI = neighbour[facei];
if (nbrCellI != -1)
{
// Internal face. Get cell on other side.
if (nbrCellI == cellI)
if (nbrCellI == celli)
{
nbrCellI = owner[faceI];
nbrCellI = owner[facei];
}
if (cellI < nbrCellI)
if (celli < nbrCellI)
{
// CellI is master
nbr[i] = nbrCellI;
@ -117,9 +117,9 @@ labelList getInternalFaceOrder
}
// Keep boundary faces in same order.
for (label faceI = newFaceI; faceI < owner.size(); faceI++)
for (label facei = newFaceI; facei < owner.size(); facei++)
{
oldToNew[faceI] = faceI;
oldToNew[facei] = facei;
}
return oldToNew;
@ -128,7 +128,7 @@ labelList getInternalFaceOrder
void storeCellInZone
(
const label cellI,
const label celli,
const label cellType,
Map<label>& typeToZone,
List<DynamicList<label>>& zoneCells
@ -149,12 +149,12 @@ void storeCellInZone
<< zoneI << endl;
typeToZone.insert(cellType, zoneI);
zoneCells[zoneI].append(cellI);
zoneCells[zoneI].append(celli);
}
else
{
// Existing zone for type
zoneCells[zoneFnd()].append(cellI);
zoneCells[zoneFnd()].append(celli);
}
}
}
@ -482,12 +482,12 @@ void ReadCells
unsigned int pos = 0;
for (unsigned int faceI = 0; faceI < nInternalFaces; faceI++)
for (unsigned int facei = 0; facei < nInternalFaces; facei++)
{
foamFaceMap[faceI] = mapData[faceI];
foamOwner[faceI] = faceCells[2*faceI];
foamNeighbour[faceI] = faceCells[2*faceI+1];
face& f = foamFaces[faceI];
foamFaceMap[facei] = mapData[facei];
foamOwner[facei] = faceCells[2*facei];
foamNeighbour[facei] = faceCells[2*facei+1];
face& f = foamFaces[facei];
f.setSize(faces[pos++]);
forAll(f, fp)
@ -804,9 +804,9 @@ int main(int argc, char *argv[])
label maxCCMPointI = max(foamPointMap);
labelList toFoamPoints(invert(maxCCMPointI+1, foamPointMap));
forAll(foamFaces, faceI)
forAll(foamFaces, facei)
{
inplaceRenumber(toFoamPoints, foamFaces[faceI]);
inplaceRenumber(toFoamPoints, foamFaces[facei]);
}
}
@ -831,15 +831,15 @@ int main(int argc, char *argv[])
// Set owner/neighbour so owner < neighbour
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(foamNeighbour, faceI)
forAll(foamNeighbour, facei)
{
label nbr = foamNeighbour[faceI];
label own = foamOwner[faceI];
label nbr = foamNeighbour[facei];
label own = foamOwner[facei];
if (nbr >= foamCellType.size() || own >= foamCellType.size())
{
FatalErrorInFunction
<< "face:" << faceI
<< "face:" << facei
<< " nbr:" << nbr
<< " own:" << own
<< " nCells:" << foamCellType.size()
@ -850,15 +850,15 @@ int main(int argc, char *argv[])
{
if (nbr < own)
{
foamOwner[faceI] = foamNeighbour[faceI];
foamNeighbour[faceI] = own;
foamFaces[faceI].flip();
foamOwner[facei] = foamNeighbour[facei];
foamNeighbour[facei] = own;
foamFaces[facei].flip();
}
}
// And check the face
const face& f = foamFaces[faceI];
const face& f = foamFaces[facei];
forAll(f, fp)
{
@ -897,9 +897,9 @@ int main(int argc, char *argv[])
);
// Reorder faces accordingly
forAll(foamCells, cellI)
forAll(foamCells, celli)
{
inplaceRenumber(oldToNew, foamCells[cellI]);
inplaceRenumber(oldToNew, foamCells[celli]);
}
// Reorder faces.
@ -1024,12 +1024,12 @@ int main(int argc, char *argv[])
// Storage for cell zones.
List<DynamicList<label>> zoneCells(0);
forAll(foamCellType, cellI)
forAll(foamCellType, celli)
{
storeCellInZone
(
cellI,
foamCellType[cellI],
celli,
foamCellType[celli],
typeToZone,
zoneCells
);
@ -1094,9 +1094,9 @@ int main(int argc, char *argv[])
dimensionedScalar("cellId", dimless, 0.0)
);
forAll(foamCellMap, cellI)
forAll(foamCellMap, celli)
{
cellIdField[cellI] = foamCellMap[cellI];
cellIdField[celli] = foamCellMap[celli];
}
// Construct field with calculated bc to hold cell type.
@ -1114,9 +1114,9 @@ int main(int argc, char *argv[])
dimensionedScalar("cellType", dimless, 0.0)
);
forAll(foamCellType, cellI)
forAll(foamCellType, celli)
{
cellTypeField[cellI] = foamCellType[cellI];
cellTypeField[celli] = foamCellType[celli];
}
Info<< "Writing cellIds as volScalarField to " << cellIdField.objectPath()

View File

@ -277,11 +277,11 @@ label findFace(const polyMesh& mesh, const face& f)
forAll(pFaces, i)
{
label faceI = pFaces[i];
label facei = pFaces[i];
if (mesh.faces()[faceI] == f)
if (mesh.faces()[facei] == f)
{
return faceI;
return facei;
}
}

View File

@ -611,11 +611,11 @@ int main(int argc, char *argv[])
label oldSize = renumberedPatch.size();
renumberedPatch.setSize(oldSize + curRawPatch.size());
forAll(curRawPatch, faceI)
forAll(curRawPatch, facei)
{
const face& oldFace = curRawPatch[faceI];
const face& oldFace = curRawPatch[facei];
face& newFace = renumberedPatch[oldSize + faceI];
face& newFace = renumberedPatch[oldSize + facei];
newFace.setSize(oldFace.size());
forAll(oldFace, pointI)
@ -635,11 +635,11 @@ int main(int argc, char *argv[])
faceList& renumberedPatch = boundary[nCreatedPatches];
renumberedPatch.setSize(curRawPatch.size());
forAll(curRawPatch, faceI)
forAll(curRawPatch, facei)
{
const face& oldFace = curRawPatch[faceI];
const face& oldFace = curRawPatch[facei];
face& newFace = renumberedPatch[faceI];
face& newFace = renumberedPatch[facei];
newFace.setSize(oldFace.size());
forAll(oldFace, pointI)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -367,9 +367,9 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
else if (blockHandedness_ == left)
{
// turn all faces inside out
forAll(result, faceI)
forAll(result, facei)
{
result[faceI].flip();
result[facei].flip();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,24 +85,24 @@ cellShape create3DCellShape
// make a list of outward-pointing faces
labelListList localFaces(faceLabels.size());
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label curFaceLabel = faceLabels[faceI];
const label curFaceLabel = faceLabels[facei];
const labelList& curFace = faces[curFaceLabel];
if (owner[curFaceLabel] == cellIndex)
{
localFaces[faceI] = curFace;
localFaces[facei] = curFace;
}
else if (neighbour[curFaceLabel] == cellIndex)
{
// Reverse the face
localFaces[faceI].setSize(curFace.size());
localFaces[facei].setSize(curFace.size());
forAllReverse(curFace, i)
{
localFaces[faceI][curFace.size() - i - 1] =
localFaces[facei][curFace.size() - i - 1] =
curFace[i];
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,9 +67,9 @@ cellShape extrudedQuadCellShape
// make a list of outward-pointing faces
labelListList localFaces(4);
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label curFaceLabel = faceLabels[faceI];
const label curFaceLabel = faceLabels[facei];
const face& curFace = faces[curFaceLabel];
@ -83,18 +83,18 @@ cellShape extrudedQuadCellShape
if (owner[curFaceLabel] == cellIndex)
{
localFaces[faceI] = curFace;
localFaces[facei] = curFace;
}
else if (neighbour[curFaceLabel] == cellIndex)
{
// Reverse the face. Note: it is necessary to reverse by
// hand to preserve connectivity of a 2-D mesh.
//
localFaces[faceI].setSize(curFace.size());
localFaces[facei].setSize(curFace.size());
forAllReverse(curFace, i)
{
localFaces[faceI][curFace.size() - i - 1] =
localFaces[facei][curFace.size() - i - 1] =
curFace[i];
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,9 +69,9 @@ cellShape extrudedTriangleCellShape
// make a list of outward-pointing faces
labelListList localFaces(3);
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label curFaceLabel = faceLabels[faceI];
const label curFaceLabel = faceLabels[facei];
const face& curFace = faces[curFaceLabel];
@ -85,18 +85,18 @@ cellShape extrudedTriangleCellShape
if (owner[curFaceLabel] == cellIndex)
{
localFaces[faceI] = curFace;
localFaces[facei] = curFace;
}
else if (neighbour[curFaceLabel] == cellIndex)
{
// Reverse the face. Note: it is necessary to reverse by
// hand to preserve connectivity of a 2-D mesh.
//
localFaces[faceI].setSize(curFace.size());
localFaces[facei].setSize(curFace.size());
forAllReverse(curFace, i)
{
localFaces[faceI][curFace.size() - i - 1] =
localFaces[facei][curFace.size() - i - 1] =
curFace[i];
}
}

View File

@ -241,7 +241,7 @@ endOfSection {space}")"{space}
// Face data
label faceGroupElementType = -1;
label faceI = 0;
label facei = 0;
// Cell data
label cellGroupElementType = -1;
@ -458,7 +458,7 @@ endOfSection {space}")"{space}
faceGroupElementType = readHexLabel(faceGroupDataStream);
// In FOAM, indices start from zero - adjust
faceI = faceGroupStartIndex.last() - 1;
facei = faceGroupStartIndex.last() - 1;
}
<readNumberOfFaces,readFaceGroupData>{spaceNl}{endOfSection} {
@ -483,7 +483,7 @@ endOfSection {space}")"{space}
IStringStream mixedFaceStream(YYText());
face& curFaceLabels = faces[faceI];
face& curFaceLabels = faces[facei];
// set size of label list
curFaceLabels.setSize(readLabel(mixedFaceStream));
@ -494,16 +494,16 @@ endOfSection {space}")"{space}
}
// read neighbour and owner. Neighbour comes first
neighbour[faceI] = readHexLabel(mixedFaceStream) - 1;
owner[faceI] = readHexLabel(mixedFaceStream) - 1;
faceI++;
neighbour[facei] = readHexLabel(mixedFaceStream) - 1;
owner[facei] = readHexLabel(mixedFaceStream) - 1;
facei++;
}
<readFacesUniform>{spaceNl}{hexLabelList} {
IStringStream mixedFaceStream(YYText());
face& curFaceLabels = faces[faceI];
face& curFaceLabels = faces[facei];
// set size of label list. This is OK because in Fluent the type
// for edge is 2, for triangle is 3 and for quad is 4
@ -515,20 +515,20 @@ endOfSection {space}")"{space}
}
// read neighbour and owner. Neighbour comes first
neighbour[faceI] = readHexLabel(mixedFaceStream) - 1;
owner[faceI] = readHexLabel(mixedFaceStream) - 1;
faceI++;
neighbour[facei] = readHexLabel(mixedFaceStream) - 1;
owner[facei] = readHexLabel(mixedFaceStream) - 1;
facei++;
}
<readFacesMixed,readFacesUniform>{spaceNl}{endOfSection} {
// check read of fluentFaces
if (faceI != faceGroupEndIndex.last())
if (facei != faceGroupEndIndex.last())
{
Info<< "problem with reading fluentFaces: "
<< "start index: " << faceGroupStartIndex.last()
<< " end index: " << faceGroupEndIndex.last()
<< " last fluentFaces read: " << faceI << endl;
<< " last fluentFaces read: " << facei << endl;
}
yy_pop_state();
@ -844,11 +844,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
forAll(pFaces, i)
{
label faceI = pFaces[i];
label facei = pFaces[i];
if (f == mesh.faces()[faceI])
if (f == mesh.faces()[facei])
{
return faceI;
return facei;
}
}
@ -932,23 +932,23 @@ int main(int argc, char *argv[])
// fill in owner and neighbour
forAll(owner, faceI)
forAll(owner, facei)
{
if (owner[faceI] > -1)
if (owner[facei] > -1)
{
label curCell = owner[faceI];
cellFaces[curCell][nFacesInCell[curCell] ] = faceI;
label curCell = owner[facei];
cellFaces[curCell][nFacesInCell[curCell] ] = facei;
nFacesInCell[curCell]++;
}
}
forAll(neighbour, faceI)
forAll(neighbour, facei)
{
if (neighbour[faceI] > -1)
if (neighbour[facei] > -1)
{
label curCell = neighbour[faceI];
cellFaces[curCell][nFacesInCell[curCell] ] = faceI;
label curCell = neighbour[facei];
cellFaces[curCell][nFacesInCell[curCell] ] = facei;
nFacesInCell[curCell]++;
}
@ -1062,17 +1062,17 @@ int main(int argc, char *argv[])
}
// Create new faces
forAll(faces, faceI)
forAll(faces, facei)
{
if (faces[faceI].size() != 2)
if (faces[facei].size() != 2)
{
FatalErrorInFunction
<< "fluentMeshToFoam: a 2-D face defined with "
<< faces[faceI].size() << " points." << endl;
<< faces[facei].size() << " points." << endl;
}
labelList& newFace = faces[faceI];
labelList& newFace = faces[facei];
newFace.setSize(4);
@ -1125,16 +1125,16 @@ int main(int argc, char *argv[])
// area vector points into the domain. Turn them round before making patches
// for Foam compatibility
forAll(faces, faceI)
forAll(faces, facei)
{
if (owner[faceI] == -1)
if (owner[facei] == -1)
{
// reverse face
labelList oldFace = faces[faceI];
labelList oldFace = faces[facei];
forAllReverse(oldFace, i)
{
faces[faceI][oldFace.size() - i - 1] =
faces[facei][oldFace.size() - i - 1] =
oldFace[i];
}
}
@ -1241,7 +1241,7 @@ int main(int argc, char *argv[])
faceList patchFaces(faceGroupEndIndexIter() - faceLabel);
forAll(patchFaces, faceI)
forAll(patchFaces, facei)
{
if
(
@ -1249,14 +1249,14 @@ int main(int argc, char *argv[])
|| faces[faceLabel].size() == 4
)
{
patchFaces[faceI] = face(faces[faceLabel]);
patchFaces[facei] = face(faces[faceLabel]);
faceLabel++;
}
else
{
FatalErrorInFunction
<< "unrecognised face shape with "
<< patchFaces[faceI].size() << " vertices"
<< patchFaces[facei].size() << " vertices"
<< abort(FatalError);
}
}
@ -1412,28 +1412,28 @@ int main(int argc, char *argv[])
//and mark patch number to global list
forAll(meshFaces, i)
{
label faceI = meshFaces[i];
label facei = meshFaces[i];
if (pShapeMesh.isInternalFace(faceI))
if (pShapeMesh.isInternalFace(facei))
{
FatalErrorInFunction
<< "Face " << faceI << " on new patch "
<< "Face " << facei << " on new patch "
<< patchNames[patchi]
<< " is not an external face of the mesh." << endl
<< exit(FatalError);
}
if (facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1)
if (facePatchID[facei - pShapeMesh.nInternalFaces()]!= -1)
{
FatalErrorInFunction
<< "Face " << faceI << " on new patch "
<< "Face " << facei << " on new patch "
<< patchNames[patchi]
<< " has already been marked for repatching to"
<< " patch "
<< facePatchID[faceI - pShapeMesh.nInternalFaces()]
<< facePatchID[facei - pShapeMesh.nInternalFaces()]
<< exit(FatalError);
}
facePatchID[faceI - pShapeMesh.nInternalFaces()] = nBoundaries;
facePatchID[facei - pShapeMesh.nInternalFaces()] = nBoundaries;
}
//add to boundary patch
@ -1521,9 +1521,9 @@ int main(int argc, char *argv[])
// Change patch ids
forAll(facePatchID, idI)
{
label faceI = idI + pShapeMesh.nInternalFaces();
label facei = idI + pShapeMesh.nInternalFaces();
repatcher.changePatchID(faceI, facePatchID[idI]);
repatcher.changePatchID(facei, facePatchID[idI]);
}
repatcher.repatch();
@ -1626,15 +1626,15 @@ int main(int argc, char *argv[])
);
DynamicList<label> zoneFaces(pShapeMesh.nFaces());
forAll(pShapeMesh.faceNeighbour(), faceI)
forAll(pShapeMesh.faceNeighbour(), facei)
{
label nei = pShapeMesh.faceNeighbour()[faceI];
label own = pShapeMesh.faceOwner()[faceI];
label nei = pShapeMesh.faceNeighbour()[facei];
label own = pShapeMesh.faceOwner()[facei];
if (nei != -1)
{
if (zoneCell[nei] && zoneCell[own])
{
zoneFaces.append(faceI);
zoneFaces.append(facei);
}
}
}

View File

@ -135,9 +135,9 @@ void Foam::fluentFvMesh::writeFluentMesh() const
<< "(13 (2 1 "
<< own.size() << " 2 0)" << std::endl << "(" << std::endl;
forAll(own, faceI)
forAll(own, facei)
{
const labelList& l = fcs[faceI];
const labelList& l = fcs[facei];
fluentMeshFile << " ";
@ -148,8 +148,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile << l[lI] + 1 << " ";
}
fluentMeshFile << nei[faceI] + 1 << " ";
fluentMeshFile << own[faceI] + 1 << std::endl;
fluentMeshFile << nei[facei] + 1 << " ";
fluentMeshFile << own[facei] + 1 << std::endl;
}
fluentMeshFile << "))" << std::endl;
@ -194,9 +194,9 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile
<<" 0)" << std::endl << "(" << std::endl;
forAll(patchFaces, faceI)
forAll(patchFaces, facei)
{
const labelList& l = patchFaces[faceI];
const labelList& l = patchFaces[facei];
fluentMeshFile << " ";
@ -210,7 +210,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile << l[lI] + 1 << " ";
}
fluentMeshFile << patchFaceCells[faceI] + 1 << " 0" << std::endl;
fluentMeshFile << patchFaceCells[facei] + 1 << " 0" << std::endl;
}
fluentMeshFile << "))" << std::endl;
@ -230,21 +230,21 @@ void Foam::fluentFvMesh::writeFluentMesh() const
bool hasWarned = false;
forAll(cells, cellI)
forAll(cells, celli)
{
if (cells[cellI].model() == tet)
if (cells[celli].model() == tet)
{
fluentMeshFile << " " << 2;
}
else if (cells[cellI].model() == hex)
else if (cells[celli].model() == hex)
{
fluentMeshFile << " " << 4;
}
else if (cells[cellI].model() == pyr)
else if (cells[celli].model() == pyr)
{
fluentMeshFile << " " << 5;
}
else if (cells[cellI].model() == prism)
else if (cells[celli].model() == prism)
{
fluentMeshFile << " " << 6;
}
@ -256,7 +256,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
WarningInFunction
<< "foamMeshToFluent: cell shape for cell "
<< cellI << " only supported by Fluent polyhedral meshes."
<< celli << " only supported by Fluent polyhedral meshes."
<< nl
<< " Suppressing any further messages for polyhedral"
<< " cells." << endl;

View File

@ -328,14 +328,14 @@ mtype {space}"MTYPE:"{space}
IStringStream elementStream(YYText());
label cellI(readLabel(elementStream));
label celli(readLabel(elementStream));
label cellType(readLabel(elementStream));
label nVertices(readLabel(elementStream));
// reset number of continuation lines
nCellContinuationLines = 0;
cellMap[curNumberOfCells] = cellI;
cellMap[curNumberOfCells] = celli;
cellTypes[curNumberOfCells] = cellType;
cellLabels.set(curNumberOfCells, new labelList(nVertices));
@ -682,19 +682,19 @@ int main(int argc, char *argv[])
// make a cell mapping array
label maxCellIndex = 0;
forAll(cellMap, cellI)
forAll(cellMap, celli)
{
if (cellMap[cellI] > maxCellIndex)
if (cellMap[celli] > maxCellIndex)
{
maxCellIndex = cellMap[cellI];
maxCellIndex = cellMap[celli];
}
}
labelList cellLookup(maxCellIndex + 1);
forAll(cellMap, cellI)
forAll(cellMap, celli)
{
cellLookup[cellMap[cellI] ] = cellI;
cellLookup[cellMap[celli] ] = celli;
}
const cellModel& hex = *(cellModeller::lookup("hex"));
@ -709,23 +709,23 @@ int main(int argc, char *argv[])
cellShapeList cells(cellLabels.size());
forAll(cellTypes, cellI)
forAll(cellTypes, celli)
{
const labelList& curCellLabels = cellLabels[cellI];
const labelList& curCellLabels = cellLabels[celli];
// Tetrahedron
if (cellTypes[cellI] == 6)
if (cellTypes[celli] == 6)
{
labelsTet[0] = pointLookup[curCellLabels[0] ];
labelsTet[1] = pointLookup[curCellLabels[2] ];
labelsTet[2] = pointLookup[curCellLabels[3] ];
labelsTet[3] = pointLookup[curCellLabels[1] ];
cells[cellI] = cellShape(tet, labelsTet);
cells[celli] = cellShape(tet, labelsTet);
}
// Square-based pyramid
else if (cellTypes[cellI] == 7)
else if (cellTypes[celli] == 7)
{
labelsPyramid[0] = pointLookup[curCellLabels[0] ];
labelsPyramid[1] = pointLookup[curCellLabels[1] ];
@ -733,11 +733,11 @@ int main(int argc, char *argv[])
labelsPyramid[3] = pointLookup[curCellLabels[2] ];
labelsPyramid[4] = pointLookup[curCellLabels[4] ];
cells[cellI] = cellShape(pyr, labelsPyramid);
cells[celli] = cellShape(pyr, labelsPyramid);
}
// Triangular prism
else if (cellTypes[cellI] == 5)
else if (cellTypes[celli] == 5)
{
labelsPrism[0] = pointLookup[curCellLabels[0] ];
labelsPrism[1] = pointLookup[curCellLabels[1] ];
@ -746,11 +746,11 @@ int main(int argc, char *argv[])
labelsPrism[4] = pointLookup[curCellLabels[4] ];
labelsPrism[5] = pointLookup[curCellLabels[5] ];
cells[cellI] = cellShape(prism, labelsPrism);
cells[celli] = cellShape(prism, labelsPrism);
}
// Hex
else if (cellTypes[cellI] == 4)
else if (cellTypes[celli] == 4)
{
labelsHex[0] = pointLookup[curCellLabels[0] ];
labelsHex[1] = pointLookup[curCellLabels[1] ];
@ -761,7 +761,7 @@ int main(int argc, char *argv[])
labelsHex[6] = pointLookup[curCellLabels[7] ];
labelsHex[7] = pointLookup[curCellLabels[6] ];
cells[cellI] = cellShape(hex, labelsHex);
cells[celli] = cellShape(hex, labelsHex);
}
}
@ -788,18 +788,18 @@ int main(int argc, char *argv[])
faceList& patchFaces = boundary[patchi];
patchFaces.setSize(curCells.size());
forAll(curCells, faceI)
forAll(curCells, facei)
{
patchFaces[faceI] =
cells[cellLookup[curCells[faceI] ] ].faces()
patchFaces[facei] =
cells[cellLookup[curCells[facei] ] ].faces()
[
faceIndex
[
// this picks a cell type
cells[cellLookup[curCells[faceI] ] ]
cells[cellLookup[curCells[facei] ] ]
.model().index()
]
[curFaces[faceI] - 1] // this gives a fluent face - 1
[curFaces[facei] - 1] // this gives a fluent face - 1
];
}

View File

@ -120,9 +120,9 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
// meshF vertices (in any order ;-)
forAll(pFaces, i)
{
label faceI = pFaces[i];
label facei = pFaces[i];
const face& f = pp[faceI];
const face& f = pp[facei];
// Count uses of vertices of meshF for f
label nMatched = 0;
@ -137,7 +137,7 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
if (nMatched == meshF.size())
{
return faceI;
return facei;
}
}
@ -152,9 +152,9 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
forAll(pFaces, i)
{
label faceI = pFaces[i];
label facei = pFaces[i];
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
// Count uses of vertices of meshF for f
label nMatched = 0;
@ -169,7 +169,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
if (nMatched == meshF.size())
{
return faceI;
return facei;
}
}
return -1;
@ -207,7 +207,7 @@ bool correctOrientation(const pointField& points, const cellShape& shape)
void storeCellInZone
(
const label regPhys,
const label cellI,
const label celli,
Map<label>& physToZone,
labelList& zoneToPhys,
@ -228,12 +228,12 @@ void storeCellInZone
physToZone.insert(regPhys, zoneI);
zoneToPhys[zoneI] = regPhys;
zoneCells[zoneI].append(cellI);
zoneCells[zoneI].append(celli);
}
else
{
// Existing zone for region
zoneCells[zoneFnd()].append(cellI);
zoneCells[zoneFnd()].append(celli);
}
}
@ -449,7 +449,7 @@ void readCells
// Storage for all cells. Too big. Shrink later
cells.setSize(nElems);
label cellI = 0;
label celli = 0;
label nTet = 0;
label nPyr = 0;
label nPrism = 0;
@ -566,7 +566,7 @@ void readCells
storeCellInZone
(
regPhys,
cellI,
celli,
physToZone,
zoneToPhys,
zoneCells
@ -578,7 +578,7 @@ void readCells
renumber(mshToFoam, tetPoints);
cells[cellI++] = cellShape(tet, tetPoints);
cells[celli++] = cellShape(tet, tetPoints);
nTet++;
}
@ -587,7 +587,7 @@ void readCells
storeCellInZone
(
regPhys,
cellI,
celli,
physToZone,
zoneToPhys,
zoneCells
@ -599,7 +599,7 @@ void readCells
renumber(mshToFoam, pyrPoints);
cells[cellI++] = cellShape(pyr, pyrPoints);
cells[celli++] = cellShape(pyr, pyrPoints);
nPyr++;
}
@ -608,7 +608,7 @@ void readCells
storeCellInZone
(
regPhys,
cellI,
celli,
physToZone,
zoneToPhys,
zoneCells
@ -620,13 +620,13 @@ void readCells
renumber(mshToFoam, prismPoints);
cells[cellI] = cellShape(prism, prismPoints);
cells[celli] = cellShape(prism, prismPoints);
const cellShape& cell = cells[cellI];
const cellShape& cell = cells[celli];
if (!keepOrientation && !correctOrientation(points, cell))
{
Info<< "Inverting prism " << cellI << endl;
Info<< "Inverting prism " << celli << endl;
// Reorder prism.
prismPoints[0] = cell[0];
prismPoints[1] = cell[2];
@ -635,10 +635,10 @@ void readCells
prismPoints[4] = cell[4];
prismPoints[5] = cell[5];
cells[cellI] = cellShape(prism, prismPoints);
cells[celli] = cellShape(prism, prismPoints);
}
cellI++;
celli++;
nPrism++;
}
@ -647,7 +647,7 @@ void readCells
storeCellInZone
(
regPhys,
cellI,
celli,
physToZone,
zoneToPhys,
zoneCells
@ -661,13 +661,13 @@ void readCells
renumber(mshToFoam, hexPoints);
cells[cellI] = cellShape(hex, hexPoints);
cells[celli] = cellShape(hex, hexPoints);
const cellShape& cell = cells[cellI];
const cellShape& cell = cells[celli];
if (!keepOrientation && !correctOrientation(points, cell))
{
Info<< "Inverting hex " << cellI << endl;
Info<< "Inverting hex " << celli << endl;
// Reorder hex.
hexPoints[0] = cell[4];
hexPoints[1] = cell[5];
@ -678,10 +678,10 @@ void readCells
hexPoints[6] = cell[2];
hexPoints[7] = cell[3];
cells[cellI] = cellShape(hex, hexPoints);
cells[celli] = cellShape(hex, hexPoints);
}
cellI++;
celli++;
nHex++;
}
@ -705,7 +705,7 @@ void readCells
}
cells.setSize(cellI);
cells.setSize(celli);
forAll(patchFaces, patchi)
{

View File

@ -250,15 +250,15 @@ void readPoints
void addAndExtend
(
DynamicList<label>& indizes,
label cellI,
label celli,
label val
)
{
if (indizes.size() < (cellI+1))
if (indizes.size() < (celli+1))
{
indizes.setSize(cellI+1,-1);
indizes.setSize(celli+1,-1);
}
indizes[cellI] = val;
indizes[celli] = val;
}
// Reads cells section. Read region as well? Not handled yet but should just
@ -304,16 +304,16 @@ void readCells
break;
}
label cellI, feID, physProp, matProp, colour, nNodes;
label celli, feID, physProp, matProp, colour, nNodes;
IStringStream lineStr(line);
lineStr
>> cellI >> feID >> physProp >> matProp >> colour >> nNodes;
>> celli >> feID >> physProp >> matProp >> colour >> nNodes;
if (foundFeType.insert(feID))
{
Info<< "First occurrence of element type " << feID
<< " for cell " << cellI << " at line "
<< " for cell " << celli << " at line "
<< is.lineNumber() << endl;
}
@ -338,7 +338,7 @@ void readCells
lineStr
>> cVerts[0] >> cVerts[1] >> cVerts[2];
boundaryFaces.append(cVerts);
boundaryFaceIndices.append(cellI);
boundaryFaceIndices.append(celli);
}
else if (feID == 44 || feID == 94)
{
@ -350,7 +350,7 @@ void readCells
lineStr
>> cVerts[0] >> cVerts[1] >> cVerts[2] >> cVerts[3];
boundaryFaces.append(cVerts);
boundaryFaceIndices.append(cellI);
boundaryFaceIndices.append(celli);
}
else if (feID == 111)
{
@ -364,12 +364,12 @@ void readCells
cellVerts.append(cellShape(tet, cVerts, true));
cellMaterial.append(physProp);
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
if (cellVerts.last().size() != cVerts.size())
{
Info<< "Line:" << is.lineNumber()
<< " element:" << cellI
<< " element:" << celli
<< " type:" << feID
<< " collapsed from " << cVerts << nl
<< " to:" << cellVerts.last()
@ -389,12 +389,12 @@ void readCells
cellVerts.append(cellShape(prism, cVerts, true));
cellMaterial.append(physProp);
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
if (cellVerts.last().size() != cVerts.size())
{
Info<< "Line:" << is.lineNumber()
<< " element:" << cellI
<< " element:" << celli
<< " type:" << feID
<< " collapsed from " << cVerts << nl
<< " to:" << cellVerts.last()
@ -414,12 +414,12 @@ void readCells
cellVerts.append(cellShape(hex, cVerts, true));
cellMaterial.append(physProp);
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
if (cellVerts.last().size() != cVerts.size())
{
Info<< "Line:" << is.lineNumber()
<< " element:" << cellI
<< " element:" << celli
<< " type:" << feID
<< " collapsed from " << cVerts << nl
<< " to:" << cellVerts.last()
@ -446,12 +446,12 @@ void readCells
cellVerts.append(cellShape(tet, cVerts, true));
cellMaterial.append(physProp);
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
if (cellVerts.last().size() != cVerts.size())
{
Info<< "Line:" << is.lineNumber()
<< " element:" << cellI
<< " element:" << celli
<< " type:" << feID
<< " collapsed from " << cVerts << nl
<< " to:" << cellVerts.last()
@ -790,28 +790,28 @@ int main(int argc, char *argv[])
// Renumber vertex numbers on cells
forAll(cellVerts, cellI)
forAll(cellVerts, celli)
{
labelList foamVerts
(
renumber
(
unvToFoam,
static_cast<labelList&>(cellVerts[cellI])
static_cast<labelList&>(cellVerts[celli])
)
);
if (findIndex(foamVerts, -1) != -1)
{
FatalErrorInFunction
<< "Cell " << cellI
<< " unv vertices " << cellVerts[cellI]
<< "Cell " << celli
<< " unv vertices " << cellVerts[celli]
<< " has some undefined vertices " << foamVerts
<< abort(FatalError);
}
// Bit nasty: replace vertex list.
cellVerts[cellI].transfer(foamVerts);
cellVerts[celli].transfer(foamVerts);
}
// Renumber vertex numbers on boundaryFaces
@ -850,15 +850,15 @@ int main(int argc, char *argv[])
{
HashTable<label, face, Hash<face>> faceToFaceID(boundaryFaces.size());
forAll(boundaryFaces, faceI)
forAll(boundaryFaces, facei)
{
SortableList<label> sortedVerts(boundaryFaces[faceI]);
faceToFaceID.insert(face(sortedVerts), faceI);
SortableList<label> sortedVerts(boundaryFaces[facei]);
faceToFaceID.insert(face(sortedVerts), facei);
}
forAll(cellVerts, cellI)
forAll(cellVerts, celli)
{
faceList faces = cellVerts[cellI].faces();
faceList faces = cellVerts[celli].faces();
forAll(faces, i)
{
SortableList<label> sortedVerts(faces[i]);
@ -867,31 +867,31 @@ int main(int argc, char *argv[])
if (fnd != faceToFaceID.end())
{
label faceI = fnd();
int stat = face::compare(faces[i], boundaryFaces[faceI]);
label facei = fnd();
int stat = face::compare(faces[i], boundaryFaces[facei]);
if (stat == 1)
{
// Same orientation. Cell is owner.
own[faceI] = cellI;
own[facei] = celli;
}
else if (stat == -1)
{
// Opposite orientation. Cell is neighbour.
nei[faceI] = cellI;
nei[facei] = celli;
}
}
}
}
label nReverse = 0;
forAll(own, faceI)
forAll(own, facei)
{
if (own[faceI] == -1 && nei[faceI] != -1)
if (own[facei] == -1 && nei[facei] != -1)
{
// Boundary face with incorrect orientation
boundaryFaces[faceI] = boundaryFaces[faceI].reverseFace();
Swap(own[faceI], nei[faceI]);
boundaryFaces[facei] = boundaryFaces[facei].reverseFace();
Swap(own[facei], nei[facei]);
nReverse++;
}
}
@ -903,12 +903,12 @@ int main(int argc, char *argv[])
label cnt = 0;
forAll(own, faceI)
forAll(own, facei)
{
if (own[faceI] != -1 && nei[faceI] != -1)
if (own[facei] != -1 && nei[facei] != -1)
{
faceToCell[1].insert(faceI, own[faceI]);
faceToCell[0].insert(faceI, nei[faceI]);
faceToCell[1].insert(facei, own[facei]);
faceToCell[0].insert(facei, nei[facei]);
cnt++;
}
}
@ -958,9 +958,9 @@ int main(int argc, char *argv[])
List<DynamicList<face>> dynPatchFaces(dofVertIndices.size());
forAll(cellVerts, cellI)
forAll(cellVerts, celli)
{
const cellShape& shape = cellVerts[cellI];
const cellShape& shape = cellVerts[celli];
const faceList shapeFaces(shape.faces());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,24 +92,24 @@ int main(int argc, char *argv[])
if (readHex)
{
for (label cellI = 0; cellI < nCells; cellI++)
for (label celli = 0; celli < nCells; celli++)
{
for (label cp = 0; cp < 8; cp++)
{
mshStream >> hexPoints[cp];
}
cells[cellI] = cellShape(hex, hexPoints);
cells[celli] = cellShape(hex, hexPoints);
}
}
else
{
for (label cellI = 0; cellI < nCells; cellI++)
for (label celli = 0; celli < nCells; celli++)
{
for (label cp = 0; cp < 4; cp++)
{
mshStream >> tetPoints[cp];
}
cells[cellI] = cellShape(tet, tetPoints);
cells[celli] = cellShape(tet, tetPoints);
}
}

View File

@ -127,7 +127,7 @@ int main(int argc, char *argv[])
labelList tetPoints(4);
forAll(cells, cellI)
forAll(cells, celli)
{
label domain(readLabel(str));
@ -144,7 +144,7 @@ int main(int argc, char *argv[])
tetPoints[2] = readLabel(str) - 1;
tetPoints[3] = readLabel(str) - 1;
cells[cellI] = cellShape(tet, tetPoints);
cells[celli] = cellShape(tet, tetPoints);
}
@ -165,7 +165,7 @@ int main(int argc, char *argv[])
// Boundary faces as three vertices
HashTable<label, triFace, Hash<triFace>> vertsToBoundary(nFaces);
forAll(boundaryFaces, faceI)
forAll(boundaryFaces, facei)
{
label patchi(readLabel(str));
@ -183,13 +183,13 @@ int main(int argc, char *argv[])
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
// Store boundary face as is for now. Later on reverse it.
boundaryFaces[faceI].setSize(3);
boundaryFaces[faceI][0] = tri[0];
boundaryFaces[faceI][1] = tri[1];
boundaryFaces[faceI][2] = tri[2];
boundaryPatch[faceI] = patchi;
boundaryFaces[facei].setSize(3);
boundaryFaces[facei][0] = tri[0];
boundaryFaces[facei][1] = tri[1];
boundaryFaces[facei][2] = tri[2];
boundaryPatch[facei] = patchi;
vertsToBoundary.insert(tri, faceI);
vertsToBoundary.insert(tri, facei);
}
label nPatches = maxPatch + 1;
@ -199,9 +199,9 @@ int main(int argc, char *argv[])
// For storage reasons I store the triangles and loop over the cells instead
// of the other way around (store cells and loop over triangles) though
// that would be faster.
forAll(cells, cellI)
forAll(cells, celli)
{
const cellShape& cll = cells[cellI];
const cellShape& cll = cells[celli];
// Get the four (outwards pointing) faces of the cell
faceList tris(cll.faces());
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
if (iter != vertsToBoundary.end())
{
label faceI = iter();
label facei = iter();
const triFace& tri = iter.key();
// Determine orientation of tri v.s. cell centre.
@ -228,7 +228,7 @@ int main(int argc, char *argv[])
if (((fc - cc) & fn) < 0)
{
// Boundary face points inwards. Flip.
boundaryFaces[faceI].flip();
boundaryFaces[facei].flip();
}
// Done this face so erase from hash
@ -268,11 +268,11 @@ int main(int argc, char *argv[])
// Sort boundaryFaces by patch.
List<DynamicList<face>> allPatchFaces(nPatches);
forAll(boundaryPatch, faceI)
forAll(boundaryPatch, facei)
{
label patchi = boundaryPatch[faceI];
label patchi = boundaryPatch[facei];
allPatchFaces[patchi].append(boundaryFaces[faceI]);
allPatchFaces[patchi].append(boundaryFaces[facei]);
}
Info<< "Patches:" << nl

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -464,9 +464,9 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
else if (blockHandedness_ == left)
{
// turn all faces inside out
forAll(result, faceI)
forAll(result, facei)
{
result[faceI].flip();
result[facei].flip();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,9 +69,9 @@ void Foam::sammMesh::calcPointCells() const
//
// For each cell
forAll(cellShapes_, cellI)
forAll(cellShapes_, celli)
{
const faceList& faces = cellFaces_[cellI];
const faceList& faces = cellFaces_[celli];
forAll(faces, i)
{
@ -90,7 +90,7 @@ void Foam::sammMesh::calcPointCells() const
for (label f = 0; f < curCount; f++)
{
if (curPointCells[f] == cellI)
if (curPointCells[f] == celli)
{
found = true;
@ -108,7 +108,7 @@ void Foam::sammMesh::calcPointCells() const
}
// Enter the cell label in the point's cell list
curPointCells[curCount] = cellI;
curPointCells[curCount] = celli;
// Increment the cell count for the point addressed
cellCount[curPoint]++;

View File

@ -76,11 +76,11 @@ void Foam::sammMesh::createBoundaryFaces()
const labelListList& PointCells = pointCells();
forAll(patchFaces, faceI)
forAll(patchFaces, facei)
{
bool found = false;
face& curFace = patchFaces[faceI];
face& curFace = patchFaces[facei];
const labelList& facePoints = curFace;
forAll(facePoints, pointI)
@ -88,10 +88,10 @@ void Foam::sammMesh::createBoundaryFaces()
const labelList& facePointCells =
PointCells[facePoints[pointI]];
forAll(facePointCells, cellI)
forAll(facePointCells, celli)
{
const faceList& curCellFaces =
cellFaces_[facePointCells[cellI]];
cellFaces_[facePointCells[celli]];
forAll(curCellFaces, cellFaceI)
{
@ -113,7 +113,7 @@ void Foam::sammMesh::createBoundaryFaces()
if (!found)
{
FatalErrorInFunction
<< "Face " << faceI
<< "Face " << facei
<< " does not have neighbour cell." << endl
<< " face : " << endl << curFace
<< abort(FatalError);

View File

@ -47,11 +47,11 @@ void Foam::sammMesh::createPolyBoundary()
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
forAll(curShapePatch, faceI)
forAll(curShapePatch, facei)
{
bool found = false;
const face& curFace = curShapePatch[faceI];
const face& curFace = curShapePatch[facei];
meshFaces_[nCreatedFaces] = curFace;
@ -64,10 +64,10 @@ void Foam::sammMesh::createPolyBoundary()
const labelList& facePointCells =
PointCells[facePoints[pointI]];
forAll(facePointCells, cellI)
forAll(facePointCells, celli)
{
const faceList& curCellFaces =
cellFaces_[facePointCells[cellI]];
cellFaces_[facePointCells[celli]];
forAll(curCellFaces, cellFaceI)
{
@ -79,7 +79,7 @@ void Foam::sammMesh::createPolyBoundary()
// Debugging
if
(
cellPolys_[facePointCells[cellI]][cellFaceI]
cellPolys_[facePointCells[celli]][cellFaceI]
!= -1
)
{
@ -89,7 +89,7 @@ void Foam::sammMesh::createPolyBoundary()
<< abort(FatalError);
}
cellPolys_[facePointCells[cellI]][cellFaceI] =
cellPolys_[facePointCells[celli]][cellFaceI] =
nCreatedFaces;
nBoundaryFacesFound++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,18 +40,18 @@ void Foam::sammMesh::createPolyCells()
label maxFaces = 0;
forAll(cellPolys_, cellI)
forAll(cellPolys_, celli)
{
cell& curCell = cellPolys_[cellI];
cell& curCell = cellPolys_[celli];
curCell.setSize(cellFaces_[cellI].size());
curCell.setSize(cellFaces_[celli].size());
forAll(curCell, fI)
{
curCell[fI] = -1;
}
maxFaces += cellFaces_[cellI].size();
maxFaces += cellFaces_[celli].size();
}
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
@ -65,7 +65,7 @@ void Foam::sammMesh::createPolyCells()
nInternalFaces_ = 0;
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
// Note:
// Insertion cannot be done in one go as the faces need to be
@ -73,7 +73,7 @@ void Foam::sammMesh::createPolyCells()
// cells. Therefore, all neighbours will be detected first
// and then added in the correct order.
const faceList& curFaces = cellFaces_[cellI];
const faceList& curFaces = cellFaces_[celli];
// Record the neighbour cell
labelList neiCells(curFaces.size(), -1);
@ -84,14 +84,14 @@ void Foam::sammMesh::createPolyCells()
label nNeighbours = 0;
// For all faces ...
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Skip faces that have already been matched
if (cellPolys_[cellI][faceI] >= 0) continue;
if (cellPolys_[celli][facei] >= 0) continue;
found = false;
const face& curFace = curFaces[faceI];
const face& curFace = curFaces[facei];
// get the list of labels
const labelList& curPoints = curFace;
@ -109,7 +109,7 @@ void Foam::sammMesh::createPolyCells()
// reject neighbours with the lower label. This should
// also reject current cell.
if (curNei > cellI)
if (curNei > celli)
{
// get the list of search faces
const faceList& searchFaces = cellFaces_[curNei];
@ -122,8 +122,8 @@ void Foam::sammMesh::createPolyCells()
found = true;
// Record the neighbour cell and face
neiCells[faceI] = curNei;
faceOfNeiCell[faceI] = neiFaceI;
neiCells[facei] = curNei;
faceOfNeiCell[facei] = neiFaceI;
nNeighbours++;
break;
@ -159,7 +159,7 @@ void Foam::sammMesh::createPolyCells()
meshFaces_[nInternalFaces_] = curFaces[nextNei];
// Mark for owner
cellPolys_[cellI][nextNei] = nInternalFaces_;
cellPolys_[celli][nextNei] = nInternalFaces_;
// Mark for neighbour
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,21 +34,21 @@ void Foam::sammMesh::fixCollapsedEdges()
{
cellFaces_.setSize(cellShapes_.size());
forAll(cellShapes_, cellI)
forAll(cellShapes_, celli)
{
cellFaces_[cellI] = cellShapes_[cellI].faces();
cellFaces_[celli] = cellShapes_[celli].faces();
}
// go through the faces and find if there exist faces with duplicate
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
faceList& curFaces = cellFaces_[cellI];
faceList& curFaces = cellFaces_[celli];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
face& vertexLabels = curFaces[faceI];
face& vertexLabels = curFaces[facei];
bool duplicatesFound = false;
@ -129,7 +129,7 @@ void Foam::sammMesh::fixCollapsedEdges()
if (nNewVertices < 3)
{
FatalErrorInFunction
<< "face " << faceI << " of cell " << cellI
<< "face " << facei << " of cell " << celli
<< " is colapsed down to a point or edge, which is "
<< "not permitted" << endl
<< "original face: " << vertexLabels << endl

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,20 +32,20 @@ Description
void Foam::sammMesh::purgeCellShapes()
{
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
const faceList& curFaces = cellFaces_[cellI];
const faceList& curFaces = cellFaces_[celli];
// Get model faces
faceList shapeFaces = cellShapes_[cellI].faces();
faceList shapeFaces = cellShapes_[celli].faces();
forAll(shapeFaces, faceI)
forAll(shapeFaces, facei)
{
bool found = false;
forAll(curFaces, i)
{
if (shapeFaces[faceI] == curFaces[i])
if (shapeFaces[facei] == curFaces[i])
{
found = true;
break;
@ -54,8 +54,8 @@ void Foam::sammMesh::purgeCellShapes()
if (!found)
{
Info<< "Purging cell shape " << cellI << endl;
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
Info<< "Purging cell shape " << celli << endl;
cellShapes_[celli] = cellShape(*unknownPtr_, labelList(0));
break;
}
}

View File

@ -139,7 +139,7 @@ void Foam::sammMesh::readBoundary()
IFstream boundaryFile(boundaryFileName);
for (label faceI=0; faceI<nFaces; faceI++)
for (label facei=0; facei<nFaces; facei++)
{
boundaryFile >> lineIndex;
@ -172,7 +172,7 @@ void Foam::sammMesh::readBoundary()
)
{
//Info<< "Converting collapsed quad into triangle"
// << " for face " << faceI
// << " for face " << facei
// << " in Samm boundary " << lineIndex << endl;
pointLabelsTri[0] = pointLabels[0];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -230,7 +230,7 @@ void Foam::sammMesh::readCells()
labelList labels(24, label(-1));
label lineLabel, sammLabel, regionLabel, typeFlag;
for (label cellI = 0; cellI < nCells; cellI++)
for (label celli = 0; celli < nCells; celli++)
{
label nLabels = 0;
@ -294,15 +294,15 @@ void Foam::sammMesh::readCells()
} while (typeFlag == -1 || addOnToCell);
starCellLabelLookup_[lineLabel] = cellI;
starCellLabelLookup_[lineLabel] = celli;
if (nLabels == 8)
{
addRegularCell(labels, cellI);
addRegularCell(labels, celli);
}
else
{
addSAMMcell(typeFlag, labels, cellI);
addSAMMcell(typeFlag, labels, celli);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -127,15 +127,15 @@ void Foam::sammMesh::readCouples()
}
// Once all couples are read, remove zero size faces from all cells
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
faceList& curFaces = cellFaces_[cellI];
faceList& curFaces = cellFaces_[celli];
label zeroSizeFound = 0;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
if (curFaces[faceI].empty())
if (curFaces[facei].empty())
{
zeroSizeFound++;
}
@ -150,11 +150,11 @@ void Foam::sammMesh::readCouples()
label nFaces = 0;
forAll(oldFaces, faceI)
forAll(oldFaces, facei)
{
if (oldFaces[faceI].size())
if (oldFaces[facei].size())
{
curFaces[nFaces] = oldFaces[faceI];
curFaces[nFaces] = oldFaces[facei];
nFaces++;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -128,21 +128,21 @@ void Foam::sammMesh::createPolyMeshData()
label nProblemCells = 0;
// check that there is no zeros in the cellPolys_
forAll(cellPolys_, cellI)
forAll(cellPolys_, celli)
{
const labelList& curFaceLabels = cellPolys_[cellI];
const labelList& curFaceLabels = cellPolys_[celli];
forAll(curFaceLabels, faceI)
forAll(curFaceLabels, facei)
{
if (curFaceLabels[faceI] == -1)
if (curFaceLabels[facei] == -1)
{
Info<< "cell " << cellI
Info<< "cell " << celli
<< " has got an unmatched face. "
<< "Index: " << cellShapes_[cellI].model().index() << endl
// << "cell shape: " << cellShapes_[cellI] << endl
// << "shape faces: " << cellShapes_[cellI].faces() << endl
<< "cellPolys: " << cellPolys_[cellI] << endl
// << "cell faces: " << cellFaces_[cellI]
<< "Index: " << cellShapes_[celli].model().index() << endl
// << "cell shape: " << cellShapes_[celli] << endl
// << "shape faces: " << cellShapes_[celli].faces() << endl
<< "cellPolys: " << cellPolys_[celli] << endl
// << "cell faces: " << cellFaces_[celli]
<< endl;
nProblemCells++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,9 +69,9 @@ void Foam::starMesh::calcPointCells() const
//
// For each cell
forAll(cellShapes_, cellI)
forAll(cellShapes_, celli)
{
const faceList& faces = cellFaces_[cellI];
const faceList& faces = cellFaces_[celli];
forAll(faces, i)
{
@ -90,7 +90,7 @@ void Foam::starMesh::calcPointCells() const
for (label f = 0; f < curCount; f++)
{
if (curPointCells[f] == cellI)
if (curPointCells[f] == celli)
{
found = true;
@ -108,7 +108,7 @@ void Foam::starMesh::calcPointCells() const
}
// Enter the cell label in the point's cell list
curPointCells[curCount] = cellI;
curPointCells[curCount] = celli;
// Increment the cell count for the point addressed
cellCount[curPoint]++;

View File

@ -110,11 +110,11 @@ void Foam::starMesh::markBoundaryFaces()
const labelListList& PointCells = pointCells();
forAll(patchFaces, faceI)
forAll(patchFaces, facei)
{
bool found = false;
const face& curFace = patchFaces[faceI];
const face& curFace = patchFaces[facei];
const labelList& facePoints = curFace;
forAll(facePoints, pointI)
@ -122,9 +122,9 @@ void Foam::starMesh::markBoundaryFaces()
const labelList& facePointCells =
PointCells[facePoints[pointI]];
forAll(facePointCells, cellI)
forAll(facePointCells, celli)
{
const label curCellIndex = facePointCells[cellI];
const label curCellIndex = facePointCells[celli];
const faceList& curCellFaces =
cellFaces_[curCellIndex];
@ -137,8 +137,8 @@ void Foam::starMesh::markBoundaryFaces()
found = true;
// Set boundary face to the corresponding cell face
curBoundaryCellIDs[faceI] = curCellIndex;
curBoundaryCellFaceIDs[faceI] = cellFaceI;
curBoundaryCellIDs[facei] = curCellIndex;
curBoundaryCellFaceIDs[facei] = cellFaceI;
}
if (found) break;
}
@ -149,7 +149,7 @@ void Foam::starMesh::markBoundaryFaces()
if (!found)
{
FatalErrorInFunction
<< "Face " << faceI
<< "Face " << facei
<< " does not have neighbour cell."
<< " Face : " << endl << curFace << endl
<< "PROSTAR Command: vset,news,vlis";
@ -186,11 +186,11 @@ void Foam::starMesh::collectBoundaryFaces()
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
forAll(curBoundaryCellIDs, faceI)
forAll(curBoundaryCellIDs, facei)
{
patchFaces[faceI] =
cellFaces_[curBoundaryCellIDs[faceI]]
[curBoundaryCellFaceIDs[faceI]];
patchFaces[facei] =
cellFaces_[curBoundaryCellIDs[facei]]
[curBoundaryCellFaceIDs[facei]];
}
}

View File

@ -1423,9 +1423,9 @@ void Foam::starMesh::createCoupleMatches()
// Loop through all cells and reset faces for removal to zero size
const labelList crfToc = cellRemovedFaces.toc();
forAll(crfToc, cellI)
forAll(crfToc, celli)
{
const label curCell = crfToc[cellI];
const label curCell = crfToc[celli];
const SLList<label>& curRemovedFaces = cellRemovedFaces[curCell];
@ -1450,9 +1450,9 @@ void Foam::starMesh::createCoupleMatches()
const labelList cafToc = cellAddedFaces.toc();
// Insert the new faces into the list
forAll(cafToc, cellI)
forAll(cafToc, celli)
{
const label curCell = cafToc[cellI];
const label curCell = cafToc[celli];
const SLList<face>& curAddedFaces = cellAddedFaces[curCell];
@ -1464,11 +1464,11 @@ void Foam::starMesh::createCoupleMatches()
label nNewFaces = 0;
// copy original faces that have not been removed
forAll(oldFaces, faceI)
forAll(oldFaces, facei)
{
if (oldFaces[faceI].size())
if (oldFaces[facei].size())
{
newFaces[nNewFaces] = oldFaces[faceI];
newFaces[nNewFaces] = oldFaces[facei];
nNewFaces++;
}
}

View File

@ -47,11 +47,11 @@ void Foam::starMesh::createPolyBoundary()
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
forAll(curShapePatch, faceI)
forAll(curShapePatch, facei)
{
bool found = false;
const face& curFace = curShapePatch[faceI];
const face& curFace = curShapePatch[facei];
meshFaces_[nCreatedFaces] = curFace;
@ -64,10 +64,10 @@ void Foam::starMesh::createPolyBoundary()
const labelList& facePointCells =
PointCells[facePoints[pointI]];
forAll(facePointCells, cellI)
forAll(facePointCells, celli)
{
const faceList& curCellFaces =
cellFaces_[facePointCells[cellI]];
cellFaces_[facePointCells[celli]];
forAll(curCellFaces, cellFaceI)
{
@ -79,13 +79,13 @@ void Foam::starMesh::createPolyBoundary()
// Debugging
if
(
cellPolys_[facePointCells[cellI]][cellFaceI]
cellPolys_[facePointCells[celli]][cellFaceI]
!= -1
)
{
if
(
cellPolys_[facePointCells[cellI]][cellFaceI]
cellPolys_[facePointCells[celli]][cellFaceI]
> nInternalFaces_
)
{
@ -157,7 +157,7 @@ void Foam::starMesh::createPolyBoundary()
}
}
cellPolys_[facePointCells[cellI]][cellFaceI] =
cellPolys_[facePointCells[celli]][cellFaceI] =
nCreatedFaces;
nBoundaryFacesFound++;
@ -176,20 +176,20 @@ void Foam::starMesh::createPolyBoundary()
// check all cellPolys_ to see if there are any missing faces
label nMissingFaceFound = 0;
forAll(cellPolys_, cellI)
forAll(cellPolys_, celli)
{
const labelList& curFaces = cellPolys_[cellI];
const labelList& curFaces = cellPolys_[celli];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
if (curFaces[faceI] < 0)
if (curFaces[facei] < 0)
{
const face& missingFace = cellFaces_[cellI][faceI];
const face& missingFace = cellFaces_[celli][facei];
InfoInFunction
<< "Missing face found in cell " << cellI
<< ".\nType: " << cellShapes_[cellI].model().name()
<< ". STAR cell number: " << starCellID_[cellI]
<< "Missing face found in cell " << celli
<< ".\nType: " << cellShapes_[celli].model().name()
<< ". STAR cell number: " << starCellID_[celli]
<< ". Face: " << missingFace << endl;
nMissingFaceFound++;
@ -228,13 +228,13 @@ void Foam::starMesh::createPolyBoundary()
// (faces addressed once or more than twice)
labelList markupFaces(meshFaces_.size(), 0);
forAll(cellPolys_, cellI)
forAll(cellPolys_, celli)
{
const labelList& curFaces = cellPolys_[cellI];
const labelList& curFaces = cellPolys_[celli];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
markupFaces[curFaces[faceI]]++;
markupFaces[curFaces[facei]]++;
}
}
@ -245,15 +245,15 @@ void Foam::starMesh::createPolyBoundary()
label nProblemFacesFound = 0;
forAll(markupFaces, faceI)
forAll(markupFaces, facei)
{
if (markupFaces[faceI] != 2)
if (markupFaces[facei] != 2)
{
const face& problemFace = meshFaces_[faceI];
const face& problemFace = meshFaces_[facei];
InfoInFunction
<< "Problem with face " << faceI << ": addressed "
<< markupFaces[faceI] << " times (should be 2!). Face: "
<< "Problem with face " << facei << ": addressed "
<< markupFaces[facei] << " times (should be 2!). Face: "
<< problemFace << endl;
nProblemFacesFound++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,18 +40,18 @@ void Foam::starMesh::createPolyCells()
label maxFaces = 0;
forAll(cellPolys_, cellI)
forAll(cellPolys_, celli)
{
cell& curCell = cellPolys_[cellI];
cell& curCell = cellPolys_[celli];
curCell.setSize(cellFaces_[cellI].size());
curCell.setSize(cellFaces_[celli].size());
forAll(curCell, fI)
{
curCell[fI] = -1;
}
maxFaces += cellFaces_[cellI].size();
maxFaces += cellFaces_[celli].size();
}
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
@ -65,7 +65,7 @@ void Foam::starMesh::createPolyCells()
nInternalFaces_ = 0;
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
// Note:
// Insertion cannot be done in one go as the faces need to be
@ -73,7 +73,7 @@ void Foam::starMesh::createPolyCells()
// cells. Therefore, all neighbours will be detected first
// and then added in the correct order.
const faceList& curFaces = cellFaces_[cellI];
const faceList& curFaces = cellFaces_[celli];
// Record the neighbour cell
labelList neiCells(curFaces.size(), -1);
@ -84,14 +84,14 @@ void Foam::starMesh::createPolyCells()
label nNeighbours = 0;
// For all faces ...
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Skip faces that have already been matched
if (cellPolys_[cellI][faceI] >= 0) continue;
if (cellPolys_[celli][facei] >= 0) continue;
found = false;
const face& curFace = curFaces[faceI];
const face& curFace = curFaces[facei];
// get the list of labels
const labelList& curPoints = curFace;
@ -109,7 +109,7 @@ void Foam::starMesh::createPolyCells()
// reject neighbours with the lower label. This should
// also reject current cell.
if (curNei > cellI)
if (curNei > celli)
{
// get the list of search faces
const faceList& searchFaces = cellFaces_[curNei];
@ -122,8 +122,8 @@ void Foam::starMesh::createPolyCells()
found = true;
// Record the neighbour cell and face
neiCells[faceI] = curNei;
faceOfNeiCell[faceI] = neiFaceI;
neiCells[facei] = curNei;
faceOfNeiCell[facei] = neiFaceI;
nNeighbours++;
break;
@ -159,7 +159,7 @@ void Foam::starMesh::createPolyCells()
meshFaces_[nInternalFaces_] = curFaces[nextNei];
// Mark for owner
cellPolys_[cellI][nextNei] = nInternalFaces_;
cellPolys_[celli][nextNei] = nInternalFaces_;
// Mark for neighbour
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,21 +34,21 @@ void Foam::starMesh::fixCollapsedEdges()
{
cellFaces_.setSize(cellShapes_.size());
forAll(cellShapes_, cellI)
forAll(cellShapes_, celli)
{
cellFaces_[cellI] = cellShapes_[cellI].faces();
cellFaces_[celli] = cellShapes_[celli].faces();
}
// go through the faces and find if there exist faces with duplicate
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
faceList& curFaces = cellFaces_[cellI];
faceList& curFaces = cellFaces_[celli];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
face& vertexLabels = curFaces[faceI];
face& vertexLabels = curFaces[facei];
bool duplicatesFound = false;
@ -128,7 +128,7 @@ void Foam::starMesh::fixCollapsedEdges()
if (nNewVertices < 3)
{
FatalErrorInFunction
<< "Face " << faceI << " of cell " << cellI
<< "Face " << facei << " of cell " << celli
<< " is colapsed down to a point or edge, which is "
<< "not permitted" << endl
<< "original face: " << vertexLabels << endl

View File

@ -62,9 +62,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
label nMergeSets = 0;
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
const faceList& curFaces = cellFaces_[cellI];
const faceList& curFaces = cellFaces_[celli];
// create a list of all points for the cell with duplicates
// and find the shortest edge length
@ -73,11 +73,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
scalar pointMergeTol = GREAT;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
nPointsInCell += curFaces[faceI].size();
nPointsInCell += curFaces[facei].size();
edgeList curEdges = curFaces[faceI].edges();
edgeList curEdges = curFaces[facei].edges();
forAll(curEdges, edgeI)
{
@ -97,9 +97,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
labelList cellPoints(nPointsInCell);
label nAddedPoints = 0;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
const face& f = curFaces[faceI];
const face& f = curFaces[facei];
forAll(f, fI)
{
@ -252,15 +252,15 @@ void Foam::starMesh::mergeCoupleFacePoints()
// renumbering of all faces. This will only be used to see which
// points are still used!
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
faceList& prelimFaces = cellFaces_[cellI];
faceList& prelimFaces = cellFaces_[celli];
forAll(prelimFaces, faceI)
forAll(prelimFaces, facei)
{
face oldFacePoints = prelimFaces[faceI];
face oldFacePoints = prelimFaces[facei];
face& prelimFacePoints = prelimFaces[faceI];
face& prelimFacePoints = prelimFaces[facei];
forAll(prelimFacePoints, pointI)
{
@ -283,13 +283,13 @@ void Foam::starMesh::mergeCoupleFacePoints()
// re-create the point list and renumber the whole lot
renumberPoints = 0;
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
const faceList& curFaces = cellFaces_[cellI];
const faceList& curFaces = cellFaces_[celli];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
const face& curFacePoints = curFaces[faceI];
const face& curFacePoints = curFaces[facei];
forAll(curFacePoints, pointI)
{
@ -298,9 +298,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
}
}
forAll(cellShapes_, cellI)
forAll(cellShapes_, celli)
{
const labelList& curLabels = cellShapes_[cellI];
const labelList& curLabels = cellShapes_[celli];
forAll(curLabels, pointI)
{
@ -308,7 +308,7 @@ void Foam::starMesh::mergeCoupleFacePoints()
{
FatalErrorInFunction
<< "Error in point merging for cell "
<< cellI << ". STAR index: " << starCellID_[cellI]
<< celli << ". STAR index: " << starCellID_[celli]
<< ". " << endl
<< "Point index: " << curLabels[pointI] << " STAR index "
<< starPointID_[curLabels[pointI]] << endl
@ -346,15 +346,15 @@ void Foam::starMesh::mergeCoupleFacePoints()
Info<< "Renumbering all faces" << endl;
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
faceList& newFaces = cellFaces_[cellI];
faceList& newFaces = cellFaces_[celli];
forAll(newFaces, faceI)
forAll(newFaces, facei)
{
face oldFacePoints = newFaces[faceI];
face oldFacePoints = newFaces[facei];
face& newFacePoints = newFaces[faceI];
face& newFacePoints = newFaces[facei];
forAll(newFacePoints, pointI)
{
@ -375,11 +375,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
Info<< "Renumbering all cell shapes" << endl;
forAll(cellShapes_, cellI)
forAll(cellShapes_, celli)
{
labelList oldLabels = cellShapes_[cellI];
labelList oldLabels = cellShapes_[celli];
labelList& curLabels = cellShapes_[cellI];
labelList& curLabels = cellShapes_[celli];
forAll(curLabels, pointI)
{
@ -387,7 +387,7 @@ void Foam::starMesh::mergeCoupleFacePoints()
{
FatalErrorInFunction
<< "Error in point renumbering for cell "
<< cellI << ". STAR index: " << starCellID_[cellI]
<< celli << ". STAR index: " << starCellID_[celli]
<< ". " << endl
<< "Point index: " << curLabels[pointI] << " STAR index "
<< starPointID_[curLabels[pointI]] << " returns invalid "

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,20 +32,20 @@ Description
void Foam::starMesh::purgeCellShapes()
{
forAll(cellFaces_, cellI)
forAll(cellFaces_, celli)
{
const faceList& curFaces = cellFaces_[cellI];
const faceList& curFaces = cellFaces_[celli];
// Get model faces
faceList shapeFaces = cellShapes_[cellI].faces();
faceList shapeFaces = cellShapes_[celli].faces();
forAll(shapeFaces, faceI)
forAll(shapeFaces, facei)
{
bool found = false;
forAll(curFaces, i)
{
if (shapeFaces[faceI] == curFaces[i])
if (shapeFaces[facei] == curFaces[i])
{
found = true;
break;
@ -54,8 +54,8 @@ void Foam::starMesh::purgeCellShapes()
if (!found)
{
Info<< "Purging cell shape " << cellI << endl;
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
Info<< "Purging cell shape " << celli << endl;
cellShapes_[celli] = cellShape(*unknownPtr_, labelList(0));
break;
}
}

View File

@ -137,7 +137,7 @@ void Foam::starMesh::readBoundary()
IFstream boundaryFile(boundaryFileName);
for (label faceI=0; faceI<nFaces; faceI++)
for (label facei=0; facei<nFaces; facei++)
{
boundaryFile >> lineIndex;
@ -170,7 +170,7 @@ void Foam::starMesh::readBoundary()
)
{
//Info<< "Converting collapsed quad into triangle"
// << " for face " << faceI
// << " for face " << facei
// << " in Star boundary " << lineIndex << endl;
pointLabelsTri[0] = pointLabels[0];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -275,7 +275,7 @@ void Foam::starMesh::readCells()
labelList labels(24, label(-1));
label lineLabel, starLabel, regionLabel, typeFlag;
for (label cellI = 0; cellI < nCells; cellI++)
for (label celli = 0; celli < nCells; celli++)
{
label nLabels = 0;
@ -346,29 +346,29 @@ void Foam::starMesh::readCells()
} while (addOnToCell >= 0);
// Record STAR cell number (used for debugging)
starCellID_[cellI] = lineLabel;
starCellID_[celli] = lineLabel;
// insert STAR lookup addressing
starCellLabelLookup_[lineLabel] = cellI;
starCellLabelLookup_[lineLabel] = celli;
if (nLabels == 8)
{
addRegularCell(labels, cellI);
addRegularCell(labels, celli);
}
else
{
addSAMMcell(labels, cellI);
addSAMMcell(labels, celli);
}
// check cell labels
const labelList& curShapeLabels = cellShapes_[cellI];
const labelList& curShapeLabels = cellShapes_[celli];
forAll(curShapeLabels, i)
{
if (curShapeLabels[i] < 0)
{
FatalErrorInFunction
<< "Invalid vertex found in cell " << cellI
<< "Invalid vertex found in cell " << celli
<< ". STAR cell no: " << lineLabel
<< " labels: " << curShapeLabels
<< abort(FatalError);

View File

@ -80,11 +80,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
forAll(pFaces, i)
{
label faceI = pFaces[i];
label facei = pFaces[i];
if (mesh.faces()[faceI] == f)
if (mesh.faces()[facei] == f)
{
return faceI;
return facei;
}
}
@ -279,7 +279,7 @@ int main(int argc, char *argv[])
labelList tetPoints(4);
cellShapeList cells(nTets);
label cellI = 0;
label celli = 0;
while (eleStream.good())
{
@ -299,7 +299,7 @@ int main(int argc, char *argv[])
tetPoints[i] = nodeToPoint[nodeI];
}
cells[cellI++] = cellShape(tet, tetPoints);
cells[celli++] = cellShape(tet, tetPoints);
// Skip attributes
for (label i = 0; i < nElemAttr; i++)
@ -391,7 +391,7 @@ int main(int argc, char *argv[])
boundaryPatch.setSize(nFaces);
boundaryPatch = -1;
label faceI = 0;
label facei = 0;
// Region to patch conversion
Map<label> regionToPatch;
@ -422,7 +422,7 @@ int main(int argc, char *argv[])
if (findFace(mesh, f) >= mesh.nInternalFaces())
{
boundaryFaces[faceI] = f;
boundaryFaces[facei] = f;
if (nFaceAttr > 0)
{
@ -451,7 +451,7 @@ int main(int argc, char *argv[])
patchi = patchFind();
}
boundaryPatch[faceI] = patchi;
boundaryPatch[facei] = patchi;
// Skip remaining attributes
for (label i = 1; i < nFaceAttr; i++)
@ -460,15 +460,15 @@ int main(int argc, char *argv[])
}
}
faceI++;
facei++;
}
}
}
// Trim
boundaryFaces.setSize(faceI);
boundaryPatch.setSize(faceI);
boundaryFaces.setSize(facei);
boundaryPatch.setSize(facei);
// Print region to patch mapping
@ -500,11 +500,11 @@ int main(int argc, char *argv[])
// Sort boundaryFaces by patch using boundaryPatch.
List<DynamicList<face>> allPatchFaces(nPatches);
forAll(boundaryPatch, faceI)
forAll(boundaryPatch, facei)
{
label patchi = boundaryPatch[faceI];
label patchi = boundaryPatch[facei];
allPatchFaces[patchi].append(boundaryFaces[faceI]);
allPatchFaces[patchi].append(boundaryFaces[facei]);
}
Info<< "Patch sizes:" << endl;

View File

@ -106,9 +106,9 @@ void writePoints
forAll(cellLabels, i)
{
label cellI = cellLabels[i];
label celli = cellLabels[i];
const labelList& cEdges = mesh.cellEdges()[cellI];
const labelList& cEdges = mesh.cellEdges()[celli];
forAll(cEdges, cEdgeI)
{
@ -155,21 +155,21 @@ void writePoints
void writePoints
(
const polyMesh& mesh,
const label cellI,
const label celli,
const fileName& timeName
)
{
fileName fName
(
mesh.time().path()
/ "meshPoints_" + timeName + '_' + name(cellI) + ".obj"
/ "meshPoints_" + timeName + '_' + name(celli) + ".obj"
);
Info<< "Writing mesh points and edges to " << fName << endl;
OFstream pointStream(fName);
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
meshTools::writeOBJ(pointStream, mesh.faces(), mesh.points(), cFaces);
}
@ -189,9 +189,9 @@ void writeFaceCentres(const polyMesh& mesh,const fileName& timeName)
OFstream faceStream(faceFile);
forAll(mesh.faceCentres(), faceI)
forAll(mesh.faceCentres(), facei)
{
writeOBJ(mesh.faceCentres()[faceI], faceStream);
writeOBJ(mesh.faceCentres()[facei], faceStream);
}
}
@ -207,9 +207,9 @@ void writeCellCentres(const polyMesh& mesh, const fileName& timeName)
OFstream cellStream(cellFile);
forAll(mesh.cellCentres(), cellI)
forAll(mesh.cellCentres(), celli)
{
writeOBJ(mesh.cellCentres()[cellI], cellStream);
writeOBJ(mesh.cellCentres()[celli], cellStream);
}
}
@ -235,9 +235,9 @@ void writePatchCentres
OFstream patchFaceStream(faceFile);
forAll(pp.faceCentres(), faceI)
forAll(pp.faceCentres(), facei)
{
writeOBJ(pp.faceCentres()[faceI], patchFaceStream);
writeOBJ(pp.faceCentres()[facei], patchFaceStream);
}
}
}
@ -270,9 +270,9 @@ void writePatchFaces
writeOBJ(pp.localPoints()[pointI], patchFaceStream);
}
forAll(pp.localFaces(), faceI)
forAll(pp.localFaces(), facei)
{
const face& f = pp.localFaces()[faceI];
const face& f = pp.localFaces()[facei];
patchFaceStream<< 'f';
@ -464,9 +464,9 @@ int main(int argc, char *argv[])
}
if (doCell)
{
label cellI = args.optionRead<label>("cell");
label celli = args.optionRead<label>("cell");
writePoints(mesh, cellI, runTime.timeName());
writePoints(mesh, celli, runTime.timeName());
}
if (doPoint)
{
@ -476,7 +476,7 @@ int main(int argc, char *argv[])
}
if (doFace)
{
label faceI = args.optionRead<label>("face");
label facei = args.optionRead<label>("face");
fileName fName
(
@ -484,7 +484,7 @@ int main(int argc, char *argv[])
/ "meshPoints_"
+ runTime.timeName()
+ '_'
+ name(faceI)
+ name(facei)
+ ".obj"
);
@ -492,7 +492,7 @@ int main(int argc, char *argv[])
OFstream str(fName);
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
meshTools::writeOBJ(str, faceList(1, f), mesh.points());
}

View File

@ -188,10 +188,10 @@ int main(int argc, char *argv[])
const pointField& cellCentres = topo.cellCentres();
forAll(cellCentres, cellI)
forAll(cellCentres, celli)
{
//point cc = b.blockShape().centre(b.points());
const point& cc = cellCentres[cellI];
const point& cc = cellCentres[celli];
str << "v " << cc.x() << ' ' << cc.y() << ' ' << cc.z() << nl;
}
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
List<DynamicList<label>> zoneCells(nZones);
// Running cell counter
label cellI = 0;
label celli = 0;
// Largest zone so far
label freeZoneI = 0;
@ -289,12 +289,12 @@ int main(int argc, char *argv[])
forAll(blockCells, i)
{
zoneCells[zoneI].append(cellI++);
zoneCells[zoneI].append(celli++);
}
}
else
{
cellI += b.cells().size();
celli += b.cells().size();
}
}

View File

@ -744,9 +744,9 @@ int main(int argc, char *argv[])
layerExtrude.layerFaces()
)
);
forAll(addedCells, faceI)
forAll(addedCells, facei)
{
const labelList& aCells = addedCells[faceI];
const labelList& aCells = addedCells[facei];
forAll(aCells, i)
{
addedCellsSet.insert(aCells[i]);

View File

@ -426,14 +426,14 @@ void checkZoneInside
forAll(extrudeMeshFaces, i)
{
label faceI = extrudeMeshFaces[i];
label facei = extrudeMeshFaces[i];
label zoneI = zoneID[i];
if (isInternal[zoneI] != mesh.isInternalFace(faceI))
if (isInternal[zoneI] != mesh.isInternalFace(facei))
{
FatalErrorInFunction
<< "Zone " << zoneNames[zoneI]
<< " is not consistently all internal or all boundary faces."
<< " Face " << faceI << " at " << mesh.faceCentres()[faceI]
<< " Face " << facei << " at " << mesh.faceCentres()[facei]
<< " is the first occurrence."
<< exit(FatalError);
}
@ -532,17 +532,17 @@ label findUncoveredPatchFace
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
forAll(eFaces, i)
{
label faceI = eFaces[i];
label patchi = pbm.whichPatch(faceI);
label facei = eFaces[i];
label patchi = pbm.whichPatch(facei);
if
(
patchi != -1
&& !pbm[patchi].coupled()
&& !extrudeFaceSet.found(faceI)
&& !extrudeFaceSet.found(facei)
)
{
return faceI;
return facei;
}
}
return -1;
@ -568,17 +568,17 @@ label findUncoveredCyclicPatchFace
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
forAll(eFaces, i)
{
label faceI = eFaces[i];
label patchi = pbm.whichPatch(faceI);
label facei = eFaces[i];
label patchi = pbm.whichPatch(facei);
if
(
patchi != -1
&& isA<cyclicPolyPatch>(pbm[patchi])
&& !extrudeFaceSet.found(faceI)
&& !extrudeFaceSet.found(facei)
)
{
return faceI;
return facei;
}
}
return -1;
@ -705,14 +705,14 @@ void countExtrudePatches
// so choose any uncovered one. If none found put face in
// undetermined zone 'side' patch
label faceI = findUncoveredPatchFace
label facei = findUncoveredPatchFace
(
mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI]
);
if (faceI == -1)
if (facei == -1)
{
zoneSidePatch[minZoneID[edgeI]]++;
}
@ -927,21 +927,21 @@ void addCoupledPatches
// Cyclic patch since both procs the same. This cyclic should
// already exist in newPatches so no adding necessary.
label faceI = findUncoveredCyclicPatchFace
label facei = findUncoveredCyclicPatchFace
(
mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI]
);
if (faceI != -1)
if (facei != -1)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
label newPatchI = findPatchID
(
newPatches,
patches[patches.whichPatch(faceI)].name()
patches[patches.whichPatch(facei)].name()
);
sidePatchID[edgeI] = newPatchI;
@ -1305,26 +1305,26 @@ void extrudeGeometricProperties
// Work out layers. Guaranteed in columns so no fancy parallel bits.
forAll(extruder.faceToFaceMap(), faceI)
forAll(extruder.faceToFaceMap(), facei)
{
if (extruder.faceToFaceMap()[faceI] != 0)
if (extruder.faceToFaceMap()[facei] != 0)
{
// 'horizontal' face
label patchFaceI = mag(extruder.faceToFaceMap()[faceI])-1;
label patchFaceI = mag(extruder.faceToFaceMap()[facei])-1;
label cellI = regionMesh.faceOwner()[faceI];
if (regionMesh.isInternalFace(faceI))
label celli = regionMesh.faceOwner()[facei];
if (regionMesh.isInternalFace(facei))
{
cellI = max(cellI, regionMesh.faceNeighbour()[faceI]);
celli = max(celli, regionMesh.faceNeighbour()[facei]);
}
// Calculate layer from cell numbering (see createShellMesh)
label layerI = (cellI % model.nLayers());
label layerI = (celli % model.nLayers());
if
(
!regionMesh.isInternalFace(faceI)
&& extruder.faceToFaceMap()[faceI] > 0
!regionMesh.isInternalFace(facei)
&& extruder.faceToFaceMap()[facei] > 0
)
{
// Top face
@ -1333,7 +1333,7 @@ void extrudeGeometricProperties
// Recalculate based on extrusion model
faceCentres[faceI] = model
faceCentres[facei] = model
(
patchFaceCentres[patchFaceI],
extrudePatch.faceNormals()[patchFaceI],
@ -1343,10 +1343,10 @@ void extrudeGeometricProperties
else
{
// 'vertical face
label patchEdgeI = extruder.faceToEdgeMap()[faceI];
label patchEdgeI = extruder.faceToEdgeMap()[facei];
label layerI =
(
regionMesh.faceOwner()[faceI]
regionMesh.faceOwner()[facei]
% model.nLayers()
);
@ -1366,7 +1366,7 @@ void extrudeGeometricProperties
);
// Interpolate
faceCentres[faceI] = 0.5*(pt0+pt1);
faceCentres[facei] = 0.5*(pt0+pt1);
}
}
@ -1385,12 +1385,12 @@ void extrudeGeometricProperties
regionMesh.nCells()
);
forAll(extruder.cellToFaceMap(), cellI)
forAll(extruder.cellToFaceMap(), celli)
{
label patchFaceI = extruder.cellToFaceMap()[cellI];
label patchFaceI = extruder.cellToFaceMap()[celli];
// Calculate layer from cell numbering (see createShellMesh)
label layerI = (cellI % model.nLayers());
label layerI = (celli % model.nLayers());
// Recalculate based on extrusion model
point pt0 = model
@ -1407,7 +1407,7 @@ void extrudeGeometricProperties
);
// Interpolate
cellCentres[cellI] = 0.5*(pt0+pt1);
cellCentres[celli] = 0.5*(pt0+pt1);
}
@ -1417,29 +1417,29 @@ void extrudeGeometricProperties
OBJstream faceStr(regionMesh.time().path()/"faceCentres.obj");
OBJstream cellStr(regionMesh.time().path()/"cellCentres.obj");
forAll(faceCentres, faceI)
forAll(faceCentres, facei)
{
Pout<< "Model :" << faceCentres[faceI] << endl
<< "regionMesh:" << regionMesh.faceCentres()[faceI] << endl;
Pout<< "Model :" << faceCentres[facei] << endl
<< "regionMesh:" << regionMesh.faceCentres()[facei] << endl;
faceStr.write
(
linePointRef
(
faceCentres[faceI],
regionMesh.faceCentres()[faceI]
faceCentres[facei],
regionMesh.faceCentres()[facei]
)
);
}
forAll(cellCentres, cellI)
forAll(cellCentres, celli)
{
Pout<< "Model :" << cellCentres[cellI] << endl
<< "regionMesh:" << regionMesh.cellCentres()[cellI] << endl;
Pout<< "Model :" << cellCentres[celli] << endl
<< "regionMesh:" << regionMesh.cellCentres()[celli] << endl;
cellStr.write
(
linePointRef
(
cellCentres[cellI],
regionMesh.cellCentres()[cellI]
cellCentres[celli],
regionMesh.cellCentres()[celli]
)
);
}
@ -1798,8 +1798,8 @@ int main(int argc, char *argv[])
const faceSet& fz = zones[i];
forAllConstIter(faceSet, fz, iter)
{
label faceI = iter.key();
if (mesh.isInternalFace(faceI))
label facei = iter.key();
if (mesh.isInternalFace(facei))
{
FatalIOErrorIn(args.executable().c_str(), dict)
<< "faceSet " << fz.name()
@ -1807,13 +1807,13 @@ int main(int argc, char *argv[])
<< " This is not permitted."
<< exit(FatalIOError);
}
extrudeMeshFaces[nExtrudeFaces] = faceI;
zoneFaces[nExtrudeFaces] = mesh.faces()[faceI];
extrudeMeshFaces[nExtrudeFaces] = facei;
zoneFaces[nExtrudeFaces] = mesh.faces()[facei];
zoneID[nExtrudeFaces] = i;
zoneFlipMap[nExtrudeFaces] = false;
nExtrudeFaces++;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
isInternal[i] = true;
}
@ -1858,8 +1858,8 @@ int main(int argc, char *argv[])
const faceSet& fz = shadowZones[i];
forAllConstIter(faceSet, fz, iter)
{
label faceI = iter.key();
if (mesh.isInternalFace(faceI))
label facei = iter.key();
if (mesh.isInternalFace(facei))
{
FatalIOErrorIn(args.executable().c_str(), dict)
<< "faceSet " << fz.name()
@ -1867,7 +1867,7 @@ int main(int argc, char *argv[])
<< " This is not permitted."
<< exit(FatalIOError);
}
extrudeMeshShadowFaces[nShadowFaces] = faceI;
extrudeMeshShadowFaces[nShadowFaces] = facei;
zoneShadowFlipMap[nShadowFaces] = false;
zoneShadowID[nShadowFaces] = i;
nShadowFaces++;
@ -2042,10 +2042,10 @@ int main(int argc, char *argv[])
labelList extrudeTopPatchID(extrudePatch.size());
labelList extrudeBottomPatchID(extrudePatch.size());
forAll(zoneID, faceI)
forAll(zoneID, facei)
{
extrudeTopPatchID[faceI] = interRegionTopPatch[zoneID[faceI]];
extrudeBottomPatchID[faceI] = interRegionBottomPatch[zoneID[faceI]];
extrudeTopPatchID[facei] = interRegionTopPatch[zoneID[facei]];
extrudeBottomPatchID[facei] = interRegionBottomPatch[zoneID[facei]];
}
@ -2231,19 +2231,19 @@ int main(int argc, char *argv[])
}
else
{
label faceI = findUncoveredPatchFace
label facei = findUncoveredPatchFace
(
mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI]
);
if (faceI != -1)
if (facei != -1)
{
label newPatchI = findPatchID
(
regionPatches,
patches[patches.whichPatch(faceI)].name()
patches[patches.whichPatch(facei)].name()
);
ePatches.setSize(eFaces.size(), newPatchI);
}
@ -2283,10 +2283,10 @@ int main(int argc, char *argv[])
// Per local region an originating point
labelList localRegionPoints(localToGlobalRegion.size());
forAll(pointLocalRegions, faceI)
forAll(pointLocalRegions, facei)
{
const face& f = extrudePatch.localFaces()[faceI];
const face& pRegions = pointLocalRegions[faceI];
const face& f = extrudePatch.localFaces()[facei];
const face& pRegions = pointLocalRegions[facei];
forAll(pRegions, fp)
{
localRegionPoints[pRegions[fp]] = f[fp];
@ -2298,13 +2298,13 @@ int main(int argc, char *argv[])
{
pointField localSum(localToGlobalRegion.size(), Zero);
forAll(pointLocalRegions, faceI)
forAll(pointLocalRegions, facei)
{
const face& pRegions = pointLocalRegions[faceI];
const face& pRegions = pointLocalRegions[facei];
forAll(pRegions, fp)
{
label localRegionI = pRegions[fp];
localSum[localRegionI] += extrudePatch.faceNormals()[faceI];
localSum[localRegionI] += extrudePatch.faceNormals()[facei];
}
}
@ -2337,13 +2337,13 @@ int main(int argc, char *argv[])
scalar thickness = model().sumThickness(1);
forAll(pointLocalRegions, faceI)
forAll(pointLocalRegions, facei)
{
const face& f = extrudeFaces[faceI];
const face& f = extrudeFaces[facei];
forAll(f, fp)
{
label region = pointLocalRegions[faceI][fp];
label region = pointLocalRegions[facei][fp];
const point& pt = extrudePoints[f[fp]];
meshTools::writeOBJ(str, pt);

View File

@ -39,12 +39,12 @@ namespace Foam
void Foam::extrude2DMesh::check2D() const
{
const faceList& faces = mesh_.faces();
forAll(faces, faceI)
forAll(faces, facei)
{
if (faces[faceI].size() != 2)
if (faces[facei].size() != 2)
{
FatalErrorInFunction
<< "Face " << faceI << " size " << faces[faceI].size()
<< "Face " << facei << " size " << faces[facei].size()
<< " is not of size 2: mesh is not a valid two-dimensional "
<< "mesh" << exit(FatalError);
}
@ -205,15 +205,15 @@ void Foam::extrude2DMesh::setRefinement
{
label offset = layer * mesh_.nCells();
forAll(mesh_.cells(), cellI)
forAll(mesh_.cells(), celli)
{
meshMod.addCell
(
-1, //masterPointID,
-1, //masterEdgeID,
-1, //masterFaceID,
cellI + offset, //masterCellID,
mesh_.cellZones().whichZone(cellI) //zoneID
celli + offset, //masterCellID,
mesh_.cellZones().whichZone(celli) //zoneID
);
}
}
@ -262,18 +262,18 @@ void Foam::extrude2DMesh::setRefinement
label currentLayerOffset = layer * mesh_.nPoints();
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
label zoneID = mesh_.faceZones().whichZone(faceI);
label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneID != -1)
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
face newFace(4);
const face& f = faces[faceI];
const face& f = faces[facei];
newFace[0] = f[0] + currentLayerOffset;
newFace[1] = f[1] + currentLayerOffset;
newFace[2] = f[1] + nextLayerOffset;
@ -281,15 +281,15 @@ void Foam::extrude2DMesh::setRefinement
//{
// vector n = newFace.normal(pointField(meshMod.points()));
// label own = mesh_.faceOwner()[faceI];
// label own = mesh_.faceOwner()[facei];
// const labelList& ownPoints = mesh_.cellPoints()[own];
// point ownCc = sum(pointField(mesh_.points(), ownPoints))/ownPoints.size();
// label nei = mesh_.faceNeighbour()[faceI];
// label nei = mesh_.faceNeighbour()[facei];
// const labelList& neiPoints = mesh_.cellPoints()[nei];
// point neiCc = sum(pointField(mesh_.points(), neiPoints))/neiPoints.size();
// vector d = neiCc - ownCc;
// Pout<< "face:" << faceI << " at:" << f.centre(mesh_.points()) << endl
// Pout<< "face:" << facei << " at:" << f.centre(mesh_.points()) << endl
// << " own:" << own << " at:" << ownCc << endl
// << " nei:" << nei << " at:" << neiCc << endl
// << " sign:" << (n & d) << endl
@ -301,8 +301,8 @@ void Foam::extrude2DMesh::setRefinement
meshMod.addFace
(
newFace,
mesh_.faceOwner()[faceI] + offset, // own
mesh_.faceNeighbour()[faceI] + offset, // nei
mesh_.faceOwner()[facei] + offset, // own
mesh_.faceNeighbour()[facei] + offset, // nei
-1, // masterPointID
-1, // masterEdgeID
nFaces++, // masterFaceID
@ -315,8 +315,8 @@ void Foam::extrude2DMesh::setRefinement
if (debug)
{
Info<< newFace << " "
<< mesh_.faceOwner()[faceI] + offset << " "
<< mesh_.faceNeighbour()[faceI] + offset << " "
<< mesh_.faceOwner()[facei] + offset << " "
<< mesh_.faceNeighbour()[facei] + offset << " "
<< nFaces - 1
<< endl;
}
@ -333,18 +333,18 @@ void Foam::extrude2DMesh::setRefinement
label startFaceI = patches[patchi].start();
label endFaceI = startFaceI + patches[patchi].size();
for (label faceI = startFaceI; faceI < endFaceI; faceI++)
for (label facei = startFaceI; facei < endFaceI; facei++)
{
label zoneID = mesh_.faceZones().whichZone(faceI);
label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneID != -1)
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
face newFace(4);
const face& f = faces[faceI];
const face& f = faces[facei];
newFace[0] = f[0] + currentLayerOffset;
newFace[1] = f[1] + currentLayerOffset;
newFace[2] = f[1] + nextLayerOffset;
@ -355,7 +355,7 @@ void Foam::extrude2DMesh::setRefinement
meshMod.addFace
(
newFace,
mesh_.faceOwner()[faceI] + offset, // own
mesh_.faceOwner()[facei] + offset, // own
-1, // nei
-1, // masterPointID
-1, // masterEdgeID
@ -369,7 +369,7 @@ void Foam::extrude2DMesh::setRefinement
if (debug)
{
Info<< newFace << " "
<< mesh_.faceOwner()[faceI] + offset << " "
<< mesh_.faceOwner()[facei] + offset << " "
<< nFaces - 1
<< endl;
}
@ -379,9 +379,9 @@ void Foam::extrude2DMesh::setRefinement
// Add extra internal faces that need special treatment for owners and
// neighbours.
forAll(mesh_.cells(), cellI)
forAll(mesh_.cells(), celli)
{
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
face frontFace(cFaces.size());
@ -391,7 +391,7 @@ void Foam::extrude2DMesh::setRefinement
const face& f = faces[nextFaceI];
label nextPointI;
if (mesh_.faceOwner()[nextFaceI] == cellI)
if (mesh_.faceOwner()[nextFaceI] == celli)
{
frontFace[0] = f[0];
nextPointI = f[1];
@ -410,21 +410,21 @@ void Foam::extrude2DMesh::setRefinement
// Find face containing pointI
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
if (faceI != nextFaceI)
label facei = cFaces[cFaceI];
if (facei != nextFaceI)
{
const face& f = faces[faceI];
const face& f = faces[facei];
if (f[0] == nextPointI)
{
nextPointI = f[1];
nextFaceI = faceI;
nextFaceI = facei;
break;
}
else if (f[1] == nextPointI)
{
nextPointI = f[0];
nextFaceI = faceI;
nextFaceI = facei;
break;
}
}
@ -444,13 +444,13 @@ void Foam::extrude2DMesh::setRefinement
label nei = -1;
if (layer != nLayers - 1)
{
nei = cellI + offset + mesh_.nCells();
nei = celli + offset + mesh_.nCells();
}
meshMod.addFace
(
frontFace,
cellI + offset, // own
celli + offset, // own
nei, // nei
-1, // masterPointID
-1, // masterEdgeID
@ -464,7 +464,7 @@ void Foam::extrude2DMesh::setRefinement
if (debug)
{
Info<< frontFace << " "
<< cellI + offset << " "
<< celli + offset << " "
<< nei << " "
<< nFaces - 1
<< endl;
@ -475,9 +475,9 @@ void Foam::extrude2DMesh::setRefinement
// Generate front and back faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(mesh_.cells(), cellI)
forAll(mesh_.cells(), celli)
{
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
face frontFace(cFaces.size());
@ -487,7 +487,7 @@ void Foam::extrude2DMesh::setRefinement
const face& f = faces[nextFaceI];
label nextPointI;
if (mesh_.faceOwner()[nextFaceI] == cellI)
if (mesh_.faceOwner()[nextFaceI] == celli)
{
frontFace[0] = f[0];
nextPointI = f[1];
@ -506,21 +506,21 @@ void Foam::extrude2DMesh::setRefinement
// Find face containing pointI
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
if (faceI != nextFaceI)
label facei = cFaces[cFaceI];
if (facei != nextFaceI)
{
const face& f = faces[faceI];
const face& f = faces[facei];
if (f[0] == nextPointI)
{
nextPointI = f[1];
nextFaceI = faceI;
nextFaceI = facei;
break;
}
else if (f[1] == nextPointI)
{
nextPointI = f[0];
nextFaceI = faceI;
nextFaceI = facei;
break;
}
}
@ -531,7 +531,7 @@ void Foam::extrude2DMesh::setRefinement
meshMod.addFace
(
frontFace.reverseFace(),
cellI, // own
celli, // own
-1, // nei
-1, // masterPointID
-1, // masterEdgeID
@ -545,7 +545,7 @@ void Foam::extrude2DMesh::setRefinement
if (debug)
{
Info<< nl<<frontFace.reverseFace() << " "
<< cellI << " "
<< celli << " "
<< nFaces - 1
<< endl;
}
@ -561,7 +561,7 @@ void Foam::extrude2DMesh::setRefinement
meshMod.addFace
(
frontFace,
cellI + offset, // own
celli + offset, // own
-1, // nei
-1, // masterPointID
-1, // masterEdgeID
@ -575,7 +575,7 @@ void Foam::extrude2DMesh::setRefinement
if (debug)
{
Info<< frontFace << " "
<< cellI + offset << " "
<< celli + offset << " "
<< nFaces - 1
<< endl;
}

View File

@ -103,9 +103,9 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
label newFaceI = 0;
forAll(faceEdges, faceI)
forAll(faceEdges, facei)
{
const labelList& fEdges = faceEdges[faceI];
const labelList& fEdges = faceEdges[facei];
// Neighbouring faces
SortableList<label> nbr(fEdges.size(), -1);
@ -117,14 +117,14 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
label nbrFaceI = neighbour_[fEdges[feI]];
if (nbrFaceI == faceI)
if (nbrFaceI == facei)
{
nbrFaceI = owner_[fEdges[feI]];
}
if (faceI < nbrFaceI)
if (facei < nbrFaceI)
{
// faceI is master
// facei is master
nbr[feI] = nbrFaceI;
}
}

View File

@ -109,16 +109,16 @@ void Foam::DelaunayMesh<Triangulation>::addPatches
faces.setSize(nInternalFaces + nBoundaryFaces);
owner.setSize(nInternalFaces + nBoundaryFaces);
label faceI = nInternalFaces;
label facei = nInternalFaces;
forAll(patchFaces, p)
{
forAll(patchFaces[p], f)
{
faces[faceI] = patchFaces[p][f];
owner[faceI] = patchOwners[p][f];
faces[facei] = patchFaces[p][f];
owner[facei] = patchOwners[p][f];
faceI++;
facei++;
}
}
}
@ -429,7 +429,7 @@ Foam::DelaunayMesh<Triangulation>::createMesh
// Index the cells
label cellI = 0;
label celli = 0;
for
(
@ -445,11 +445,11 @@ Foam::DelaunayMesh<Triangulation>::createMesh
&& cit->real()
)
{
cellMap[cit->cellIndex()] = cellI++;
cellMap[cit->cellIndex()] = celli++;
}
}
label faceI = 0;
label facei = 0;
labelList verticesOnTriFace(3, label(-1));
face newFace(verticesOnTriFace);
@ -566,16 +566,16 @@ Foam::DelaunayMesh<Triangulation>::createMesh
neighbourCell = c1I;
}
faces[faceI] = newFace;
owner[faceI] = ownerCell;
neighbour[faceI] = neighbourCell;
faceI++;
faces[facei] = newFace;
owner[facei] = ownerCell;
neighbour[facei] = neighbourCell;
facei++;
}
}
faces.setSize(faceI);
owner.setSize(faceI);
neighbour.setSize(faceI);
faces.setSize(facei);
owner.setSize(facei);
neighbour.setSize(facei);
sortFaces(faces, owner, neighbour);
@ -583,7 +583,7 @@ Foam::DelaunayMesh<Triangulation>::createMesh
addPatches
(
faceI,
facei,
faces,
owner,
patchDicts,

View File

@ -164,13 +164,13 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
while (true)
{
// Determine/update the status of each cell
forAll(volumeStatus, cellI)
forAll(volumeStatus, celli)
{
if (volumeStatus[cellI] == volumeType::UNKNOWN)
if (volumeStatus[celli] == volumeType::UNKNOWN)
{
treeBoundBox cellBb
(
mesh_.cells()[cellI].points
mesh_.cells()[celli].points
(
mesh_.faces(),
mesh_.points()
@ -179,15 +179,15 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
if (geometry.overlaps(cellBb))
{
volumeStatus[cellI] = volumeType::MIXED;
volumeStatus[celli] = volumeType::MIXED;
}
else if (geometry.inside(cellBb.midpoint()))
{
volumeStatus[cellI] = volumeType::INSIDE;
volumeStatus[celli] = volumeType::INSIDE;
}
else
{
volumeStatus[cellI] = volumeType::OUTSIDE;
volumeStatus[celli] = volumeType::OUTSIDE;
}
}
}
@ -211,17 +211,17 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
forAll(newCellsToRefine, nCTRI)
{
label cellI = newCellsToRefine[nCTRI];
label celli = newCellsToRefine[nCTRI];
if (volumeStatus[cellI] == volumeType::MIXED)
if (volumeStatus[celli] == volumeType::MIXED)
{
volumeStatus[cellI] = volumeType::UNKNOWN;
volumeStatus[celli] = volumeType::UNKNOWN;
}
icellWeights[cellI] = max
icellWeights[celli] = max
(
1.0,
icellWeights[cellI]/8.0
icellWeights[celli]/8.0
);
}
@ -283,13 +283,13 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
}
// Determine/update the status of each cell
forAll(volumeStatus, cellI)
forAll(volumeStatus, celli)
{
if (volumeStatus[cellI] == volumeType::UNKNOWN)
if (volumeStatus[celli] == volumeType::UNKNOWN)
{
treeBoundBox cellBb
(
mesh_.cells()[cellI].points
mesh_.cells()[celli].points
(
mesh_.faces(),
mesh_.points()
@ -298,15 +298,15 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
if (geometry.overlaps(cellBb))
{
volumeStatus[cellI] = volumeType::MIXED;
volumeStatus[celli] = volumeType::MIXED;
}
else if (geometry.inside(cellBb.midpoint()))
{
volumeStatus[cellI] = volumeType::INSIDE;
volumeStatus[celli] = volumeType::INSIDE;
}
else
{
volumeStatus[cellI] = volumeType::OUTSIDE;
volumeStatus[celli] = volumeType::OUTSIDE;
}
}
}
@ -318,11 +318,11 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
{
DynamicList<label> cellsToRemove;
forAll(volumeStatus, cellI)
forAll(volumeStatus, celli)
{
if (volumeStatus[cellI] == volumeType::OUTSIDE)
if (volumeStatus[celli] == volumeType::OUTSIDE)
{
cellsToRemove.append(cellI);
cellsToRemove.append(celli);
}
}
@ -503,7 +503,7 @@ void Foam::backgroundMeshDecomposition::printMeshData
bool Foam::backgroundMeshDecomposition::refineCell
(
label cellI,
label celli,
volumeType volType,
scalar& weightEstimate
) const
@ -515,7 +515,7 @@ bool Foam::backgroundMeshDecomposition::refineCell
treeBoundBox cellBb
(
mesh_.cells()[cellI].points
mesh_.cells()[celli].points
(
mesh_.faces(),
mesh_.points()
@ -637,29 +637,29 @@ Foam::labelList Foam::backgroundMeshDecomposition::selectRefinementCells
labelHashSet cellsToRefine;
// Determine/update the status of each cell
forAll(volumeStatus, cellI)
forAll(volumeStatus, celli)
{
if (volumeStatus[cellI] == volumeType::MIXED)
if (volumeStatus[celli] == volumeType::MIXED)
{
if (meshCutter_.cellLevel()[cellI] < minLevels_)
if (meshCutter_.cellLevel()[celli] < minLevels_)
{
cellsToRefine.insert(cellI);
cellsToRefine.insert(celli);
}
}
if (volumeStatus[cellI] != volumeType::OUTSIDE)
if (volumeStatus[celli] != volumeType::OUTSIDE)
{
if
(
refineCell
(
cellI,
volumeStatus[cellI],
icellWeights[cellI]
celli,
volumeStatus[celli],
icellWeights[celli]
)
)
{
cellsToRefine.insert(cellI);
cellsToRefine.insert(celli);
}
}
}
@ -943,9 +943,9 @@ Foam::backgroundMeshDecomposition::distribute
forAll(newCellsToRefine, nCTRI)
{
label cellI = newCellsToRefine[nCTRI];
label celli = newCellsToRefine[nCTRI];
icellWeights[cellI] /= 8.0;
icellWeights[celli] /= 8.0;
}
// Mesh changing engine.

View File

@ -167,7 +167,7 @@ class backgroundMeshDecomposition
// it
bool refineCell
(
label cellI,
label celli,
volumeType volType,
scalar& weightEstimate
) const;

View File

@ -133,7 +133,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh
points.setSize(vertI);
pointToDelaunayVertex.setSize(vertI);
label cellI = 0;
label celli = 0;
for
(
@ -144,7 +144,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh
{
if (cit->internalOrBoundaryDualVertex())
{
cit->cellIndex() = cellI++;
cit->cellIndex() = celli++;
}
else
{
@ -170,7 +170,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh
neighbour.setSize(number_of_finite_facets());
label faceI = 0;
label facei = 0;
labelList verticesOnTriFace(3, label(-1));
@ -262,14 +262,14 @@ void Foam::conformalVoronoiMesh::calcTetMesh
neighbourCell = c1I;
}
faces[faceI] = newFace;
owner[faceI] = ownerCell;
neighbour[faceI] = neighbourCell;
faceI++;
faces[facei] = newFace;
owner[facei] = ownerCell;
neighbour[facei] = neighbourCell;
facei++;
}
}
label nInternalFaces = faceI;
label nInternalFaces = facei;
faces.setSize(nInternalFaces);
owner.setSize(nInternalFaces);
@ -910,11 +910,11 @@ void Foam::conformalVoronoiMesh::checkCellSizing()
pointField cellsToResize(cellsToResizeMap.size());
label count = 0;
for (label cellI = 0; cellI < pMesh.nCells(); ++cellI)
for (label celli = 0; celli < pMesh.nCells(); ++celli)
{
if (cellsToResizeMap.found(cellI))
if (cellsToResizeMap.found(celli))
{
cellsToResize[count++] = pMesh.cellCentres()[cellI];
cellsToResize[count++] = pMesh.cellCentres()[celli];
}
}
@ -1152,9 +1152,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
// forAllConstIter(labelHashSet, limitCells, iter)
// {
// label cellI = iter.key();
// label celli = iter.key();
// const labelList& cP = cellPts[cellI];
// const labelList& cP = cellPts[celli];
// forAll(cP, cPI)
// {
@ -2527,17 +2527,17 @@ void Foam::conformalVoronoiMesh::addPatches
owner.setSize(nInternalFaces + nBoundaryFaces);
boundaryFacesToRemove.setSize(nInternalFaces + nBoundaryFaces);
label faceI = nInternalFaces;
label facei = nInternalFaces;
forAll(patchFaces, p)
{
forAll(patchFaces[p], f)
{
faces[faceI] = patchFaces[p][f];
owner[faceI] = patchOwners[p][f];
boundaryFacesToRemove[faceI] = indirectPatchFace[p][f];
faces[facei] = patchFaces[p][f];
owner[facei] = patchOwners[p][f];
boundaryFacesToRemove[facei] = indirectPatchFace[p][f];
faceI++;
facei++;
}
}
}
@ -2623,7 +2623,7 @@ Foam::labelList Foam::conformalVoronoiMesh::removeUnusedCells
cellUsed[neighbour[nI]] = true;
}
label cellI = 0;
label celli = 0;
labelList oldToNew(cellUsed.size(), label(-1));
@ -2634,11 +2634,11 @@ Foam::labelList Foam::conformalVoronoiMesh::removeUnusedCells
{
if (cellUsed[cellUI] == true)
{
oldToNew[cellUI] = cellI++;
oldToNew[cellUI] = celli++;
}
}
labelList newToOld(invert(cellI, oldToNew));
labelList newToOld(invert(celli, oldToNew));
// Find all of the unused cells, create a list of them, then
// subtract one from each owner and neighbour entry for each of

View File

@ -132,30 +132,30 @@ Foam::label Foam::conformalVoronoiMesh::findVerticesNearBoundaries()
continue;
}
for (label cellI = 0; cellI < 4; ++cellI)
for (label celli = 0; celli < 4; ++celli)
{
Vertex_handle v = c1->vertex(cellI);
Vertex_handle v = c1->vertex(celli);
if
(
!is_infinite(v)
&& v->internalPoint()
&& fit->second != cellI
&& fit->second != celli
)
{
v->setNearBoundary();
}
}
for (label cellI = 0; cellI < 4; ++cellI)
for (label celli = 0; celli < 4; ++celli)
{
Vertex_handle v = c2->vertex(cellI);
Vertex_handle v = c2->vertex(celli);
if
(
!is_infinite(v)
&& v->internalPoint()
&& fit->second != cellI
&& fit->second != celli
)
{
v->setNearBoundary();

View File

@ -179,7 +179,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
if (foamyHexMeshControls().writeTetDualMesh())
{
label cellI = 0;
label celli = 0;
for
(
Finite_cells_iterator cit = finite_cells_begin();
@ -193,7 +193,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
&& !is_infinite(cit)
)
{
cit->cellIndex() = cellI++;
cit->cellIndex() = celli++;
}
}
@ -213,20 +213,20 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// // or patch face (negative index)
// labelList vertexToDualAddressing(number_of_vertices(), 0);
//
// forAll(cellToDelaunayVertex, cellI)
// forAll(cellToDelaunayVertex, celli)
// {
// label vertI = cellToDelaunayVertex[cellI];
// label vertI = cellToDelaunayVertex[celli];
//
// if (vertexToDualAddressing[vertI] != 0)
// {
// FatalErrorInFunction
// << "Delaunay vertex " << vertI
// << " from cell " << cellI
// << " from cell " << celli
// << " is already mapped to "
// << vertexToDualAddressing[vertI]
// << exit(FatalError);
// }
// vertexToDualAddressing[vertI] = cellI+1;
// vertexToDualAddressing[vertI] = celli+1;
// }
//
// forAll(patchToDelaunayVertex, patchi)
@ -356,15 +356,15 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
//
// if (index > 0)
// {
// label cellI = index-1;
// dualPoints[pointI] = mesh.cellCentres()[cellI];
// label celli = index-1;
// dualPoints[pointI] = mesh.cellCentres()[celli];
// }
// else if (index < 0)
// {
// label faceI = -index-1;
// if (faceI >= mesh.nInternalFaces())
// label facei = -index-1;
// if (facei >= mesh.nInternalFaces())
// {
// dualPoints[pointI] = mesh.faceCentres()[faceI];
// dualPoints[pointI] = mesh.faceCentres()[facei];
// }
// }
// }
@ -736,9 +736,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
{
label nReorderedFaces = 0;
forAll(faceMap, faceI)
forAll(faceMap, facei)
{
if (faceMap[faceI] != -1)
if (faceMap[facei] != -1)
{
nReorderedFaces++;
}
@ -752,11 +752,11 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
// Rotate faces (rotation is already in new face indices).
label nRotated = 0;
forAll(rotation, faceI)
forAll(rotation, facei)
{
if (rotation[faceI] != 0)
if (rotation[facei] != 0)
{
faces[faceI] = rotateList(faces[faceI], rotation[faceI]);
faces[facei] = rotateList(faces[facei], rotation[facei]);
nRotated++;
}
}
@ -961,11 +961,11 @@ void Foam::conformalVoronoiMesh::writeMesh
labelList addr(boundaryFacesToRemove.count());
label count = 0;
forAll(boundaryFacesToRemove, faceI)
forAll(boundaryFacesToRemove, facei)
{
if (boundaryFacesToRemove[faceI])
if (boundaryFacesToRemove[facei])
{
addr[count++] = faceI;
addr[count++] = facei;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -98,22 +98,22 @@ bool Foam::conformalVoronoiMesh::distributeBackground(const Triangulation& mesh)
{
pointFromPoint v = topoint(vit->point());
label cellI = cellSearch.findCell(v);
label celli = cellSearch.findCell(v);
if (cellI == -1)
if (celli == -1)
{
// Pout<< "findCell conformalVoronoiMesh::distribute "
// << "findCell "
// << vit->type() << " "
// << vit->index() << " "
// << v << " "
// << cellI
// << " find nearest cellI ";
// << celli
// << " find nearest celli ";
cellI = cellSearch.findNearestCell(v);
celli = cellSearch.findNearestCell(v);
}
cellVertices[cellI]++;
cellVertices[celli]++;
}
}

View File

@ -116,15 +116,15 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk
boolList blockedFace(mesh.nFaces());
selectSeparatedCoupledFaces(mesh, blockedFace);
forAll(faceToSurface, faceI)
forAll(faceToSurface, facei)
{
if (faceToSurface[faceI] == -1)
if (faceToSurface[facei] == -1)
{
blockedFace[faceI] = false;
blockedFace[facei] = false;
}
else
{
blockedFace[faceI] = true;
blockedFace[facei] = true;
}
}
// No need to sync since namedSurfaceIndex already is synced
@ -156,16 +156,16 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk
// Find the region containing the insidePoint
label keepRegionI = -1;
label cellI = mesh.findCell(insidePoint);
label celli = mesh.findCell(insidePoint);
if (cellI != -1)
if (celli != -1)
{
keepRegionI = cellRegion[cellI];
keepRegionI = cellRegion[celli];
}
reduce(keepRegionI, maxOp<label>());
Info<< " For surface " << surfName
<< " found point " << insidePoint << " in cell " << cellI
<< " found point " << insidePoint << " in cell " << celli
<< " in global region " << keepRegionI
<< " out of " << cellRegion.nRegions() << " regions." << endl;
@ -179,22 +179,22 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk
}
// Set all cells with this region
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (cellRegion[cellI] == keepRegionI)
if (cellRegion[celli] == keepRegionI)
{
if (cellToSurface[cellI] == -2)
if (cellToSurface[celli] == -2)
{
cellToSurface[cellI] = surfI;
cellToSurface[celli] = surfI;
}
else if (cellToSurface[cellI] != surfI)
else if (cellToSurface[celli] != surfI)
{
WarningInFunction
<< "Cell " << cellI
<< " at " << mesh.cellCentres()[cellI]
<< "Cell " << celli
<< " at " << mesh.cellCentres()[celli]
<< " is inside surface " << surfName
<< " but already marked as being in zone "
<< cellToSurface[cellI] << endl
<< cellToSurface[celli] << endl
<< "This can happen if your surfaces are not"
<< " (sufficiently) closed."
<< endl;
@ -343,65 +343,65 @@ void Foam::conformalVoronoiMesh::calcFaceZones
syncTools::swapBoundaryFaceList(mesh, neiFaceOwner);
forAll(faces, faceI)
forAll(faces, facei)
{
const label ownerSurfaceI = cellToSurface[faceOwner[faceI]];
const label ownerSurfacei = cellToSurface[faceOwner[facei]];
if (faceToSurface[faceI] >= 0)
if (faceToSurface[facei] >= 0)
{
continue;
}
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
const label neiSurfaceI = cellToSurface[faceNeighbour[faceI]];
const label neiSurfacei = cellToSurface[faceNeighbour[facei]];
if
(
(ownerSurfaceI >= 0 || neiSurfaceI >= 0)
&& ownerSurfaceI != neiSurfaceI
(ownerSurfacei >= 0 || neiSurfacei >= 0)
&& ownerSurfacei != neiSurfacei
)
{
flipMap[faceI] =
flipMap[facei] =
(
ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI)
ownerSurfacei == max(ownerSurfacei, neiSurfacei)
? false
: true
);
faceToSurface[faceI] = max(ownerSurfaceI, neiSurfaceI);
faceToSurface[facei] = max(ownerSurfacei, neiSurfacei);
}
}
else
{
label patchID = mesh.boundaryMesh().whichPatch(faceI);
label patchID = mesh.boundaryMesh().whichPatch(facei);
if (mesh.boundaryMesh()[patchID].coupled())
{
const label neiSurfaceI =
neiFaceOwner[faceI - mesh.nInternalFaces()];
const label neiSurfacei =
neiFaceOwner[facei - mesh.nInternalFaces()];
if
(
(ownerSurfaceI >= 0 || neiSurfaceI >= 0)
&& ownerSurfaceI != neiSurfaceI
(ownerSurfacei >= 0 || neiSurfacei >= 0)
&& ownerSurfacei != neiSurfacei
)
{
flipMap[faceI] =
flipMap[facei] =
(
ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI)
ownerSurfacei == max(ownerSurfacei, neiSurfacei)
? false
: true
);
faceToSurface[faceI] = max(ownerSurfaceI, neiSurfaceI);
faceToSurface[facei] = max(ownerSurfacei, neiSurfacei);
}
}
else
{
if (ownerSurfaceI >= 0)
if (ownerSurfacei >= 0)
{
faceToSurface[faceI] = ownerSurfaceI;
faceToSurface[facei] = ownerSurfacei;
}
}
}
@ -430,23 +430,23 @@ void Foam::conformalVoronoiMesh::calcFaceZones
);
// Use intersection of cellCentre connections
forAll(faces, faceI)
forAll(faces, facei)
{
if (faceToSurface[faceI] >= 0)
if (faceToSurface[facei] >= 0)
{
continue;
}
label patchID = mesh.boundaryMesh().whichPatch(faceI);
label patchID = mesh.boundaryMesh().whichPatch(facei);
const label own = faceOwner[faceI];
const label own = faceOwner[facei];
List<pointIndexHit> surfHit;
labelList hitSurface;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
const label nei = faceNeighbour[faceI];
const label nei = faceNeighbour[facei];
geometryToConformTo().findSurfaceAllIntersections
(
@ -461,7 +461,7 @@ void Foam::conformalVoronoiMesh::calcFaceZones
geometryToConformTo().findSurfaceAllIntersections
(
cellCentres[own],
neiCc[faceI - mesh.nInternalFaces()],
neiCc[facei - mesh.nInternalFaces()],
surfHit,
hitSurface
);
@ -481,19 +481,19 @@ void Foam::conformalVoronoiMesh::calcFaceZones
norm
);
vector fN = faces[faceI].normal(mesh.points());
vector fN = faces[facei].normal(mesh.points());
fN /= mag(fN) + SMALL;
if ((norm[0] & fN) < 0)
{
flipMap[faceI] = true;
flipMap[facei] = true;
}
else
{
flipMap[faceI] = false;
flipMap[facei] = false;
}
faceToSurface[faceI] = hitSurface[0];
faceToSurface[facei] = hitSurface[0];
}
}
}
@ -509,9 +509,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
// {
// forAll(pp, i)
// {
// label faceI = pp.start()+i;
// label ownSurface = cellToSurface[faceOwner[faceI]];
// neiCellSurface[faceI - mesh.nInternalFaces()] = ownSurface;
// label facei = pp.start()+i;
// label ownSurface = cellToSurface[faceOwner[facei]];
// neiCellSurface[facei - mesh.nInternalFaces()] = ownSurface;
// }
// }
// }
@ -525,15 +525,15 @@ void Foam::conformalVoronoiMesh::calcFaceZones
// {
// forAll(pp, i)
// {
// label faceI = pp.start()+i;
// label ownSurface = cellToSurface[faceOwner[faceI]];
// label facei = pp.start()+i;
// label ownSurface = cellToSurface[faceOwner[facei]];
// label neiSurface =
// neiCellSurface[faceI-mesh.nInternalFaces()];
// neiCellSurface[facei-mesh.nInternalFaces()];
//
// if (faceToSurface[faceI] == -1 && (ownSurface != neiSurface))
// if (faceToSurface[facei] == -1 && (ownSurface != neiSurface))
// {
// // Give face the max cell zone
// faceToSurface[faceI] = max(ownSurface, neiSurface);
// faceToSurface[facei] = max(ownSurface, neiSurface);
// }
// }
// }
@ -617,13 +617,13 @@ void Foam::conformalVoronoiMesh::addZones
// Topochange container
polyTopoChange meshMod(mesh);
forAll(cellToSurface, cellI)
forAll(cellToSurface, celli)
{
label surfaceI = cellToSurface[cellI];
label surfacei = cellToSurface[celli];
if (surfaceI >= 0)
if (surfacei >= 0)
{
label zoneI = surfaceToCellZone[surfaceI];
label zoneI = surfaceToCellZone[surfacei];
if (zoneI >= 0)
{
@ -631,7 +631,7 @@ void Foam::conformalVoronoiMesh::addZones
(
polyModifyCell
(
cellI,
celli,
false, // removeFromZone
zoneI
)
@ -643,55 +643,55 @@ void Foam::conformalVoronoiMesh::addZones
const labelList& faceOwner = mesh.faceOwner();
const labelList& faceNeighbour = mesh.faceNeighbour();
forAll(faceToSurface, faceI)
forAll(faceToSurface, facei)
{
label surfaceI = faceToSurface[faceI];
label surfacei = faceToSurface[facei];
if (surfaceI < 0)
if (surfacei < 0)
{
continue;
}
label patchID = mesh.boundaryMesh().whichPatch(faceI);
label patchID = mesh.boundaryMesh().whichPatch(facei);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label own = faceOwner[faceI];
label nei = faceNeighbour[faceI];
label own = faceOwner[facei];
label nei = faceNeighbour[facei];
meshMod.setAction
(
polyModifyFace
(
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faces()[facei], // modified face
facei, // label of face
own, // owner
nei, // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
surfaceToFaceZone[surfaceI], // zone for face
flipMap[faceI] // face flip in zone
surfaceToFaceZone[surfacei], // zone for face
flipMap[facei] // face flip in zone
)
);
}
else if (patchID != -1 && mesh.boundaryMesh()[patchID].coupled())
{
label own = faceOwner[faceI];
label own = faceOwner[facei];
meshMod.setAction
(
polyModifyFace
(
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faces()[facei], // modified face
facei, // label of face
own, // owner
-1, // neighbour
false, // face flip
patchID, // patch for face
false, // remove from zone
surfaceToFaceZone[surfaceI], // zone for face
flipMap[faceI] // face flip in zone
surfaceToFaceZone[surfacei], // zone for face
flipMap[facei] // face flip in zone
)
);
}

View File

@ -255,7 +255,7 @@ autoPtr<polyMesh> generateHexMesh
cellShapeList cellShapes(nCells[0]*nCells[1]*nCells[2]);
labelList hexPoints(8);
label cellI = 0;
label celli = 0;
for (label i = 0; i < nCells[0]; i++)
{
for (label j = 0; j < nCells[1]; j++)
@ -270,7 +270,7 @@ autoPtr<polyMesh> generateHexMesh
hexPoints[5] = vtxLabel(nCells, i+1, j, k+1);
hexPoints[6] = vtxLabel(nCells, i+1, j+1, k+1);
hexPoints[7] = vtxLabel(nCells, i, j+1, k+1);
cellShapes[cellI++] = cellShape(hex, hexPoints);
cellShapes[celli++] = cellShape(hex, hexPoints);
}
}
}
@ -627,11 +627,11 @@ int main(int argc, char *argv[])
scalarField distSqr(cellDistance.size());
const labelList& cellLevel = backgroundMesh.cellLevel();
forAll(cellLevel, cellI)
forAll(cellLevel, celli)
{
// The largest edge of the cell will always be less than the
// span of the bounding box of the cell.
distSqr[cellI] = magSqr(cellSize)/pow(2, cellLevel[cellI]);
distSqr[celli] = magSqr(cellSize)/pow(2, cellLevel[celli]);
}
{
@ -682,12 +682,12 @@ int main(int argc, char *argv[])
);
{
scalarField pointDistSqr(fvm.nPoints(), -sqr(GREAT));
for (label faceI = 0; faceI < fvm.nInternalFaces(); faceI++)
for (label facei = 0; facei < fvm.nInternalFaces(); facei++)
{
label own = fvm.faceOwner()[faceI];
label own = fvm.faceOwner()[facei];
label ownDistSqr = distSqr[own];
const face& f = fvm.faces()[faceI];
const face& f = fvm.faces()[facei];
forAll(f, fp)
{
pointDistSqr[f[fp]] = max(pointDistSqr[f[fp]], ownDistSqr);

View File

@ -243,9 +243,9 @@ Foam::shortEdgeFilter2D::filter()
// List of number of vertices in a face.
labelList newFaceVertexCount(faces.size(), -1);
forAll(faces, faceI)
forAll(faces, facei)
{
newFaceVertexCount[faceI] = faces[faceI].size();
newFaceVertexCount[facei] = faces[facei].size();
}
// Check if the point is a boundary point. Flag if it is so that
@ -456,9 +456,9 @@ Foam::shortEdgeFilter2D::filter()
label newFaceSize = 0;
// Now need to iterate over the faces and remove points. Global index.
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
newFace.clear();
newFace.setSize(f.size());
@ -526,7 +526,7 @@ Foam::shortEdgeFilter2D::filter()
else
{
FatalErrorInFunction
<< "Only " << newFace.size() << " in face " << faceI
<< "Only " << newFace.size() << " in face " << facei
<< exit(FatalError);
}
}

View File

@ -157,13 +157,13 @@ int main(int argc, char *argv[])
// Assign all visited faces to current patch
label nVisited = 0;
forAll(visited, faceI)
forAll(visited, facei)
{
if (visited[faceI])
if (visited[facei])
{
nVisited++;
patchIDs[faceI] = newPatchI;
patchIDs[facei] = newPatchI;
}
}
@ -234,11 +234,11 @@ int main(int argc, char *argv[])
// have to do the geometric stuff.
const labelList& meshFace = bMesh.meshFace();
forAll(patchIDs, faceI)
forAll(patchIDs, facei)
{
label meshFaceI = meshFace[faceI];
label meshFaceI = meshFace[facei];
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[faceI]);
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[facei]);
}
polyMeshRepatcher.repatch();

View File

@ -156,9 +156,9 @@ bool Foam::checkWedges
// Check all non-wedge faces
label nEdgesInError = 0;
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fp)
{
@ -200,7 +200,7 @@ bool Foam::checkWedges
// Ok if purely in empty directions.
if (nNonEmptyDirs > 0)
{
if (edgesInError.insert(edge(p0, p1), faceI))
if (edgesInError.insert(edge(p0, p1), facei))
{
nEdgesInError++;
}
@ -209,7 +209,7 @@ bool Foam::checkWedges
else if (nEmptyDirs > 1)
{
// Always an error
if (edgesInError.insert(edge(p0, p1), faceI))
if (edgesInError.insert(edge(p0, p1), facei))
{
nEdgesInError++;
}
@ -274,9 +274,9 @@ namespace Foam
// lists of size cpp to transform.
List<pointField> newPts(pts.size());
forAll(pts, faceI)
forAll(pts, facei)
{
newPts[faceI].setSize(pts[faceI].size());
newPts[facei].setSize(pts[facei].size());
}
label index = 0;
@ -286,12 +286,12 @@ namespace Foam
// Extract for every face the i'th position
pointField ptsAtIndex(pts.size(), Zero);
forAll(cpp, faceI)
forAll(cpp, facei)
{
const pointField& facePts = pts[faceI];
const pointField& facePts = pts[facei];
if (facePts.size() > index)
{
ptsAtIndex[faceI] = facePts[index];
ptsAtIndex[facei] = facePts[index];
n++;
}
}
@ -306,12 +306,12 @@ namespace Foam
cpp.transformPosition(ptsAtIndex);
// Extract back from ptsAtIndex into newPts
forAll(cpp, faceI)
forAll(cpp, facei)
{
pointField& facePts = newPts[faceI];
pointField& facePts = newPts[facei];
if (facePts.size() > index)
{
facePts[index] = ptsAtIndex[faceI];
facePts[index] = ptsAtIndex[facei];
}
}

View File

@ -97,19 +97,19 @@ Foam::label Foam::checkTopology
{
cellSet cells(mesh, "illegalCells", mesh.nCells()/100);
forAll(mesh.cells(), cellI)
forAll(mesh.cells(), celli)
{
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
if (cFaces.size() <= 3)
{
cells.insert(cellI);
cells.insert(celli);
}
forAll(cFaces, i)
{
if (cFaces[i] < 0 || cFaces[i] >= mesh.nFaces())
{
cells.insert(cellI);
cells.insert(celli);
break;
}
}
@ -223,10 +223,10 @@ Foam::label Foam::checkTopology
{
labelList nInternalFaces(mesh.nCells(), 0);
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
nInternalFaces[mesh.faceOwner()[faceI]]++;
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
nInternalFaces[mesh.faceOwner()[facei]]++;
nInternalFaces[mesh.faceNeighbour()[facei]]++;
}
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchi)
@ -245,15 +245,15 @@ Foam::label Foam::checkTopology
cellSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100);
cellSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100);
forAll(nInternalFaces, cellI)
forAll(nInternalFaces, celli)
{
if (nInternalFaces[cellI] <= 1)
if (nInternalFaces[celli] <= 1)
{
oneCells.insert(cellI);
oneCells.insert(celli);
}
else if (nInternalFaces[cellI] == 2)
else if (nInternalFaces[celli] == 2)
{
twoCells.insert(cellI);
twoCells.insert(celli);
}
}

View File

@ -97,36 +97,36 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
Map<label> polyhedralFaces;
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))
{
nHex++;
}
else if (tet.isA(mesh, cellI))
else if (tet.isA(mesh, celli))
{
nTet++;
}
else if (pyr.isA(mesh, cellI))
else if (pyr.isA(mesh, celli))
{
nPyr++;
}
else if (prism.isA(mesh, cellI))
else if (prism.isA(mesh, celli))
{
nPrism++;
}
else if (wedge.isA(mesh, cellI))
else if (wedge.isA(mesh, celli))
{
nWedge++;
}
else if (tetWedge.isA(mesh, cellI))
else if (tetWedge.isA(mesh, celli))
{
nTetWedge++;
}
else
{
nUnknown++;
polyhedralFaces(mesh.cells()[cellI].size())++;
polyhedralFaces(mesh.cells()[celli].size())++;
}
}

View File

@ -110,7 +110,7 @@ void modifyOrAddFace
(
polyTopoChange& meshMod,
const face& f,
const label faceI,
const label facei,
const label own,
const bool flipFaceFlux,
const label newPatchI,
@ -120,7 +120,7 @@ void modifyOrAddFace
PackedBoolList& modifiedFace
)
{
if (!modifiedFace[faceI])
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
@ -128,7 +128,7 @@ void modifyOrAddFace
polyModifyFace
(
f, // modified face
faceI, // label of face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
@ -138,7 +138,7 @@ void modifyOrAddFace
zoneFlip // face flip in zone
)
);
modifiedFace[faceI] = 1;
modifiedFace[facei] = 1;
}
else
{
@ -152,7 +152,7 @@ void modifyOrAddFace
-1, // neighbour
-1, // master point
-1, // master edge
faceI, // master face
facei, // master face
flipFaceFlux, // face flip
newPatchI, // patch for face
zoneID, // zone for face
@ -184,9 +184,9 @@ void createFaces
// Pass 1. Do selected side of zone
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
label zoneFaceI = fZone.whichFace(faceI);
label zoneFaceI = fZone.whichFace(facei);
if (zoneFaceI != -1)
{
@ -196,9 +196,9 @@ void createFaces
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faceOwner()[faceI],// owner
mesh.faces()[facei], // modified face
facei, // label of face
mesh.faceOwner()[facei],// owner
false, // face flip
newMasterPatches[i], // patch for face
fZone.index(), // zone for face
@ -215,9 +215,9 @@ void createFaces
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI].reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI],// owner
mesh.faces()[facei].reverseFace(), // modified face
facei, // label of face
mesh.faceNeighbour()[facei],// owner
true, // face flip
newMasterPatches[i], // patch for face
fZone.index(), // zone for face
@ -234,9 +234,9 @@ void createFaces
// Pass 2. Do other side of zone
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
label zoneFaceI = fZone.whichFace(faceI);
label zoneFaceI = fZone.whichFace(facei);
if (zoneFaceI != -1)
{
@ -246,9 +246,9 @@ void createFaces
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI].reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI], // owner
mesh.faces()[facei].reverseFace(), // modified face
facei, // label of face
mesh.faceNeighbour()[facei], // owner
true, // face flip
newSlavePatches[i], // patch for face
fZone.index(), // zone for face
@ -262,9 +262,9 @@ void createFaces
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faceOwner()[faceI],// owner
mesh.faces()[facei], // modified face
facei, // label of face
mesh.faceOwner()[facei],// owner
false, // face flip
newSlavePatches[i], // patch for face
fZone.index(), // zone for face
@ -305,9 +305,9 @@ void createFaces
{
forAll(pp, i)
{
label faceI = pp.start()+i;
label facei = pp.start()+i;
label zoneFaceI = fZone.whichFace(faceI);
label zoneFaceI = fZone.whichFace(facei);
if (zoneFaceI != -1)
{
@ -328,9 +328,9 @@ void createFaces
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
mesh.faces()[facei], // modified face
facei, // label of face
mesh.faceOwner()[facei], // owner
false, // face flip
newPatchI, // patch for face
fZone.index(), // zone for face
@ -494,9 +494,9 @@ int main(int argc, char *argv[])
// Add faces to faceZones
labelList nFaces(mesh.faceZones().size(), 0);
forAll(faceToZoneID, faceI)
forAll(faceToZoneID, facei)
{
label zoneID = faceToZoneID[faceI];
label zoneID = faceToZoneID[facei];
if (zoneID != -1)
{
nFaces[zoneID]++;
@ -512,13 +512,13 @@ int main(int argc, char *argv[])
labelList addr(n);
boolList flip(n);
n = 0;
forAll(faceToZoneID, faceI)
forAll(faceToZoneID, facei)
{
label zone = faceToZoneID[faceI];
label zone = faceToZoneID[facei];
if (zone == zoneID)
{
addr[n] = faceI;
flip[n] = faceToFlip[faceI];
addr[n] = facei;
flip[n] = faceToFlip[facei];
n++;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,11 +94,11 @@ void Foam::faceSelection::select
{
if (flip_)
{
forAll(faceToZoneID, faceI)
forAll(faceToZoneID, facei)
{
if (faceToZoneID[faceI] == zoneID)
if (faceToZoneID[facei] == zoneID)
{
faceToFlip[faceI] = !faceToFlip[faceI];
faceToFlip[facei] = !faceToFlip[facei];
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,18 +81,18 @@ void Foam::faceSelections::faceZoneSelection::select
forAll(fZone, i)
{
label faceI = fZone[i];
label facei = fZone[i];
if (faceToZoneID[faceI] == -1)
if (faceToZoneID[facei] == -1)
{
faceToZoneID[faceI] = zoneID;
faceToFlip[faceI] = fZone.flipMap()[i];
faceToZoneID[facei] = zoneID;
faceToFlip[facei] = fZone.flipMap()[i];
}
else if (faceToZoneID[faceI] != zoneID)
else if (faceToZoneID[facei] != zoneID)
{
FatalErrorInFunction
<< "Face " << faceI << " already in faceZone "
<< faceToZoneID[faceI]
<< "Face " << facei << " already in faceZone "
<< faceToZoneID[facei]
<< exit(FatalError);
}
}

View File

@ -98,10 +98,10 @@ void Foam::faceSelections::searchableSurfaceSelection::select
pointField end(mesh_.nFaces());
// Internal faces
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
end[faceI] = mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]];
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
}
// Boundary faces
@ -123,18 +123,18 @@ void Foam::faceSelections::searchableSurfaceSelection::select
{
forAll(pp, i)
{
label faceI = pp.start()+i;
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
end[faceI] = neighbourCellCentres[faceI-mesh_.nInternalFaces()];
label facei = pp.start()+i;
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
end[facei] = neighbourCellCentres[facei-mesh_.nInternalFaces()];
}
}
else
{
forAll(pp, i)
{
label faceI = pp.start()+i;
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
end[faceI] = mesh_.faceCentres()[faceI];
label facei = pp.start()+i;
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
end[facei] = mesh_.faceCentres()[facei];
}
}
}
@ -146,13 +146,13 @@ void Foam::faceSelections::searchableSurfaceSelection::select
//- Note: do not select boundary faces.
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
if (hits[faceI].hit())
if (hits[facei].hit())
{
faceToZoneID[faceI] = zoneID;
vector d = end[faceI]-start[faceI];
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
faceToZoneID[facei] = zoneID;
vector d = end[facei]-start[facei];
faceToFlip[facei] = ((normals[facei] & d) < 0);
}
}
forAll(pbm, patchi)
@ -163,12 +163,12 @@ void Foam::faceSelections::searchableSurfaceSelection::select
{
forAll(pp, i)
{
label faceI = pp.start()+i;
if (hits[faceI].hit())
label facei = pp.start()+i;
if (hits[facei].hit())
{
faceToZoneID[faceI] = zoneID;
vector d = end[faceI]-start[faceI];
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
faceToZoneID[facei] = zoneID;
vector d = end[facei]-start[facei];
faceToFlip[facei] = ((normals[facei] & d) < 0);
}
}
}

View File

@ -244,12 +244,12 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
Pout<< "Dumping cyclic match as lines between face centres to "
<< str.name() << endl;
forAll(cycPatch, faceI)
forAll(cycPatch, facei)
{
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
const point& fc0 = mesh.faceCentres()[cycPatch.start()+facei];
meshTools::writeOBJ(str, fc0);
vertI++;
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+faceI];
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+facei];
meshTools::writeOBJ(str, fc1);
vertI++;
@ -716,12 +716,12 @@ int main(int argc, char *argv[])
forAll(patchFaces, i)
{
label faceI = patchFaces[i];
label facei = patchFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
FatalErrorInFunction
<< "Face " << faceI << " specified in set "
<< "Face " << facei << " specified in set "
<< faces.name()
<< " is not an external face of the mesh." << endl
<< "This application can only repatch existing boundary"
@ -731,7 +731,7 @@ int main(int argc, char *argv[])
changePatchID
(
mesh,
faceI,
facei,
destPatchI,
meshMod
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,11 +75,11 @@ int main(int argc, char *argv[])
boolList inside(querySurf.calcInside(mesh.cellCentres()));
forAll(inside, cellI)
forAll(inside, celli)
{
if (inside[cellI])
if (inside[celli])
{
insideCells.insert(cellI);
insideCells.insert(celli);
}
}

View File

@ -244,10 +244,10 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
cellZoneIndices[zoneI] = zoneIndex(cellZoneNames_, cz[zoneI].name());
}
forAll(c, cellI)
forAll(c, celli)
{
// Grab zone ID. If a cell is not in a zone, it will return -1
zoneID = cz.whichZone(cellI);
zoneID = cz.whichZone(celli);
if (zoneID >= 0)
{
@ -255,7 +255,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = cellZoneIndices[zoneID];
}
renumberCells[cellI] =
renumberCells[celli] =
meshMod_.setAction
(
polyAddCell
@ -303,9 +303,9 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
label newOwn, newNei, newPatch, newZone;
bool newZoneFlip;
forAll(f, faceI)
forAll(f, facei)
{
const face& curFace = f[faceI];
const face& curFace = f[facei];
face newFace(curFace.size());
@ -320,22 +320,22 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
if (min(newFace) < 0)
{
FatalErrorInFunction
<< "Error in point mapping for face " << faceI
<< "Error in point mapping for face " << facei
<< ". Old face: " << curFace << " New face: " << newFace
<< abort(FatalError);
}
}
if (faceI < m.nInternalFaces() || faceI >= m.nFaces())
if (facei < m.nInternalFaces() || facei >= m.nFaces())
{
newPatch = -1;
}
else
{
newPatch = patchIndices[bm.whichPatch(faceI)];
newPatch = patchIndices[bm.whichPatch(facei)];
}
newOwn = own[faceI];
newOwn = own[facei];
if (newOwn > -1) newOwn = renumberCells[newOwn];
if (newPatch > -1)
@ -344,23 +344,23 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
}
else
{
newNei = nei[faceI];
newNei = nei[facei];
newNei = renumberCells[newNei];
}
newZone = fz.whichZone(faceI);
newZone = fz.whichZone(facei);
newZoneFlip = false;
if (newZone >= 0)
{
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(faceI)];
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(facei)];
// Grab the new zone
newZone = faceZoneIndices[newZone];
}
renumberFaces[faceI] =
renumberFaces[facei] =
meshMod_.setAction
(
polyAddFace

View File

@ -170,16 +170,16 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
{
if (duplicates[bFaceI] != -1)
{
label faceI = mesh.nInternalFaces() + bFaceI;
label patchi = patches.whichPatch(faceI);
label facei = mesh.nInternalFaces() + bFaceI;
label patchi = patches.whichPatch(facei);
if (isA<processorPolyPatch>(patches[patchi]))
{
FatalErrorInFunction
<< "Duplicate face " << faceI
<< "Duplicate face " << facei
<< " is on a processorPolyPatch."
<< "This is not allowed." << nl
<< "Face:" << faceI
<< "Face:" << facei
<< " is on patch:" << patches[patchi].name()
<< abort(FatalError);
}

View File

@ -130,12 +130,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
forAll(newCellFaces, cellI)
forAll(newCellFaces, celli)
{
labelList& curFaces = newCellFaces[cellI];
labelList& curFaces = newCellFaces[celli];
const label s = oldOwnerStart[cellI];
const label e = oldOwnerStart[cellI + 1];
const label s = oldOwnerStart[celli];
const label e = oldOwnerStart[celli + 1];
curFaces.setSize(e - s);
@ -171,12 +171,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
const labelUList& curFaceCells = curPatch.faceCells();
const label curStart = curPatch.start();
forAll(curPatch, faceI)
forAll(curPatch, facei)
{
// Find out if the mirrored face is identical to the
// original. If so, the face needs to become internal and
// added to its owner cell
const face& origFace = curPatch[faceI];
const face& origFace = curPatch[facei];
face mirrorFace(origFace.size());
forAll(mirrorFace, pointI)
@ -188,12 +188,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
{
// The mirror is identical to current face. This will
// become an internal face
const label oldSize = newCellFaces[curFaceCells[faceI]].size();
const label oldSize = newCellFaces[curFaceCells[facei]].size();
newCellFaces[curFaceCells[faceI]].setSize(oldSize + 1);
newCellFaces[curFaceCells[faceI]][oldSize] = curStart + faceI;
newCellFaces[curFaceCells[facei]].setSize(oldSize + 1);
newCellFaces[curFaceCells[facei]][oldSize] = curStart + facei;
curInsBouFace[faceI] = true;
curInsBouFace[facei] = true;
}
}
}
@ -210,9 +210,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
label nNewFaces = 0;
// Insert original (internal) faces
forAll(newCellFaces, cellI)
forAll(newCellFaces, celli)
{
const labelList& curCellFaces = newCellFaces[cellI];
const labelList& curCellFaces = newCellFaces[celli];
forAll(curCellFaces, cfI)
{
@ -224,9 +224,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
}
// Mirror internal faces
for (label faceI = 0; faceI < nOldInternalFaces; faceI++)
for (label facei = 0; facei < nOldInternalFaces; facei++)
{
const face& oldFace = oldFaces[faceI];
const face& oldFace = oldFaces[facei];
face& nf = newFaces[nNewFaces];
nf.setSize(oldFace.size());
@ -237,7 +237,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
}
mirrorFaceLookup[faceI] = nNewFaces;
mirrorFaceLookup[facei] = nNewFaces;
nNewFaces++;
}
@ -258,27 +258,27 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
newPatchStarts[nNewPatches] = nNewFaces;
// Master side
for (label faceI = 0; faceI < curPatchSize; faceI++)
for (label facei = 0; facei < curPatchSize; facei++)
{
// Check if the face has already been added. If not, add it and
// insert the numbering details.
if (!curInserted[faceI])
if (!curInserted[facei])
{
newFaces[nNewFaces] = oldFaces[curPatchStart + faceI];
newFaces[nNewFaces] = oldFaces[curPatchStart + facei];
masterFaceLookup[curPatchStart + faceI] = nNewFaces;
masterFaceLookup[curPatchStart + facei] = nNewFaces;
nNewFaces++;
}
}
// Mirror side
for (label faceI = 0; faceI < curPatchSize; faceI++)
for (label facei = 0; facei < curPatchSize; facei++)
{
// Check if the face has already been added. If not, add it and
// insert the numbering details.
if (!curInserted[faceI])
if (!curInserted[facei])
{
const face& oldFace = oldFaces[curPatchStart + faceI];
const face& oldFace = oldFaces[curPatchStart + facei];
face& nf = newFaces[nNewFaces];
nf.setSize(oldFace.size());
@ -289,14 +289,14 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
}
mirrorFaceLookup[curPatchStart + faceI] = nNewFaces;
mirrorFaceLookup[curPatchStart + facei] = nNewFaces;
nNewFaces++;
}
else
{
// Grab the index of the master face for the mirror side
mirrorFaceLookup[curPatchStart + faceI] =
masterFaceLookup[curPatchStart + faceI];
mirrorFaceLookup[curPatchStart + facei] =
masterFaceLookup[curPatchStart + facei];
}
}
@ -330,9 +330,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
label nNewCells = 0;
// Grab the original cells. Take care of face renumbering.
forAll(oldCells, cellI)
forAll(oldCells, celli)
{
const cell& oc = oldCells[cellI];
const cell& oc = oldCells[celli];
cell& nc = newCells[nNewCells];
nc.setSize(oc.size());
@ -346,9 +346,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
}
// Mirror the cells
forAll(oldCells, cellI)
forAll(oldCells, celli)
{
const cell& oc = oldCells[cellI];
const cell& oc = oldCells[celli];
cell& nc = newCells[nNewCells];
nc.setSize(oc.size());

View File

@ -99,9 +99,9 @@ int main(int argc, char *argv[])
label nProtected = 0;
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label meshFaceI = faceLabels[faceI];
const label meshFaceI = faceLabels[facei];
const label patchi = bm.whichPatch(meshFaceI);
if
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
)
{
// Slave side. Mark so doesn't get visited.
allFaceInfo[faceI] = orientedSurface::NOFLIP;
allFaceInfo[facei] = orientedSurface::NOFLIP;
nProtected++;
}
}
@ -125,13 +125,13 @@ int main(int argc, char *argv[])
// Number of (master)faces per edge
labelList nMasterFaces(patch.nEdges(), 0);
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label meshFaceI = faceLabels[faceI];
const label meshFaceI = faceLabels[facei];
if (isMasterFace[meshFaceI])
{
const labelList& fEdges = patch.faceEdges()[faceI];
const labelList& fEdges = patch.faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
nMasterFaces[fEdges[fEdgeI]]++;
@ -184,11 +184,11 @@ int main(int argc, char *argv[])
{
// Pick an unset face
label unsetFaceI = labelMax;
forAll(allFaceInfo, faceI)
forAll(allFaceInfo, facei)
{
if (allFaceInfo[faceI] == orientedSurface::UNVISITED)
if (allFaceInfo[facei] == orientedSurface::UNVISITED)
{
unsetFaceI = globalFaces.toGlobal(faceI);
unsetFaceI = globalFaces.toGlobal(facei);
break;
}
}
@ -347,25 +347,25 @@ int main(int argc, char *argv[])
boolList newFlipMap(allFaceInfo.size(), false);
label nChanged = 0;
forAll(allFaceInfo, faceI)
forAll(allFaceInfo, facei)
{
if (allFaceInfo[faceI] == orientedSurface::NOFLIP)
if (allFaceInfo[facei] == orientedSurface::NOFLIP)
{
newFlipMap[faceI] = false;
newFlipMap[facei] = false;
}
else if (allFaceInfo[faceI] == orientedSurface::FLIP)
else if (allFaceInfo[facei] == orientedSurface::FLIP)
{
newFlipMap[faceI] = true;
newFlipMap[facei] = true;
}
else
{
FatalErrorInFunction
<< "Problem : unvisited face " << faceI
<< " centre:" << mesh.faceCentres()[faceLabels[faceI]]
<< "Problem : unvisited face " << facei
<< " centre:" << mesh.faceCentres()[faceLabels[facei]]
<< abort(FatalError);
}
if (fZone.flipMap()[faceI] != newFlipMap[faceI])
if (fZone.flipMap()[facei] != newFlipMap[facei])
{
nChanged++;
}

View File

@ -102,9 +102,9 @@ void Foam::meshDualiser::dumpPolyTopoChange
const DynamicList<face>& faces = meshMod.faces();
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
str1<< 'f';
forAll(f, fp)
@ -125,7 +125,7 @@ void Foam::meshDualiser::dumpPolyTopoChange
Foam::label Foam::meshDualiser::findDualCell
(
const label cellI,
const label celli,
const label pointI
) const
{
@ -137,7 +137,7 @@ Foam::label Foam::meshDualiser::findDualCell
}
else
{
label index = findIndex(mesh_.pointCells()[pointI], cellI);
label index = findIndex(mesh_.pointCells()[pointI], celli);
return dualCells[index];
}
@ -177,19 +177,19 @@ void Foam::meshDualiser::generateDualBoundaryEdges
// sides.
bool Foam::meshDualiser::sameDualCell
(
const label faceI,
const label facei,
const label pointI
) const
{
if (!mesh_.isInternalFace(faceI))
if (!mesh_.isInternalFace(facei))
{
FatalErrorInFunction
<< "face:" << faceI << " is not internal face."
<< "face:" << facei << " is not internal face."
<< abort(FatalError);
}
label own = mesh_.faceOwner()[faceI];
label nei = mesh_.faceNeighbour()[faceI];
label own = mesh_.faceOwner()[facei];
label nei = mesh_.faceNeighbour()[facei];
return findDualCell(own, pointI) == findDualCell(nei, pointI);
}
@ -436,19 +436,19 @@ void Foam::meshDualiser::createFacesAroundEdge
while (true)
{
label faceI = ie.faceLabel();
label facei = ie.faceLabel();
// Mark face as visited.
doneEFaces[findIndex(eFaces, faceI)] = true;
doneEFaces[findIndex(eFaces, facei)] = true;
if (faceToDualPoint_[faceI] != -1)
if (faceToDualPoint_[facei] != -1)
{
verts.append(faceToDualPoint_[faceI]);
verts.append(faceToDualPoint_[facei]);
}
label cellI = ie.cellLabel();
label celli = ie.cellLabel();
if (cellI == -1)
if (celli == -1)
{
// At ending boundary face. We've stored the face point above
// so this is the whole face.
@ -456,8 +456,8 @@ void Foam::meshDualiser::createFacesAroundEdge
}
label dualCell0 = findDualCell(cellI, e[0]);
label dualCell1 = findDualCell(cellI, e[1]);
label dualCell0 = findDualCell(celli, e[0]);
label dualCell1 = findDualCell(celli, e[1]);
// Generate face. (always if splitFace=true; only if needed to
// separate cells otherwise)
@ -492,15 +492,15 @@ void Foam::meshDualiser::createFacesAroundEdge
{
verts.append(edgeToDualPoint_[edgeI]);
}
if (faceToDualPoint_[faceI] != -1)
if (faceToDualPoint_[facei] != -1)
{
verts.append(faceToDualPoint_[faceI]);
verts.append(faceToDualPoint_[facei]);
}
}
if (cellToDualPoint_[cellI] != -1)
if (cellToDualPoint_[celli] != -1)
{
verts.append(cellToDualPoint_[cellI]);
verts.append(cellToDualPoint_[celli]);
}
++ie;
@ -537,22 +537,22 @@ void Foam::meshDualiser::createFacesAroundEdge
}
// Walks around circumference of faceI. Creates single face. Gets given
// Walks around circumference of facei. Creates single face. Gets given
// starting (feature) edge to start from. Returns ending edge. (all edges
// in form of index in faceEdges)
void Foam::meshDualiser::createFaceFromInternalFace
(
const label faceI,
const label facei,
label& fp,
polyTopoChange& meshMod
) const
{
const face& f = mesh_.faces()[faceI];
const labelList& fEdges = mesh_.faceEdges()[faceI];
label own = mesh_.faceOwner()[faceI];
label nei = mesh_.faceNeighbour()[faceI];
const face& f = mesh_.faces()[facei];
const labelList& fEdges = mesh_.faceEdges()[facei];
label own = mesh_.faceOwner()[facei];
label nei = mesh_.faceNeighbour()[facei];
//Pout<< "createFaceFromInternalFace : At face:" << faceI
//Pout<< "createFaceFromInternalFace : At face:" << facei
// << " verts:" << f
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
// << " started walking at edge:" << fEdges[fp]
@ -563,7 +563,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
// Walk and collect face.
DynamicList<label> verts(100);
verts.append(faceToDualPoint_[faceI]);
verts.append(faceToDualPoint_[facei]);
verts.append(edgeToDualPoint_[fEdges[fp]]);
// Step to vertex after edge mid
@ -602,7 +602,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
if (edgeToDualPoint_[edgeI] == -1)
{
FatalErrorInFunction
<< "face:" << faceI << " verts:" << f
<< "face:" << facei << " verts:" << f
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
<< " no feature edge between " << f[fp]
<< " and " << f[nextFp] << " although have different"
@ -621,7 +621,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
(
-1, // masterPointI
-1, // masterEdgeI
faceI, // masterFaceI
facei, // masterFaceI
true, // edgeOrder,
currentDualCell0,
currentDualCell1,
@ -660,13 +660,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// pointFaces.
// Starting face
label faceI = startFaceI;
label facei = startFaceI;
DynamicList<label> verts(4);
while (true)
{
label index = findIndex(pFaces, faceI-pp.start());
label index = findIndex(pFaces, facei-pp.start());
// Has face been visited already?
if (donePFaces[index])
@ -676,15 +676,15 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
donePFaces[index] = true;
// Insert face centre
verts.append(faceToDualPoint_[faceI]);
verts.append(faceToDualPoint_[facei]);
label dualCellI = findDualCell(own[faceI], pointI);
label dualCellI = findDualCell(own[facei], pointI);
// Get the edge before the patchPointI
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
label fp = findIndex(f, pointI);
label prevFp = f.rcIndex(fp);
label edgeI = mesh_.faceEdges()[faceI][prevFp];
label edgeI = mesh_.faceEdges()[facei][prevFp];
if (edgeToDualPoint_[edgeI] != -1)
{
@ -695,7 +695,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
edgeFaceCirculator circ
(
mesh_,
faceI,
facei,
true, // ownerSide
prevFp, // index of edge in face
true // isBoundaryEdge
@ -708,20 +708,20 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
while (mesh_.isInternalFace(circ.faceLabel()));
// Step to next face
faceI = circ.faceLabel();
facei = circ.faceLabel();
if (faceI < pp.start() || faceI >= pp.start()+pp.size())
if (facei < pp.start() || facei >= pp.start()+pp.size())
{
FatalErrorInFunction
<< "Walked from face on patch:" << patchi
<< " to face:" << faceI
<< " fc:" << mesh_.faceCentres()[faceI]
<< " on patch:" << patches.whichPatch(faceI)
<< " to face:" << facei
<< " fc:" << mesh_.faceCentres()[facei]
<< " on patch:" << patches.whichPatch(facei)
<< abort(FatalError);
}
// Check if different cell.
if (dualCellI != findDualCell(own[faceI], pointI))
if (dualCellI != findDualCell(own[facei], pointI))
{
FatalErrorInFunction
<< "Different dual cells but no feature edge"
@ -733,7 +733,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
verts.shrink();
label dualCellI = findDualCell(own[faceI], pointI);
label dualCellI = findDualCell(own[facei], pointI);
//Bit dodgy: create dualface from the last face (instead of from
// the central point). This will also use the original faceZone to
@ -744,7 +744,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
//pointI, // masterPointI
-1, // masterPointI
-1, // masterEdgeI
faceI, // masterFaceI
facei, // masterFaceI
dualCellI,
patchi,
verts,
@ -753,17 +753,17 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
}
else
{
label faceI = startFaceI;
label facei = startFaceI;
// Storage for face
DynamicList<label> verts(mesh_.faces()[faceI].size());
DynamicList<label> verts(mesh_.faces()[facei].size());
// Starting point.
verts.append(pointToDualPoint_[pointI]);
// Find edge between pointI and next point on face.
const labelList& fEdges = mesh_.faceEdges()[faceI];
label nextEdgeI = fEdges[findIndex(mesh_.faces()[faceI], pointI)];
const labelList& fEdges = mesh_.faceEdges()[facei];
label nextEdgeI = fEdges[findIndex(mesh_.faces()[facei], pointI)];
if (edgeToDualPoint_[nextEdgeI] != -1)
{
verts.append(edgeToDualPoint_[nextEdgeI]);
@ -771,7 +771,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
do
{
label index = findIndex(pFaces, faceI-pp.start());
label index = findIndex(pFaces, facei-pp.start());
// Has face been visited already?
if (donePFaces[index])
@ -781,11 +781,11 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
donePFaces[index] = true;
// Face centre
verts.append(faceToDualPoint_[faceI]);
verts.append(faceToDualPoint_[facei]);
// Find edge before pointI on faceI
const labelList& fEdges = mesh_.faceEdges()[faceI];
const face& f = mesh_.faces()[faceI];
// Find edge before pointI on facei
const labelList& fEdges = mesh_.faceEdges()[facei];
const face& f = mesh_.faces()[facei];
label prevFp = f.rcIndex(findIndex(f, pointI));
label edgeI = fEdges[prevFp];
@ -798,8 +798,8 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
(
-1, // masterPointI
-1, // masterEdgeI
faceI, // masterFaceI
findDualCell(own[faceI], pointI),
facei, // masterFaceI
findDualCell(own[facei], pointI),
patchi,
verts.shrink(),
meshMod
@ -814,7 +814,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
edgeFaceCirculator circ
(
mesh_,
faceI,
facei,
true, // ownerSide
prevFp, // index of edge in face
true // isBoundaryEdge
@ -827,13 +827,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
while (mesh_.isInternalFace(circ.faceLabel()));
// Step to next face. Quit if not on same patch.
faceI = circ.faceLabel();
facei = circ.faceLabel();
}
while
(
faceI != startFaceI
&& faceI >= pp.start()
&& faceI < pp.start()+pp.size()
facei != startFaceI
&& facei >= pp.start()
&& facei < pp.start()+pp.size()
);
if (verts.size() > 2)
@ -844,7 +844,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
-1, // masterPointI
-1, // masterEdgeI
startFaceI, // masterFaceI
findDualCell(own[faceI], pointI),
findDualCell(own[facei], pointI),
patchi,
verts.shrink(),
meshMod
@ -887,9 +887,9 @@ void Foam::meshDualiser::setRefinement
// (Note: in 1.4.2 we can use the built-in mesh point ordering
// facility instead)
PackedBoolList isBoundaryEdge(mesh_.nEdges());
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
{
const labelList& fEdges = mesh_.faceEdges()[faceI];
const labelList& fEdges = mesh_.faceEdges()[facei];
forAll(fEdges, i)
{
@ -912,15 +912,15 @@ void Foam::meshDualiser::setRefinement
{
featureFaceSet[featureFaces[i]] = true;
}
label faceI = findIndex(featureFaceSet, false);
label facei = findIndex(featureFaceSet, false);
if (faceI != -1)
if (facei != -1)
{
FatalErrorInFunction
<< "In split-face-mode (splitFace=true) but not all faces"
<< " marked as feature faces." << endl
<< "First conflicting face:" << faceI
<< " centre:" << mesh_.faceCentres()[faceI]
<< "First conflicting face:" << facei
<< " centre:" << mesh_.faceCentres()[facei]
<< abort(FatalError);
}
@ -954,18 +954,18 @@ void Foam::meshDualiser::setRefinement
}
for
(
label faceI = mesh_.nInternalFaces();
faceI < mesh_.nFaces();
faceI++
label facei = mesh_.nInternalFaces();
facei < mesh_.nFaces();
facei++
)
{
if (!featureFaceSet[faceI])
if (!featureFaceSet[facei])
{
FatalErrorInFunction
<< "Not all boundary faces marked as feature faces."
<< endl
<< "First conflicting face:" << faceI
<< " centre:" << mesh_.faceCentres()[faceI]
<< "First conflicting face:" << facei
<< " centre:" << mesh_.faceCentres()[facei]
<< abort(FatalError);
}
}
@ -1116,12 +1116,12 @@ void Foam::meshDualiser::setRefinement
// Dual points (from cell centres, feature faces, feature edges)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(cellToDualPoint_, cellI)
forAll(cellToDualPoint_, celli)
{
cellToDualPoint_[cellI] = meshMod.addPoint
cellToDualPoint_[celli] = meshMod.addPoint
(
cellCentres[cellI],
mesh_.faces()[mesh_.cells()[cellI][0]][0], // masterPoint
cellCentres[celli],
mesh_.faces()[mesh_.cells()[celli][0]][0], // masterPoint
-1, // zoneID
true // inCell
);
@ -1131,12 +1131,12 @@ void Foam::meshDualiser::setRefinement
forAll(featureFaces, i)
{
label faceI = featureFaces[i];
label facei = featureFaces[i];
faceToDualPoint_[faceI] = meshMod.addPoint
faceToDualPoint_[facei] = meshMod.addPoint
(
mesh_.faceCentres()[faceI],
mesh_.faces()[faceI][0], // masterPoint
mesh_.faceCentres()[facei],
mesh_.faces()[facei][0], // masterPoint
-1, // zoneID
true // inCell
);
@ -1144,22 +1144,22 @@ void Foam::meshDualiser::setRefinement
// Detect whether different dual cells on either side of a face. This
// would neccesitate having a dual face built from the face and thus a
// dual point at the face centre.
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
if (faceToDualPoint_[faceI] == -1)
if (faceToDualPoint_[facei] == -1)
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
forAll(f, fp)
{
label ownDualCell = findDualCell(own[faceI], f[fp]);
label neiDualCell = findDualCell(nei[faceI], f[fp]);
label ownDualCell = findDualCell(own[facei], f[fp]);
label neiDualCell = findDualCell(nei[facei], f[fp]);
if (ownDualCell != neiDualCell)
{
faceToDualPoint_[faceI] = meshMod.addPoint
faceToDualPoint_[facei] = meshMod.addPoint
(
mesh_.faceCentres()[faceI],
mesh_.faceCentres()[facei],
f[fp], // masterPoint
-1, // zoneID
true // inCell
@ -1332,12 +1332,12 @@ void Foam::meshDualiser::setRefinement
// - multiple cells: create single face between unique cell pair. Only
// create face where cells differ on either side.
// - non-feature face : inbetween cell zones.
forAll(faceToDualPoint_, faceI)
forAll(faceToDualPoint_, facei)
{
if (faceToDualPoint_[faceI] != -1 && mesh_.isInternalFace(faceI))
if (faceToDualPoint_[facei] != -1 && mesh_.isInternalFace(facei))
{
const face& f = mesh_.faces()[faceI];
const labelList& fEdges = mesh_.faceEdges()[faceI];
const face& f = mesh_.faces()[facei];
const labelList& fEdges = mesh_.faceEdges()[facei];
// Starting edge
label fp = 0;
@ -1353,7 +1353,7 @@ void Foam::meshDualiser::setRefinement
if
(
edgeToDualPoint_[fEdges[fp]] != -1
&& !sameDualCell(faceI, f.nextLabel(fp))
&& !sameDualCell(facei, f.nextLabel(fp))
)
{
foundStart = true;
@ -1371,7 +1371,7 @@ void Foam::meshDualiser::setRefinement
// Walk from edge fp and generate a face.
createFaceFromInternalFace
(
faceI,
facei,
fp,
meshMod
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,7 +94,7 @@ class meshDualiser
static void dumpPolyTopoChange(const polyTopoChange&, const fileName&);
//- Find dual cell given point and cell
label findDualCell(const label cellI, const label pointI) const;
label findDualCell(const label celli, const label pointI) const;
//- Helper function to generate dualpoints on all boundary edges
// emanating from (boundary & feature) point
@ -108,7 +108,7 @@ class meshDualiser
//- Check that owner and neighbour of face have same dual cell
bool sameDualCell
(
const label faceI,
const label facei,
const label pointI
) const;
@ -153,7 +153,7 @@ class meshDualiser
//- Create single internal face from internal face
void createFaceFromInternalFace
(
const label faceI,
const label facei,
label& fp,
polyTopoChange&
) const;

View File

@ -234,9 +234,9 @@ void simpleMarkFeatures
// Face centres that need inclusion in the dual mesh
labelHashSet featureFaceSet(mesh.nFaces()-mesh.nInternalFaces());
// A. boundary faces.
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
featureFaceSet.insert(faceI);
featureFaceSet.insert(facei);
}
// B. face zones.
@ -270,11 +270,11 @@ void simpleMarkFeatures
forAll(fz, i)
{
label faceI = fz[i];
const face& f = mesh.faces()[faceI];
const labelList& fEdges = mesh.faceEdges()[faceI];
label facei = fz[i];
const face& f = mesh.faces()[facei];
const labelList& fEdges = mesh.faceEdges()[facei];
featureFaceSet.insert(faceI);
featureFaceSet.insert(facei);
forAll(f, fp)
{
// Mark point as multi cell point (since both sides of
@ -385,9 +385,9 @@ int main(int argc, char *argv[])
// (Note: in 1.4.2 we can use the built-in mesh point ordering
// facility instead)
PackedBoolList isBoundaryEdge(mesh.nEdges());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
const labelList& fEdges = mesh.faceEdges()[faceI];
const labelList& fEdges = mesh.faceEdges()[facei];
forAll(fEdges, i)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -240,9 +240,9 @@ int main(int argc, char *argv[])
// Select all cells
refCells.setSize(mesh.nCells());
forAll(mesh.cells(), cellI)
forAll(mesh.cells(), celli)
{
refCells[cellI] = cellI;
refCells[celli] = celli;
}
if (mesh.nGeometricD() == 3)

View File

@ -86,9 +86,9 @@ tmp<volScalarField> createScalarField
);
volScalarField& fld = tfld.ref();
forAll(fld, cellI)
forAll(fld, celli)
{
fld[cellI] = elems[cellI];
fld[celli] = elems[celli];
}
return tfld;
@ -100,9 +100,9 @@ label getBand(const labelList& owner, const labelList& neighbour)
{
label band = 0;
forAll(neighbour, faceI)
forAll(neighbour, facei)
{
label diff = neighbour[faceI] - owner[faceI];
label diff = neighbour[facei] - owner[facei];
if (diff > band)
{
@ -128,10 +128,10 @@ void getBand
labelList cellBandwidth(nCells, 0);
scalarField nIntersect(nCells, 0.0);
forAll(neighbour, faceI)
forAll(neighbour, facei)
{
label own = owner[faceI];
label nei = neighbour[faceI];
label own = owner[facei];
label nei = neighbour[facei];
// Note: mag not necessary for correct (upper-triangular) ordering.
label diff = nei-own;
@ -142,17 +142,17 @@ void getBand
// Do not use field algebra because of conversion label to scalar
profile = 0.0;
forAll(cellBandwidth, cellI)
forAll(cellBandwidth, celli)
{
profile += 1.0*cellBandwidth[cellI];
profile += 1.0*cellBandwidth[celli];
}
sumSqrIntersect = 0.0;
if (calculateIntersect)
{
forAll(nIntersect, cellI)
forAll(nIntersect, celli)
{
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
for (label colI = celli-cellBandwidth[celli]; colI <= celli; colI++)
{
nIntersect[colI] += 1.0;
}
@ -190,15 +190,15 @@ labelList getFaceOrder
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
// Internal face. Get cell on other side.
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[faceI]];
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
if (nbrCellI == newCellI)
{
nbrCellI = reverseCellOrder[mesh.faceOwner()[faceI]];
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
}
if (newCellI < nbrCellI)
@ -233,19 +233,19 @@ labelList getFaceOrder
}
// Leave patch faces intact.
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
{
oldToNewFace[faceI] = faceI;
oldToNewFace[facei] = facei;
}
// Check done all faces.
forAll(oldToNewFace, faceI)
forAll(oldToNewFace, facei)
{
if (oldToNewFace[faceI] == -1)
if (oldToNewFace[facei] == -1)
{
FatalErrorInFunction
<< "Did not determine new position" << " for face " << faceI
<< "Did not determine new position" << " for face " << facei
<< abort(FatalError);
}
}
@ -286,15 +286,15 @@ labelList getRegionFaceOrder
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
// Internal face. Get cell on other side.
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[faceI]];
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
if (nbrCellI == newCellI)
{
nbrCellI = reverseCellOrder[mesh.faceOwner()[faceI]];
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
}
if (cellToRegion[oldCellI] != cellToRegion[cellOrder[nbrCellI]])
@ -337,14 +337,14 @@ labelList getRegionFaceOrder
// Sort in increasing region
SortableList<label> sortKey(mesh.nFaces(), labelMax);
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
label ownRegion = cellToRegion[mesh.faceOwner()[faceI]];
label neiRegion = cellToRegion[mesh.faceNeighbour()[faceI]];
label ownRegion = cellToRegion[mesh.faceOwner()[facei]];
label neiRegion = cellToRegion[mesh.faceNeighbour()[facei]];
if (ownRegion != neiRegion)
{
sortKey[faceI] =
sortKey[facei] =
min(ownRegion, neiRegion)*nRegions
+max(ownRegion, neiRegion);
}
@ -372,20 +372,20 @@ labelList getRegionFaceOrder
}
// Leave patch faces intact.
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
{
oldToNewFace[faceI] = faceI;
oldToNewFace[facei] = facei;
}
// Check done all faces.
forAll(oldToNewFace, faceI)
forAll(oldToNewFace, facei)
{
if (oldToNewFace[faceI] == -1)
if (oldToNewFace[facei] == -1)
{
FatalErrorInFunction
<< "Did not determine new position"
<< " for face " << faceI
<< " for face " << facei
<< abort(FatalError);
}
}
@ -427,16 +427,16 @@ autoPtr<mapPolyMesh> reorderMesh
// Check if any faces need swapping.
labelHashSet flipFaceFlux(newOwner.size());
forAll(newNeighbour, faceI)
forAll(newNeighbour, facei)
{
label own = newOwner[faceI];
label nei = newNeighbour[faceI];
label own = newOwner[facei];
label nei = newNeighbour[facei];
if (nei < own)
{
newFaces[faceI].flip();
Swap(newOwner[faceI], newNeighbour[faceI]);
flipFaceFlux.insert(faceI);
newFaces[facei].flip();
Swap(newOwner[facei], newNeighbour[facei]);
flipFaceFlux.insert(facei);
}
}
@ -566,11 +566,11 @@ labelList regionRenumber
labelListList regionToCells(invertOneToMany(nRegions, cellToRegion));
label cellI = 0;
label celli = 0;
forAll(regionToCells, regionI)
{
Info<< " region " << regionI << " starts at " << cellI << endl;
Info<< " region " << regionI << " starts at " << celli << endl;
// Make sure no parallel comms
bool oldParRun = UPstream::parRun();
@ -595,7 +595,7 @@ labelList regionRenumber
forAll(subCellOrder, i)
{
cellOrder[cellI++] = cellMap[subCellOrder[i]];
cellOrder[celli++] = cellMap[subCellOrder[i]];
}
}
Info<< endl;
@ -975,13 +975,13 @@ int main(int argc, char *argv[])
const labelUList& faceCells = pbm[patchi].faceCells();
forAll(faceCells, i)
{
label cellI = faceCells[i];
label celli = faceCells[i];
if (reverseCellOrder[cellI] != -1)
if (reverseCellOrder[celli] != -1)
{
bndCells[nBndCells] = cellI;
bndCellMap[nBndCells++] = reverseCellOrder[cellI];
reverseCellOrder[cellI] = -1;
bndCells[nBndCells] = celli;
bndCellMap[nBndCells++] = reverseCellOrder[celli];
reverseCellOrder[celli] = -1;
}
}
}
@ -1105,10 +1105,10 @@ int main(int argc, char *argv[])
const labelHashSet& fff = map().flipFaceFlux();
forAllConstIter(labelHashSet, fff, iter)
{
label faceI = iter.key();
label masterFaceI = faceProcAddressing[faceI];
label facei = iter.key();
label masterFaceI = faceProcAddressing[facei];
faceProcAddressing[faceI] = -masterFaceI;
faceProcAddressing[facei] = -masterFaceI;
if (masterFaceI == 0)
{

View File

@ -110,31 +110,31 @@ void writeVTK
forAllConstIter(cellSet, currentSet, iter)
{
label cellI = iter.key();
label celli = iter.key();
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label otherCellI = mesh.faceOwner()[faceI];
label otherCellI = mesh.faceOwner()[facei];
if (otherCellI == cellI)
if (otherCellI == celli)
{
otherCellI = mesh.faceNeighbour()[faceI];
otherCellI = mesh.faceNeighbour()[facei];
}
if (!currentSet.found(otherCellI))
{
cellFaces.insert(faceI, cellI);
cellFaces.insert(facei, celli);
}
}
else
{
cellFaces.insert(faceI, cellI);
cellFaces.insert(facei, celli);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,9 +81,9 @@ void writePatch
label nFaceVerts = 0;
forAll(fp.localFaces(), faceI)
forAll(fp.localFaces(), facei)
{
nFaceVerts += fp.localFaces()[faceI].size() + 1;
nFaceVerts += fp.localFaces()[facei].size() + 1;
}
pStream << "POLYGONS " << fp.size() << ' ' << nFaceVerts
<< std::endl;
@ -91,9 +91,9 @@ void writePatch
DynamicList<label> vertLabels(nFaceVerts);
forAll(fp.localFaces(), faceI)
forAll(fp.localFaces(), facei)
{
const face& f = fp.localFaces()[faceI];
const face& f = fp.localFaces()[facei];
vertLabels.append(f.size());

View File

@ -163,8 +163,8 @@ int main(int argc, char *argv[])
// No flip map.
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
addressing.append(faceI);
label facei = faceLabels[i];
addressing.append(facei);
flipMap.append(false);
}
}
@ -187,24 +187,24 @@ int main(int argc, char *argv[])
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
label facei = faceLabels[i];
bool flip = false;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
if
(
cells.found(mesh.faceOwner()[faceI])
&& !cells.found(mesh.faceNeighbour()[faceI])
cells.found(mesh.faceOwner()[facei])
&& !cells.found(mesh.faceNeighbour()[facei])
)
{
flip = false;
}
else if
(
!cells.found(mesh.faceOwner()[faceI])
&& cells.found(mesh.faceNeighbour()[faceI])
!cells.found(mesh.faceOwner()[facei])
&& cells.found(mesh.faceNeighbour()[facei])
)
{
flip = true;
@ -213,21 +213,21 @@ int main(int argc, char *argv[])
{
FatalErrorInFunction
<< "One of owner or neighbour of internal face "
<< faceI << " should be in cellSet " << cells.name()
<< facei << " should be in cellSet " << cells.name()
<< " to be able to determine orientation." << endl
<< "Face:" << faceI
<< " own:" << mesh.faceOwner()[faceI]
<< "Face:" << facei
<< " own:" << mesh.faceOwner()[facei]
<< " OwnInCellSet:"
<< cells.found(mesh.faceOwner()[faceI])
<< " nei:" << mesh.faceNeighbour()[faceI]
<< cells.found(mesh.faceOwner()[facei])
<< " nei:" << mesh.faceNeighbour()[facei]
<< " NeiInCellSet:"
<< cells.found(mesh.faceNeighbour()[faceI])
<< cells.found(mesh.faceNeighbour()[facei])
<< abort(FatalError);
}
}
else
{
if (cells.found(mesh.faceOwner()[faceI]))
if (cells.found(mesh.faceOwner()[facei]))
{
flip = false;
}
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
}
}
addressing.append(faceI);
addressing.append(facei);
flipMap.append(flip);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,16 +43,16 @@ defineTypeNameAndDebug(regionSide, 0);
Foam::label Foam::regionSide::otherFace
(
const primitiveMesh& mesh,
const label cellI,
const label faceI,
const label celli,
const label facei,
const label edgeI
)
{
label f0I, f1I;
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0I, f1I);
meshTools::getEdgeFaces(mesh, celli, edgeI, f0I, f1I);
if (f0I == faceI)
if (f0I == facei)
{
return f1I;
}
@ -67,7 +67,7 @@ Foam::label Foam::regionSide::otherFace
Foam::label Foam::regionSide::otherEdge
(
const primitiveMesh& mesh,
const label faceI,
const label facei,
const label edgeI,
const label pointI
)
@ -77,7 +77,7 @@ Foam::label Foam::regionSide::otherEdge
// Get other point on edge.
label freePointI = e.otherVertex(pointI);
const labelList& fEdges = mesh.faceEdges()[faceI];
const labelList& fEdges = mesh.faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
@ -102,52 +102,52 @@ Foam::label Foam::regionSide::otherEdge
}
FatalErrorInFunction
<< "Cannot find other edge on face " << faceI << " that uses point "
<< "Cannot find other edge on face " << facei << " that uses point "
<< pointI << " but not point " << freePointI << endl
<< "Edges on face:" << fEdges
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
<< " Vertices on face:"
<< mesh.faces()[faceI]
<< mesh.faces()[facei]
<< " Vertices on original edge:" << e << abort(FatalError);
return -1;
}
// Step from faceI (on side cellI) to connected face & cell without crossing
// Step from facei (on side celli) to connected face & cell without crossing
// fenceEdges.
void Foam::regionSide::visitConnectedFaces
(
const primitiveMesh& mesh,
const labelHashSet& region,
const labelHashSet& fenceEdges,
const label cellI,
const label faceI,
const label celli,
const label facei,
labelHashSet& visitedFace
)
{
if (!visitedFace.found(faceI))
if (!visitedFace.found(facei))
{
if (debug)
{
Info<< "visitConnectedFaces : cellI:" << cellI << " faceI:"
<< faceI << " isOwner:" << (cellI == mesh.faceOwner()[faceI])
Info<< "visitConnectedFaces : celli:" << celli << " facei:"
<< facei << " isOwner:" << (celli == mesh.faceOwner()[facei])
<< endl;
}
// Mark as visited
visitedFace.insert(faceI);
visitedFace.insert(facei);
// Mark which side of face was visited.
if (cellI == mesh.faceOwner()[faceI])
if (celli == mesh.faceOwner()[facei])
{
sideOwner_.insert(faceI);
sideOwner_.insert(facei);
}
// Visit all neighbouring faces on faceSet. Stay on this 'side' of
// face by doing edge-face-cell walk.
const labelList& fEdges = mesh.faceEdges()[faceI];
const labelList& fEdges = mesh.faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
@ -159,11 +159,11 @@ void Foam::regionSide::visitConnectedFaces
// we hit face on faceSet.
// Find face reachable from edge
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
if (mesh.isInternalFace(otherFaceI))
{
label otherCellI = cellI;
label otherCellI = celli;
// Keep on crossing faces/cells until back on face on
// surface
@ -173,7 +173,7 @@ void Foam::regionSide::visitConnectedFaces
if (debug)
{
Info<< "visitConnectedFaces : cellI:" << cellI
Info<< "visitConnectedFaces : celli:" << celli
<< " found insideEdgeFace:" << otherFaceI
<< endl;
}
@ -234,13 +234,13 @@ void Foam::regionSide::walkPointConnectedFaces
if (debug)
{
Info<< "walkPointConnectedFaces : regionPointI:" << regionPointI
<< " faceI:" << startFaceI
<< " facei:" << startFaceI
<< " edgeI:" << startEdgeI << " verts:"
<< mesh.edges()[startEdgeI]
<< endl;
}
// Cross faceI i.e. get edge not startEdgeI which uses regionPointI
// Cross facei i.e. get edge not startEdgeI which uses regionPointI
label edgeI = otherEdge(mesh, startFaceI, startEdgeI, regionPointI);
if (!regionEdges.found(edgeI))
@ -265,14 +265,14 @@ void Foam::regionSide::walkPointConnectedFaces
forAll(eFaces, eFaceI)
{
label faceI = eFaces[eFaceI];
label facei = eFaces[eFaceI];
walkPointConnectedFaces
(
mesh,
regionEdges,
regionPointI,
faceI,
facei,
edgeI,
visitedEdges
);
@ -298,8 +298,8 @@ void Foam::regionSide::walkAllPointConnectedFaces
forAllConstIter(labelHashSet, regionFaces, iter)
{
const label faceI = iter.key();
const labelList& fEdges = mesh.faceEdges()[faceI];
const label facei = iter.key();
const labelList& fEdges = mesh.faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
@ -331,29 +331,29 @@ void Foam::regionSide::walkAllPointConnectedFaces
forAllConstIter(labelHashSet, regionFaces, iter)
{
const label faceI = iter.key();
const label facei = iter.key();
// Get side of face.
label cellI;
label celli;
if (sideOwner_.found(faceI))
if (sideOwner_.found(facei))
{
cellI = mesh.faceOwner()[faceI];
celli = mesh.faceOwner()[facei];
}
else
{
cellI = mesh.faceNeighbour()[faceI];
celli = mesh.faceNeighbour()[facei];
}
// Find starting point and edge on face.
const labelList& fEdges = mesh.faceEdges()[faceI];
const labelList& fEdges = mesh.faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
label edgeI = fEdges[fEdgeI];
// Get the face 'perpendicular' to faceI on region.
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
// Get the face 'perpendicular' to facei on region.
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
// Edge
const edge& e = mesh.edges()[edgeI];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,20 +77,20 @@ class regionSide
static label otherEdge
(
const primitiveMesh& mesh,
const label faceI,
const label facei,
const label edgeI,
const label pointI
);
//- From faceI, side cellI, cross to other faces/cells by
//- From facei, side celli, cross to other faces/cells by
// face-cell walking and store visited faces and update sideOwner_.
void visitConnectedFaces
(
const primitiveMesh& mesh,
const labelHashSet& region,
const labelHashSet& fenceEdges,
const label cellI,
const label faceI,
const label celli,
const label facei,
labelHashSet& visitedFace
);
@ -127,7 +127,7 @@ public:
static label otherFace
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
const label excludeFaceI,
const label edgeI
);

View File

@ -250,11 +250,11 @@ void subsetSurfaceFields
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
{
DynamicList<label> nonRegionCells(cellRegion.size());
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (cellRegion[cellI] != regionI)
if (cellRegion[celli] != regionI)
{
nonRegionCells.append(cellI);
nonRegionCells.append(celli);
}
}
return nonRegionCells.shrink();
@ -329,17 +329,17 @@ void getInterfaceSizes
// Internal faces
// ~~~~~~~~~~~~~~
forAll(mesh.faceNeighbour(), faceI)
forAll(mesh.faceNeighbour(), facei)
{
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
if (ownRegion != neiRegion)
{
addToInterface
(
mesh,
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
ownRegion,
neiRegion,
regionsToSize
@ -355,15 +355,15 @@ void getInterfaceSizes
forAll(coupledRegion, i)
{
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[cellI];
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[celli];
}
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
forAll(coupledRegion, i)
{
label faceI = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label facei = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = coupledRegion[i];
if (ownRegion != neiRegion)
@ -371,7 +371,7 @@ void getInterfaceSizes
addToInterface
(
mesh,
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
ownRegion,
neiRegion,
regionsToSize
@ -519,17 +519,17 @@ void getInterfaceSizes
// Mark all inter-region faces.
faceToInterface.setSize(mesh.nFaces(), -1);
forAll(mesh.faceNeighbour(), faceI)
forAll(mesh.faceNeighbour(), facei)
{
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
if (ownRegion != neiRegion)
{
label zoneID = -1;
if (useFaceZones)
{
zoneID = mesh.faceZones().whichZone(faceI);
zoneID = mesh.faceZones().whichZone(facei);
}
edge interface
@ -538,13 +538,13 @@ void getInterfaceSizes
max(ownRegion, neiRegion)
);
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
faceToInterface[facei] = regionsToInterface[interface][zoneID];
}
}
forAll(coupledRegion, i)
{
label faceI = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label facei = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = coupledRegion[i];
if (ownRegion != neiRegion)
@ -552,7 +552,7 @@ void getInterfaceSizes
label zoneID = -1;
if (useFaceZones)
{
zoneID = mesh.faceZones().whichZone(faceI);
zoneID = mesh.faceZones().whichZone(facei);
}
edge interface
@ -561,7 +561,7 @@ void getInterfaceSizes
max(ownRegion, neiRegion)
);
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
faceToInterface[facei] = regionsToInterface[interface][zoneID];
}
}
}
@ -639,8 +639,8 @@ autoPtr<mapPolyMesh> createRegionMesh
forAll(coupledRegion, i)
{
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[cellI];
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[celli];
}
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
@ -662,19 +662,19 @@ autoPtr<mapPolyMesh> createRegionMesh
labelList exposedPatchIDs(exposedFaces.size());
forAll(exposedFaces, i)
{
label faceI = exposedFaces[i];
label interfaceI = faceToInterface[faceI];
label facei = exposedFaces[i];
label interfacei = faceToInterface[facei];
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = -1;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
}
else
{
neiRegion = coupledRegion[faceI-mesh.nInternalFaces()];
neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
}
@ -694,8 +694,8 @@ autoPtr<mapPolyMesh> createRegionMesh
else
{
FatalErrorInFunction
<< "Exposed face:" << faceI
<< " fc:" << mesh.faceCentres()[faceI]
<< "Exposed face:" << facei
<< " fc:" << mesh.faceCentres()[facei]
<< " has owner region " << ownRegion
<< " and neighbour region " << neiRegion
<< " when handling region:" << regionI
@ -705,11 +705,11 @@ autoPtr<mapPolyMesh> createRegionMesh
// Find the patch.
if (regionI < otherRegion)
{
exposedPatchIDs[i] = interfacePatches[interfaceI];
exposedPatchIDs[i] = interfacePatches[interfacei];
}
else
{
exposedPatchIDs[i] = interfacePatches[interfaceI]+1;
exposedPatchIDs[i] = interfacePatches[interfacei]+1;
}
}
@ -770,10 +770,10 @@ void createAndWriteRegion
// Make map of all added patches
labelHashSet addedPatches(2*interfacePatches.size());
forAll(interfacePatches, interfaceI)
forAll(interfacePatches, interfacei)
{
addedPatches.insert(interfacePatches[interfaceI]);
addedPatches.insert(interfacePatches[interfaceI]+1);
addedPatches.insert(interfacePatches[interfacei]);
addedPatches.insert(interfacePatches[interfacei]+1);
}
@ -968,23 +968,23 @@ void createAndWriteRegion
),
newMesh().nFaces()
);
forAll(faceProcAddressing, faceI)
forAll(faceProcAddressing, facei)
{
// face + turning index. (see decomposePar)
// Is the face pointing in the same direction?
label oldFaceI = map().faceMap()[faceI];
label oldFaceI = map().faceMap()[facei];
if
(
map().cellMap()[newMesh().faceOwner()[faceI]]
map().cellMap()[newMesh().faceOwner()[facei]]
== mesh.faceOwner()[oldFaceI]
)
{
faceProcAddressing[faceI] = oldFaceI+1;
faceProcAddressing[facei] = oldFaceI+1;
}
else
{
faceProcAddressing[faceI] = -(oldFaceI+1);
faceProcAddressing[facei] = -(oldFaceI+1);
}
}
Info<< "Writing map " << faceProcAddressing.name()
@ -1138,11 +1138,11 @@ label findCorrespondingRegion
// Per region the number of cells in zoneI
labelList cellsInZone(nCellRegions, 0);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (existingZoneID[cellI] == zoneI)
if (existingZoneID[celli] == zoneI)
{
cellsInZone[cellRegion[cellI]]++;
cellsInZone[cellRegion[celli]]++;
}
}
@ -1161,11 +1161,11 @@ label findCorrespondingRegion
else
{
// Check that region contains no cells that aren't in cellZone.
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (cellRegion[cellI] == regionI && existingZoneID[cellI] != zoneI)
if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
{
// cellI in regionI but not in zoneI
// celli in regionI but not in zoneI
regionI = -1;
break;
}
@ -1200,18 +1200,18 @@ void getZoneID
forAll(cz, i)
{
label cellI = cz[i];
if (zoneID[cellI] == -1)
label celli = cz[i];
if (zoneID[celli] == -1)
{
zoneID[cellI] = zoneI;
zoneID[celli] = zoneI;
}
else
{
FatalErrorInFunction
<< "Cell " << cellI << " with cell centre "
<< mesh.cellCentres()[cellI]
<< "Cell " << celli << " with cell centre "
<< mesh.cellCentres()[celli]
<< " is multiple zones. This is not allowed." << endl
<< "It is in zone " << cellZones[zoneID[cellI]].name()
<< "It is in zone " << cellZones[zoneID[celli]].name()
<< " and in zone " << cellZones[zoneI].name()
<< exit(FatalError);
}
@ -1386,9 +1386,9 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
dimensionedScalar("zero", dimless, 0),
zeroGradientFvPatchScalarField::typeName
);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
cellToRegion[cellI] = cellRegion[cellI];
cellToRegion[celli] = cellRegion[celli];
}
cellToRegion.write();
@ -1662,25 +1662,25 @@ int main(int argc, char *argv[])
{
blockedFace.setSize(mesh.nFaces(), false);
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
label own = mesh.faceOwner()[faceI];
label nei = mesh.faceNeighbour()[faceI];
label own = mesh.faceOwner()[facei];
label nei = mesh.faceNeighbour()[facei];
if (zoneID[own] != zoneID[nei])
{
blockedFace[faceI] = true;
blockedFace[facei] = true;
}
}
// Different cellZones on either side of processor patch.
forAll(neiZoneID, i)
{
label faceI = i+mesh.nInternalFaces();
label facei = i+mesh.nInternalFaces();
if (zoneID[mesh.faceOwner()[faceI]] != neiZoneID[i])
if (zoneID[mesh.faceOwner()[facei]] != neiZoneID[i])
{
blockedFace[faceI] = true;
blockedFace[facei] = true;
}
}
}
@ -1740,9 +1740,9 @@ int main(int argc, char *argv[])
labelList regionSizes(nCellRegions, 0);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
regionSizes[cellRegion[cellI]]++;
regionSizes[cellRegion[celli]]++;
}
forAll(regionSizes, regionI)
{
@ -1992,14 +1992,14 @@ int main(int argc, char *argv[])
(void)mesh.tetBasePtIs();
label cellI = mesh.findCell(insidePoint);
label celli = mesh.findCell(insidePoint);
Info<< nl << "Found point " << insidePoint << " in cell " << cellI
Info<< nl << "Found point " << insidePoint << " in cell " << celli
<< endl;
if (cellI != -1)
if (celli != -1)
{
regionI = cellRegion[cellI];
regionI = cellRegion[celli];
}
reduce(regionI, maxOp<label>());

View File

@ -12,11 +12,11 @@
{
const labelList& curFaceAddr = faceProcAddressing[procI];
forAll(curFaceAddr, faceI)
forAll(curFaceAddr, facei)
{
if (mag(curFaceAddr[faceI]) < minFaceIndex)
if (mag(curFaceAddr[facei]) < minFaceIndex)
{
minFaceIndex = mag(curFaceAddr[faceI]);
minFaceIndex = mag(curFaceAddr[facei]);
}
}
}
@ -37,9 +37,9 @@
{
labelList& curFaceAddr = faceProcAddressing[procI];
forAll(curFaceAddr, faceI)
forAll(curFaceAddr, facei)
{
curFaceAddr[faceI] += sign(curFaceAddr[faceI]);
curFaceAddr[facei] += sign(curFaceAddr[facei]);
}
faceProcAddressing[procI].write();

View File

@ -404,9 +404,9 @@ void writeCellDistance
zeroGradientFvPatchScalarField::typeName
);
forAll(cellDecomposition, cellI)
forAll(cellDecomposition, celli)
{
cellDist[cellI] = cellDecomposition[cellI];
cellDist[celli] = cellDecomposition[celli];
}
cellDist.write();

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