STYLE: use forAllIter, forAllConstIter instead of long-hand version

STYLE: use 'forAll(' NOT 'forAll (', as per coding guide
This commit is contained in:
Mark Olesen
2010-04-12 11:18:38 +02:00
parent 0f58ac5a9b
commit a50f01b079
220 changed files with 1144 additions and 1898 deletions

View File

@ -84,7 +84,7 @@
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll (Y, i) forAll(Y, i)
{ {
fields.add(Y[i]); fields.add(Y[i]);
} }

View File

@ -292,20 +292,14 @@ void addCutNeighbours
labelHashSet addCutFaces(cutCells.size()); labelHashSet addCutFaces(cutCells.size());
for forAllConstIter(labelHashSet, cutCells, iter)
(
labelHashSet::const_iterator iter = cutCells.begin();
iter != cutCells.end();
++iter
)
{ {
label cellI = iter.key(); const label cellI = iter.key();
const labelList& cFaces = mesh.cells()[cellI]; const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, i) forAll(cFaces, i)
{ {
label faceI = cFaces[i]; const label faceI = cFaces[i];
if (mesh.isInternalFace(faceI)) if (mesh.isInternalFace(faceI))
{ {
@ -331,12 +325,7 @@ void addCutNeighbours
Info<< " Selected an additional " << addCutFaces.size() Info<< " Selected an additional " << addCutFaces.size()
<< " neighbours of cutCells to refine" << endl; << " neighbours of cutCells to refine" << endl;
for forAllConstIter(labelHashSet, addCutFaces, iter)
(
labelHashSet::const_iterator iter = addCutFaces.begin();
iter != addCutFaces.end();
++iter
)
{ {
cutCells.insert(iter.key()); cutCells.insert(iter.key());
} }
@ -386,21 +375,15 @@ bool limitRefinementLevel
labelHashSet addCutCells(cutCells.size()); labelHashSet addCutCells(cutCells.size());
for forAllConstIter(labelHashSet, cutCells, iter)
(
labelHashSet::const_iterator iter = cutCells.begin();
iter != cutCells.end();
++iter
)
{ {
// cellI will be refined. // cellI will be refined.
label cellI = iter.key(); const label cellI = iter.key();
const labelList& cCells = mesh.cellCells()[cellI]; const labelList& cCells = mesh.cellCells()[cellI];
forAll(cCells, i) forAll(cCells, i)
{ {
label nbr = cCells[i]; const label nbr = cCells[i];
if (!excludeCells.found(nbr) && !cutCells.found(nbr)) if (!excludeCells.found(nbr) && !cutCells.found(nbr))
{ {
@ -419,12 +402,8 @@ bool limitRefinementLevel
Info<< "Added an additional " << addCutCells.size() << " cells" Info<< "Added an additional " << addCutCells.size() << " cells"
<< " to satisfy 1:" << limitDiff << " refinement level" << " to satisfy 1:" << limitDiff << " refinement level"
<< endl; << endl;
for
( forAllConstIter(labelHashSet, addCutCells, iter)
labelHashSet::const_iterator iter = addCutCells.begin();
iter != addCutCells.end();
++iter
)
{ {
cutCells.insert(iter.key()); cutCells.insert(iter.key());
} }

View File

@ -112,12 +112,7 @@ int main(int argc, char *argv[])
<< cells.instance()/cells.local()/cells.name() << cells.instance()/cells.local()/cells.name()
<< nl << endl; << nl << endl;
for forAllConstIter(cellSet, cells, iter)
(
cellSet::const_iterator iter = cells.begin();
iter != cells.end();
++iter
)
{ {
cutCells.erase(iter.key()); cutCells.erase(iter.key());
} }
@ -131,7 +126,7 @@ int main(int argc, char *argv[])
forAll(meshPoints, pointI) forAll(meshPoints, pointI)
{ {
label meshPointI = meshPoints[pointI]; const label meshPointI = meshPoints[pointI];
vertOnPatch[meshPointI] = true; vertOnPatch[meshPointI] = true;
} }
@ -151,8 +146,7 @@ int main(int argc, char *argv[])
forAll(pEdges, pEdgeI) forAll(pEdges, pEdgeI)
{ {
label edgeI = pEdges[pEdgeI]; const label edgeI = pEdges[pEdgeI];
const edge& e = mesh.edges()[edgeI]; const edge& e = mesh.edges()[edgeI];
label otherPointI = e.otherVertex(meshPointI); label otherPointI = e.otherVertex(meshPointI);

View File

@ -392,15 +392,9 @@ void collectCuts
boolList edgeIsCut(mesh.nEdges(), false); boolList edgeIsCut(mesh.nEdges(), false);
scalarField edgeWeight(mesh.nEdges(), -GREAT); scalarField edgeWeight(mesh.nEdges(), -GREAT);
for forAllConstIter(cellSet, cellsToCut, iter)
(
cellSet::const_iterator iter = cellsToCut.begin();
iter != cellsToCut.end();
++iter
)
{ {
label cellI = iter.key(); const label cellI = iter.key();
const labelList& cEdges = cellEdges[cellI]; const labelList& cEdges = cellEdges[cellI];
forAll(cEdges, i) forAll(cEdges, i)

View File

@ -268,13 +268,8 @@ int main(int argc, char *argv[])
pointField points(slPoints.size()); pointField points(slPoints.size());
label i=0; label i = 0;
for forAllConstIter(SLList<point>, slPoints, pointIter)
(
SLList<point>::iterator pointIter = slPoints.begin();
pointIter != slPoints.end();
++pointIter
)
{ {
// Scale points for the given scale factor // Scale points for the given scale factor
points[i++] = scaleFactor * pointIter(); points[i++] = scaleFactor * pointIter();
@ -283,13 +278,8 @@ int main(int argc, char *argv[])
labelList pointMap(maxNodei+1); labelList pointMap(maxNodei+1);
i=0; i = 0;
for forAllConstIter(SLList<label>, slPointMap, pointMapIter)
(
SLList<label>::iterator pointMapIter = slPointMap.begin();
pointMapIter != slPointMap.end();
++pointMapIter
)
{ {
pointMap[pointMapIter()] = i++; pointMap[pointMapIter()] = i++;
} }
@ -298,13 +288,8 @@ int main(int argc, char *argv[])
labelList cellMap(maxCelli+1); labelList cellMap(maxCelli+1);
i=0; i = 0;
for forAllConstIter(SLList<label>, slCellMap, cellMapIter)
(
SLList<label>::iterator cellMapIter = slCellMap.begin();
cellMapIter != slCellMap.end();
++cellMapIter
)
{ {
cellMap[cellMapIter()] = i++; cellMap[cellMapIter()] = i++;
} }
@ -323,12 +308,7 @@ int main(int argc, char *argv[])
cellShapeList cellShapes(slCellLabels.size()); cellShapeList cellShapes(slCellLabels.size());
label nCells = 0; label nCells = 0;
for forAllConstIter(SLPtrList<labelList>, slCellLabels, cellIter)
(
SLPtrList<labelList>::iterator cellIter = slCellLabels.begin();
cellIter != slCellLabels.end();
++cellIter
)
{ {
if // Tetrahedron if // Tetrahedron
( (

View File

@ -327,12 +327,7 @@ if
{ {
scalar minz = GREAT; scalar minz = GREAT;
for forAllConstIter(SLList<face>, pFaces[CYLINDERHEAD][0], iter)
(
SLList<face>::iterator iter = pFaces[CYLINDERHEAD][0].begin();
iter != pFaces[CYLINDERHEAD][0].end();
++iter
)
{ {
const face& pf = iter(); const face& pf = iter();
@ -346,12 +341,7 @@ if
SLList<face> newLinerFaces; SLList<face> newLinerFaces;
for forAllConstIter(SLList<face>, pFaces[LINER][0], iter)
(
SLList<face>::iterator iter = pFaces[LINER][0].begin();
iter != pFaces[LINER][0].end();
++iter
)
{ {
const face& pf = iter(); const face& pf = iter();
@ -380,12 +370,7 @@ if
SLList<face> newCylinderHeadFaces; SLList<face> newCylinderHeadFaces;
for forAllConstIter(SLList<face>, pFaces[CYLINDERHEAD][0], iter)
(
SLList<face>::iterator iter = pFaces[CYLINDERHEAD][0].begin();
iter != pFaces[CYLINDERHEAD][0].end();
++iter
)
{ {
const face& pf = iter(); const face& pf = iter();

View File

@ -468,12 +468,7 @@ int main(int argc, char *argv[])
// Print region to patch mapping // Print region to patch mapping
Info<< "Regions:" << endl; Info<< "Regions:" << endl;
for forAllConstIter(Map<label>, regionToPatch, iter)
(
Map<label>::const_iterator iter = regionToPatch.begin();
iter != regionToPatch.end();
++iter
)
{ {
Info<< " region:" << iter.key() << '\t' << "patch:" Info<< " region:" << iter.key() << '\t' << "patch:"
<< iter() << endl; << iter() << endl;

View File

@ -356,12 +356,7 @@ void writePointCells
label vertI = 0; label vertI = 0;
for forAllConstIter(labelHashSet, allEdges, iter)
(
labelHashSet::const_iterator iter = allEdges.begin();
iter != allEdges.end();
++iter
)
{ {
const edge& e = mesh.edges()[iter.key()]; const edge& e = mesh.edges()[iter.key()];

View File

@ -100,12 +100,7 @@ int main(int argc, char *argv[])
//Pout<< "pointSets:" << pointObjects.names() << endl; //Pout<< "pointSets:" << pointObjects.names() << endl;
for forAllConstIter(IOobjectList, pointObjects, iter)
(
IOobjectList::const_iterator iter = pointObjects.begin();
iter != pointObjects.end();
++iter
)
{ {
// Not in memory. Load it. // Not in memory. Load it.
pointSet set(*iter()); pointSet set(*iter());
@ -149,12 +144,7 @@ int main(int argc, char *argv[])
//Pout<< "faceSets:" << faceObjects.names() << endl; //Pout<< "faceSets:" << faceObjects.names() << endl;
for forAllConstIter(IOobjectList, faceObjects, iter)
(
IOobjectList::const_iterator iter = faceObjects.begin();
iter != faceObjects.end();
++iter
)
{ {
// Not in memory. Load it. // Not in memory. Load it.
faceSet set(*iter()); faceSet set(*iter());
@ -288,12 +278,7 @@ int main(int argc, char *argv[])
//Pout<< "cellSets:" << cellObjects.names() << endl; //Pout<< "cellSets:" << cellObjects.names() << endl;
for forAllConstIter(IOobjectList, cellObjects, iter)
(
IOobjectList::const_iterator iter = cellObjects.begin();
iter != cellObjects.end();
++iter
)
{ {
if (!slaveCellSets.found(iter.key())) if (!slaveCellSets.found(iter.key()))
{ {

View File

@ -81,8 +81,7 @@ Foam::label Foam::regionSide::otherEdge
forAll(fEdges, fEdgeI) forAll(fEdges, fEdgeI)
{ {
label otherEdgeI = fEdges[fEdgeI]; const label otherEdgeI = fEdges[fEdgeI];
const edge& otherE = mesh.edges()[otherEdgeI]; const edge& otherE = mesh.edges()[otherEdgeI];
if if
@ -300,15 +299,9 @@ void Foam::regionSide::walkAllPointConnectedFaces
// //
labelHashSet regionEdges(4*regionFaces.size()); labelHashSet regionEdges(4*regionFaces.size());
for forAllConstIter(labelHashSet, regionFaces, iter)
(
labelHashSet::const_iterator iter = regionFaces.begin();
iter != regionFaces.end();
++iter
)
{ {
label faceI = iter.key(); const label faceI = iter.key();
const labelList& fEdges = mesh.faceEdges()[faceI]; const labelList& fEdges = mesh.faceEdges()[faceI];
forAll(fEdges, fEdgeI) forAll(fEdges, fEdgeI)
@ -326,12 +319,7 @@ void Foam::regionSide::walkAllPointConnectedFaces
labelHashSet visitedPoint(4*regionFaces.size()); labelHashSet visitedPoint(4*regionFaces.size());
// Insert fence points so we don't visit them // Insert fence points so we don't visit them
for forAllConstIter(labelHashSet, fencePoints, iter)
(
labelHashSet::const_iterator iter = fencePoints.begin();
iter != fencePoints.end();
++iter
)
{ {
visitedPoint.insert(iter.key()); visitedPoint.insert(iter.key());
} }
@ -344,14 +332,9 @@ void Foam::regionSide::walkAllPointConnectedFaces
Info<< "Excluding visit of points:" << visitedPoint << endl; Info<< "Excluding visit of points:" << visitedPoint << endl;
} }
for forAllConstIter(labelHashSet, regionFaces, iter)
(
labelHashSet::const_iterator iter = regionFaces.begin();
iter != regionFaces.end();
++iter
)
{ {
label faceI = iter.key(); const label faceI = iter.key();
// Get side of face. // Get side of face.
label cellI; label cellI;
@ -459,12 +442,7 @@ Foam::regionSide::regionSide
labelHashSet fencePoints(fenceEdges.size()); labelHashSet fencePoints(fenceEdges.size());
for forAllConstIter(labelHashSet, fenceEdges, iter)
(
labelHashSet::const_iterator iter = fenceEdges.begin();
iter != fenceEdges.end();
++iter
)
{ {
const edge& e = mesh.edges()[iter.key()]; const edge& e = mesh.edges()[iter.key()];

View File

@ -360,7 +360,7 @@ int main(int argc, char *argv[])
labelList osf(slavePatch.size()); labelList osf(slavePatch.size());
forAll (osf, i) forAll(osf, i)
{ {
osf[i] = slavePatch.start() + i; osf[i] = slavePatch.start() + i;
} }

View File

@ -76,12 +76,7 @@ int main(int argc, char *argv[])
if (args.optionFound("keywords") && !args.optionFound("entry")) if (args.optionFound("keywords") && !args.optionFound("entry"))
{ {
for forAllConstIter(dictionary, dict, iter)
(
IDLList<entry>::iterator iter = dict.begin();
iter != dict.end();
++iter
)
{ {
Info<< iter().keyword() << endl; Info<< iter().keyword() << endl;
} }
@ -137,13 +132,8 @@ int main(int argc, char *argv[])
} }
*/ */
const dictionary& dict(entPtr->dict()); const dictionary& dict = entPtr->dict();
for forAllConstIter(dictionary, dict, iter)
(
IDLList<entry>::const_iterator iter = dict.begin();
iter != dict.end();
++iter
)
{ {
Info<< iter().keyword() << endl; Info<< iter().keyword() << endl;
} }

View File

@ -506,12 +506,7 @@ void Foam::domainDecomposition::decomposeMesh()
// Add internal and boundary faces // Add internal and boundary faces
// Remember to increment the index by one such that the // Remember to increment the index by one such that the
// turning index works properly. // turning index works properly.
for forAllIter(SLList<label>, curProcFaces, curProcFacesIter)
(
SLList<label>::iterator curProcFacesIter = curProcFaces.begin();
curProcFacesIter != curProcFaces.end();
++curProcFacesIter
)
{ {
curProcFaceAddressing[nFaces] = curProcFacesIter() + 1; curProcFaceAddressing[nFaces] = curProcFacesIter() + 1;
nFaces++; nFaces++;
@ -564,12 +559,11 @@ void Foam::domainDecomposition::decomposeMesh()
// add faces for this processor boundary // add faces for this processor boundary
for forAllIter
( (
SLList<label>::iterator curFacesIter = SLList<label>,
curInterProcBFacesIter().begin(); curInterProcBFacesIter(),
curFacesIter != curInterProcBFacesIter().end(); curFacesIter
++curFacesIter
) )
{ {
// add the face // add the face

View File

@ -48,22 +48,13 @@ void Foam::readFields
// Construct the vol scalar fields // Construct the vol scalar fields
fields.setSize(fieldObjects.size()); fields.setSize(fieldObjects.size());
label fieldi=0; label fieldI = 0;
for forAllIter(IOobjectList, fieldObjects, iter)
(
IOobjectList::iterator iter = fieldObjects.begin();
iter != fieldObjects.end();
++iter
)
{ {
fields.set fields.set
( (
fieldi++, fieldI++,
new GeoField new GeoField(*iter(), mesh)
(
*iter(),
mesh
)
); );
} }
} }

View File

@ -110,34 +110,21 @@ int main(int argc, char *argv[])
// Search list of objects for volScalarFields // Search list of objects for volScalarFields
IOobjectList scalarFields(objects.lookupClass("volScalarField")); IOobjectList scalarFields(objects.lookupClass("volScalarField"));
for forAllIter(IOobjectList, scalarFields, iter)
(
IOobjectList::iterator scalarFieldIter = scalarFields.begin();
scalarFieldIter != scalarFields.end();
++scalarFieldIter
)
{ {
// Read field // Read field
volScalarField field volScalarField field(*iter(), mesh);
// lookup field from dictionary and convert field
label unitNumber;
if
( (
*scalarFieldIter(), foamDataToFluentDict.readIfPresent(field.name(), unitNumber)
mesh && unitNumber > 0
); )
// lookup field from dictionary
if (foamDataToFluentDict.found(field.name()))
{ {
label unitNumber Info<< " Converting field " << field.name() << endl;
( writeFluentField(field, unitNumber, fluentDataFile);
readLabel(foamDataToFluentDict.lookup(field.name()))
);
// Convert field
if (unitNumber > 0)
{
Info<< " Converting field " << field.name() << endl;
writeFluentField(field, unitNumber, fluentDataFile);
}
} }
} }
@ -148,34 +135,21 @@ int main(int argc, char *argv[])
// Search list of objects for volVectorFields // Search list of objects for volVectorFields
IOobjectList vectorFields(objects.lookupClass("volVectorField")); IOobjectList vectorFields(objects.lookupClass("volVectorField"));
for forAllIter(IOobjectList, vectorFields, iter)
(
IOobjectList::iterator vectorFieldIter = vectorFields.begin();
vectorFieldIter != vectorFields.end();
++vectorFieldIter
)
{ {
// Read field // Read field
volVectorField field volVectorField field(*iter(), mesh);
// lookup field from dictionary and convert field
label unitNumber;
if
( (
*vectorFieldIter(), foamDataToFluentDict.readIfPresent(field.name(), unitNumber)
mesh && unitNumber > 0
); )
// lookup field from dictionary
if (foamDataToFluentDict.found(field.name()))
{ {
label unitNumber Info<< " Converting field " << field.name() << endl;
( writeFluentField(field, unitNumber, fluentDataFile);
readLabel(foamDataToFluentDict.lookup(field.name()))
);
// Convert field
if (unitNumber > 0)
{
Info<< " Converting field " << field.name() << endl;
writeFluentField(field, unitNumber, fluentDataFile);
}
} }
} }

View File

@ -22,11 +22,11 @@ for (label i=0; i < nTypes; i++)
if (fieldTypes[i] == "volScalarField") if (fieldTypes[i] == "volScalarField")
{ {
volScalarField gmvScalarField(fieldObject, mesh); volScalarField fld(fieldObject, mesh);
gmvFile << fieldName << " 0" << nl; gmvFile << fieldName << " 0" << nl;
for (label indx=0;indx<mesh.nCells();indx++) for (label indx=0;indx<mesh.nCells();indx++)
{ {
gmvFile << gmvScalarField[indx] << " "; gmvFile << fld[indx] << " ";
} }
gmvFile << nl; gmvFile << nl;
} }
@ -35,19 +35,19 @@ for (label i=0; i < nTypes; i++)
{ {
if (fieldName == vComp) if (fieldName == vComp)
{ {
volVectorField gmvVectorField(fieldObject, mesh); volVectorField fld(fieldObject, mesh);
gmvFile << "velocity 0" << nl; gmvFile << "velocity 0" << nl;
for (label indx=0;indx<mesh.nCells();indx++) for (label indx=0;indx<mesh.nCells();indx++)
{ {
gmvFile << gmvVectorField[indx].x() << " "; gmvFile << fld[indx].x() << " ";
} }
for (label indx=0;indx<mesh.nCells();indx++) for (label indx=0;indx<mesh.nCells();indx++)
{ {
gmvFile << gmvVectorField[indx].y() << " "; gmvFile << fld[indx].y() << " ";
} }
for (label indx=0;indx<mesh.nCells();indx++) for (label indx=0;indx<mesh.nCells();indx++)
{ {
gmvFile << gmvVectorField[indx].z() << " "; gmvFile << fld[indx].z() << " ";
} }
gmvFile << nl; gmvFile << nl;
} }

View File

@ -1,42 +1,27 @@
gmvFile << "tracers " << particles.size() << nl; gmvFile << "tracers " << particles.size() << nl;
for forAllConstIter(Cloud<passiveParticle>, particles, iter)
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().x() << " "; gmvFile << iter().position().x() << ' ';
} }
gmvFile << nl; gmvFile << nl;
for forAllConstIter(Cloud<passiveParticle>, particles, iter)
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().y() << " "; gmvFile << iter().position().y() << ' ';
} }
gmvFile << nl; gmvFile << nl;
for forAllConstIter(Cloud<passiveParticle>, particles, iter)
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().z() << " "; gmvFile << iter().position().z() << ' ';
} }
gmvFile << nl; gmvFile << nl;
forAll(lagrangianScalarNames, i) forAll(lagrangianScalarNames, i)
{ {
word name = lagrangianScalarNames[i]; const word name = lagrangianScalarNames[i];
IOField<scalar> s IOField<scalar> fld
( (
IOobject IOobject
( (
@ -49,13 +34,13 @@ forAll(lagrangianScalarNames, i)
) )
); );
if (s.size()) if (fld.size())
{ {
gmvFile << name << nl; gmvFile << name << nl;
for (label n = 0; n < s.size(); n++) forAll(fld, n)
{ {
gmvFile << s[n] << token::SPACE; gmvFile << fld[n] << token::SPACE;
} }
gmvFile << nl; gmvFile << nl;
} }
@ -65,9 +50,9 @@ forAll(lagrangianScalarNames, i)
forAll(lagrangianVectorNames, i) forAll(lagrangianVectorNames, i)
{ {
word name = lagrangianVectorNames[i]; const word name = lagrangianVectorNames[i];
IOField<vector> v IOField<vector> fld
( (
IOobject IOobject
( (
@ -80,29 +65,29 @@ forAll(lagrangianVectorNames, i)
) )
); );
if (v.size()) if (fld.size())
{ {
gmvFile << name + "x" << nl; gmvFile << name + "x" << nl;
for (label n = 0; n < v.size(); n++) forAll(fld, n)
{ {
gmvFile << v[n].x() << token::SPACE; gmvFile << fld[n].x() << token::SPACE;
} }
gmvFile << nl; gmvFile << nl;
gmvFile << name + "y" << nl; gmvFile << name + "y" << nl;
for (label n = 0; n < v.size(); n++) forAll(fld, n)
{ {
gmvFile << v[n].y() << token::SPACE; gmvFile << fld[n].y() << token::SPACE;
} }
gmvFile << nl; gmvFile << nl;
gmvFile << name + "z" << nl; gmvFile << name + "z" << nl;
for (label n = 0; n < v.size(); n++) forAll(fld, n)
{ {
gmvFile << v[n].z() << token::SPACE; gmvFile << fld[n].z() << token::SPACE;
} }
gmvFile << nl; gmvFile << nl;
} }

View File

@ -1,81 +1,48 @@
gmvFile << "tracers " << particles.size() << nl; gmvFile << "tracers " << particles.size() << nl;
for forAllConstIter(discretePhase, particles, iter)
(
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().x() << " "; gmvFile << iter().position().x() << " ";
} }
gmvFile << nl; gmvFile << nl;
for
( forAllConstIter(discretePhase, particles, iter)
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().y() << " "; gmvFile << iter().position().y() << " ";
} }
gmvFile << nl; gmvFile << nl;
for
( forAllConstIter(discretePhase, particles, iter)
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().z() << " "; gmvFile << iter().position().z() << " ";
} }
gmvFile << nl; gmvFile << nl;
gmvFile << "U" << nl; gmvFile << "U" << nl;
for forAllConstIter(discretePhase, particles, iter)
(
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().velocity().x() << " "; gmvFile << iter().velocity().x() << " ";
} }
gmvFile << nl; gmvFile << nl;
gmvFile << "V" << nl; gmvFile << "V" << nl;
for forAllConstIter(discretePhase, particles, iter)
(
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().velocity().y() << " "; gmvFile << iter().velocity().y() << " ";
} }
gmvFile << nl; gmvFile << nl;
gmvFile << "W" << nl; gmvFile << "W" << nl;
for forAllConstIter(discretePhase, particles, iter)
(
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().velocity().z() << " "; {
gmvFile << iter().velocity().z() << " ";
} }
gmvFile << nl; gmvFile << nl;
gmvFile << "Diam" << nl; gmvFile << "Diam" << nl;
forAllConstIter(discretePhase, particles, iter)
for
(
discretePhase::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().d() << " "; gmvFile << iter().d() << " ";
} }
gmvFile << "endtrace"<< nl; gmvFile << "endtrace"<< nl;

View File

@ -1,32 +1,19 @@
gmvFile << "tracers " << particles.size() << nl; gmvFile << "tracers " << particles.size() << nl;
for forAllConstIter(Cloud<passiveParticle>, particles, iter)
(
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().x() << " "; gmvFile << iter().position().x() << " ";
} }
gmvFile << nl; gmvFile << nl;
for
( forAllConstIter(Cloud<passiveParticle>, particles, iter)
Cloud<passiveParticle>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().y() << " "; gmvFile << iter().position().y() << " ";
} }
gmvFile << nl; gmvFile << nl;
for
( forAllConstIter(Cloud<passiveParticle>, particles, iter)
Cloud<passiveParticles>::iterator elmnt = particles.begin();
elmnt != particles.end();
++elmnt
)
{ {
gmvFile << elmnt().position().z() << " "; gmvFile << iter().position().z() << " ";
} }
gmvFile << nl; gmvFile << nl;
@ -51,15 +38,13 @@ forAll(lagrangianScalarNames, i)
{ {
gmvFile << name << nl; gmvFile << name << nl;
for (label n = 0; n < s.size(); n++) forAll(s, n)
{ {
gmvFile << s[n] << token::SPACE; gmvFile << s[n] << token::SPACE;
} }
gmvFile << nl; gmvFile << nl;
} }
} }
gmvFile << "endtrace"<< nl; gmvFile << "endtrace"<< nl;

View File

@ -1,2 +1,3 @@
gmvFile << "probtime " << runTime.timeName() << nl; gmvFile
gmvFile << "endgmv" << nl; << "probtime " << runTime.timeName() << nl
<< "endgmv" << nl;

View File

@ -26,13 +26,14 @@ word format
conversionProperties.lookup("format") conversionProperties.lookup("format")
); );
if ( (format != "ascii") && (format != "ieeei4r8") ) if ((format != "ascii") && (format != "ieeei4r8"))
{ {
FatalError << "format type: " << format << " unknown." FatalError << "format type: " << format << " unknown."
<< " Valid options are: ascii ieeei4r8" << " Valid options are: ascii ieeei4r8"
<< abort(FatalError); << abort(FatalError);
} }
word cells word cells
( (
conversionProperties.lookup("cells") conversionProperties.lookup("cells")

View File

@ -50,12 +50,7 @@ void readFields
label nFields = fields.size(); label nFields = fields.size();
fields.setSize(nFields + fieldObjects.size()); fields.setSize(nFields + fieldObjects.size());
for forAllIter(IOobjectList::iterator, fieldObjects, iter)
(
IOobjectList::iterator iter = fieldObjects.begin();
iter != fieldObjects.end();
++iter
)
{ {
if (selectedFields.empty() || selectedFields.found(iter()->name())) if (selectedFields.empty() || selectedFields.found(iter()->name()))
{ {

View File

@ -50,12 +50,7 @@ void readFields
fields.setSize(fieldObjects.size()); fields.setSize(fieldObjects.size());
label nFields = 0; label nFields = 0;
for forAllIter(IOobjectList, fieldObjects, iter)
(
IOobjectList::iterator iter = fieldObjects.begin();
iter != fieldObjects.end();
++iter
)
{ {
if (selectedFields.empty() || selectedFields.found(iter()->name())) if (selectedFields.empty() || selectedFields.found(iter()->name()))
{ {

View File

@ -27,14 +27,9 @@ License
#include "OFstream.H" #include "OFstream.H"
#include "writeFuns.H" #include "writeFuns.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void writeFaceSet void Foam::writeFaceSet
( (
const bool binary, const bool binary,
const vtkMesh& vMesh, const vtkMesh& vMesh,
@ -73,12 +68,7 @@ void writeFaceSet
labelList setFaceLabels(set.size()); labelList setFaceLabels(set.size());
label setFaceI = 0; label setFaceI = 0;
for forAllConstIter(faceSet, set, iter)
(
faceSet::const_iterator iter = set.begin();
iter != set.end();
++iter
)
{ {
setFaceLabels[setFaceI] = iter.key(); setFaceLabels[setFaceI] = iter.key();
setFaces[setFaceI] = faces[iter.key()]; setFaces[setFaceI] = faces[iter.key()];
@ -139,8 +129,5 @@ void writeFaceSet
writeFuns::write(pStream, binary, setFaceLabels); writeFuns::write(pStream, binary, setFaceLabels);
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,19 +47,13 @@ int USERD_get_part_coords
} }
else if (part_number == nPatches+2) else if (part_number == nPatches+2)
{ {
label indx = 1; label indx = 1;
for forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
(
Cloud<passiveParticle>::iterator elmnt = sprayPtr->begin();
elmnt != sprayPtr->end();
++elmnt
)
{ {
coord_array[0][indx] = (float)elmnt().position().x(); coord_array[0][indx] = (float)iter().position().x();
coord_array[1][indx] = (float)elmnt().position().y(); coord_array[1][indx] = (float)iter().position().y();
coord_array[2][indx] = (float)elmnt().position().z(); coord_array[2][indx] = (float)iter().position().z();
indx++; indx++;
} }

View File

@ -17,7 +17,7 @@ int USERD_get_part_node_ids
nodeid_array[indx] = indx + 1; nodeid_array[indx] = indx + 1;
} }
} }
else if (part_number < nPatches+2) else if (part_number < nPatches+2)
{ {
label patchi = part_number-2; label patchi = part_number-2;
@ -32,18 +32,14 @@ int USERD_get_part_node_ids
} }
} }
else if (part_number == nPatches+2) else if (part_number == nPatches+2)
{ {
label indx = 0; label indx = 0;
for
( forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
Cloud<passiveParticle>::iterator elmnt = sprayPtr->begin();
elmnt != sprayPtr->end();
++elmnt
)
{ {
nodeid_array[indx] = indx + 1; nodeid_array[indx] = indx + 1;
indx++; indx++;
} }
} }
else else

View File

@ -52,12 +52,7 @@ void MapConsistentVolFields
IOobjectList fields = objects.lookupClass(fieldClassName); IOobjectList fields = objects.lookupClass(fieldClassName);
for forAllIter(IOobjectList, fields, fieldIter)
(
IOobjectList::iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
{ {
Info<< " interpolating " << fieldIter()->name() Info<< " interpolating " << fieldIter()->name()
<< endl; << endl;

View File

@ -52,12 +52,7 @@ void MapVolFields
IOobjectList fields = objects.lookupClass(fieldClassName); IOobjectList fields = objects.lookupClass(fieldClassName);
for forAllIter(IOobjectList, fields, fieldIter)
(
IOobjectList::iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
{ {
IOobject fieldTargetIOobject IOobject fieldTargetIOobject
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,12 +39,7 @@ void UnMapped(const IOobjectList& objects)
{ {
IOobjectList fields = objects.lookupClass(Type::typeName); IOobjectList fields = objects.lookupClass(Type::typeName);
for forAllConstIter(IOobjectList, fields, fieldIter)
(
IOobjectList::iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
{ {
mvBak(fieldIter()->objectPath(), "unmapped"); mvBak(fieldIter()->objectPath(), "unmapped");
} }

View File

@ -126,18 +126,13 @@ void dumpFaces
OFstream os(fName); OFstream os(fName);
for forAllConstIter(Map<label>, connectedFaces, iter)
(
Map<label>::const_iterator iter = connectedFaces.begin();
iter != connectedFaces.end();
++iter
)
{ {
const labelledTri& f = surf.localFaces()[iter.key()]; const labelledTri& f = surf.localFaces()[iter.key()];
point ctr(f.centre(surf.localPoints())); point ctr(f.centre(surf.localPoints()));
os << "v " << ctr.x() << ' ' << ctr.y() << ' ' << ctr.z() << endl; os << "v " << ctr.x() << ' ' << ctr.y() << ' ' << ctr.z() << endl;
} }
} }
@ -502,14 +497,9 @@ void calcPointVecs
boolList edgeDone(surf.nEdges(), false); boolList edgeDone(surf.nEdges(), false);
for forAllConstIter(Map<label>, faceToEdge, iter)
(
Map<label>::const_iterator iter = faceToEdge.begin();
iter != faceToEdge.end();
++iter
)
{ {
label edgeI = iter(); const label edgeI = iter();
if (!edgeDone[edgeI]) if (!edgeDone[edgeI])
{ {
@ -610,15 +600,9 @@ void renumberFaces
List<labelledTri>& newTris List<labelledTri>& newTris
) )
{ {
for forAllConstIter(Map<label>, faceToEdge, iter)
(
Map<label>::const_iterator iter = faceToEdge.begin();
iter != faceToEdge.end();
++iter
)
{ {
label faceI = iter.key(); const label faceI = iter.key();
const labelledTri& f = surf.localFaces()[faceI]; const labelledTri& f = surf.localFaces()[faceI];
forAll(f, fp) forAll(f, fp)

View File

@ -51,7 +51,6 @@ int main(int argc, char *argv[])
{ {
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
Info<< nl << "Reading Burcat data IOdictionary" << endl; Info<< nl << "Reading Burcat data IOdictionary" << endl;
@ -119,17 +118,11 @@ int main(int argc, char *argv[])
); );
for forAllConstIter(SLPtrList<thermo>, EQreactions, iter)
(
SLPtrList<thermo>::iterator EQreactionsIter = EQreactions.begin();
EQreactionsIter != EQreactions.end();
++EQreactionsIter
)
{ {
Info<< "Kc(EQreactions) = " << EQreactionsIter().Kc(T) << endl; Info<< "Kc(EQreactions) = " << iter().Kc(T) << endl;
} }
Info<< nl << "end" << endl; Info<< nl << "end" << endl;
return 0; return 0;

View File

@ -80,7 +80,7 @@ Foam::Keyed<T>::createList(const List<T>& lst, const label key)
{ {
List<Keyed<T> > newList(lst.size()); List<Keyed<T> > newList(lst.size());
forAll (lst, elemI) forAll(lst, elemI)
{ {
newList[elemI] = Keyed(lst[elemI], key); newList[elemI] = Keyed(lst[elemI], key);
} }
@ -106,7 +106,7 @@ Foam::Keyed<T>::createList(const List<T>& lst, const List<label>& keys)
List<Keyed<T> > newList(lst.size()); List<Keyed<T> > newList(lst.size());
forAll (lst, elemI) forAll(lst, elemI)
{ {
newList[elemI] = Keyed(lst[elemI], keys[elemI]); newList[elemI] = Keyed(lst[elemI], keys[elemI]);
} }

View File

@ -152,12 +152,7 @@ Foam::IOobjectList Foam::IOobjectList::lookupClass(const word& ClassName) const
{ {
IOobjectList objectsOfClass(size()); IOobjectList objectsOfClass(size());
for forAllConstIter(HashPtrTable<IOobject>, *this, iter)
(
HashPtrTable<IOobject>::const_iterator iter = begin();
iter != end();
++iter
)
{ {
if (iter()->headerClassName() == ClassName) if (iter()->headerClassName() == ClassName)
{ {
@ -192,12 +187,7 @@ Foam::wordList Foam::IOobjectList::names(const word& ClassName) const
wordList objectNames(size()); wordList objectNames(size());
label count = 0; label count = 0;
for forAllConstIter(HashPtrTable<IOobject>, *this, iter)
(
HashPtrTable<IOobject>::const_iterator iter = begin();
iter != end();
++iter
)
{ {
if (iter()->headerClassName() == ClassName) if (iter()->headerClassName() == ClassName)
{ {

View File

@ -379,7 +379,7 @@ interfaces() const
{ {
lduInterfaceFieldPtrsList interfaces(this->size()); lduInterfaceFieldPtrsList interfaces(this->size());
forAll (interfaces, patchi) forAll(interfaces, patchi)
{ {
if (isA<lduInterfaceField>(this->operator[](patchi))) if (isA<lduInterfaceField>(this->operator[](patchi)))
{ {

View File

@ -50,7 +50,7 @@ slicedBoundaryField
FieldField<PatchField, Type>& bf = tbf(); FieldField<PatchField, Type>& bf = tbf();
forAll (mesh.boundary(), patchi) forAll(mesh.boundary(), patchi)
{ {
if (preserveCouples && mesh.boundary()[patchi].coupled()) if (preserveCouples && mesh.boundary()[patchi].coupled())
{ {
@ -119,7 +119,7 @@ slicedBoundaryField
FieldField<PatchField, Type>& bf = tbf(); FieldField<PatchField, Type>& bf = tbf();
forAll (mesh.boundary(), patchi) forAll(mesh.boundary(), patchi)
{ {
if (preserveCouples && mesh.boundary()[patchi].coupled()) if (preserveCouples && mesh.boundary()[patchi].coupled())
{ {

View File

@ -144,7 +144,7 @@ tmp<Field<Type1> > pointPatchField<Type>::patchInternalField
tmp<Field<Type1> > tvalues(new Field<Type1>(meshPoints.size())); tmp<Field<Type1> > tvalues(new Field<Type1>(meshPoints.size()));
Field<Type1>& values = tvalues(); Field<Type1>& values = tvalues();
forAll (meshPoints, pointI) forAll(meshPoints, pointI)
{ {
values[pointI] = iF[meshPoints[pointI]]; values[pointI] = iF[meshPoints[pointI]];
} }
@ -202,7 +202,7 @@ void pointPatchField<Type>::addToInternalField
// Get the addressing // Get the addressing
const labelList& mp = patch().meshPoints(); const labelList& mp = patch().meshPoints();
forAll (mp, pointI) forAll(mp, pointI)
{ {
iF[mp[pointI]] += pF[pointI]; iF[mp[pointI]] += pF[pointI];
} }
@ -292,7 +292,7 @@ void pointPatchField<Type>::setInInternalField
<< abort(FatalError); << abort(FatalError);
} }
forAll (meshPoints, pointI) forAll(meshPoints, pointI)
{ {
iF[meshPoints[pointI]] = pF[pointI]; iF[meshPoints[pointI]] = pF[pointI];
} }

View File

@ -47,7 +47,7 @@ void graph::readCurves(Istream& is)
x_.setSize(xyData.size()); x_.setSize(xyData.size());
scalarField y(xyData.size()); scalarField y(xyData.size());
forAll (xyData, i) forAll(xyData, i)
{ {
x_[i] = xyData[i].x_; x_[i] = xyData[i].x_;
y[i] = xyData[i].y_; y[i] = xyData[i].y_;
@ -191,18 +191,13 @@ void graph::writeTable(Ostream& os) const
{ {
forAll(x_, xi) forAll(x_, xi)
{ {
os << setw(10) << x_[xi]; os << setw(10) << x_[xi];
for forAllConstIter(graph, *this, iter)
(
graph::const_iterator iter = begin();
iter != end();
++iter
)
{ {
os << token::SPACE << setw(10) << (*iter())[xi]; os << token::SPACE << setw(10) << (*iter())[xi];
} }
os << endl; os << endl;
} }
} }

View File

@ -51,7 +51,7 @@ void Foam::gnuplotGraph::write(const graph& g, Ostream& os) const
bool firstField = true; bool firstField = true;
for (graph::const_iterator iter = g.begin(); iter != g.end(); ++iter) forAllConstIter(graph, g, iter)
{ {
if (!firstField) if (!firstField)
{ {
@ -64,9 +64,9 @@ void Foam::gnuplotGraph::write(const graph& g, Ostream& os) const
os << "; pause -1" << endl; os << "; pause -1" << endl;
for (graph::const_iterator iter = g.begin(); iter != g.end(); ++iter) forAllConstIter(graph, g, iter)
{ {
os << endl; os << endl;
writeXY(g.x(), *iter(), os); writeXY(g.x(), *iter(), os);
} }
} }

View File

@ -41,12 +41,12 @@ namespace Foam
void Foam::jplotGraph::write(const graph& g, Ostream& os) const void Foam::jplotGraph::write(const graph& g, Ostream& os) const
{ {
os << "# JPlot file" << endl os << "# JPlot file" << nl
<< "# column 1: " << g.xName() << endl; << "# column 1: " << g.xName() << endl;
label fieldI = 0; label fieldI = 0;
for (graph::const_iterator iter = g.begin(); iter != g.end(); ++iter) forAllConstIter(graph, g, iter)
{ {
os << "# column " << fieldI + 2 << ": " << (*iter()).name() << endl; os << "# column " << fieldI + 2 << ": " << (*iter()).name() << endl;
fieldI++; fieldI++;

View File

@ -42,17 +42,17 @@ namespace Foam
void Foam::xmgrGraph::write(const graph& g, Ostream& os) const void Foam::xmgrGraph::write(const graph& g, Ostream& os) const
{ {
os << "@title " << g.title() << endl os << "@title " << g.title() << nl
<< "@xaxis label " << g.xName() << endl << "@xaxis label " << g.xName() << nl
<< "@yaxis label " << g.yName() << endl; << "@yaxis label " << g.yName() << endl;
label fieldI = 0; label fieldI = 0;
for (graph::const_iterator iter = g.begin(); iter != g.end(); ++iter) forAllConstIter(graph, g, iter)
{ {
os << "@s" << fieldI << " legend " os << "@s" << fieldI << " legend "
<< iter()->name() << endl << iter()->name() << nl
<< "@target G0.S" << fieldI << endl << "@target G0.S" << fieldI << nl
<< "@type xy" << endl; << "@type xy" << endl;
writeXY(g.x(), *iter(), os); writeXY(g.x(), *iter(), os);

View File

@ -73,7 +73,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
bool doWeights = false; bool doWeights = false;
forAll (pointAddressing, pointI) forAll(pointAddressing, pointI)
{ {
doWeights = false; doWeights = false;
@ -146,7 +146,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
edgeList hitFaceEdges = edgeList hitFaceEdges =
fromPatchFaces[proj[pointI].hitObject()].edges(); fromPatchFaces[proj[pointI].hitObject()].edges();
forAll (hitFaceEdges, edgeI) forAll(hitFaceEdges, edgeI)
{ {
minEdgeLength = minEdgeLength =
min min
@ -158,7 +158,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
const labelList& curEdges = toPatchPointEdges[pointI]; const labelList& curEdges = toPatchPointEdges[pointI];
forAll (curEdges, edgeI) forAll(curEdges, edgeI)
{ {
minEdgeLength = minEdgeLength =
min min
@ -208,7 +208,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
pointField hitFacePoints = hitFace.points(fromPatchPoints); pointField hitFacePoints = hitFace.points(fromPatchPoints);
forAll (hitFacePoints, masterPointI) forAll(hitFacePoints, masterPointI)
{ {
pointWeights[pointI][masterPointI] = pointWeights[pointI][masterPointI] =
1.0/ 1.0/
@ -252,7 +252,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
vectorField fromPatchFaceCentres(fromPatchFaces.size()); vectorField fromPatchFaceCentres(fromPatchFaces.size());
forAll (fromPatchFaceCentres, faceI) forAll(fromPatchFaceCentres, faceI)
{ {
fromPatchFaceCentres[faceI] = fromPatchFaceCentres[faceI] =
fromPatchFaces[faceI].centre(fromPatchPoints); fromPatchFaces[faceI].centre(fromPatchPoints);
@ -275,7 +275,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
faceAddressingPtr_ = new labelList(proj.size(), -1); faceAddressingPtr_ = new labelList(proj.size(), -1);
labelList& faceAddressing = *faceAddressingPtr_; labelList& faceAddressing = *faceAddressingPtr_;
forAll (faceAddressing, faceI) forAll(faceAddressing, faceI)
{ {
if (proj[faceI].hit()) if (proj[faceI].hit())
{ {
@ -327,7 +327,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
faceWeights[faceI][0] = 1.0/m; faceWeights[faceI][0] = 1.0/m;
forAll (neighbours, nI) forAll(neighbours, nI)
{ {
faceWeights[faceI][nI + 1] = faceWeights[faceI][nI + 1] =
1.0/ 1.0/

View File

@ -71,7 +71,7 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate
const labelList& addr = pointAddr(); const labelList& addr = pointAddr();
forAll (result, pointI) forAll(result, pointI)
{ {
const scalarField& curWeights = weights[pointI]; const scalarField& curWeights = weights[pointI];
@ -80,7 +80,7 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate
const labelList& hitFacePoints = const labelList& hitFacePoints =
fromPatchLocalFaces[addr[pointI]]; fromPatchLocalFaces[addr[pointI]];
forAll (curWeights, wI) forAll(curWeights, wI)
{ {
result[pointI] += curWeights[wI]*pf[hitFacePoints[wI]]; result[pointI] += curWeights[wI]*pf[hitFacePoints[wI]];
} }
@ -142,7 +142,7 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::faceInterpolate
const labelList& addr = faceAddr(); const labelList& addr = faceAddr();
forAll (result, faceI) forAll(result, faceI)
{ {
const scalarField& curWeights = weights[faceI]; const scalarField& curWeights = weights[faceI];

View File

@ -44,7 +44,7 @@ void Foam::lduAddressing::calcLosort() const
const unallocLabelList& nbr = upperAddr(); const unallocLabelList& nbr = upperAddr();
forAll (nbr, nbrI) forAll(nbr, nbrI)
{ {
nNbrOfFace[nbr[nbrI]]++; nNbrOfFace[nbr[nbrI]]++;
} }
@ -52,7 +52,7 @@ void Foam::lduAddressing::calcLosort() const
// Create temporary neighbour addressing // Create temporary neighbour addressing
labelListList cellNbrFaces(size()); labelListList cellNbrFaces(size());
forAll (cellNbrFaces, cellI) forAll(cellNbrFaces, cellI)
{ {
cellNbrFaces[cellI].setSize(nNbrOfFace[cellI]); cellNbrFaces[cellI].setSize(nNbrOfFace[cellI]);
} }
@ -61,7 +61,7 @@ void Foam::lduAddressing::calcLosort() const
nNbrOfFace = 0; nNbrOfFace = 0;
// Scatter the neighbour faces // Scatter the neighbour faces
forAll (nbr, nbrI) forAll(nbr, nbrI)
{ {
cellNbrFaces[nbr[nbrI]][nNbrOfFace[nbr[nbrI]]] = nbrI; cellNbrFaces[nbr[nbrI]][nNbrOfFace[nbr[nbrI]]] = nbrI;
@ -76,11 +76,11 @@ void Foam::lduAddressing::calcLosort() const
// Set counter for losort // Set counter for losort
label lstI = 0; label lstI = 0;
forAll (cellNbrFaces, cellI) forAll(cellNbrFaces, cellI)
{ {
const labelList& curNbr = cellNbrFaces[cellI]; const labelList& curNbr = cellNbrFaces[cellI];
forAll (curNbr, curNbrI) forAll(curNbr, curNbrI)
{ {
lst[lstI] = curNbr[curNbrI]; lst[lstI] = curNbr[curNbrI];
lstI++; lstI++;
@ -109,7 +109,7 @@ void Foam::lduAddressing::calcOwnerStart() const
label nOwnStart = 0; label nOwnStart = 0;
label i = 1; label i = 1;
forAll (own, faceI) forAll(own, faceI)
{ {
label curOwn = own[faceI]; label curOwn = own[faceI];
@ -148,7 +148,7 @@ void Foam::lduAddressing::calcLosortStart() const
label nLsrtStart = 0; label nLsrtStart = 0;
label i = 0; label i = 0;
forAll (lsrt, faceI) forAll(lsrt, faceI)
{ {
// Get neighbour // Get neighbour
const label curNbr = nbr[lsrt[faceI]]; const label curNbr = nbr[lsrt[faceI]];

View File

@ -42,7 +42,7 @@ void Foam::lduMatrix::initMatrixInterfaces
|| Pstream::defaultCommsType == Pstream::nonBlocking || Pstream::defaultCommsType == Pstream::nonBlocking
) )
{ {
forAll (interfaces, interfaceI) forAll(interfaces, interfaceI)
{ {
if (interfaces.set(interfaceI)) if (interfaces.set(interfaceI))
{ {
@ -117,7 +117,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
OPstream::waitRequests(); OPstream::waitRequests();
} }
forAll (interfaces, interfaceI) forAll(interfaces, interfaceI)
{ {
if (interfaces.set(interfaceI)) if (interfaces.set(interfaceI))
{ {
@ -138,7 +138,7 @@ void Foam::lduMatrix::updateMatrixInterfaces
const lduSchedule& patchSchedule = this->patchSchedule(); const lduSchedule& patchSchedule = this->patchSchedule();
// Loop over all the "normal" interfaces relating to standard patches // Loop over all the "normal" interfaces relating to standard patches
forAll (patchSchedule, i) forAll(patchSchedule, i)
{ {
label interfaceI = patchSchedule[i].patch; label interfaceI = patchSchedule[i].patch;

View File

@ -88,7 +88,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
label nCoarseFaces = 0; label nCoarseFaces = 0;
// Loop through all fine faces // Loop through all fine faces
forAll (upperAddr, fineFacei) forAll(upperAddr, fineFacei)
{ {
label rmUpperAddr = restrictMap[upperAddr[fineFacei]]; label rmUpperAddr = restrictMap[upperAddr[fineFacei]];
label rmLowerAddr = restrictMap[lowerAddr[fineFacei]]; label rmLowerAddr = restrictMap[lowerAddr[fineFacei]];
@ -174,7 +174,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
label coarseFacei = 0; label coarseFacei = 0;
forAll (cCellnFaces, cci) forAll(cCellnFaces, cci)
{ {
label* cFaces = &cCellFaces[maxNnbrs*cci]; label* cFaces = &cCellFaces[maxNnbrs*cci];
label ccnFaces = cCellnFaces[cci]; label ccnFaces = cCellnFaces[cci];
@ -223,7 +223,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
labelListList coarseInterfaceAddr(fineInterfaces.size()); labelListList coarseInterfaceAddr(fineInterfaces.size());
// Initialise transfer of restrict addressing on the interface // Initialise transfer of restrict addressing on the interface
forAll (fineInterfaces, inti) forAll(fineInterfaces, inti)
{ {
if (fineInterfaces.set(inti)) if (fineInterfaces.set(inti))
{ {
@ -236,7 +236,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
} }
// Add the coarse level // Add the coarse level
forAll (fineInterfaces, inti) forAll(fineInterfaces, inti)
{ {
if (fineInterfaces.set(inti)) if (fineInterfaces.set(inti))
{ {

View File

@ -202,7 +202,7 @@ Foam::GAMGAgglomeration::~GAMGAgglomeration()
{ {
lduInterfacePtrsList& curLevel = interfaceLevels_[leveli]; lduInterfacePtrsList& curLevel = interfaceLevels_[leveli];
forAll (curLevel, i) forAll(curLevel, i)
{ {
if (curLevel.set(i)) if (curLevel.set(i))
{ {

View File

@ -48,18 +48,18 @@ Foam::tmp<Foam::labelField> Foam::pairGAMGAgglomeration::agglomerate
{ {
labelList nNbrs(nFineCells, 0); labelList nNbrs(nFineCells, 0);
forAll (upperAddr, facei) forAll(upperAddr, facei)
{ {
nNbrs[upperAddr[facei]]++; nNbrs[upperAddr[facei]]++;
} }
forAll (lowerAddr, facei) forAll(lowerAddr, facei)
{ {
nNbrs[lowerAddr[facei]]++; nNbrs[lowerAddr[facei]]++;
} }
cellFaceOffsets[0] = 0; cellFaceOffsets[0] = 0;
forAll (nNbrs, celli) forAll(nNbrs, celli)
{ {
cellFaceOffsets[celli+1] = cellFaceOffsets[celli] + nNbrs[celli]; cellFaceOffsets[celli+1] = cellFaceOffsets[celli] + nNbrs[celli];
} }
@ -67,7 +67,7 @@ Foam::tmp<Foam::labelField> Foam::pairGAMGAgglomeration::agglomerate
// reset the whole list to use as counter // reset the whole list to use as counter
nNbrs = 0; nNbrs = 0;
forAll (upperAddr, facei) forAll(upperAddr, facei)
{ {
cellFaces cellFaces
[ [
@ -77,7 +77,7 @@ Foam::tmp<Foam::labelField> Foam::pairGAMGAgglomeration::agglomerate
nNbrs[upperAddr[facei]]++; nNbrs[upperAddr[facei]]++;
} }
forAll (lowerAddr, facei) forAll(lowerAddr, facei)
{ {
cellFaces cellFaces
[ [
@ -187,7 +187,7 @@ Foam::tmp<Foam::labelField> Foam::pairGAMGAgglomeration::agglomerate
// (doesn't always help and is sometimes detrimental) // (doesn't always help and is sometimes detrimental)
nCoarseCells--; nCoarseCells--;
forAll (coarseCellMap, celli) forAll(coarseCellMap, celli)
{ {
coarseCellMap[celli] = nCoarseCells - coarseCellMap[celli]; coarseCellMap[celli] = nCoarseCells - coarseCellMap[celli];
} }

View File

@ -78,7 +78,7 @@ void Foam::pairGAMGAgglomeration::combineLevels(const label curLevel)
const lduInterfacePtrsList& curInterLevel = interfaceLevels_[curLevel+1]; const lduInterfacePtrsList& curInterLevel = interfaceLevels_[curLevel+1];
lduInterfacePtrsList& prevInterLevel = interfaceLevels_[prevLevel+1]; lduInterfacePtrsList& prevInterLevel = interfaceLevels_[prevLevel+1];
forAll (prevInterLevel, inti) forAll(prevInterLevel, inti)
{ {
if (prevInterLevel.set(inti)) if (prevInterLevel.set(inti))
{ {

View File

@ -127,11 +127,11 @@ Foam::GAMGSolver::GAMGSolver
Foam::GAMGSolver::~GAMGSolver() Foam::GAMGSolver::~GAMGSolver()
{ {
// Clear the the lists of pointers to the interfaces // Clear the the lists of pointers to the interfaces
forAll (interfaceLevels_, leveli) forAll(interfaceLevels_, leveli)
{ {
lduInterfaceFieldPtrsList& curLevel = interfaceLevels_[leveli]; lduInterfaceFieldPtrsList& curLevel = interfaceLevels_[leveli];
forAll (curLevel, i) forAll(curLevel, i)
{ {
if (curLevel.set(i)) if (curLevel.set(i))
{ {

View File

@ -91,7 +91,7 @@ void Foam::GAMGSolver::agglomerateMatrix(const label fineLevelIndex)
interfaceLevelsIntCoeffs_[fineLevelIndex]; interfaceLevelsIntCoeffs_[fineLevelIndex];
// Add the coarse level // Add the coarse level
forAll (fineInterfaces, inti) forAll(fineInterfaces, inti)
{ {
if (fineInterfaces.set(inti)) if (fineInterfaces.set(inti))
{ {

View File

@ -377,7 +377,7 @@ void Foam::GAMGSolver::initVcycle
) )
); );
forAll (matrixLevels_, leveli) forAll(matrixLevels_, leveli)
{ {
coarseCorrFields.set coarseCorrFields.set
( (

View File

@ -36,7 +36,7 @@ Foam::tmp<Foam::Field<Type> > Foam::GAMGInterface::interfaceInternalField
tmp<Field<Type> > tresult(new Field<Type>(size())); tmp<Field<Type> > tresult(new Field<Type>(size()));
Field<Type>& result = tresult(); Field<Type>& result = tresult();
forAll (result, elemI) forAll(result, elemI)
{ {
result[elemI] = iF[faceCells_[elemI]]; result[elemI] = iF[faceCells_[elemI]];
} }

View File

@ -144,7 +144,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
nCoarseFaces = 0; nCoarseFaces = 0;
// On master side, the owner addressing is stored in table of contents // On master side, the owner addressing is stored in table of contents
forAll (contents, masterI) forAll(contents, masterI)
{ {
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])(); SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
@ -163,12 +163,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
{ {
faceCells_[nCoarseFaces] = contents[masterI]; faceCells_[nCoarseFaces] = contents[masterI];
for forAllIter(SLList<label>, faceFacesIter(), facesIter)
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
)
{ {
faceRestrictAddressing_[facesIter()] = nCoarseFaces; faceRestrictAddressing_[facesIter()] = nCoarseFaces;
} }
@ -178,7 +173,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
} }
// On slave side, the owner addressing is stored in linked lists // On slave side, the owner addressing is stored in linked lists
forAll (contents, masterI) forAll(contents, masterI)
{ {
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])(); SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
@ -197,12 +192,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
{ {
faceCells_[nCoarseFaces] = nbrsIter(); faceCells_[nCoarseFaces] = nbrsIter();
for forAllIter(SLList<label>, faceFacesIter(), facesIter)
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
)
{ {
faceRestrictAddressing_[facesIter() + sizeBy2] = nCoarseFaces; faceRestrictAddressing_[facesIter() + sizeBy2] = nCoarseFaces;
} }

View File

@ -71,7 +71,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
label nCoarseFaces = 0; label nCoarseFaces = 0;
forAll (localRestrictAddressing, ffi) forAll(localRestrictAddressing, ffi)
{ {
label curMaster = -1; label curMaster = -1;
label curSlave = -1; label curSlave = -1;
@ -159,7 +159,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
if (myProcNo() < neighbProcNo()) if (myProcNo() < neighbProcNo())
{ {
// On master side, the owner addressing is stored in table of contents // On master side, the owner addressing is stored in table of contents
forAll (contents, masterI) forAll(contents, masterI)
{ {
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])(); SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
@ -180,12 +180,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
{ {
faceCells_[nCoarseFaces] = contents[masterI]; faceCells_[nCoarseFaces] = contents[masterI];
for forAllIter(SLList<label>, faceFacesIter(), facesIter)
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
)
{ {
faceRestrictAddressing_[facesIter()] = nCoarseFaces; faceRestrictAddressing_[facesIter()] = nCoarseFaces;
} }
@ -197,7 +192,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
else else
{ {
// On slave side, the owner addressing is stored in linked lists // On slave side, the owner addressing is stored in linked lists
forAll (contents, masterI) forAll(contents, masterI)
{ {
SLList<label>& curNbrs = neighboursTable.find(contents[masterI])(); SLList<label>& curNbrs = neighboursTable.find(contents[masterI])();
@ -218,12 +213,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
{ {
faceCells_[nCoarseFaces] = nbrsIter(); faceCells_[nCoarseFaces] = nbrsIter();
for forAllIter(SLList<label>, faceFacesIter(), facesIter)
(
SLList<label>::iterator facesIter = faceFacesIter().begin();
facesIter != faceFacesIter().end();
++facesIter
)
{ {
faceRestrictAddressing_[facesIter()] = nCoarseFaces; faceRestrictAddressing_[facesIter()] = nCoarseFaces;
} }

View File

@ -48,13 +48,13 @@ Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing)
label cellInOrder = 0; label cellInOrder = 0;
// reset the visited cells list // reset the visited cells list
forAll (visited, cellI) forAll(visited, cellI)
{ {
visited[cellI] = 0; visited[cellI] = 0;
} }
// loop over the cells // loop over the cells
forAll (visited, cellI) forAll(visited, cellI)
{ {
// find the first cell that has not been visited yet // find the first cell that has not been visited yet
if (visited[cellI] == 0) if (visited[cellI] == 0)
@ -85,7 +85,7 @@ Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing)
const labelList& neighbours = const labelList& neighbours =
cellCellAddressing[currentCell]; cellCellAddressing[currentCell];
forAll (neighbours, nI) forAll(neighbours, nI)
{ {
if (visited[neighbours[nI]] == 0) if (visited[neighbours[nI]] == 0)
{ {

View File

@ -41,7 +41,7 @@ Foam::labelList Foam::cell::labels(const unallocFaceList& f) const
const labelList& faces = *this; const labelList& faces = *this;
forAll (faces, faceI) forAll(faces, faceI)
{ {
maxVert += f[faces[faceI]].size(); maxVert += f[faces[faceI]].size();
} }
@ -52,7 +52,7 @@ Foam::labelList Foam::cell::labels(const unallocFaceList& f) const
// in the first face there is no duplicates // in the first face there is no duplicates
const labelList& first = f[faces[0]]; const labelList& first = f[faces[0]];
forAll (first, pointI) forAll(first, pointI)
{ {
p[pointI] = first[pointI]; p[pointI] = first[pointI];
} }
@ -67,7 +67,7 @@ Foam::labelList Foam::cell::labels(const unallocFaceList& f) const
{ {
const labelList& curFace = f[faces[faceI]]; const labelList& curFace = f[faces[faceI]];
forAll (curFace, pointI) forAll(curFace, pointI)
{ {
const label curPoint = curFace[pointI]; const label curPoint = curFace[pointI];
@ -126,7 +126,7 @@ Foam::edgeList Foam::cell::edges(const unallocFaceList& f) const
// create a list of edges // create a list of edges
label maxNoEdges = 0; label maxNoEdges = 0;
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
maxNoEdges += f[curFaces[faceI]].nEdges(); maxNoEdges += f[curFaces[faceI]].nEdges();
} }
@ -134,11 +134,11 @@ Foam::edgeList Foam::cell::edges(const unallocFaceList& f) const
edgeList allEdges(maxNoEdges); edgeList allEdges(maxNoEdges);
label nEdges = 0; label nEdges = 0;
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
const edgeList curFaceEdges = f[curFaces[faceI]].edges(); const edgeList curFaceEdges = f[curFaces[faceI]].edges();
forAll (curFaceEdges, faceEdgeI) forAll(curFaceEdges, faceEdgeI)
{ {
const edge& curEdge = curFaceEdges[faceEdgeI]; const edge& curEdge = curFaceEdges[faceEdgeI];
@ -197,7 +197,7 @@ Foam::point Foam::cell::centre
const labelList& faces = *this; const labelList& faces = *this;
forAll (faces, faceI) forAll(faces, faceI)
{ {
scalar a = f[faces[faceI]].mag(p); scalar a = f[faces[faceI]].mag(p);
cEst += f[faces[faceI]].centre(p)*a; cEst += f[faces[faceI]].centre(p)*a;
@ -212,7 +212,7 @@ Foam::point Foam::cell::centre
scalar sumV = 0; scalar sumV = 0;
forAll (faces, faceI) forAll(faces, faceI)
{ {
// calculate pyramid volume. If it is greater than zero, OK. // calculate pyramid volume. If it is greater than zero, OK.
// If not, the pyramid is inside-out. Create a face with the opposite // If not, the pyramid is inside-out. Create a face with the opposite
@ -256,7 +256,7 @@ Foam::scalar Foam::cell::mag
const labelList& faces = *this; const labelList& faces = *this;
forAll (faces, faceI) forAll(faces, faceI)
{ {
cEst += f[faces[faceI]].centre(p); cEst += f[faces[faceI]].centre(p);
nCellFaces += 1; nCellFaces += 1;
@ -267,7 +267,7 @@ Foam::scalar Foam::cell::mag
// Calculate the magnitude by summing the mags of the pyramids // Calculate the magnitude by summing the mags of the pyramids
scalar v = 0; scalar v = 0;
forAll (faces, faceI) forAll(faces, faceI)
{ {
v += ::Foam::mag(pyramidPointFaceRef(f[faces[faceI]], cEst).mag(p)); v += ::Foam::mag(pyramidPointFaceRef(f[faces[faceI]], cEst).mag(p));
} }
@ -288,13 +288,13 @@ bool Foam::operator==(const cell& a, const cell& b)
List<bool> fnd(a.size(), false); List<bool> fnd(a.size(), false);
forAll (b, bI) forAll(b, bI)
{ {
label curLabel = b[bI]; label curLabel = b[bI];
bool found = false; bool found = false;
forAll (a, aI) forAll(a, aI)
{ {
if (a[aI] == curLabel) if (a[aI] == curLabel)
{ {
@ -313,7 +313,7 @@ bool Foam::operator==(const cell& a, const cell& b)
// check if all faces on a were marked // check if all faces on a were marked
bool result = true; bool result = true;
forAll (fnd, aI) forAll(fnd, aI)
{ {
result = (result && fnd[aI]); result = (result && fnd[aI]);
} }

View File

@ -54,7 +54,7 @@ Foam::label Foam::cell::opposingFaceLabel
label oppositeFaceLabel = -1; label oppositeFaceLabel = -1;
forAll (curFaceLabels, faceI) forAll(curFaceLabels, faceI)
{ {
// Compare the face with the master // Compare the face with the master
const face& curFace = meshFaces[curFaceLabels[faceI]]; const face& curFace = meshFaces[curFaceLabels[faceI]];
@ -70,11 +70,11 @@ Foam::label Foam::cell::opposingFaceLabel
// Compare every vertex of the current face agains the // Compare every vertex of the current face agains the
// vertices of the master face // vertices of the master face
forAll (curFace, pointI) forAll(curFace, pointI)
{ {
const label l = curFace[pointI]; const label l = curFace[pointI];
forAll (masterFace, masterPointI) forAll(masterFace, masterPointI)
{ {
if (masterFace[masterPointI] == l) if (masterFace[masterPointI] == l)
{ {
@ -149,11 +149,11 @@ Foam::oppositeFace Foam::cell::opposingFace
oppFaceLabel oppFaceLabel
); );
forAll (masterFace, pointI) forAll(masterFace, pointI)
{ {
// Go through the list of edges and find the edge from this vertex // Go through the list of edges and find the edge from this vertex
// to the slave face // to the slave face
forAll (e, edgeI) forAll(e, edgeI)
{ {
if (!usedEdges[edgeI]) if (!usedEdges[edgeI])
{ {
@ -166,7 +166,7 @@ Foam::oppositeFace Foam::cell::opposingFace
// Found an edge coming from this vertex. // Found an edge coming from this vertex.
// Check all vertices of the slave to find out // Check all vertices of the slave to find out
// if it exists. // if it exists.
forAll (slaveFace, slavePointI) forAll(slaveFace, slavePointI)
{ {
if (slaveFace[slavePointI] == otherVertex) if (slaveFace[slavePointI] == otherVertex)
{ {

View File

@ -123,14 +123,9 @@ Foam::label Foam::cellMatcher::calcLocalFaces
} }
// Create local to global vertex mapping // Create local to global vertex mapping
for forAllConstIter(Map<label>, localPoint_, iter)
(
Map<label>::iterator iter = localPoint_.begin();
iter != localPoint_.end();
++iter
)
{ {
label fp = iter(); const label fp = iter();
pointMap_[fp] = iter.key(); pointMap_[fp] = iter.key();
} }

View File

@ -107,7 +107,7 @@ inline faceList cellModel::faces(const labelList& pointLabels) const
curFace.setSize(curModelLabels.size()); curFace.setSize(curModelLabels.size());
forAll (curModelLabels, labelI) forAll(curModelLabels, labelI)
{ {
curFace[labelI] = pointLabels[curModelLabels[labelI]]; curFace[labelI] = pointLabels[curModelLabels[labelI]];
} }

View File

@ -322,7 +322,7 @@ int Foam::face::compare(const face& a, const face& b)
const label firstA = a[0]; const label firstA = a[0];
label Bptr = -1; label Bptr = -1;
forAll (b, i) forAll(b, i)
{ {
if (b[i] == firstA) if (b[i] == firstA)
{ {
@ -621,7 +621,7 @@ Foam::label Foam::face::which(const label globalIndex) const
label pointInFace = -1; label pointInFace = -1;
const labelList& f = *this; const labelList& f = *this;
forAll (f, i) forAll(f, i)
{ {
if (f[i] == globalIndex) if (f[i] == globalIndex)
{ {
@ -750,7 +750,7 @@ Foam::edgeList Foam::face::edges() const
int Foam::face::edgeDirection(const edge& e) const int Foam::face::edgeDirection(const edge& e) const
{ {
forAll (*this, i) forAll(*this, i)
{ {
if (operator[](i) == e.start()) if (operator[](i) == e.start())
{ {

View File

@ -43,7 +43,7 @@ Foam::scalar Foam::face::areaInContact
scalarField vertexValue(labels.size()); scalarField vertexValue(labels.size());
forAll (labels, i) forAll(labels, i)
{ {
vertexValue[i] = v[labels[i]]; vertexValue[i] = v[labels[i]];
} }
@ -56,7 +56,7 @@ Foam::scalar Foam::face::areaInContact
bool allPositive = true; bool allPositive = true;
bool allNegative = true; bool allNegative = true;
forAll (vertexValue, vI) forAll(vertexValue, vI)
{ {
if (vertexValue[vI] > 0) if (vertexValue[vI] > 0)
{ {
@ -147,7 +147,7 @@ Foam::scalar Foam::face::areaInContact
// Make a labelList for the sub-face (points are ordered!) // Make a labelList for the sub-face (points are ordered!)
labelList sfl(newFacePoints.size()); labelList sfl(newFacePoints.size());
forAll (sfl, sflI) forAll(sfl, sflI)
{ {
sfl[sflI] = sflI; sfl[sflI] = sflI;
} }

View File

@ -73,7 +73,7 @@ public:
{ {
const pointBoundaryMesh& patches = mesh.boundary(); const pointBoundaryMesh& patches = mesh.boundary();
forAll (patches, patchI) forAll(patches, patchI)
{ {
set set
( (

View File

@ -63,7 +63,7 @@ void Foam::pointMapper::calcAddressing() const
label nInsertedPoints = 0; label nInsertedPoints = 0;
forAll (directAddr, pointI) forAll(directAddr, pointI)
{ {
if (directAddr[pointI] < 0) if (directAddr[pointI] < 0)
{ {
@ -89,7 +89,7 @@ void Foam::pointMapper::calcAddressing() const
// Points created from other points (i.e. points merged into it). // Points created from other points (i.e. points merged into it).
const List<objectMap>& cfc = mpm_.pointsFromPointsMap(); const List<objectMap>& cfc = mpm_.pointsFromPointsMap();
forAll (cfc, cfcI) forAll(cfc, cfcI)
{ {
// Get addressing // Get addressing
const labelList& mo = cfc[cfcI].masterObjects(); const labelList& mo = cfc[cfcI].masterObjects();
@ -115,7 +115,7 @@ void Foam::pointMapper::calcAddressing() const
const labelList& cm = mpm_.pointMap(); const labelList& cm = mpm_.pointMap();
forAll (cm, pointI) forAll(cm, pointI)
{ {
if (cm[pointI] > -1 && addr[pointI].empty()) if (cm[pointI] > -1 && addr[pointI].empty())
{ {
@ -132,7 +132,7 @@ void Foam::pointMapper::calcAddressing() const
label nInsertedPoints = 0; label nInsertedPoints = 0;
forAll (addr, pointI) forAll(addr, pointI)
{ {
if (addr[pointI].empty()) if (addr[pointI].empty())
{ {
@ -198,7 +198,7 @@ Foam::pointMapper::pointMapper(const pointMesh& pMesh, const mapPolyMesh& mpm)
const List<objectMap>& cfc = mpm_.pointsFromPointsMap(); const List<objectMap>& cfc = mpm_.pointsFromPointsMap();
forAll (cfc, cfcI) forAll(cfc, cfcI)
{ {
cm[cfc[cfcI].index()] = 0; cm[cfc[cfcI].index()] = 0;
} }

View File

@ -62,7 +62,7 @@ void Foam::processorPointPatch::initGeometry(PstreamBuffers& pBufs)
faceList masterFaces(pp.size()); faceList masterFaces(pp.size());
forAll (pp, faceI) forAll(pp, faceI)
{ {
masterFaces[faceI] = pp[faceI].reverseFace(); masterFaces[faceI] = pp[faceI].reverseFace();
} }

View File

@ -64,7 +64,7 @@ void Foam::globalMeshData::initProcAddr()
label nNeighbours = 0; label nNeighbours = 0;
forAll (mesh_.boundaryMesh(), patchi) forAll(mesh_.boundaryMesh(), patchi)
{ {
if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi])) if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
{ {
@ -78,7 +78,7 @@ void Foam::globalMeshData::initProcAddr()
if (Pstream::parRun()) if (Pstream::parRun())
{ {
// Send indices of my processor patches to my neighbours // Send indices of my processor patches to my neighbours
forAll (processorPatches_, i) forAll(processorPatches_, i)
{ {
label patchi = processorPatches_[i]; label patchi = processorPatches_[i];

View File

@ -63,7 +63,7 @@ void Foam::cellMapper::calcAddressing() const
label nInsertedCells = 0; label nInsertedCells = 0;
forAll (directAddr, cellI) forAll(directAddr, cellI)
{ {
if (directAddr[cellI] < 0) if (directAddr[cellI] < 0)
{ {
@ -88,7 +88,7 @@ void Foam::cellMapper::calcAddressing() const
const List<objectMap>& cfp = mpm_.cellsFromPointsMap(); const List<objectMap>& cfp = mpm_.cellsFromPointsMap();
forAll (cfp, cfpI) forAll(cfp, cfpI)
{ {
// Get addressing // Get addressing
const labelList& mo = cfp[cfpI].masterObjects(); const labelList& mo = cfp[cfpI].masterObjects();
@ -110,7 +110,7 @@ void Foam::cellMapper::calcAddressing() const
const List<objectMap>& cfe = mpm_.cellsFromEdgesMap(); const List<objectMap>& cfe = mpm_.cellsFromEdgesMap();
forAll (cfe, cfeI) forAll(cfe, cfeI)
{ {
// Get addressing // Get addressing
const labelList& mo = cfe[cfeI].masterObjects(); const labelList& mo = cfe[cfeI].masterObjects();
@ -132,7 +132,7 @@ void Foam::cellMapper::calcAddressing() const
const List<objectMap>& cff = mpm_.cellsFromFacesMap(); const List<objectMap>& cff = mpm_.cellsFromFacesMap();
forAll (cff, cffI) forAll(cff, cffI)
{ {
// Get addressing // Get addressing
const labelList& mo = cff[cffI].masterObjects(); const labelList& mo = cff[cffI].masterObjects();
@ -154,7 +154,7 @@ void Foam::cellMapper::calcAddressing() const
const List<objectMap>& cfc = mpm_.cellsFromCellsMap(); const List<objectMap>& cfc = mpm_.cellsFromCellsMap();
forAll (cfc, cfcI) forAll(cfc, cfcI)
{ {
// Get addressing // Get addressing
const labelList& mo = cfc[cfcI].masterObjects(); const labelList& mo = cfc[cfcI].masterObjects();
@ -180,7 +180,7 @@ void Foam::cellMapper::calcAddressing() const
const labelList& cm = mpm_.cellMap(); const labelList& cm = mpm_.cellMap();
forAll (cm, cellI) forAll(cm, cellI)
{ {
if (cm[cellI] > -1 && addr[cellI].empty()) if (cm[cellI] > -1 && addr[cellI].empty())
{ {
@ -197,7 +197,7 @@ void Foam::cellMapper::calcAddressing() const
label nInsertedCells = 0; label nInsertedCells = 0;
forAll (addr, cellI) forAll(addr, cellI)
{ {
if (addr[cellI].empty()) if (addr[cellI].empty())
{ {
@ -270,28 +270,28 @@ Foam::cellMapper::cellMapper(const mapPolyMesh& mpm)
const List<objectMap>& cfp = mpm_.cellsFromPointsMap(); const List<objectMap>& cfp = mpm_.cellsFromPointsMap();
forAll (cfp, cfpI) forAll(cfp, cfpI)
{ {
cm[cfp[cfpI].index()] = 0; cm[cfp[cfpI].index()] = 0;
} }
const List<objectMap>& cfe = mpm_.cellsFromEdgesMap(); const List<objectMap>& cfe = mpm_.cellsFromEdgesMap();
forAll (cfe, cfeI) forAll(cfe, cfeI)
{ {
cm[cfe[cfeI].index()] = 0; cm[cfe[cfeI].index()] = 0;
} }
const List<objectMap>& cff = mpm_.cellsFromFacesMap(); const List<objectMap>& cff = mpm_.cellsFromFacesMap();
forAll (cff, cffI) forAll(cff, cffI)
{ {
cm[cff[cffI].index()] = 0; cm[cff[cffI].index()] = 0;
} }
const List<objectMap>& cfc = mpm_.cellsFromCellsMap(); const List<objectMap>& cfc = mpm_.cellsFromCellsMap();
forAll (cfc, cfcI) forAll(cfc, cfcI)
{ {
cm[cfc[cfcI].index()] = 0; cm[cfc[cfcI].index()] = 0;
} }

View File

@ -63,7 +63,7 @@ void Foam::faceMapper::calcAddressing() const
label nInsertedFaces = 0; label nInsertedFaces = 0;
forAll (directAddr, faceI) forAll(directAddr, faceI)
{ {
if (directAddr[faceI] < 0) if (directAddr[faceI] < 0)
{ {
@ -88,7 +88,7 @@ void Foam::faceMapper::calcAddressing() const
const List<objectMap>& ffp = mpm_.facesFromPointsMap(); const List<objectMap>& ffp = mpm_.facesFromPointsMap();
forAll (ffp, ffpI) forAll(ffp, ffpI)
{ {
// Get addressing // Get addressing
const labelList& mo = ffp[ffpI].masterObjects(); const labelList& mo = ffp[ffpI].masterObjects();
@ -110,7 +110,7 @@ void Foam::faceMapper::calcAddressing() const
const List<objectMap>& ffe = mpm_.facesFromEdgesMap(); const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
forAll (ffe, ffeI) forAll(ffe, ffeI)
{ {
// Get addressing // Get addressing
const labelList& mo = ffe[ffeI].masterObjects(); const labelList& mo = ffe[ffeI].masterObjects();
@ -132,7 +132,7 @@ void Foam::faceMapper::calcAddressing() const
const List<objectMap>& fff = mpm_.facesFromFacesMap(); const List<objectMap>& fff = mpm_.facesFromFacesMap();
forAll (fff, fffI) forAll(fff, fffI)
{ {
// Get addressing // Get addressing
const labelList& mo = fff[fffI].masterObjects(); const labelList& mo = fff[fffI].masterObjects();
@ -157,7 +157,7 @@ void Foam::faceMapper::calcAddressing() const
// so check if addressing size still zero. // so check if addressing size still zero.
const labelList& fm = mpm_.faceMap(); const labelList& fm = mpm_.faceMap();
forAll (fm, faceI) forAll(fm, faceI)
{ {
if (fm[faceI] > -1 && addr[faceI].empty()) if (fm[faceI] > -1 && addr[faceI].empty())
{ {
@ -175,7 +175,7 @@ void Foam::faceMapper::calcAddressing() const
label nInsertedFaces = 0; label nInsertedFaces = 0;
forAll (addr, faceI) forAll(addr, faceI)
{ {
if (addr[faceI].empty()) if (addr[faceI].empty())
{ {
@ -247,21 +247,21 @@ Foam::faceMapper::faceMapper(const mapPolyMesh& mpm)
const List<objectMap>& ffp = mpm_.facesFromPointsMap(); const List<objectMap>& ffp = mpm_.facesFromPointsMap();
forAll (ffp, ffpI) forAll(ffp, ffpI)
{ {
fm[ffp[ffpI].index()] = 0; fm[ffp[ffpI].index()] = 0;
} }
const List<objectMap>& ffe = mpm_.facesFromEdgesMap(); const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
forAll (ffe, ffeI) forAll(ffe, ffeI)
{ {
fm[ffe[ffeI].index()] = 0; fm[ffe[ffeI].index()] = 0;
} }
const List<objectMap>& fff = mpm_.facesFromFacesMap(); const List<objectMap>& fff = mpm_.facesFromFacesMap();
forAll (fff, fffI) forAll(fff, fffI)
{ {
fm[fff[fffI].index()] = 0; fm[fff[fffI].index()] = 0;
} }

View File

@ -120,7 +120,7 @@ Foam::polyBoundaryMesh::~polyBoundaryMesh()
void Foam::polyBoundaryMesh::clearGeom() void Foam::polyBoundaryMesh::clearGeom()
{ {
forAll (*this, patchi) forAll(*this, patchi)
{ {
operator[](patchi).clearGeom(); operator[](patchi).clearGeom();
} }
@ -132,7 +132,7 @@ void Foam::polyBoundaryMesh::clearAddressing()
neighbourEdgesPtr_.clear(); neighbourEdgesPtr_.clear();
patchIDPtr_.clear(); patchIDPtr_.clear();
forAll (*this, patchi) forAll(*this, patchi)
{ {
operator[](patchi).clearAddressing(); operator[](patchi).clearAddressing();
} }
@ -355,7 +355,7 @@ Foam::wordList Foam::polyBoundaryMesh::names() const
wordList t(patches.size()); wordList t(patches.size());
forAll (patches, patchI) forAll(patches, patchI)
{ {
t[patchI] = patches[patchI].name(); t[patchI] = patches[patchI].name();
} }
@ -370,7 +370,7 @@ Foam::wordList Foam::polyBoundaryMesh::types() const
wordList t(patches.size()); wordList t(patches.size());
forAll (patches, patchI) forAll(patches, patchI)
{ {
t[patchI] = patches[patchI].type(); t[patchI] = patches[patchI].type();
} }
@ -385,7 +385,7 @@ Foam::wordList Foam::polyBoundaryMesh::physicalTypes() const
wordList t(patches.size()); wordList t(patches.size());
forAll (patches, patchI) forAll(patches, patchI)
{ {
t[patchI] = patches[patchI].physicalType(); t[patchI] = patches[patchI].physicalType();
} }
@ -398,7 +398,7 @@ Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
{ {
const polyPatchList& patches = *this; const polyPatchList& patches = *this;
forAll (patches, patchI) forAll(patches, patchI)
{ {
if (patches[patchI].name() == patchName) if (patches[patchI].name() == patchName)
{ {
@ -440,7 +440,7 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
return -1; return -1;
} }
forAll (*this, patchI) forAll(*this, patchI)
{ {
const polyPatch& bp = operator[](patchI); const polyPatch& bp = operator[](patchI);
@ -518,7 +518,7 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
label nonProcI = 0; label nonProcI = 0;
forAll (bm, patchI) forAll(bm, patchI)
{ {
if (!isA<processorPolyPatch>(bm[patchI])) if (!isA<processorPolyPatch>(bm[patchI]))
{ {
@ -594,7 +594,7 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
bool hasError = false; bool hasError = false;
forAll (bm, patchI) forAll(bm, patchI)
{ {
if (bm[patchI].start() != nextPatchStart && !hasError) if (bm[patchI].start() != nextPatchStart && !hasError)
{ {

View File

@ -438,7 +438,7 @@ Foam::polyMesh::polyMesh
oldPointsPtr_(NULL) oldPointsPtr_(NULL)
{ {
// Check if the faces and cells are valid // Check if the faces and cells are valid
forAll (faces_, faceI) forAll(faces_, faceI)
{ {
const face& curFace = faces_[faceI]; const face& curFace = faces_[faceI];
@ -594,7 +594,7 @@ Foam::polyMesh::polyMesh
oldPointsPtr_(NULL) oldPointsPtr_(NULL)
{ {
// Check if faces are valid // Check if faces are valid
forAll (faces_, faceI) forAll(faces_, faceI)
{ {
const face& curFace = faces_[faceI]; const face& curFace = faces_[faceI];
@ -619,7 +619,7 @@ Foam::polyMesh::polyMesh
cellList cLst(cells); cellList cLst(cells);
// Check if cells are valid // Check if cells are valid
forAll (cLst, cellI) forAll(cLst, cellI)
{ {
const cell& curCell = cLst[cellI]; const cell& curCell = cLst[cellI];
@ -701,7 +701,7 @@ void Foam::polyMesh::resetPrimitives
setInstance(time().timeName()); setInstance(time().timeName());
// Check if the faces and cells are valid // Check if the faces and cells are valid
forAll (faces_, faceI) forAll(faces_, faceI)
{ {
const face& curFace = faces_[faceI]; const face& curFace = faces_[faceI];
@ -866,7 +866,7 @@ void Foam::polyMesh::addPatches
boundary_.setSize(p.size()); boundary_.setSize(p.size());
// Copy the patch pointers // Copy the patch pointers
forAll (p, pI) forAll(p, pI)
{ {
boundary_.set(pI, p[pI]); boundary_.set(pI, p[pI]);
} }
@ -918,7 +918,7 @@ void Foam::polyMesh::addZones
pointZones_.setSize(pz.size()); pointZones_.setSize(pz.size());
// Copy the zone pointers // Copy the zone pointers
forAll (pz, pI) forAll(pz, pI)
{ {
pointZones_.set(pI, pz[pI]); pointZones_.set(pI, pz[pI]);
} }
@ -932,7 +932,7 @@ void Foam::polyMesh::addZones
faceZones_.setSize(fz.size()); faceZones_.setSize(fz.size());
// Copy the zone pointers // Copy the zone pointers
forAll (fz, fI) forAll(fz, fI)
{ {
faceZones_.set(fI, fz[fI]); faceZones_.set(fI, fz[fI]);
} }
@ -946,7 +946,7 @@ void Foam::polyMesh::addZones
cellZones_.setSize(cz.size()); cellZones_.setSize(cz.size());
// Copy the zone pointers // Copy the zone pointers
forAll (cz, cI) forAll(cz, cI)
{ {
cellZones_.set(cI, cz[cI]); cellZones_.set(cI, cz[cI]);
} }

View File

@ -62,7 +62,7 @@ void Foam::polyMesh::clearGeom()
primitiveMesh::clearGeom(); primitiveMesh::clearGeom();
forAll (boundary_, patchI) forAll(boundary_, patchI)
{ {
boundary_[patchI].clearGeom(); boundary_[patchI].clearGeom();
} }

View File

@ -61,7 +61,7 @@ Foam::labelListList Foam::polyMesh::cellShapePointCells
labelListList pointCellAddr(pc.size()); labelListList pointCellAddr(pc.size());
forAll (pc, pointI) forAll(pc, pointI)
{ {
pointCellAddr[pointI].transfer(pc[pointI]); pointCellAddr[pointI].transfer(pc[pointI]);
} }
@ -384,7 +384,7 @@ Foam::polyMesh::polyMesh
label nextNei = -1; label nextNei = -1;
label minNei = cells.size(); label minNei = cells.size();
forAll (neiCells, ncI) forAll(neiCells, ncI)
{ {
if (neiCells[ncI] > -1 && neiCells[ncI] < minNei) if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
{ {
@ -433,7 +433,7 @@ Foam::polyMesh::polyMesh
labelList patchSizes(boundaryFaces.size(), -1); labelList patchSizes(boundaryFaces.size(), -1);
labelList patchStarts(boundaryFaces.size(), -1); labelList patchStarts(boundaryFaces.size(), -1);
forAll (boundaryFaces, patchI) forAll(boundaryFaces, patchI)
{ {
const faceList& patchFaces = boundaryFaces[patchI]; const faceList& patchFaces = boundaryFaces[patchI];
@ -449,7 +449,7 @@ Foam::polyMesh::polyMesh
// Grab the start label // Grab the start label
label curPatchStart = nFaces; label curPatchStart = nFaces;
forAll (patchFaces, faceI) forAll(patchFaces, faceI)
{ {
const face& curFace = patchFaces[faceI]; const face& curFace = patchFaces[faceI];
@ -462,7 +462,7 @@ Foam::polyMesh::polyMesh
bool found = false; bool found = false;
forAll (facesOfCellInside, cellFaceI) forAll(facesOfCellInside, cellFaceI)
{ {
if (facesOfCellInside[cellFaceI] == curFace) if (facesOfCellInside[cellFaceI] == curFace)
{ {
@ -541,7 +541,7 @@ Foam::polyMesh::polyMesh
// Warning: Patches can only be added once the face list is // Warning: Patches can only be added once the face list is
// completed, as they hold a subList of the face list // completed, as they hold a subList of the face list
forAll (boundaryFaces, patchI) forAll(boundaryFaces, patchI)
{ {
// add the patch to the list // add the patch to the list
boundary_.set boundary_.set

View File

@ -185,7 +185,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
wordList oldTypes = boundary_.types(); wordList oldTypes = boundary_.types();
wordList oldNames = boundary_.names(); wordList oldNames = boundary_.names();
forAll (oldTypes, patchI) forAll(oldTypes, patchI)
{ {
if if
( (
@ -208,14 +208,14 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
boundary_.clear(); boundary_.clear();
boundary_.setSize(newBoundary.size()); boundary_.setSize(newBoundary.size());
forAll (newBoundary, patchI) forAll(newBoundary, patchI)
{ {
boundary_.set(patchI, newBoundary[patchI].clone(boundary_)); boundary_.set(patchI, newBoundary[patchI].clone(boundary_));
} }
} }
else else
{ {
forAll (boundary_, patchI) forAll(boundary_, patchI)
{ {
boundary_[patchI] = polyPatch boundary_[patchI] = polyPatch
( (
@ -296,7 +296,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
} }
// Reset existing ones // Reset existing ones
forAll (pointZones_, czI) forAll(pointZones_, czI)
{ {
pointZones_[czI] = newPointZones[czI]; pointZones_[czI] = newPointZones[czI];
} }
@ -333,7 +333,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
} }
// Reset existing ones // Reset existing ones
forAll (faceZones_, fzI) forAll(faceZones_, fzI)
{ {
faceZones_[fzI].resetAddressing faceZones_[fzI].resetAddressing
( (
@ -374,7 +374,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
} }
// Reset existing ones // Reset existing ones
forAll (cellZones_, czI) forAll(cellZones_, czI)
{ {
cellZones_[czI] = newCellZones[czI]; cellZones_[czI] = newCellZones[czI];
} }

View File

@ -111,7 +111,7 @@ void Foam::polyMesh::initMesh(cellList& c)
// get reference to face labels for current cell // get reference to face labels for current cell
const labelList& cellfaces = c[cellI]; const labelList& cellfaces = c[cellI];
forAll (cellfaces, faceI) forAll(cellfaces, faceI)
{ {
if (!markedFaces[cellfaces[faceI]]) if (!markedFaces[cellfaces[faceI]])
{ {

View File

@ -308,7 +308,7 @@ void Foam::coupledPolyPatch::calcTransformTensors
collocated_.setSize(Cf.size()); collocated_.setSize(Cf.size());
collocated_ = false; collocated_ = false;
forAll (forwardT_, facei) forAll(forwardT_, facei)
{ {
forwardT_[facei] = rotationTensor(-nr[facei], nf[facei]); forwardT_[facei] = rotationTensor(-nr[facei], nf[facei]);
reverseT_[facei] = rotationTensor(nf[facei], -nr[facei]); reverseT_[facei] = rotationTensor(nf[facei], -nr[facei]);

View File

@ -123,12 +123,7 @@ void Foam::genericPolyPatch::write(Ostream& os) const
os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl; os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl; os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
for forAllConstIter(dictionary, dict_, iter)
(
dictionary::const_iterator iter = dict_.begin();
iter != dict_.end();
++iter
)
{ {
if if
( (

View File

@ -275,7 +275,7 @@ Foam::tmp<Foam::vectorField> Foam::polyPatch::faceCellCentres() const
const unallocLabelList& faceCells = this->faceCells(); const unallocLabelList& faceCells = this->faceCells();
forAll (faceCells, facei) forAll(faceCells, facei)
{ {
cc[facei] = gcc[faceCells[facei]]; cc[facei] = gcc[faceCells[facei]];
} }

View File

@ -50,7 +50,7 @@ void ZoneMesh<ZoneType, MeshType>::calcZoneMap() const
// Count number of objects in all zones // Count number of objects in all zones
label nObjects = 0; label nObjects = 0;
forAll (*this, zoneI) forAll(*this, zoneI)
{ {
nObjects += this->operator[](zoneI).size(); nObjects += this->operator[](zoneI).size();
} }
@ -60,11 +60,11 @@ void ZoneMesh<ZoneType, MeshType>::calcZoneMap() const
// Fill in objects of all zones into the map. The key is the global // Fill in objects of all zones into the map. The key is the global
// object index and the result is the zone index // object index and the result is the zone index
forAll (*this, zoneI) forAll(*this, zoneI)
{ {
const labelList& zoneObjects = this->operator[](zoneI); const labelList& zoneObjects = this->operator[](zoneI);
forAll (zoneObjects, objI) forAll(zoneObjects, objI)
{ {
zm.insert(zoneObjects[objI], zoneI); zm.insert(zoneObjects[objI], zoneI);
} }
@ -201,7 +201,7 @@ wordList ZoneMesh<ZoneType, MeshType>::types() const
wordList t(zones.size()); wordList t(zones.size());
forAll (zones, zoneI) forAll(zones, zoneI)
{ {
t[zoneI] = zones[zoneI].type(); t[zoneI] = zones[zoneI].type();
} }
@ -218,7 +218,7 @@ wordList ZoneMesh<ZoneType, MeshType>::names() const
wordList t(zones.size()); wordList t(zones.size());
forAll (zones, zoneI) forAll(zones, zoneI)
{ {
t[zoneI] = zones[zoneI].name(); t[zoneI] = zones[zoneI].name();
} }
@ -232,7 +232,7 @@ label ZoneMesh<ZoneType, MeshType>::findZoneID(const word& zoneName) const
{ {
const PtrList<ZoneType>& zones = *this; const PtrList<ZoneType>& zones = *this;
forAll (zones, zoneI) forAll(zones, zoneI)
{ {
if (zones[zoneI].name() == zoneName) if (zones[zoneI].name() == zoneName)
{ {
@ -261,7 +261,7 @@ void ZoneMesh<ZoneType, MeshType>::clearAddressing()
PtrList<ZoneType>& zones = *this; PtrList<ZoneType>& zones = *this;
forAll (zones, zoneI) forAll(zones, zoneI)
{ {
zones[zoneI].clearAddressing(); zones[zoneI].clearAddressing();
} }
@ -284,7 +284,7 @@ bool ZoneMesh<ZoneType, MeshType>::checkDefinition(const bool report) const
const PtrList<ZoneType>& zones = *this; const PtrList<ZoneType>& zones = *this;
forAll (zones, zoneI) forAll(zones, zoneI)
{ {
inError |= zones[zoneI].checkDefinition(report); inError |= zones[zoneI].checkDefinition(report);
} }
@ -298,7 +298,7 @@ void ZoneMesh<ZoneType, MeshType>::movePoints(const pointField& p)
{ {
PtrList<ZoneType>& zones = *this; PtrList<ZoneType>& zones = *this;
forAll (zones, zoneI) forAll(zones, zoneI)
{ {
zones[zoneI].movePoints(p); zones[zoneI].movePoints(p);
} }

View File

@ -77,7 +77,7 @@ void Foam::faceZone::calcFaceZonePatch() const
const labelList& addr = *this; const labelList& addr = *this;
const boolList& flip = flipMap(); const boolList& flip = flipMap();
forAll (addr, faceI) forAll(addr, faceI)
{ {
if (flip[faceI]) if (flip[faceI])
{ {
@ -133,7 +133,7 @@ void Foam::faceZone::calcCellLayers() const
slaveCellsPtr_ = new labelList(mf.size()); slaveCellsPtr_ = new labelList(mf.size());
labelList& sc = *slaveCellsPtr_; labelList& sc = *slaveCellsPtr_;
forAll (mf, faceI) forAll(mf, faceI)
{ {
label ownCellI = own[mf[faceI]]; label ownCellI = own[mf[faceI]];
label neiCellI = label neiCellI =
@ -346,7 +346,7 @@ const Foam::labelList& Foam::faceZone::meshEdges() const
// //
//const labelList& faceLabels = *this; //const labelList& faceLabels = *this;
// //
//forAll (faceCells, faceI) //forAll(faceCells, faceI)
//{ //{
// faceCells[faceI] = own[faceLabels[faceI]]; // faceCells[faceI] = own[faceLabels[faceI]];
//} //}

View File

@ -78,7 +78,7 @@ calcAddressing() const
// Guess the max number of edges and neighbours for a face // Guess the max number of edges and neighbours for a face
label maxEdges = 0; label maxEdges = 0;
forAll (locFcs, faceI) forAll(locFcs, faceI)
{ {
maxEdges += locFcs[faceI].size(); maxEdges += locFcs[faceI].size();
} }
@ -103,14 +103,14 @@ calcAddressing() const
// initialise the lists of subshapes for each face to avoid duplication // initialise the lists of subshapes for each face to avoid duplication
edgeListList faceIntoEdges(locFcs.size()); edgeListList faceIntoEdges(locFcs.size());
forAll (locFcs, faceI) forAll(locFcs, faceI)
{ {
faceIntoEdges[faceI] = locFcs[faceI].edges(); faceIntoEdges[faceI] = locFcs[faceI].edges();
labelList& curFaceEdges = faceEdges[faceI]; labelList& curFaceEdges = faceEdges[faceI];
curFaceEdges.setSize(faceIntoEdges[faceI].size()); curFaceEdges.setSize(faceIntoEdges[faceI].size());
forAll (curFaceEdges, faceEdgeI) forAll(curFaceEdges, faceEdgeI)
{ {
curFaceEdges[faceEdgeI] = -1; curFaceEdges[faceEdgeI] = -1;
} }
@ -128,7 +128,7 @@ calcAddressing() const
// in face (i.e. curEdges[0] is edge between f[0] and f[1]) // in face (i.e. curEdges[0] is edge between f[0] and f[1])
// For all local faces ... // For all local faces ...
forAll (locFcs, faceI) forAll(locFcs, faceI)
{ {
// Get reference to vertices of current face and corresponding edges. // Get reference to vertices of current face and corresponding edges.
const Face& curF = locFcs[faceI]; const Face& curF = locFcs[faceI];
@ -141,7 +141,7 @@ calcAddressing() const
label nNeighbours = 0; label nNeighbours = 0;
// For all edges ... // For all edges ...
forAll (curEdges, edgeI) forAll(curEdges, edgeI)
{ {
// If the edge is already detected, skip // If the edge is already detected, skip
if (faceEdges[faceI][edgeI] >= 0) continue; if (faceEdges[faceI][edgeI] >= 0) continue;
@ -155,7 +155,7 @@ calcAddressing() const
const labelList& nbrFaces = pf[e.start()]; const labelList& nbrFaces = pf[e.start()];
forAll (nbrFaces, nbrFaceI) forAll(nbrFaces, nbrFaceI)
{ {
// set reference to the current neighbour // set reference to the current neighbour
label curNei = nbrFaces[nbrFaceI]; label curNei = nbrFaces[nbrFaceI];
@ -166,7 +166,7 @@ calcAddressing() const
// get the reference to subshapes of the neighbour // get the reference to subshapes of the neighbour
const edgeList& searchEdges = faceIntoEdges[curNei]; const edgeList& searchEdges = faceIntoEdges[curNei];
forAll (searchEdges, neiEdgeI) forAll(searchEdges, neiEdgeI)
{ {
if (searchEdges[neiEdgeI] == e) if (searchEdges[neiEdgeI] == e)
{ {
@ -204,7 +204,7 @@ calcAddressing() const
label nextNei = -1; label nextNei = -1;
label minNei = locFcs.size(); label minNei = locFcs.size();
forAll (neiFaces, nfI) forAll(neiFaces, nfI)
{ {
if (neiFaces[nfI].size() && neiFaces[nfI][0] < minNei) if (neiFaces[nfI].size() && neiFaces[nfI][0] < minNei)
{ {
@ -229,7 +229,7 @@ calcAddressing() const
curEf.setSize(cnf.size() + 1); curEf.setSize(cnf.size() + 1);
curEf[0] = faceI; curEf[0] = faceI;
forAll (cnf, cnfI) forAll(cnf, cnfI)
{ {
faceEdges[cnf[cnfI]][eonf[cnfI]] = nEdges; faceEdges[cnf[cnfI]][eonf[cnfI]] = nEdges;
@ -259,11 +259,11 @@ calcAddressing() const
// Do boundary faces // Do boundary faces
forAll (faceEdges, faceI) forAll(faceEdges, faceI)
{ {
labelList& curEdges = faceEdges[faceI]; labelList& curEdges = faceEdges[faceI];
forAll (curEdges, edgeI) forAll(curEdges, edgeI)
{ {
if (curEdges[edgeI] < 0) if (curEdges[edgeI] < 0)
{ {
@ -291,7 +291,7 @@ calcAddressing() const
faceFacesPtr_ = new labelListList(locFcs.size()); faceFacesPtr_ = new labelListList(locFcs.size());
labelListList& faceFaces = *faceFacesPtr_; labelListList& faceFaces = *faceFacesPtr_;
forAll (faceFaces, faceI) forAll(faceFaces, faceI)
{ {
faceFaces[faceI].transfer(ff[faceI]); faceFaces[faceI].transfer(ff[faceI]);
} }

View File

@ -80,7 +80,7 @@ calcLocalPointOrder() const
label nPoints = 0; label nPoints = 0;
forAll (lf, faceI) forAll(lf, faceI)
{ {
if (!visitedFace[faceI]) if (!visitedFace[faceI])
{ {
@ -99,7 +99,7 @@ calcLocalPointOrder() const
const labelList& curPoints = lf[curFace]; const labelList& curPoints = lf[curFace];
// mark points // mark points
forAll (curPoints, pointI) forAll(curPoints, pointI)
{ {
if (!visitedPoint[curPoints[pointI]]) if (!visitedPoint[curPoints[pointI]])
{ {
@ -114,7 +114,7 @@ calcLocalPointOrder() const
// add face neighbours to the list // add face neighbours to the list
const labelList& nbrs = ff[curFace]; const labelList& nbrs = ff[curFace];
forAll (nbrs, nbrI) forAll(nbrs, nbrI)
{ {
if (!visitedFace[nbrs[nbrI]]) if (!visitedFace[nbrs[nbrI]])
{ {

View File

@ -67,7 +67,7 @@ meshEdges
// WARNING: Remember that local edges address into local point list; // WARNING: Remember that local edges address into local point list;
// local-to-global point label translation is necessary // local-to-global point label translation is necessary
forAll (PatchEdges, edgeI) forAll(PatchEdges, edgeI)
{ {
const edge curEdge const edge curEdge
(pp[PatchEdges[edgeI].start()], pp[PatchEdges[edgeI].end()]); (pp[PatchEdges[edgeI].start()], pp[PatchEdges[edgeI].end()]);
@ -77,7 +77,7 @@ meshEdges
// get the patch faces sharing the edge // get the patch faces sharing the edge
const labelList& curFaces = EdgeFaces[edgeI]; const labelList& curFaces = EdgeFaces[edgeI];
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
// get the cell next to the face // get the cell next to the face
label curCell = faceCells[curFaces[faceI]]; label curCell = faceCells[curFaces[faceI]];
@ -85,7 +85,7 @@ meshEdges
// get reference to edges on the cell // get reference to edges on the cell
const labelList& ce = cellEdges[curCell]; const labelList& ce = cellEdges[curCell];
forAll (ce, cellEdgeI) forAll(ce, cellEdgeI)
{ {
if (allEdges[ce[cellEdgeI]] == curEdge) if (allEdges[ce[cellEdgeI]] == curEdge)
{ {
@ -139,14 +139,14 @@ meshEdges
// WARNING: Remember that local edges address into local point list; // WARNING: Remember that local edges address into local point list;
// local-to-global point label translation is necessary // local-to-global point label translation is necessary
forAll (PatchEdges, edgeI) forAll(PatchEdges, edgeI)
{ {
const label globalPointI = pp[PatchEdges[edgeI].start()]; const label globalPointI = pp[PatchEdges[edgeI].start()];
const edge curEdge(globalPointI, pp[PatchEdges[edgeI].end()]); const edge curEdge(globalPointI, pp[PatchEdges[edgeI].end()]);
const labelList& pe = pointEdges[globalPointI]; const labelList& pe = pointEdges[globalPointI];
forAll (pe, i) forAll(pe, i)
{ {
if (allEdges[pe[i]] == curEdge) if (allEdges[pe[i]] == curEdge)
{ {
@ -183,7 +183,7 @@ whichEdge
{ {
const labelList& pe = pointEdges()[e.start()]; const labelList& pe = pointEdges()[e.start()];
forAll (pe, peI) forAll(pe, peI)
{ {
if (e == Edges[pe[peI]]) if (e == Edges[pe[peI]])
{ {

View File

@ -67,7 +67,7 @@ calcPointEdges() const
// set up storage for pointEdges // set up storage for pointEdges
List<SLList<label> > pointEdges(meshPoints().size()); List<SLList<label> > pointEdges(meshPoints().size());
forAll (e, edgeI) forAll(e, edgeI)
{ {
pointEdges[e[edgeI].start()].append(edgeI); pointEdges[e[edgeI].start()].append(edgeI);
pointEdges[e[edgeI].end()].append(edgeI); pointEdges[e[edgeI].end()].append(edgeI);
@ -78,19 +78,14 @@ calcPointEdges() const
labelListList& pe = *pointEdgesPtr_; labelListList& pe = *pointEdgesPtr_;
forAll (pointEdges, pointI) forAll(pointEdges, pointI)
{ {
pe[pointI].setSize(pointEdges[pointI].size()); pe[pointI].setSize(pointEdges[pointI].size());
label i = 0; label i = 0;
for forAllIter(SLList<label>, pointEdges[pointI], curEdgesIter)
(
SLList<label>::iterator curEdgesIter = pointEdges[pointI].begin();
curEdgesIter != pointEdges[pointI].end();
++curEdgesIter, ++i
)
{ {
pe[pointI][i] = curEdgesIter(); pe[pointI][i++] = curEdgesIter();
} }
} }
@ -138,11 +133,11 @@ calcPointFaces() const
// set up storage for pointFaces // set up storage for pointFaces
List<SLList<label> > pointFcs(meshPoints().size()); List<SLList<label> > pointFcs(meshPoints().size());
forAll (f, faceI) forAll(f, faceI)
{ {
const Face& curPoints = f[faceI]; const Face& curPoints = f[faceI];
forAll (curPoints, pointI) forAll(curPoints, pointI)
{ {
pointFcs[curPoints[pointI]].append(faceI); pointFcs[curPoints[pointI]].append(faceI);
} }
@ -153,19 +148,14 @@ calcPointFaces() const
labelListList& pf = *pointFacesPtr_; labelListList& pf = *pointFacesPtr_;
forAll (pointFcs, pointI) forAll(pointFcs, pointI)
{ {
pf[pointI].setSize(pointFcs[pointI].size()); pf[pointI].setSize(pointFcs[pointI].size());
label i = 0; label i = 0;
for forAllIter(SLList<label>, pointFcs[pointI], curFacesIter)
(
SLList<label>::iterator curFacesIter = pointFcs[pointI].begin();
curFacesIter != pointFcs[pointI].end();
++curFacesIter, ++i
)
{ {
pf[pointI][i] = curFacesIter(); pf[pointI][i++] = curFacesIter();
} }
} }

View File

@ -84,7 +84,7 @@ projectPoints
// Estimate face centre of target side // Estimate face centre of target side
Field<PointType> masterFaceCentres(targetPatch.size()); Field<PointType> masterFaceCentres(targetPatch.size());
forAll (masterFaceCentres, faceI) forAll(masterFaceCentres, faceI)
{ {
masterFaceCentres[faceI] = masterFaceCentres[faceI] =
average(masterFaces[faceI].points(masterPoints)); average(masterFaces[faceI].points(masterPoints));
@ -101,7 +101,7 @@ projectPoints
label curFace = 0; label curFace = 0;
label nNSquaredSearches = 0; label nNSquaredSearches = 0;
forAll (slavePointOrder, pointI) forAll(slavePointOrder, pointI)
{ {
// Pick up slave point and direction // Pick up slave point and direction
const label curLocalPointLabel = slavePointOrder[pointI]; const label curLocalPointLabel = slavePointOrder[pointI];
@ -179,7 +179,7 @@ projectPoints
sqrDistance = sqrDistance =
magSqr(missPlanePoint - masterFaceCentres[curFace]); magSqr(missPlanePoint - masterFaceCentres[curFace]);
forAll (masterNbrs, nbrI) forAll(masterNbrs, nbrI)
{ {
if if
( (
@ -224,7 +224,7 @@ projectPoints
result[curLocalPointLabel] = objectHit(false, -1); result[curLocalPointLabel] = objectHit(false, -1);
scalar minDistance = GREAT; scalar minDistance = GREAT;
forAll (masterFaces, faceI) forAll(masterFaces, faceI)
{ {
PointHit<PointType> curHit = PointHit<PointType> curHit =
masterFaces[faceI].ray masterFaces[faceI].ray
@ -325,7 +325,7 @@ projectFaceCentres
const typename ToPatch::PointFieldType& masterPoints = targetPatch.points(); const typename ToPatch::PointFieldType& masterPoints = targetPatch.points();
forAll (masterFaceCentres, faceI) forAll(masterFaceCentres, faceI)
{ {
masterFaceCentres[faceI] = masterFaceCentres[faceI] =
masterFaces[faceI].centre(masterPoints); masterFaces[faceI].centre(masterPoints);
@ -348,7 +348,7 @@ projectFaceCentres
label curFace = 0; label curFace = 0;
label nNSquaredSearches = 0; label nNSquaredSearches = 0;
forAll (slaveFaceOrder, faceI) forAll(slaveFaceOrder, faceI)
{ {
// pick up slave point and direction // pick up slave point and direction
const label curLocalFaceLabel = slaveFaceOrder[faceI]; const label curLocalFaceLabel = slaveFaceOrder[faceI];
@ -425,7 +425,7 @@ projectFaceCentres
const labelList& masterNbrs = masterFaceFaces[curFace]; const labelList& masterNbrs = masterFaceFaces[curFace];
forAll (masterNbrs, nbrI) forAll(masterNbrs, nbrI)
{ {
if if
( (
@ -467,7 +467,7 @@ projectFaceCentres
result[curLocalFaceLabel] = objectHit(false, -1); result[curLocalFaceLabel] = objectHit(false, -1);
scalar minDistance = GREAT; scalar minDistance = GREAT;
forAll (masterFaces, faceI) forAll(masterFaces, faceI)
{ {
PointHit<PointType> curHit = PointHit<PointType> curHit =
masterFaces[faceI].ray masterFaces[faceI].ray

View File

@ -49,7 +49,7 @@ void Foam::primitiveMesh::calcCellShapes() const
cellShapesPtr_ = new cellShapeList(nCells()); cellShapesPtr_ = new cellShapeList(nCells());
cellShapeList& cellShapes = *cellShapesPtr_; cellShapeList& cellShapes = *cellShapesPtr_;
forAll (cellShapes, celli) forAll(cellShapes, celli)
{ {
cellShapes[celli] = degenerateMatcher::match(*this, celli); cellShapes[celli] = degenerateMatcher::match(*this, celli);
} }

View File

@ -63,7 +63,7 @@ void Foam::primitiveMesh::calcCellCells() const
const labelList& own = faceOwner(); const labelList& own = faceOwner();
const labelList& nei = faceNeighbour(); const labelList& nei = faceNeighbour();
forAll (nei, faceI) forAll(nei, faceI)
{ {
ncc[own[faceI]]++; ncc[own[faceI]]++;
ncc[nei[faceI]]++; ncc[nei[faceI]]++;
@ -77,13 +77,13 @@ void Foam::primitiveMesh::calcCellCells() const
// 2. Size and fill cellFaceAddr // 2. Size and fill cellFaceAddr
forAll (cellCellAddr, cellI) forAll(cellCellAddr, cellI)
{ {
cellCellAddr[cellI].setSize(ncc[cellI]); cellCellAddr[cellI].setSize(ncc[cellI]);
} }
ncc = 0; ncc = 0;
forAll (nei, faceI) forAll(nei, faceI)
{ {
label ownCellI = own[faceI]; label ownCellI = own[faceI];
label neiCellI = nei[faceI]; label neiCellI = nei[faceI];

View File

@ -90,13 +90,13 @@ void Foam::primitiveMesh::makeCellCentresAndVols
vectorField cEst(nCells(), vector::zero); vectorField cEst(nCells(), vector::zero);
labelField nCellFaces(nCells(), 0); labelField nCellFaces(nCells(), 0);
forAll (own, facei) forAll(own, facei)
{ {
cEst[own[facei]] += fCtrs[facei]; cEst[own[facei]] += fCtrs[facei];
nCellFaces[own[facei]] += 1; nCellFaces[own[facei]] += 1;
} }
forAll (nei, facei) forAll(nei, facei)
{ {
cEst[nei[facei]] += fCtrs[facei]; cEst[nei[facei]] += fCtrs[facei];
nCellFaces[nei[facei]] += 1; nCellFaces[nei[facei]] += 1;
@ -107,7 +107,7 @@ void Foam::primitiveMesh::makeCellCentresAndVols
cEst[celli] /= nCellFaces[celli]; cEst[celli] /= nCellFaces[celli];
} }
forAll (own, facei) forAll(own, facei)
{ {
// Calculate 3*face-pyramid volume // Calculate 3*face-pyramid volume
scalar pyr3Vol = scalar pyr3Vol =
@ -123,7 +123,7 @@ void Foam::primitiveMesh::makeCellCentresAndVols
cellVols[own[facei]] += pyr3Vol; cellVols[own[facei]] += pyr3Vol;
} }
forAll (nei, facei) forAll(nei, facei)
{ {
// Calculate 3*face-pyramid volume // Calculate 3*face-pyramid volume
scalar pyr3Vol = scalar pyr3Vol =

View File

@ -69,13 +69,13 @@ void Foam::primitiveMesh::calcCellEdges() const
const labelListList& fe = faceEdges(); const labelListList& fe = faceEdges();
// loop through the list again and add edges; checking for duplicates // loop through the list again and add edges; checking for duplicates
forAll (own, faceI) forAll(own, faceI)
{ {
DynamicList<label, edgesPerCell_>& curCellEdges = ce[own[faceI]]; DynamicList<label, edgesPerCell_>& curCellEdges = ce[own[faceI]];
const labelList& curEdges = fe[faceI]; const labelList& curEdges = fe[faceI];
forAll (curEdges, edgeI) forAll(curEdges, edgeI)
{ {
if (findIndex(curCellEdges, curEdges[edgeI]) == -1) if (findIndex(curCellEdges, curEdges[edgeI]) == -1)
{ {
@ -85,13 +85,13 @@ void Foam::primitiveMesh::calcCellEdges() const
} }
} }
forAll (nei, faceI) forAll(nei, faceI)
{ {
DynamicList<label, edgesPerCell_>& curCellEdges = ce[nei[faceI]]; DynamicList<label, edgesPerCell_>& curCellEdges = ce[nei[faceI]];
const labelList& curEdges = fe[faceI]; const labelList& curEdges = fe[faceI];
forAll (curEdges, edgeI) forAll(curEdges, edgeI)
{ {
if (findIndex(curCellEdges, curEdges[edgeI]) == -1) if (findIndex(curCellEdges, curEdges[edgeI]) == -1)
{ {
@ -105,7 +105,7 @@ void Foam::primitiveMesh::calcCellEdges() const
labelListList& cellEdgeAddr = *cePtr_; labelListList& cellEdgeAddr = *cePtr_;
// reset the size // reset the size
forAll (ce, cellI) forAll(ce, cellI)
{ {
cellEdgeAddr[cellI].transfer(ce[cellI]); cellEdgeAddr[cellI].transfer(ce[cellI]);
} }

View File

@ -52,12 +52,12 @@ void Foam::primitiveMesh::calcCells
labelList ncf(nCells, 0); labelList ncf(nCells, 0);
forAll (own, faceI) forAll(own, faceI)
{ {
ncf[own[faceI]]++; ncf[own[faceI]]++;
} }
forAll (nei, faceI) forAll(nei, faceI)
{ {
if (nei[faceI] >= 0) if (nei[faceI] >= 0)
{ {
@ -71,20 +71,20 @@ void Foam::primitiveMesh::calcCells
// 2. Size and fill cellFaceAddr // 2. Size and fill cellFaceAddr
forAll (cellFaceAddr, cellI) forAll(cellFaceAddr, cellI)
{ {
cellFaceAddr[cellI].setSize(ncf[cellI]); cellFaceAddr[cellI].setSize(ncf[cellI]);
} }
ncf = 0; ncf = 0;
forAll (own, faceI) forAll(own, faceI)
{ {
label cellI = own[faceI]; label cellI = own[faceI];
cellFaceAddr[cellI][ncf[cellI]++] = faceI; cellFaceAddr[cellI][ncf[cellI]++] = faceI;
} }
forAll (nei, faceI) forAll(nei, faceI)
{ {
label cellI = nei[faceI]; label cellI = nei[faceI];

View File

@ -113,7 +113,7 @@ bool Foam::primitiveMesh::checkClosedCells
label nErrorClosed = 0; label nErrorClosed = 0;
forAll (c, cI) forAll(c, cI)
{ {
const cell& curCell = c[cI]; const cell& curCell = c[cI];
@ -149,14 +149,14 @@ bool Foam::primitiveMesh::checkClosedCells
const labelList& nei = faceNeighbour(); const labelList& nei = faceNeighbour();
const vectorField& areas = faceAreas(); const vectorField& areas = faceAreas();
forAll (own, faceI) forAll(own, faceI)
{ {
// Add to owner // Add to owner
sumClosed[own[faceI]] += areas[faceI]; sumClosed[own[faceI]] += areas[faceI];
sumMagClosed[own[faceI]] += cmptMag(areas[faceI]); sumMagClosed[own[faceI]] += cmptMag(areas[faceI]);
} }
forAll (nei, faceI) forAll(nei, faceI)
{ {
// Subtract from neighbour // Subtract from neighbour
sumClosed[nei[faceI]] -= areas[faceI]; sumClosed[nei[faceI]] -= areas[faceI];
@ -172,7 +172,7 @@ bool Foam::primitiveMesh::checkClosedCells
const scalarField& vols = cellVolumes(); const scalarField& vols = cellVolumes();
// Check the sums // Check the sums
forAll (sumClosed, cellI) forAll(sumClosed, cellI)
{ {
scalar maxOpenness = 0; scalar maxOpenness = 0;
@ -281,7 +281,7 @@ bool Foam::primitiveMesh::checkFaceAreas
scalar minArea = GREAT; scalar minArea = GREAT;
scalar maxArea = -GREAT; scalar maxArea = -GREAT;
forAll (magFaceAreas, faceI) forAll(magFaceAreas, faceI)
{ {
if (magFaceAreas[faceI] < VSMALL) if (magFaceAreas[faceI] < VSMALL)
{ {
@ -342,7 +342,7 @@ bool Foam::primitiveMesh::checkCellVolumes
label nNegVolCells = 0; label nNegVolCells = 0;
forAll (vols, cellI) forAll(vols, cellI)
{ {
if (vols[cellI] < VSMALL) if (vols[cellI] < VSMALL)
{ {
@ -421,7 +421,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
label errorNonOrth = 0; label errorNonOrth = 0;
forAll (nei, faceI) forAll(nei, faceI)
{ {
vector d = centres[nei[faceI]] - centres[own[faceI]]; vector d = centres[nei[faceI]] - centres[own[faceI]];
const vector& s = areas[faceI]; const vector& s = areas[faceI];
@ -534,7 +534,7 @@ bool Foam::primitiveMesh::checkFacePyramids
label nErrorPyrs = 0; label nErrorPyrs = 0;
forAll (f, faceI) forAll(f, faceI)
{ {
// Create the owner pyramid - it will have negative volume // Create the owner pyramid - it will have negative volume
scalar pyrVol = pyramidPointFaceRef(f[faceI], ctrs[own[faceI]]).mag(p); scalar pyrVol = pyramidPointFaceRef(f[faceI], ctrs[own[faceI]]).mag(p);
@ -619,7 +619,7 @@ bool Foam::primitiveMesh::checkFaceTets
label nErrorPyrs = 0; label nErrorPyrs = 0;
forAll (fcs, faceI) forAll(fcs, faceI)
{ {
// Create the owner tets - they will have negative volume // Create the owner tets - they will have negative volume
const face& f = fcs[faceI]; const face& f = fcs[faceI];
@ -863,7 +863,7 @@ bool Foam::primitiveMesh::checkPoints
const labelListList& pf = pointFaces(); const labelListList& pf = pointFaces();
forAll (pf, pointI) forAll(pf, pointI)
{ {
if (pf[pointI].empty()) if (pf[pointI].empty())
{ {
@ -877,7 +877,7 @@ bool Foam::primitiveMesh::checkPoints
} }
forAll (pf, pointI) forAll(pf, pointI)
{ {
const labelList& pc = pointCells(pointI); const labelList& pc = pointCells(pointI);
@ -1360,7 +1360,7 @@ bool Foam::primitiveMesh::checkUpperTriangular
// and add it to the check list (upper triangular order). // and add it to the check list (upper triangular order).
// Once the list is completed, check it against the faceCell list // Once the list is completed, check it against the faceCell list
forAll (c, cellI) forAll(c, cellI)
{ {
const labelList& curFaces = c[cellI]; const labelList& curFaces = c[cellI];
@ -1498,7 +1498,7 @@ bool Foam::primitiveMesh::checkCellsZipUp
const faceList& f = faces(); const faceList& f = faces();
const cellList& c = cells(); const cellList& c = cells();
forAll (c, cellI) forAll(c, cellI)
{ {
const labelList& curFaces = c[cellI]; const labelList& curFaces = c[cellI];
@ -1506,15 +1506,15 @@ bool Foam::primitiveMesh::checkCellsZipUp
labelList edgeUsage(cellEdges.size(), 0); labelList edgeUsage(cellEdges.size(), 0);
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
edgeList curFaceEdges = f[curFaces[faceI]].edges(); edgeList curFaceEdges = f[curFaces[faceI]].edges();
forAll (curFaceEdges, faceEdgeI) forAll(curFaceEdges, faceEdgeI)
{ {
const edge& curEdge = curFaceEdges[faceEdgeI]; const edge& curEdge = curFaceEdges[faceEdgeI];
forAll (cellEdges, cellEdgeI) forAll(cellEdges, cellEdgeI)
{ {
if (cellEdges[cellEdgeI] == curEdge) if (cellEdges[cellEdgeI] == curEdge)
{ {
@ -1528,7 +1528,7 @@ bool Foam::primitiveMesh::checkCellsZipUp
edgeList singleEdges(cellEdges.size()); edgeList singleEdges(cellEdges.size());
label nSingleEdges = 0; label nSingleEdges = 0;
forAll (edgeUsage, edgeI) forAll(edgeUsage, edgeI)
{ {
if (edgeUsage[edgeI] == 1) if (edgeUsage[edgeI] == 1)
{ {
@ -1599,7 +1599,7 @@ bool Foam::primitiveMesh::checkFaceVertices
label nErrorFaces = 0; label nErrorFaces = 0;
forAll (f, fI) forAll(f, fI)
{ {
const face& curFace = f[fI]; const face& curFace = f[fI];
@ -1995,7 +1995,7 @@ bool Foam::primitiveMesh::checkCellDeterminant
scalar sumDet = 0; scalar sumDet = 0;
label nSummed = 0; label nSummed = 0;
forAll (c, cellI) forAll(c, cellI)
{ {
const labelList& curFaces = c[cellI]; const labelList& curFaces = c[cellI];
@ -2114,7 +2114,7 @@ bool Foam::primitiveMesh::checkConcaveCells
label nConcaveCells = 0; label nConcaveCells = 0;
forAll (c, cellI) forAll(c, cellI)
{ {
const cell& cFaces = c[cellI]; const cell& cFaces = c[cellI];

View File

@ -68,7 +68,7 @@ bool Foam::primitiveMesh::checkMeshMotion
scalar minVolume = GREAT; scalar minVolume = GREAT;
label nNegVols = 0; label nNegVols = 0;
forAll (cellVols, cellI) forAll(cellVols, cellI)
{ {
if (cellVols[cellI] < VSMALL) if (cellVols[cellI] < VSMALL)
{ {
@ -108,7 +108,7 @@ bool Foam::primitiveMesh::checkMeshMotion
label nPyrErrors = 0; label nPyrErrors = 0;
label nDotProductErrors = 0; label nDotProductErrors = 0;
forAll (f, faceI) forAll(f, faceI)
{ {
const scalar a = Foam::mag(fAreas[faceI]); const scalar a = Foam::mag(fAreas[faceI]);

View File

@ -79,7 +79,7 @@ void Foam::primitiveMesh::makeFaceCentresAndAreas
{ {
const faceList& fs = faces(); const faceList& fs = faces();
forAll (fs, facei) forAll(fs, facei)
{ {
const labelList& f = fs[facei]; const labelList& f = fs[facei];
label nPoints = f.size(); label nPoints = f.size();

View File

@ -42,7 +42,7 @@ bool Foam::primitiveMesh::pointInCellBB(const point& p, label celli) const
vector bbmax = -GREAT*vector::one; vector bbmax = -GREAT*vector::one;
vector bbmin = GREAT*vector::one; vector bbmin = GREAT*vector::one;
forAll (cellVertices, vertexI) forAll(cellVertices, vertexI)
{ {
bbmax = max(bbmax, points[cellVertices[vertexI]]); bbmax = max(bbmax, points[cellVertices[vertexI]]);
bbmin = min(bbmin, points[cellVertices[vertexI]]); bbmin = min(bbmin, points[cellVertices[vertexI]]);

View File

@ -63,11 +63,11 @@ void Foam::primitiveMesh::calcPointCells() const
labelList npc(nPoints(), 0); labelList npc(nPoints(), 0);
forAll (cf, cellI) forAll(cf, cellI)
{ {
const labelList curPoints = cf[cellI].labels(faces()); const labelList curPoints = cf[cellI].labels(faces());
forAll (curPoints, pointI) forAll(curPoints, pointI)
{ {
label ptI = curPoints[pointI]; label ptI = curPoints[pointI];
@ -81,18 +81,18 @@ void Foam::primitiveMesh::calcPointCells() const
pcPtr_ = new labelListList(npc.size()); pcPtr_ = new labelListList(npc.size());
labelListList& pointCellAddr = *pcPtr_; labelListList& pointCellAddr = *pcPtr_;
forAll (pointCellAddr, pointI) forAll(pointCellAddr, pointI)
{ {
pointCellAddr[pointI].setSize(npc[pointI]); pointCellAddr[pointI].setSize(npc[pointI]);
} }
npc = 0; npc = 0;
forAll (cf, cellI) forAll(cf, cellI)
{ {
const labelList curPoints = cf[cellI].labels(faces()); const labelList curPoints = cf[cellI].labels(faces());
forAll (curPoints, pointI) forAll(curPoints, pointI)
{ {
label ptI = curPoints[pointI]; label ptI = curPoints[pointI];

View File

@ -60,11 +60,11 @@ void Foam::primitiveMesh::calcPointPoints() const
ppPtr_ = new labelListList(pe.size()); ppPtr_ = new labelListList(pe.size());
labelListList& pp = *ppPtr_; labelListList& pp = *ppPtr_;
forAll (pe, pointI) forAll(pe, pointI)
{ {
pp[pointI].setSize(pe[pointI].size()); pp[pointI].setSize(pe[pointI].size());
forAll (pe[pointI], ppi) forAll(pe[pointI], ppi)
{ {
if (e[pe[pointI][ppi]].start() == pointI) if (e[pe[pointI][ppi]].start() == pointI)
{ {

View File

@ -79,7 +79,7 @@ Foam::ensightPartFaces::ensightPartFaces
label nQuad = 0; label nQuad = 0;
label nPoly = 0; label nPoly = 0;
forAll (pPatch, patchfaceI) forAll(pPatch, patchfaceI)
{ {
const face& f = pMesh.faces()[patchfaceI + offset_]; const face& f = pMesh.faces()[patchfaceI + offset_];

View File

@ -127,7 +127,7 @@ void Foam::meshWriters::STARCD::getCellTable()
// get the cellZone <-> cellTable correspondence // get the cellZone <-> cellTable correspondence
Info<< "matching cellZones to cellTable" << endl; Info<< "matching cellZones to cellTable" << endl;
forAll (mesh_.cellZones(), zoneI) forAll(mesh_.cellZones(), zoneI)
{ {
const cellZone& cZone = mesh_.cellZones()[zoneI]; const cellZone& cZone = mesh_.cellZones()[zoneI];
if (cZone.size()) if (cZone.size())
@ -144,7 +144,7 @@ void Foam::meshWriters::STARCD::getCellTable()
tableId = cellTable_.append(dict); tableId = cellTable_.append(dict);
} }
forAll (cZone, i) forAll(cZone, i)
{ {
cellTableId_[cZone[i]] = tableId; cellTableId_[cZone[i]] = tableId;
} }
@ -159,7 +159,7 @@ void Foam::meshWriters::STARCD::getCellTable()
dict.add("MaterialType", "fluid"); dict.add("MaterialType", "fluid");
label tableId = cellTable_.append(dict); label tableId = cellTable_.append(dict);
forAll (cellTableId_, i) forAll(cellTableId_, i)
{ {
if (cellTableId_[i] < 0) if (cellTableId_[i] < 0)
{ {

View File

@ -112,7 +112,7 @@ void Foam::attachDetach::checkDefinition()
DynamicList<label> bouFacesInZone(addr.size()); DynamicList<label> bouFacesInZone(addr.size());
forAll (addr, faceI) forAll(addr, faceI)
{ {
if (!mesh.isInternalFace(addr[faceI])) if (!mesh.isInternalFace(addr[faceI]))
{ {
@ -180,7 +180,7 @@ void Foam::attachDetach::checkDefinition()
DynamicList<label> zoneProblemFaces(addr.size()); DynamicList<label> zoneProblemFaces(addr.size());
forAll (addr, faceI) forAll(addr, faceI)
{ {
label facePatch = label facePatch =
mesh.boundaryMesh().whichPatch(addr[faceI]); mesh.boundaryMesh().whichPatch(addr[faceI]);

View File

@ -76,7 +76,7 @@ void Foam::attachDetach::calcPointMatchMap() const
const label slavePatchStart = slavePatch.start(); const label slavePatchStart = slavePatch.start();
forAll (reverseSlavePatch, faceI) forAll(reverseSlavePatch, faceI)
{ {
reverseSlavePatch[faceI] = reverseSlavePatch[faceI] =
faces[slavePatchStart + faceI].reverseFace(); faces[slavePatchStart + faceI].reverseFace();
@ -92,12 +92,12 @@ void Foam::attachDetach::calcPointMatchMap() const
pointMatchMapPtr_ = new Map<label>(2*slaveMeshPoints.size()); pointMatchMapPtr_ = new Map<label>(2*slaveMeshPoints.size());
Map<label>& removedPointMap = *pointMatchMapPtr_; Map<label>& removedPointMap = *pointMatchMapPtr_;
forAll (masterLocalFaces, faceI) forAll(masterLocalFaces, faceI)
{ {
const face& curMasterPoints = masterLocalFaces[faceI]; const face& curMasterPoints = masterLocalFaces[faceI];
const face& curSlavePoints = slaveLocalFaces[faceI]; const face& curSlavePoints = slaveLocalFaces[faceI];
forAll (curMasterPoints, pointI) forAll(curMasterPoints, pointI)
{ {
// If the master and slave point labels are the same, the // If the master and slave point labels are the same, the
// point remains. Otherwise, the slave point is removed and // point remains. Otherwise, the slave point is removed and

View File

@ -81,7 +81,7 @@ void Foam::attachDetach::attachInterface
const labelList removedPoints = removedPointMap.toc(); const labelList removedPoints = removedPointMap.toc();
forAll (removedPoints, pointI) forAll(removedPoints, pointI)
{ {
ref.setAction(polyRemovePoint(removedPoints[pointI])); ref.setAction(polyRemovePoint(removedPoints[pointI]));
} }
@ -100,7 +100,7 @@ void Foam::attachDetach::attachInterface
const boolList& mfFlip = mesh.faceZones()[faceZoneID_.index()].flipMap(); const boolList& mfFlip = mesh.faceZones()[faceZoneID_.index()].flipMap();
forAll (masterFaceCells, faceI) forAll(masterFaceCells, faceI)
{ {
// If slave neighbour is greater than master, face does not need // If slave neighbour is greater than master, face does not need
// turning. Modify it to become internal // turning. Modify it to become internal
@ -155,11 +155,11 @@ void Foam::attachDetach::attachInterface
// Grab all the faces off the points in the slave patch. If the face has // Grab all the faces off the points in the slave patch. If the face has
// not been removed, add it to the map of faces to renumber // not been removed, add it to the map of faces to renumber
forAll (slaveMeshPoints, pointI) forAll(slaveMeshPoints, pointI)
{ {
const labelList& curFaces = pf[slaveMeshPoints[pointI]]; const labelList& curFaces = pf[slaveMeshPoints[pointI]];
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
if (!ref.faceRemoved(curFaces[faceI])) if (!ref.faceRemoved(curFaces[faceI]))
{ {
@ -171,7 +171,7 @@ void Foam::attachDetach::attachInterface
// Grab the faces to be renumbered // Grab the faces to be renumbered
const labelList ftm = facesToModifyMap.toc(); const labelList ftm = facesToModifyMap.toc();
forAll (ftm, faceI) forAll(ftm, faceI)
{ {
// For every face to modify, copy the face and re-map the vertices. // For every face to modify, copy the face and re-map the vertices.
// It is known all the faces will be changed since they hang off // It is known all the faces will be changed since they hang off
@ -180,7 +180,7 @@ void Foam::attachDetach::attachInterface
face newFace(faces[curFaceID]); face newFace(faces[curFaceID]);
forAll (newFace, pointI) forAll(newFace, pointI)
{ {
Map<label>::const_iterator rpmIter = Map<label>::const_iterator rpmIter =
removedPointMap.find(newFace[pointI]); removedPointMap.find(newFace[pointI]);
@ -267,7 +267,7 @@ void Foam::attachDetach::modifyMotionPoints
// Calculate the difference in motion point positions // Calculate the difference in motion point positions
scalar pointDiff = 0; scalar pointDiff = 0;
forAll (removedPoints, pointI) forAll(removedPoints, pointI)
{ {
pointDiff += pointDiff +=
mag mag
@ -284,7 +284,7 @@ void Foam::attachDetach::modifyMotionPoints
} }
// Put the slave point on top of the master point // Put the slave point on top of the master point
forAll (removedPoints, pointI) forAll(removedPoints, pointI)
{ {
motionPoints[removedPoints[pointI]] = motionPoints[removedPoints[pointI]] =
motionPoints[removedPointMap.find(removedPoints[pointI])()]; motionPoints[removedPointMap.find(removedPoints[pointI])()];

View File

@ -127,7 +127,7 @@ void Foam::attachDetach::detachInterface
bool edgeIsInternal = true; bool edgeIsInternal = true;
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
if (!mesh.isInternalFace(curFaces[faceI])) if (!mesh.isInternalFace(curFaces[faceI]))
{ {
@ -149,7 +149,7 @@ void Foam::attachDetach::detachInterface
// Pout << "addedPoints before point creation: " << addedPoints << endl; // Pout << "addedPoints before point creation: " << addedPoints << endl;
// Create new points for face zone // Create new points for face zone
forAll (addedPoints, pointI) forAll(addedPoints, pointI)
{ {
if (addedPoints[pointI] < 0) if (addedPoints[pointI] < 0)
{ {
@ -181,7 +181,7 @@ void Foam::attachDetach::detachInterface
const labelList& own = mesh.faceOwner(); const labelList& own = mesh.faceOwner();
const labelList& nei = mesh.faceNeighbour(); const labelList& nei = mesh.faceNeighbour();
forAll (mf, faceI) forAll(mf, faceI)
{ {
const label curFaceID = mf[faceI]; const label curFaceID = mf[faceI];
@ -190,7 +190,7 @@ void Foam::attachDetach::detachInterface
face newFace(oldFace.size()); face newFace(oldFace.size());
forAll (oldFace, pointI) forAll(oldFace, pointI)
{ {
newFace[pointI] = addedPoints[oldFace[pointI]]; newFace[pointI] = addedPoints[oldFace[pointI]];
} }
@ -313,11 +313,11 @@ void Foam::attachDetach::detachInterface
const cellList& cells = mesh.cells(); const cellList& cells = mesh.cells();
forAll (mc, cellI) forAll(mc, cellI)
{ {
const labelList& curFaces = cells[mc[cellI]]; const labelList& curFaces = cells[mc[cellI]];
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
// Check if the face belongs to the master patch; if not add it // Check if the face belongs to the master patch; if not add it
if (zoneMesh.whichZone(curFaces[faceI]) != faceZoneID_.index()) if (zoneMesh.whichZone(curFaces[faceI]) != faceZoneID_.index())
@ -333,7 +333,7 @@ void Foam::attachDetach::detachInterface
// Make a map of master cells for quick reject // Make a map of master cells for quick reject
labelHashSet mcMap(2*mc.size()); labelHashSet mcMap(2*mc.size());
forAll (mc, mcI) forAll(mc, mcI)
{ {
mcMap.insert(mc[mcI]); mcMap.insert(mc[mcI]);
} }
@ -343,7 +343,7 @@ void Foam::attachDetach::detachInterface
// faces to the map // faces to the map
const labelList mcf = masterCellFaceMap.toc(); const labelList mcf = masterCellFaceMap.toc();
forAll (mcf, mcfI) forAll(mcf, mcfI)
{ {
// Do the owner side // Do the owner side
const label ownCell = own[mcf[mcfI]]; const label ownCell = own[mcf[mcfI]];
@ -353,7 +353,7 @@ void Foam::attachDetach::detachInterface
// Cell not found. Add its faces to the map // Cell not found. Add its faces to the map
const cell& curFaces = cells[ownCell]; const cell& curFaces = cells[ownCell];
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
masterCellFaceMap.insert(curFaces[faceI]); masterCellFaceMap.insert(curFaces[faceI]);
} }
@ -369,7 +369,7 @@ void Foam::attachDetach::detachInterface
// Cell not found. Add its faces to the map // Cell not found. Add its faces to the map
const cell& curFaces = cells[neiCell]; const cell& curFaces = cells[neiCell];
forAll (curFaces, faceI) forAll(curFaces, faceI)
{ {
masterCellFaceMap.insert(curFaces[faceI]); masterCellFaceMap.insert(curFaces[faceI]);
} }
@ -381,7 +381,7 @@ void Foam::attachDetach::detachInterface
// Create the master layer point map // Create the master layer point map
Map<label> masterLayerPointMap(2*mp.size()); Map<label> masterLayerPointMap(2*mp.size());
forAll (mp, pointI) forAll(mp, pointI)
{ {
masterLayerPointMap.insert masterLayerPointMap.insert
( (
@ -393,7 +393,7 @@ void Foam::attachDetach::detachInterface
// Grab the list of faces of the master layer // Grab the list of faces of the master layer
const labelList masterCellFaces = masterCellFaceMap.toc(); const labelList masterCellFaces = masterCellFaceMap.toc();
forAll (masterCellFaces, faceI) forAll(masterCellFaces, faceI)
{ {
// Attempt to renumber the face using the masterLayerPointMap. // Attempt to renumber the face using the masterLayerPointMap.
// Missing point remain the same // Missing point remain the same
@ -406,7 +406,7 @@ void Foam::attachDetach::detachInterface
bool changed = false; bool changed = false;
forAll (oldFace, pointI) forAll(oldFace, pointI)
{ {
if (masterLayerPointMap.found(oldFace[pointI])) if (masterLayerPointMap.found(oldFace[pointI]))
{ {

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